spanport 0.0.0-stage → 0.1.1
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/LICENSE +201 -0
- package/README.md +168 -2
- package/dist/consoleCapture.d.ts +14 -0
- package/dist/consoleCapture.d.ts.map +1 -0
- package/dist/consoleCapture.js +44 -0
- package/dist/consoleCapture.js.map +1 -0
- package/dist/constants.d.ts +38 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +38 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/keyCheck.d.ts +17 -0
- package/dist/keyCheck.d.ts.map +1 -0
- package/dist/keyCheck.js +56 -0
- package/dist/keyCheck.js.map +1 -0
- package/dist/logStream.d.ts +24 -0
- package/dist/logStream.d.ts.map +1 -0
- package/dist/logStream.js +127 -0
- package/dist/logStream.js.map +1 -0
- package/dist/pipeline.d.ts +39 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +55 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/sdkMessages.d.ts +11 -0
- package/dist/sdkMessages.d.ts.map +1 -0
- package/dist/sdkMessages.js +21 -0
- package/dist/sdkMessages.js.map +1 -0
- package/dist/severity.d.ts +31 -0
- package/dist/severity.d.ts.map +1 -0
- package/dist/severity.js +76 -0
- package/dist/severity.js.map +1 -0
- package/dist/urls.d.ts +17 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.js +22 -0
- package/dist/urls.js.map +1 -0
- package/package.json +59 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAI5D;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C"}
|
package/dist/urls.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** URL helpers shared by the exporter and the key check. */
|
|
2
|
+
import { ALLOWED_URL_PROTOCOLS } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Append a path to a base URL, keeping any path the base already has (e.g. behind a proxy).
|
|
5
|
+
*
|
|
6
|
+
* @param baseUrl - e.g. "https://example.com/spanport" or "https://example.com/spanport/".
|
|
7
|
+
* @param path - Starting with "/", e.g. "/v1/logs".
|
|
8
|
+
* @returns The joined URL text.
|
|
9
|
+
*/
|
|
10
|
+
export function joinUrl(baseUrl, path) {
|
|
11
|
+
return (baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl) + path;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether the text is an absolute http:// or https:// URL.
|
|
15
|
+
*
|
|
16
|
+
* @param url - The URL text to check.
|
|
17
|
+
* @returns True only for parseable http(s) URLs.
|
|
18
|
+
*/
|
|
19
|
+
export function isHttpUrl(url) {
|
|
20
|
+
return URL.canParse(url) && ALLOWED_URL_PROTOCOLS.includes(new URL(url).protocol);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=urls.js.map
|
package/dist/urls.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe,EAAE,IAAY;IACnD,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;AACpF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spanport",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Send your Node.js app's logs to Spanport. Keep logging the way you already do.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"logging",
|
|
7
|
+
"observability",
|
|
8
|
+
"opentelemetry",
|
|
9
|
+
"otlp",
|
|
10
|
+
"spanport"
|
|
11
|
+
],
|
|
12
|
+
"license": "Apache-2.0",
|
|
13
|
+
"author": "Nitish Bharadwaj <nitishbharadwaj2002@gmail.com>",
|
|
14
|
+
"homepage": "https://github.com/span-port/spanport",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/span-port/spanport.git",
|
|
18
|
+
"directory": "sdk/node"
|
|
19
|
+
},
|
|
20
|
+
"bugs": "https://github.com/span-port/spanport/issues",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=22.15"
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.build.json",
|
|
38
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"test": "tsc -p tsconfig.json && node --test --test-reporter=dot \"build/test/**/*.test.js\"",
|
|
41
|
+
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@opentelemetry/api": ">=1.10.0 <1.11.0",
|
|
45
|
+
"@opentelemetry/exporter-logs-otlp-http": ">=0.300.0 <0.301.0",
|
|
46
|
+
"@opentelemetry/resources": ">=3.0.0 <4.0.0",
|
|
47
|
+
"@opentelemetry/sdk-logs": ">=3.0.0 <4.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/js": "10.0.1",
|
|
51
|
+
"@opentelemetry/context-async-hooks": "3.0.0",
|
|
52
|
+
"@opentelemetry/sdk-trace": "3.0.0",
|
|
53
|
+
"@types/node": "22.20.5",
|
|
54
|
+
"eslint": "10.13.0",
|
|
55
|
+
"typescript": "6.0.3",
|
|
56
|
+
"typescript-eslint": "8.72.1"
|
|
57
|
+
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"@types/estree": "1.0.9"
|
|
60
|
+
}
|
|
61
|
+
}
|