surrge 0.5.0 → 0.11.3
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 +70 -3
- package/dist/auth/config.d.ts.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/passkey.d.ts +1 -1
- package/dist/auth/passkey.d.ts.map +1 -1
- package/dist/auth/setup.d.ts +5 -3
- package/dist/auth/setup.d.ts.map +1 -1
- package/dist/cli.js +13 -1
- package/dist/client.d.ts +31 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +4 -0
- package/dist/collector.d.ts +11 -0
- package/dist/collector.d.ts.map +1 -1
- package/dist/dashboard/client.d.ts +2 -0
- package/dist/dashboard/client.d.ts.map +1 -0
- package/dist/dashboard/html.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/geo.d.ts +10 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/index.js +22080 -6501
- package/dist/loader.js +22086 -6507
- package/dist/patch/utils.d.ts.map +1 -1
- package/dist/period.d.ts +13 -0
- package/dist/period.d.ts.map +1 -0
- package/dist/register.js +22080 -6501
- package/dist/storage/db.d.ts +32 -2
- package/dist/storage/db.d.ts.map +1 -1
- package/dist/storage/schema.d.ts +1 -1
- package/dist/storage/schema.d.ts.map +1 -1
- package/dist/storage/user.d.ts.map +1 -1
- package/package.json +21 -8
- package/dist/src/cli.js +0 -53
- package/dist/src/hooks.js +0 -148
- package/dist/src/index.js +0 -26073
- package/dist/src/loader.js +0 -26194
- package/dist/src/register.js +0 -26068
- package/scripts/postinstall.ts +0 -53
- /package/dist/{scripts/postinstall.js → postinstall.js} +0 -0
package/README.md
CHANGED
|
@@ -2,14 +2,81 @@
|
|
|
2
2
|
|
|
3
3
|
One-line observability for Node.js and Bun. Captures logs, HTTP requests, errors, and server metrics with zero configuration. Dashboard at `/surrge`.
|
|
4
4
|
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
5
7
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
npm install surrge
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Update your `package.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "surrge next dev",
|
|
17
|
+
"start": "surrge node server.js"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Open http://localhost:3000/surrge to view the dashboard.
|
|
23
|
+
|
|
24
|
+
## Adding Surrge to Your App
|
|
25
|
+
|
|
26
|
+
### Option 1: CLI Wrapper (Recommended)
|
|
27
|
+
|
|
28
|
+
The `surrge` CLI wraps your start command and handles loader injection for both Node.js and Bun:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "surrge next dev",
|
|
34
|
+
"start": "surrge node server.js",
|
|
35
|
+
"preview": "surrge vite preview"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The CLI automatically:
|
|
41
|
+
- Detects Bun or falls back to Node.js
|
|
42
|
+
- Resolves binaries from `node_modules/.bin`
|
|
43
|
+
- Injects the loader (`--import` for Node, `--preload` for Bun)
|
|
44
|
+
|
|
45
|
+
You can also specify the runtime explicitly:
|
|
8
46
|
|
|
47
|
+
```bash
|
|
48
|
+
surrge node app.js # Force Node.js
|
|
49
|
+
surrge bun app.ts # Force Bun
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Option 2: Manual Flags
|
|
53
|
+
|
|
54
|
+
If you prefer manual control:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
9
57
|
# Node.js
|
|
10
|
-
node --import surrge
|
|
58
|
+
node --import surrge app.js
|
|
59
|
+
|
|
60
|
+
# Bun
|
|
61
|
+
bun --preload surrge app.ts
|
|
11
62
|
```
|
|
12
63
|
|
|
64
|
+
### Option 3: Environment Variable
|
|
65
|
+
|
|
66
|
+
For tools that don't support direct flags:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"scripts": {
|
|
71
|
+
"dev": "NODE_OPTIONS='--import surrge' next dev"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Production Deployment
|
|
77
|
+
|
|
78
|
+
For Docker, PM2, Kubernetes, and other production environments, see the [Deployment Guide](docs/deployment.md).
|
|
79
|
+
|
|
13
80
|
## Features
|
|
14
81
|
|
|
15
82
|
- **Logs**: Console output + structured loggers (pino, winston JSON)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/auth/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,qBAA4B,CAAC;AAGpD,eAAO,MAAM,MAAM,EAAE,MAAiB,CAAC;AACvC,eAAO,MAAM,IAAI,EAAE,MAAgD,CAAC;AACpE,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/auth/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,qBAA4B,CAAC;AAGpD,eAAO,MAAM,MAAM,EAAE,MAAiB,CAAC;AACvC,eAAO,MAAM,IAAI,EAAE,MAAgD,CAAC;AACpE,eAAO,MAAM,MAAM,EAAE,MACiC,CAAC;AAGvD,eAAO,MAAM,MAAM,EAAE,MAAkD,CAAC"}
|
package/dist/auth/index.d.ts
CHANGED
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC"}
|
package/dist/auth/passkey.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type Authentication = {
|
|
|
9
9
|
counter: number;
|
|
10
10
|
};
|
|
11
11
|
export declare const challenge: (username: string) => Promise<Awaited<ReturnType<typeof generateRegistrationOptions>>>;
|
|
12
|
-
export declare const register: (
|
|
12
|
+
export declare const register: (_username: string, response: VerifyRegistrationResponseOpts["response"], expectedChallenge: string) => Promise<Registration>;
|
|
13
13
|
export declare const discover: () => Promise<Awaited<ReturnType<typeof generateAuthenticationOptions>>>;
|
|
14
14
|
export declare const authenticate: (user: User.Record, response: VerifyAuthenticationResponseOpts["response"], expectedChallenge: string) => Promise<Authentication>;
|
|
15
15
|
//# sourceMappingURL=passkey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/auth/passkey.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/auth/passkey.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EAGpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAC;AAGhD,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAgBjE,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,WAAW,MAAM,EACjB,UAAU,8BAA8B,CAAC,UAAU,CAAC,EACpD,mBAAmB,MAAM,KACxB,OAAO,CAAC,YAAY,CAmBtB,CAAC;AAGF,eAAO,MAAM,QAAQ,QAAa,OAAO,CACvC,OAAO,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAU1D,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,MAAM,IAAI,CAAC,MAAM,EACjB,UAAU,gCAAgC,CAAC,UAAU,CAAC,EACtD,mBAAmB,MAAM,KACxB,OAAO,CAAC,cAAc,CAkBxB,CAAC"}
|
package/dist/auth/setup.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const hash:
|
|
2
|
-
export declare const verify: (code: string, stored: string) => boolean;
|
|
3
|
-
export declare const clear: () => void;
|
|
1
|
+
export declare const setHash: (hash: string) => void;
|
|
4
2
|
export declare const generate: () => {
|
|
5
3
|
code: string;
|
|
6
4
|
hash: string;
|
|
7
5
|
};
|
|
6
|
+
export declare const verify: (code: string, stored: string) => boolean;
|
|
7
|
+
export declare const stored: () => Promise<string | null>;
|
|
8
|
+
export declare const ensure: () => Promise<string | null>;
|
|
9
|
+
export declare const remove: () => Promise<void>;
|
|
8
10
|
//# sourceMappingURL=setup.d.ts.map
|
package/dist/auth/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/auth/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/auth/setup.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,IAEtC,CAAC;AAGF,eAAO,MAAM,QAAQ,QAAO;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAMvD,CAAC;AAGF,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,OAYrD,CAAC;AAGF,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAIpD,CAAC;AAGF,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAgBpD,CAAC;AAGF,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,IAAI,CAE3C,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { spawn, spawnSync } from "node:child_process";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
5
6
|
import { dirname, resolve } from "node:path";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
7
8
|
var args = process.argv.slice(2);
|
|
9
|
+
var resolveScript = (script) => {
|
|
10
|
+
if (existsSync(script))
|
|
11
|
+
return script;
|
|
12
|
+
const binPath = resolve("node_modules", ".bin", script);
|
|
13
|
+
if (existsSync(binPath))
|
|
14
|
+
return binPath;
|
|
15
|
+
return script;
|
|
16
|
+
};
|
|
8
17
|
if (args.length === 0) {
|
|
9
18
|
console.log("Usage: surrge [options] <script> [args...]");
|
|
10
19
|
console.log(" surrge node [options] <script> [args...]");
|
|
@@ -42,12 +51,15 @@ if (scriptArgs.length === 0) {
|
|
|
42
51
|
console.log("Error: No script specified");
|
|
43
52
|
process.exit(1);
|
|
44
53
|
}
|
|
54
|
+
var scriptPath = resolveScript(scriptArgs[0]);
|
|
45
55
|
var flag = runtime === "bun" ? "--preload" : "--import";
|
|
46
|
-
var child = spawn(runtime, [flag, loaderPath, ...runtimeFlags, ...scriptArgs], {
|
|
56
|
+
var child = spawn(runtime, [flag, loaderPath, ...runtimeFlags, scriptPath, ...scriptArgs.slice(1)], {
|
|
47
57
|
stdio: "inherit",
|
|
48
58
|
cwd: process.cwd(),
|
|
49
59
|
env: process.env
|
|
50
60
|
});
|
|
61
|
+
process.on("SIGINT", () => {});
|
|
62
|
+
process.on("SIGTERM", () => child.kill("SIGTERM"));
|
|
51
63
|
child.on("close", (code) => {
|
|
52
64
|
process.exit(code ?? 0);
|
|
53
65
|
});
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type ErrorContext = {
|
|
2
|
+
viewport: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
connection: string | null;
|
|
7
|
+
memory: number | null;
|
|
8
|
+
};
|
|
9
|
+
type ErrorPayload = {
|
|
10
|
+
type: "error";
|
|
11
|
+
path: string;
|
|
12
|
+
message: string;
|
|
13
|
+
stack: string | null;
|
|
14
|
+
kind: "exception" | "rejection" | "console";
|
|
15
|
+
context: ErrorContext;
|
|
16
|
+
};
|
|
17
|
+
type TrackPayload = {
|
|
18
|
+
type: "pageview" | "event";
|
|
19
|
+
path: string;
|
|
20
|
+
referrer: string | null;
|
|
21
|
+
name?: string;
|
|
22
|
+
data?: Record<string, unknown>;
|
|
23
|
+
} | ErrorPayload | {
|
|
24
|
+
type: "errors";
|
|
25
|
+
errors: ErrorPayload[];
|
|
26
|
+
};
|
|
27
|
+
declare const send: (payload: TrackPayload) => void;
|
|
28
|
+
declare const trackPageView: () => void;
|
|
29
|
+
declare const trackEvent: (name: string, data?: Record<string, unknown>) => void;
|
|
30
|
+
export { trackPageView, trackEvent, send };
|
|
31
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;IAC5C,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,KAAK,YAAY,GACb;IACE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,GACD,YAAY,GACZ;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC;AAI/C,QAAA,MAAM,IAAI,GAAI,SAAS,YAAY,KAAG,IAmBrC,CAAC;AAEF,QAAA,MAAM,aAAa,QAAO,IAMzB,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAQlE,CAAC;AAgMF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(()=>{var{defineProperty:W,getOwnPropertyNames:I,getOwnPropertyDescriptor:M}=Object,F=Object.prototype.hasOwnProperty;var Z=new WeakMap,q=(z)=>{var j=Z.get(z),B;if(j)return j;if(j=W({},"__esModule",{value:!0}),z&&typeof z==="object"||typeof z==="function")I(z).map((G)=>!F.call(j,G)&&W(j,G,{get:()=>z[G],enumerable:!(B=M(z,G))||B.enumerable}));return Z.set(z,j),j};var x=(z,j)=>{for(var B in j)W(z,B,{get:j[B],enumerable:!0,configurable:!0,set:(G)=>j[B]=()=>G})};var y={};x(y,{trackPageView:()=>R,trackEvent:()=>$,send:()=>U});var U=(z)=>{let j=JSON.stringify(z);if(navigator.sendBeacon){navigator.sendBeacon("/surrge/track",j);return}fetch("/surrge/track",{method:"POST",headers:{"Content-Type":"application/json"},body:j,keepalive:!0}).catch(()=>{})},R=()=>{U({type:"pageview",path:location.pathname+location.search,referrer:document.referrer||null})},$=(z,j)=>{U({type:"event",path:location.pathname+location.search,referrer:null,name:z,data:j})};var N=new Map,S=[],X=null,O=(z,j)=>{return(j?.split(`
|
|
2
|
+
`)[1]??z).trim().slice(0,100)},T=(z)=>{let j=Date.now(),B=N.get(z);if(B&&j-B<5000)return!1;if(N.set(z,j),N.size>50){for(let[G,K]of N)if(j-K>5000)N.delete(G)}return!0},b=()=>({viewport:{width:window.innerWidth,height:window.innerHeight},connection:navigator.connection?.effectiveType??null,memory:performance.memory?.usedJSHeapSize??null}),A=()=>{if(S.length===0)return;let z=S.splice(0,5);if(U({type:"errors",errors:z}),S.length>0)C()},C=()=>{if(X)return;X=setTimeout(()=>{X=null,A()},2000)},Y=(z,j,B)=>{let G=O(z,j);if(!T(G))return;S.push({type:"error",path:location.pathname+location.search,message:z.slice(0,500),stack:j?.split(`
|
|
3
|
+
`).slice(0,10).join(`
|
|
4
|
+
`)??null,kind:B,context:b()}),C()},Q=()=>{let z=window.onerror;window.onerror=(B,G,K,L,J)=>{let D=typeof B==="string"?B:"Unknown error",H=J?.stack??(G?`at ${G}:${K}:${L}`:null);if(Y(D,H,"exception"),z)return z(B,G,K,L,J);return!1},window.addEventListener("unhandledrejection",(B)=>{let G=B.reason,K=G instanceof Error?G.message:String(G??"Promise rejected"),L=G instanceof Error?G.stack??null:null;Y(`Unhandled: ${K}`,L,"rejection")});let j=console.error.bind(console);console.error=(...B)=>{j(...B);let G=B.map((J)=>{if(J instanceof Error)return J.message;if(typeof J==="object")try{return JSON.stringify(J)}catch{return String(J)}return String(J)}).join(" "),K=B.find((J)=>J instanceof Error),L=K instanceof Error?K.stack??null:null;Y(G,L,"console")}},v=()=>{let z={pushState:history.pushState.bind(history),replaceState:history.replaceState.bind(history)};history.pushState=(...j)=>{z.pushState(...j),R()},history.replaceState=(...j)=>{z.replaceState(...j),R()}},V=()=>{window.addEventListener("popstate",()=>{R()})},_=()=>{R(),v(),V(),Q(),window.surrge={event:$}};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",_);else _();})();
|
package/dist/collector.d.ts
CHANGED
|
@@ -3,6 +3,17 @@ export declare const stop: () => void;
|
|
|
3
3
|
export declare const log: (level: string, message: string, metadata?: Record<string, unknown>) => void;
|
|
4
4
|
export declare const request: (method: string, url: string, status: number | null, duration: number | null, direction: "in" | "out") => void;
|
|
5
5
|
export declare const error: (message: string, stack: string | null) => void;
|
|
6
|
+
export type BrowserContext = {
|
|
7
|
+
user_agent: string;
|
|
8
|
+
visitor_id: string;
|
|
9
|
+
viewport: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
connection: string | null;
|
|
14
|
+
memory: number | null;
|
|
15
|
+
};
|
|
16
|
+
export declare const browserError: (message: string, stack: string | null, url: string, context: BrowserContext) => void;
|
|
6
17
|
export declare const pageview: (path: string, referrer: string | null, visitor_id: string | null, country: string | null, device: string | null, browser: string | null) => void;
|
|
7
18
|
export declare const metric: (memory_rss: number, memory_heap: number, cpu_user: number, cpu_system: number, event_loop_lag: number, load_avg: number) => void;
|
|
8
19
|
//# sourceMappingURL=collector.d.ts.map
|
package/dist/collector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAqJA,eAAO,MAAM,KAAK,QAAO,IAOxB,CAAC;AAEF,eAAO,MAAM,IAAI,QAAO,IAQvB,CAAC;AAGF,eAAO,MAAM,GAAG,GACd,OAAO,MAAM,EACb,SAAS,MAAM,EACf,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACjC,IAQF,CAAC;AAEF,eAAO,MAAM,OAAO,GAClB,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,MAAM,GAAG,IAAI,EACvB,WAAW,IAAI,GAAG,KAAK,KACtB,IAUF,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,GAAG,IAAI,KAAG,IAW7D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,MAAM,EACf,OAAO,MAAM,GAAG,IAAI,EACpB,KAAK,MAAM,EACX,SAAS,cAAc,KACtB,IAaF,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,MAAM,MAAM,EACZ,UAAU,MAAM,GAAG,IAAI,EACvB,YAAY,MAAM,GAAG,IAAI,EACzB,SAAS,MAAM,GAAG,IAAI,EACtB,QAAQ,MAAM,GAAG,IAAI,EACrB,SAAS,MAAM,GAAG,IAAI,KACrB,IAWF,CAAC;AAEF,eAAO,MAAM,MAAM,GACjB,YAAY,MAAM,EAClB,aAAa,MAAM,EACnB,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,gBAAgB,MAAM,EACtB,UAAU,MAAM,KACf,IAWF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/dashboard/client.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,QAAO,MAAy0F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/dashboard/html.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,QAAO,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/dashboard/html.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,QAAO,MAAmnlmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAiB5B,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,KACf,IAAI,CAAC;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAsc/B,CAAC"}
|
package/dist/geo.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type GeoResult = {
|
|
2
|
+
country: string | null;
|
|
3
|
+
countryCode: string | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const lookup: (ip: string) => Promise<GeoResult>;
|
|
6
|
+
export declare const lookupAsync: (ip: string) => void;
|
|
7
|
+
export declare const cached: (ip: string) => string | null;
|
|
8
|
+
export declare const clear: () => void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=geo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo.d.ts","sourceRoot":"","sources":["../src/geo.ts"],"names":[],"mappings":"AAGA,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAmEF,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,SAAS,CAqBpD,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,KAAG,IAUxC,CAAC;AAGF,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,KAAG,MAAM,GAAG,IAE5C,CAAC;AAgBF,eAAO,MAAM,KAAK,QAAO,IAExB,CAAC"}
|