@reproapp/node-sdk 0.0.3 → 0.0.4
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 +36 -2
- package/dist/index.d.ts +140 -15
- package/dist/index.js +4927 -927
- package/dist/ingest/client.d.ts +10 -0
- package/dist/ingest/client.js +158 -0
- package/dist/ingest/mapper.d.ts +2 -0
- package/dist/ingest/mapper.js +92 -0
- package/dist/ingest/types.d.ts +40 -0
- package/dist/ingest/types.js +2 -0
- package/dist/ingest/worker.js +19 -0
- package/dist/integrations/sendgrid.d.ts +2 -4
- package/dist/integrations/sendgrid.js +4 -14
- package/dist/privacy-fallback.d.ts +1 -0
- package/dist/privacy-fallback.js +27 -0
- package/dist/privacy-redaction.d.ts +3 -0
- package/dist/privacy-redaction.js +38 -0
- package/dist/privacy.d.ts +108 -0
- package/dist/privacy.js +2868 -0
- package/dist/trace-materializer-worker.d.ts +1 -0
- package/dist/trace-materializer-worker.js +33 -0
- package/docs/tracing.md +1 -0
- package/package.json +8 -2
- package/src/index.ts +5583 -954
- package/src/ingest/client.ts +194 -0
- package/src/ingest/mapper.ts +104 -0
- package/src/ingest/types.ts +42 -0
- package/src/integrations/sendgrid.ts +6 -19
- package/src/privacy-fallback.ts +25 -0
- package/src/privacy-redaction.ts +37 -0
- package/src/privacy.ts +3593 -0
- package/src/trace-materializer-worker.ts +39 -0
- package/test/circular-capture.test.js +111 -0
- package/test/disable-subtree.test.js +154 -0
- package/test/integration-unawaited.js +183 -0
- package/test/kafka-runtime-privacy-policy.test.js +285 -0
- package/test/privacy-runtime-policy.test.js +2043 -0
- package/test/promise-map.test.js +72 -0
- package/test/unawaited.test.js +163 -0
- package/test/wrap-plugin-arrow-args.test.js +80 -0
- package/tracer/cjs-hook.js +0 -1
- package/tracer/wrap-plugin.js +96 -10
- package/dist/redaction.d.ts +0 -44
- package/dist/redaction.js +0 -167
- package/dist/server.js +0 -26
- /package/dist/{server.d.ts → ingest/worker.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
4
|
+
const index_1 = require("./index");
|
|
5
|
+
function isTraceMaterializationWorkerRequest(value) {
|
|
6
|
+
if (!value || typeof value !== 'object') {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const message = value;
|
|
10
|
+
return Number.isFinite(message.taskId) && message.type === 'materialize-trace-events' && !!message.payload;
|
|
11
|
+
}
|
|
12
|
+
node_worker_threads_1.parentPort?.on('message', (message) => {
|
|
13
|
+
if (!isTraceMaterializationWorkerRequest(message)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
void (async () => {
|
|
17
|
+
try {
|
|
18
|
+
const events = await (0, index_1.__materializePendingTraceEventsForWorker)(message.payload);
|
|
19
|
+
node_worker_threads_1.parentPort?.postMessage({
|
|
20
|
+
taskId: message.taskId,
|
|
21
|
+
ok: true,
|
|
22
|
+
events,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
node_worker_threads_1.parentPort?.postMessage({
|
|
27
|
+
taskId: message.taskId,
|
|
28
|
+
ok: false,
|
|
29
|
+
error: err instanceof Error ? err.message : String(err),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
});
|
package/docs/tracing.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reproapp/node-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Repro Nest SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc -p tsconfig.json",
|
|
13
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
13
14
|
"prepublishOnly": "npm run build",
|
|
14
|
-
"test": "npm run build && node
|
|
15
|
+
"test": "npm run build && node test/unawaited.test.js && node test/integration-unawaited.js && node -r ./tracer/register test/promise-map.test.js && node test/disable-subtree.test.js && node test/circular-capture.test.js && node test/wrap-plugin-arrow-args.test.js && node test/privacy-runtime-policy.test.js && node test/kafka-runtime-privacy-policy.test.js"
|
|
15
16
|
},
|
|
16
17
|
"peerDependencies": {
|
|
17
18
|
"express": "^5.1.0",
|
|
@@ -34,6 +35,11 @@
|
|
|
34
35
|
"@nestjs/common": "^11.1.9",
|
|
35
36
|
"@nestjs/core": "^11.1.9",
|
|
36
37
|
"@nestjs/platform-express": "^11.1.9",
|
|
38
|
+
"@redactpii/node": "^1.0.17",
|
|
39
|
+
"@secretlint/core": "^9.3.4",
|
|
40
|
+
"@secretlint/node": "^9.3.4",
|
|
41
|
+
"@secretlint/secretlint-rule-pattern": "^9.3.4",
|
|
42
|
+
"@secretlint/secretlint-rule-preset-recommend": "^9.3.4",
|
|
37
43
|
"express": "^5.1.0",
|
|
38
44
|
"import-in-the-middle": "^2.0.0",
|
|
39
45
|
"mongoose": ">=6",
|