@dszp/netsapiens-lib 0.1.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/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/html.d.ts +51 -0
- package/dist/html.js +332 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +22 -0
- package/dist/jwt.d.ts +174 -0
- package/dist/jwt.js +290 -0
- package/dist/mermaid.d.ts +14 -0
- package/dist/mermaid.js +0 -0
- package/dist/model.d.ts +80 -0
- package/dist/model.js +10 -0
- package/dist/nsClient.d.ts +79 -0
- package/dist/nsClient.js +205 -0
- package/dist/policy.d.ts +49 -0
- package/dist/policy.js +39 -0
- package/dist/principal.d.ts +52 -0
- package/dist/principal.js +45 -0
- package/dist/raster.d.ts +21 -0
- package/dist/raster.js +81 -0
- package/dist/resolver.d.ts +58 -0
- package/dist/resolver.js +1092 -0
- package/dist/sensitivity.d.ts +32 -0
- package/dist/sensitivity.js +30 -0
- package/dist/themes.d.ts +71 -0
- package/dist/themes.js +104 -0
- package/package.json +60 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which calls need a FRESH live JWT revalidation (bypassing the verdict cache) — a *can't-forget*
|
|
3
|
+
* classification. Logout/revocation is server-side and we get no event to evict the cache, so
|
|
4
|
+
* write/sensitive operations must force-fresh (`verify({ forceFresh: true })`) or they'd accept a
|
|
5
|
+
* logged-out token for up to the cache TTL. Plain reads stay cache-fronted (cheap).
|
|
6
|
+
*
|
|
7
|
+
* The reminder is structural, not a comment you can skip: every portal route's config must satisfy
|
|
8
|
+
* `RouteAuth`, whose `sensitivity` is REQUIRED. Adding a route without classifying it is a TypeScript
|
|
9
|
+
* error — so you can't forget. Derive the verify option straight from it:
|
|
10
|
+
*
|
|
11
|
+
* const ROUTES = {
|
|
12
|
+
* '/flow': { sensitivity: 'read', handle: getFlow },
|
|
13
|
+
* '/publish': { sensitivity: 'write', handle: publish },
|
|
14
|
+
* '/preview': { sensitivity: 'sensitive', handle: preview },
|
|
15
|
+
* } satisfies Record<string, RouteAuth & { handle: Handler }>; // ← omitting sensitivity won't compile
|
|
16
|
+
*
|
|
17
|
+
* const route = ROUTES[path];
|
|
18
|
+
* const verdict = await verify(ns_t, { mode: 'live', cache, forceFresh: needsFreshAuth(route.sensitivity) });
|
|
19
|
+
*
|
|
20
|
+
* Portable (no Node).
|
|
21
|
+
*/
|
|
22
|
+
/** read = safe to serve from the cached JWT verdict. sensitive/write = must revalidate live. */
|
|
23
|
+
export type CallSensitivity = 'read' | 'sensitive' | 'write';
|
|
24
|
+
/** True when a call must force a fresh live JWT check (bypass the verdict cache). */
|
|
25
|
+
export declare function needsFreshAuth(sensitivity: CallSensitivity): boolean;
|
|
26
|
+
/** Base shape every route config MUST satisfy — `sensitivity` is required (that's the reminder). */
|
|
27
|
+
export interface RouteAuth {
|
|
28
|
+
sensitivity: CallSensitivity;
|
|
29
|
+
}
|
|
30
|
+
/** Human note surfaced in docs/registries so the rule is visible where routes are defined. */
|
|
31
|
+
export declare const SENSITIVITY_NOTE: string;
|
|
32
|
+
//# sourceMappingURL=sensitivity.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which calls need a FRESH live JWT revalidation (bypassing the verdict cache) — a *can't-forget*
|
|
3
|
+
* classification. Logout/revocation is server-side and we get no event to evict the cache, so
|
|
4
|
+
* write/sensitive operations must force-fresh (`verify({ forceFresh: true })`) or they'd accept a
|
|
5
|
+
* logged-out token for up to the cache TTL. Plain reads stay cache-fronted (cheap).
|
|
6
|
+
*
|
|
7
|
+
* The reminder is structural, not a comment you can skip: every portal route's config must satisfy
|
|
8
|
+
* `RouteAuth`, whose `sensitivity` is REQUIRED. Adding a route without classifying it is a TypeScript
|
|
9
|
+
* error — so you can't forget. Derive the verify option straight from it:
|
|
10
|
+
*
|
|
11
|
+
* const ROUTES = {
|
|
12
|
+
* '/flow': { sensitivity: 'read', handle: getFlow },
|
|
13
|
+
* '/publish': { sensitivity: 'write', handle: publish },
|
|
14
|
+
* '/preview': { sensitivity: 'sensitive', handle: preview },
|
|
15
|
+
* } satisfies Record<string, RouteAuth & { handle: Handler }>; // ← omitting sensitivity won't compile
|
|
16
|
+
*
|
|
17
|
+
* const route = ROUTES[path];
|
|
18
|
+
* const verdict = await verify(ns_t, { mode: 'live', cache, forceFresh: needsFreshAuth(route.sensitivity) });
|
|
19
|
+
*
|
|
20
|
+
* Portable (no Node).
|
|
21
|
+
*/
|
|
22
|
+
/** True when a call must force a fresh live JWT check (bypass the verdict cache). */
|
|
23
|
+
export function needsFreshAuth(sensitivity) {
|
|
24
|
+
return sensitivity !== 'read';
|
|
25
|
+
}
|
|
26
|
+
/** Human note surfaced in docs/registries so the rule is visible where routes are defined. */
|
|
27
|
+
export const SENSITIVITY_NOTE = 'Every portal route MUST declare `sensitivity` (read | sensitive | write). write/sensitive ⇒ verify ' +
|
|
28
|
+
'with forceFresh (bypass the JWT verdict cache) so logout/revocation is caught immediately; read ⇒ ' +
|
|
29
|
+
'cache-fronted verify. A missing classification is a compile error via `satisfies Record<string, RouteAuth>`.';
|
|
30
|
+
//# sourceMappingURL=sensitivity.js.map
|
package/dist/themes.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme registry — the single source of truth for call-flow *appearance*, shared by every host (a
|
|
3
|
+
* viewer SPA, a static gallery, a Worker). A theme bundles a
|
|
4
|
+
* Mermaid node **palette** (fill/stroke/color per node kind), the Mermaid **base + look**, and the
|
|
5
|
+
* surrounding page/app **chrome** (backgrounds, borders, text, accent, brand) as plain data so any
|
|
6
|
+
* renderer can consume it — the viewer injects it into its page, a gallery can map it to CSS.
|
|
7
|
+
*
|
|
8
|
+
* Portable / Node-free (pure data + types). `mermaid.ts` pulls its palettes from here so palettes
|
|
9
|
+
* live in exactly one place. The legacy no-theme Mermaid path is unchanged (the Worker relies on it).
|
|
10
|
+
*/
|
|
11
|
+
import type { NodeKind } from './model.js';
|
|
12
|
+
/** A per-node-kind Mermaid `classDef` body: `fill:..,stroke:..,color:..`. */
|
|
13
|
+
export type NodePalette = Record<NodeKind, string>;
|
|
14
|
+
export type ThemeMode = 'light' | 'dark';
|
|
15
|
+
/** Colors for the surrounding app/page chrome (everything that is NOT the diagram nodes). A host
|
|
16
|
+
* maps these onto its own surfaces — the viewer binds them to CSS custom properties. */
|
|
17
|
+
export interface ThemeChrome {
|
|
18
|
+
bg: string;
|
|
19
|
+
panel: string;
|
|
20
|
+
panel2: string;
|
|
21
|
+
border: string;
|
|
22
|
+
text: string;
|
|
23
|
+
dim: string;
|
|
24
|
+
inputBg: string;
|
|
25
|
+
diagramBg: string;
|
|
26
|
+
itemHover: string;
|
|
27
|
+
itemActive: string;
|
|
28
|
+
accent: string;
|
|
29
|
+
notes: string;
|
|
30
|
+
/** Logo/title color — this is what distinguishes the two portal-match themes (crimson vs blue). */
|
|
31
|
+
brand: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ThemeDef {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
mode: ThemeMode;
|
|
37
|
+
/** Mermaid built-in base theme this rides on. */
|
|
38
|
+
mermaidBase: 'base' | 'dark';
|
|
39
|
+
/** Mermaid `look` — `neo` (soft, default) or `handDrawn` (sketchy). */
|
|
40
|
+
look: 'neo' | 'handDrawn';
|
|
41
|
+
lineColor: string;
|
|
42
|
+
/** Mermaid `primaryTextColor` (node label text). */
|
|
43
|
+
textColor: string;
|
|
44
|
+
palette: NodePalette;
|
|
45
|
+
chrome: ThemeChrome;
|
|
46
|
+
}
|
|
47
|
+
/** Light tints + dark text (readable on white cards). Used by every light theme. */
|
|
48
|
+
export declare const NODE_LIGHT: NodePalette;
|
|
49
|
+
/** Saturated fills + white text — the original dark palette (Worker legacy path + `dark` theme). */
|
|
50
|
+
export declare const NODE_DARK: NodePalette;
|
|
51
|
+
/** Cooler, desaturated dark — calmer than the neon `NODE_DARK`. */
|
|
52
|
+
export declare const NODE_SLATE: NodePalette;
|
|
53
|
+
/** Colorblind-safe-ish hues + darkened text for WCAG-AA on-node contrast. */
|
|
54
|
+
export declare const NODE_A11Y: NodePalette;
|
|
55
|
+
/**
|
|
56
|
+
* The shipped theme set (viewer picker order). Add a theme here → every host gets it.
|
|
57
|
+
*
|
|
58
|
+
* Deliberately vendor-neutral: no theme here encodes anyone's brand. `ns-portal` matches the stock
|
|
59
|
+
* NetSapiens Manager Portal scheme, which is common to every deployment. To add your own branding,
|
|
60
|
+
* assign into this record at startup — it is a plain, mutable `Record<string, ThemeDef>`:
|
|
61
|
+
*
|
|
62
|
+
* THEMES['acme'] = { ...THEMES['ns-portal'], id: 'acme', label: 'Acme',
|
|
63
|
+
* chrome: { ...THEMES['ns-portal'].chrome, accent: '#b3282d', brand: '#b3282d' } };
|
|
64
|
+
*
|
|
65
|
+
* Keep brand values in your host's config (an env var), not in this library.
|
|
66
|
+
*/
|
|
67
|
+
export declare const THEMES: Record<string, ThemeDef>;
|
|
68
|
+
/** System-auto defaults (host picks by `prefers-color-scheme` on first load). */
|
|
69
|
+
export declare const DEFAULT_LIGHT_THEME = "light-neo";
|
|
70
|
+
export declare const DEFAULT_DARK_THEME = "slate-dark";
|
|
71
|
+
//# sourceMappingURL=themes.d.ts.map
|
package/dist/themes.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme registry — the single source of truth for call-flow *appearance*, shared by every host (a
|
|
3
|
+
* viewer SPA, a static gallery, a Worker). A theme bundles a
|
|
4
|
+
* Mermaid node **palette** (fill/stroke/color per node kind), the Mermaid **base + look**, and the
|
|
5
|
+
* surrounding page/app **chrome** (backgrounds, borders, text, accent, brand) as plain data so any
|
|
6
|
+
* renderer can consume it — the viewer injects it into its page, a gallery can map it to CSS.
|
|
7
|
+
*
|
|
8
|
+
* Portable / Node-free (pure data + types). `mermaid.ts` pulls its palettes from here so palettes
|
|
9
|
+
* live in exactly one place. The legacy no-theme Mermaid path is unchanged (the Worker relies on it).
|
|
10
|
+
*/
|
|
11
|
+
// ---- node palettes (same call-flow semantics across palettes; different tints per mode) ----
|
|
12
|
+
/** Light tints + dark text (readable on white cards). Used by every light theme. */
|
|
13
|
+
export const NODE_LIGHT = {
|
|
14
|
+
did: 'fill:#dbeafe,stroke:#3b82f6,color:#1e3a5f', timeframe: 'fill:#fef3c7,stroke:#d9a441,color:#5c4a1e',
|
|
15
|
+
user: 'fill:#dcfce7,stroke:#4caf7d,color:#14532d', devices: 'fill:#eafaf1,stroke:#3d6b52,color:#1a3d2e',
|
|
16
|
+
queue: 'fill:#ccfbf1,stroke:#14b8a6,color:#134e4a', agents: 'fill:#ede9fe,stroke:#7d6bd9,color:#3730a3',
|
|
17
|
+
attendant: 'fill:#f3e8ff,stroke:#a855f7,color:#581c87', prompt: 'fill:#e0e7ff,stroke:#8a8ad9,color:#312e81',
|
|
18
|
+
voicemail: 'fill:#fee2e2,stroke:#ef4444,color:#7f1d1d', external: 'fill:#ffedd5,stroke:#f97316,color:#7c2d12',
|
|
19
|
+
trunk: 'fill:#f1f5f9,stroke:#94a3b8,color:#334155', hangup: 'fill:#f3f4f6,stroke:#9ca3af,color:#374151',
|
|
20
|
+
unknown: 'fill:#fee2e2,stroke:#dc2626,color:#7f1d1d',
|
|
21
|
+
};
|
|
22
|
+
/** Saturated fills + white text — the original dark palette (Worker legacy path + `dark` theme). */
|
|
23
|
+
export const NODE_DARK = {
|
|
24
|
+
did: 'fill:#1e3a5f,stroke:#4a90d9,color:#fff', timeframe: 'fill:#5c4a1e,stroke:#d9a441,color:#fff',
|
|
25
|
+
user: 'fill:#1f3a2e,stroke:#4caf7d,color:#fff', devices: 'fill:#26332c,stroke:#3d6b52,color:#cfe',
|
|
26
|
+
queue: 'fill:#3a1f3a,stroke:#b44ab4,color:#fff', agents: 'fill:#2e2640,stroke:#7d6bd9,color:#fff',
|
|
27
|
+
attendant: 'fill:#3a2a1f,stroke:#d97d4a,color:#fff', prompt: 'fill:#2a2a3a,stroke:#8a8ad9,color:#dde',
|
|
28
|
+
voicemail: 'fill:#3a1f1f,stroke:#d94a4a,color:#fff', external: 'fill:#4a3a1e,stroke:#d9b84a,color:#fff',
|
|
29
|
+
trunk: 'fill:#333,stroke:#999,color:#ddd', hangup: 'fill:#2a2a2a,stroke:#777,color:#bbb',
|
|
30
|
+
unknown: 'fill:#402020,stroke:#c05050,color:#fdd',
|
|
31
|
+
};
|
|
32
|
+
/** Cooler, desaturated dark — calmer than the neon `NODE_DARK`. */
|
|
33
|
+
export const NODE_SLATE = {
|
|
34
|
+
did: 'fill:#243447,stroke:#5b8bc0,color:#e8eef5', timeframe: 'fill:#3d3527,stroke:#c2a15a,color:#f0e9dc',
|
|
35
|
+
user: 'fill:#243a30,stroke:#5aa583,color:#e3f0e9', devices: 'fill:#293430,stroke:#5f8873,color:#dbe9e2',
|
|
36
|
+
queue: 'fill:#2b3540,stroke:#4bb3a6,color:#dcefec', agents: 'fill:#2e2f42,stroke:#8b7fd0,color:#e6e2f4',
|
|
37
|
+
attendant: 'fill:#352c40,stroke:#b07fd0,color:#efe3f5', prompt: 'fill:#2c2f3d,stroke:#8f95c9,color:#e2e5f2',
|
|
38
|
+
voicemail: 'fill:#3d2a2a,stroke:#d07a7a,color:#f5e3e3', external: 'fill:#3d3527,stroke:#cba85f,color:#f0e9dc',
|
|
39
|
+
trunk: 'fill:#2f333a,stroke:#8792a3,color:#dde2e8', hangup: 'fill:#2a2d33,stroke:#7a828e,color:#cfd4db',
|
|
40
|
+
unknown: 'fill:#3d2a2a,stroke:#c56b6b,color:#f5dede',
|
|
41
|
+
};
|
|
42
|
+
/** Colorblind-safe-ish hues + darkened text for WCAG-AA on-node contrast. */
|
|
43
|
+
export const NODE_A11Y = {
|
|
44
|
+
did: 'fill:#cfe3f7,stroke:#0072b2,color:#04243a', timeframe: 'fill:#fbe6c2,stroke:#e69f00,color:#3d2b00',
|
|
45
|
+
user: 'fill:#cdeee3,stroke:#009e73,color:#043226', devices: 'fill:#d8f0f9,stroke:#56b4e9,color:#0a3346',
|
|
46
|
+
queue: 'fill:#f3dcea,stroke:#cc79a7,color:#3d0f2a', agents: 'fill:#dcdcf0,stroke:#3b3b8f,color:#161642',
|
|
47
|
+
attendant: 'fill:#e8dbf5,stroke:#8036c4,color:#2c0f47', prompt: 'fill:#e4e4ee,stroke:#5a5a8a,color:#1c1c33',
|
|
48
|
+
voicemail: 'fill:#f7ddd0,stroke:#d55e00,color:#3d1a00', external: 'fill:#f2e6c0,stroke:#b8860b,color:#3a2c00',
|
|
49
|
+
trunk: 'fill:#e6e9ee,stroke:#556070,color:#1c232e', hangup: 'fill:#e8eaed,stroke:#4a5260,color:#20262e',
|
|
50
|
+
unknown: 'fill:#f7ddd0,stroke:#d55e00,color:#3d1a00',
|
|
51
|
+
};
|
|
52
|
+
// ---- chrome bases ----
|
|
53
|
+
const LIGHT_CHROME = {
|
|
54
|
+
bg: '#fafafa', panel: '#ffffff', panel2: '#f4f6f8', border: '#e2e8f0', text: '#1e293b', dim: '#64748b',
|
|
55
|
+
inputBg: '#ffffff', diagramBg: '#f8fafc', itemHover: '#eef2f6', itemActive: '#e5edf7', notes: '#b45309',
|
|
56
|
+
};
|
|
57
|
+
const WHITE_CHROME = { ...LIGHT_CHROME, bg: '#ffffff', panel2: '#f5f5f5', diagramBg: '#ffffff' };
|
|
58
|
+
const DARK_CHROME = {
|
|
59
|
+
bg: '#141a24', panel: '#1b2230', panel2: '#151b26', border: '#2b3444', text: '#dbe2ea', dim: '#8c99ab',
|
|
60
|
+
inputBg: '#1c2431', diagramBg: '#121821', itemHover: '#1f2836', itemActive: '#233046', notes: '#c9a24a',
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* The shipped theme set (viewer picker order). Add a theme here → every host gets it.
|
|
64
|
+
*
|
|
65
|
+
* Deliberately vendor-neutral: no theme here encodes anyone's brand. `ns-portal` matches the stock
|
|
66
|
+
* NetSapiens Manager Portal scheme, which is common to every deployment. To add your own branding,
|
|
67
|
+
* assign into this record at startup — it is a plain, mutable `Record<string, ThemeDef>`:
|
|
68
|
+
*
|
|
69
|
+
* THEMES['acme'] = { ...THEMES['ns-portal'], id: 'acme', label: 'Acme',
|
|
70
|
+
* chrome: { ...THEMES['ns-portal'].chrome, accent: '#b3282d', brand: '#b3282d' } };
|
|
71
|
+
*
|
|
72
|
+
* Keep brand values in your host's config (an env var), not in this library.
|
|
73
|
+
*/
|
|
74
|
+
export const THEMES = {
|
|
75
|
+
'light-neo': {
|
|
76
|
+
id: 'light-neo', label: 'Light · Neo', mode: 'light', mermaidBase: 'base', look: 'neo',
|
|
77
|
+
lineColor: '#64748b', textColor: '#1e293b', palette: NODE_LIGHT,
|
|
78
|
+
chrome: { ...LIGHT_CHROME, accent: '#3b82f6', brand: '#1e293b' },
|
|
79
|
+
},
|
|
80
|
+
'ns-portal': {
|
|
81
|
+
id: 'ns-portal', label: 'NetSapiens portal', mode: 'light', mermaidBase: 'base', look: 'neo',
|
|
82
|
+
lineColor: '#8a8a8a', textColor: '#333333', palette: NODE_LIGHT,
|
|
83
|
+
chrome: { ...WHITE_CHROME, accent: '#1a6bb0', brand: '#1a6bb0' },
|
|
84
|
+
},
|
|
85
|
+
'a11y-light': {
|
|
86
|
+
id: 'a11y-light', label: 'Accessible light', mode: 'light', mermaidBase: 'base', look: 'neo',
|
|
87
|
+
lineColor: '#475569', textColor: '#111827', palette: NODE_A11Y,
|
|
88
|
+
chrome: { ...LIGHT_CHROME, text: '#111827', dim: '#4b5563', accent: '#0072b2', brand: '#111827' },
|
|
89
|
+
},
|
|
90
|
+
'sketch-light': {
|
|
91
|
+
id: 'sketch-light', label: 'Hand-drawn', mode: 'light', mermaidBase: 'base', look: 'handDrawn',
|
|
92
|
+
lineColor: '#64748b', textColor: '#1e293b', palette: NODE_LIGHT,
|
|
93
|
+
chrome: { ...LIGHT_CHROME, accent: '#3b82f6', brand: '#1e293b' },
|
|
94
|
+
},
|
|
95
|
+
'slate-dark': {
|
|
96
|
+
id: 'slate-dark', label: 'Slate dark', mode: 'dark', mermaidBase: 'dark', look: 'neo',
|
|
97
|
+
lineColor: '#8c99ab', textColor: '#dbe2ea', palette: NODE_SLATE,
|
|
98
|
+
chrome: { ...DARK_CHROME, accent: '#5b8bc0', brand: '#dbe2ea' },
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
/** System-auto defaults (host picks by `prefers-color-scheme` on first load). */
|
|
102
|
+
export const DEFAULT_LIGHT_THEME = 'light-neo';
|
|
103
|
+
export const DEFAULT_DARK_THEME = 'slate-dark';
|
|
104
|
+
//# sourceMappingURL=themes.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dszp/netsapiens-lib",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Portable, Node-free NetSapiens toolkit: read-only API client, JWT (ns_t) validation, and a snapshot -> FlowGraph -> Mermaid call-flow resolver/renderer. Runs unchanged in a Cloudflare Worker, Node, or the browser.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "David Szpunar",
|
|
9
|
+
"url": "https://david.szpunar.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/dszp/netsapiens-lib.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": { "url": "https://github.com/dszp/netsapiens-lib/issues" },
|
|
16
|
+
"homepage": "https://github.com/dszp/netsapiens-lib#readme",
|
|
17
|
+
"//publishConfig": "No `provenance: true` here on purpose: it would force provenance on EVERY publish, including the manual first one that a brand-new package requires (npm can only configure trusted publishing on a package that already exists). Provenance comes from the workflow's explicit `npm publish --provenance` in CI.",
|
|
18
|
+
"publishConfig": { "access": "public" },
|
|
19
|
+
"engines": { "node": ">=20" },
|
|
20
|
+
"keywords": [
|
|
21
|
+
"netsapiens",
|
|
22
|
+
"voip",
|
|
23
|
+
"call-flow",
|
|
24
|
+
"mermaid",
|
|
25
|
+
"cloudflare-workers"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"module": "./dist/index.js",
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"//files": "Globs exclude dist/**/*.map on purpose: the maps point at src/, which does not ship, so shipping them gives every consumer broken references. Maps are still emitted locally for link: consumers.",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist/**/*.js",
|
|
40
|
+
"dist/**/*.d.ts",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.json",
|
|
45
|
+
"build:watch": "tsc -p tsconfig.json --watch",
|
|
46
|
+
"prepublishOnly": "tsc -p tsconfig.json",
|
|
47
|
+
"//test": "The offline suite — green on a fresh clone with no credentials and no fixtures. test:ns is NOT included: it needs a domain snapshot that (correctly) isn't in the repo.",
|
|
48
|
+
"test": "pnpm run test:jwt && pnpm run test:principal && pnpm run test:resolver && pnpm run test:raster",
|
|
49
|
+
"test:jwt": "tsx src/jwt.selftest.ts",
|
|
50
|
+
"test:ns": "tsx src/nsClient.selftest.ts",
|
|
51
|
+
"test:principal": "tsx src/principal.selftest.ts",
|
|
52
|
+
"test:resolver": "tsx src/resolver.selftest.ts",
|
|
53
|
+
"test:raster": "tsx src/raster.selftest.ts"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"tsx": "^4.22.4",
|
|
57
|
+
"typescript": "^5"
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "pnpm@11.11.0"
|
|
60
|
+
}
|