@mp70/react-networks 0.2.0-rc.0 → 0.3.0-alpha.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/dist/index.css +45 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +371 -5
- package/dist/index.d.ts +371 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,36 @@ interface FibreFlowCircuit {
|
|
|
42
42
|
color?: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
interface NetBoxPortPosition {
|
|
46
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
47
|
+
offsetPercent?: number;
|
|
48
|
+
offsetPx?: number;
|
|
49
|
+
xPercent?: number;
|
|
50
|
+
yPercent?: number;
|
|
51
|
+
}
|
|
52
|
+
interface NetBoxMappedPort {
|
|
53
|
+
id?: string;
|
|
54
|
+
label?: string;
|
|
55
|
+
face?: 'front' | 'rear';
|
|
56
|
+
group?: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
cableType?: string;
|
|
59
|
+
connected?: boolean;
|
|
60
|
+
connectorType?: 'C13' | 'C19' | 'C14' | 'C20';
|
|
61
|
+
position?: NetBoxPortPosition;
|
|
62
|
+
}
|
|
63
|
+
interface NetBoxDeviceTransformOptions {
|
|
64
|
+
/** Include interface arrays as `ports`/`rearPorts` in generated nodes */
|
|
65
|
+
includeInterfacePorts?: boolean;
|
|
66
|
+
/** Include per-port position metadata when provided */
|
|
67
|
+
includePortPositions?: boolean;
|
|
68
|
+
/** Optional mapper for full control over interface->port mapping */
|
|
69
|
+
mapInterfaceToPort?: (args: {
|
|
70
|
+
device: NetBoxDevice;
|
|
71
|
+
iface: NetBoxInterface;
|
|
72
|
+
index: number;
|
|
73
|
+
}) => NetBoxMappedPort | null | undefined;
|
|
74
|
+
}
|
|
45
75
|
interface NetBoxDevice {
|
|
46
76
|
id: number;
|
|
47
77
|
name: string;
|
|
@@ -102,6 +132,18 @@ interface NetBoxInterface {
|
|
|
102
132
|
type: string;
|
|
103
133
|
color: string;
|
|
104
134
|
} | null;
|
|
135
|
+
/** Optional face hint used by UI transforms */
|
|
136
|
+
face?: 'front' | 'rear' | null;
|
|
137
|
+
/** Optional display/ordering position from external enrichments */
|
|
138
|
+
position?: number | null;
|
|
139
|
+
/** Optional grouping hint used by UI transforms */
|
|
140
|
+
port_group?: string | null;
|
|
141
|
+
/** Optional explicit connector hint (e.g., C13/C19 for PDUs) */
|
|
142
|
+
connector_type?: 'C13' | 'C19' | 'C14' | 'C20' | null;
|
|
143
|
+
/** Optional transform layout metadata */
|
|
144
|
+
layout?: NetBoxMappedPort;
|
|
145
|
+
/** Optional custom fields payload from NetBox */
|
|
146
|
+
custom_fields?: Record<string, unknown>;
|
|
105
147
|
}
|
|
106
148
|
interface NetBoxRack {
|
|
107
149
|
id: number;
|
|
@@ -239,7 +281,25 @@ interface DeviceImageOptions {
|
|
|
239
281
|
/** When true, stretch device image to fill the device bounds (overrides imageFit) */
|
|
240
282
|
stretchToFit?: boolean;
|
|
241
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Explicit handle placement for a device/PDU port.
|
|
286
|
+
* @public
|
|
287
|
+
*/
|
|
288
|
+
interface PortPosition {
|
|
289
|
+
/** Handle side on the node */
|
|
290
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
291
|
+
/** Side offset as percentage (0-100) */
|
|
292
|
+
offsetPercent?: number;
|
|
293
|
+
/** Side offset in pixels */
|
|
294
|
+
offsetPx?: number;
|
|
295
|
+
/** Absolute X position as percentage (0-100) */
|
|
296
|
+
xPercent?: number;
|
|
297
|
+
/** Absolute Y position as percentage (0-100) */
|
|
298
|
+
yPercent?: number;
|
|
299
|
+
}
|
|
242
300
|
interface Port {
|
|
301
|
+
/** Stable handle identifier override (defaults to `label`) */
|
|
302
|
+
id?: string;
|
|
243
303
|
/** Display label for the port */
|
|
244
304
|
label: string;
|
|
245
305
|
/** Whether the port is currently connected */
|
|
@@ -248,6 +308,10 @@ interface Port {
|
|
|
248
308
|
type?: PortType;
|
|
249
309
|
/** Cable type for connection validation */
|
|
250
310
|
cableType?: PortCableType;
|
|
311
|
+
/** Optional power connector type for rendering (mainly for PDU ports) */
|
|
312
|
+
connectorType?: 'C13' | 'C14' | 'C19' | 'C20';
|
|
313
|
+
/** Optional explicit handle placement */
|
|
314
|
+
position?: PortPosition;
|
|
251
315
|
}
|
|
252
316
|
/**
|
|
253
317
|
* Group of related ports on a device
|
|
@@ -274,6 +338,16 @@ type DeviceStatus = 'active' | 'inactive' | 'maintenance';
|
|
|
274
338
|
* @public
|
|
275
339
|
*/
|
|
276
340
|
type DeviceView = 'front' | 'rear';
|
|
341
|
+
/**
|
|
342
|
+
* Rack rendering layout modes.
|
|
343
|
+
* @public
|
|
344
|
+
*/
|
|
345
|
+
type RackLayoutMode = 'single-face' | 'split-face';
|
|
346
|
+
/**
|
|
347
|
+
* Rack mounting behavior for a device.
|
|
348
|
+
* @public
|
|
349
|
+
*/
|
|
350
|
+
type RackMountMode = 'front' | 'rear' | 'both';
|
|
277
351
|
/**
|
|
278
352
|
* Power port side configuration
|
|
279
353
|
* @public
|
|
@@ -316,6 +390,12 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
316
390
|
view?: DeviceView;
|
|
317
391
|
/** Rack face orientation */
|
|
318
392
|
face?: DeviceView;
|
|
393
|
+
/** Rack rendering layout mode */
|
|
394
|
+
rackLayout?: RackLayoutMode;
|
|
395
|
+
/** Gap in pixels between front and rear faces in split-face mode */
|
|
396
|
+
rackFaceGapPx?: number;
|
|
397
|
+
/** Device mount behavior within a rack */
|
|
398
|
+
mountMode?: RackMountMode;
|
|
319
399
|
/** Device type specification */
|
|
320
400
|
deviceType?: string;
|
|
321
401
|
/** Device manufacturer */
|
|
@@ -330,6 +410,10 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
330
410
|
heightCm?: number;
|
|
331
411
|
/** Number of AC power ports */
|
|
332
412
|
powerPorts?: number;
|
|
413
|
+
/** Optional explicit PDU connector sequence */
|
|
414
|
+
portTypes?: Array<'C13' | 'C19'>;
|
|
415
|
+
/** Optional grouped PDU ports (supports custom positions/types) */
|
|
416
|
+
pduPortGroups?: PortBlock[];
|
|
333
417
|
/** Vertical PDU width in pixels */
|
|
334
418
|
widthPx?: number;
|
|
335
419
|
/** Optional management unit position for vertical PDUs */
|
|
@@ -558,6 +642,12 @@ interface NetworkEdgeData {
|
|
|
558
642
|
label?: string;
|
|
559
643
|
/** Optional opacity for styling (0–1) */
|
|
560
644
|
opacity?: number;
|
|
645
|
+
/** Optional power edge stroke width override */
|
|
646
|
+
powerStrokeWidth?: number;
|
|
647
|
+
/** Optional power edge stroke dasharray override */
|
|
648
|
+
powerStrokeDasharray?: string;
|
|
649
|
+
/** Optional power edge opacity override (0–1) */
|
|
650
|
+
powerOpacity?: number;
|
|
561
651
|
/** Additional extension metadata */
|
|
562
652
|
metadata?: Record<string, unknown>;
|
|
563
653
|
}
|
|
@@ -606,6 +696,10 @@ interface RackConfig {
|
|
|
606
696
|
uNumberingDirection?: UNumberingDirection;
|
|
607
697
|
/** Custom header text for rack */
|
|
608
698
|
customHeaderText?: string;
|
|
699
|
+
/** Rack rendering layout mode */
|
|
700
|
+
rackLayout?: RackLayoutMode;
|
|
701
|
+
/** Gap in pixels between front and rear faces in split-face mode */
|
|
702
|
+
rackFaceGapPx?: number;
|
|
609
703
|
/** Devices mounted in the rack */
|
|
610
704
|
devices: RackDevice[];
|
|
611
705
|
/** Optional rack width in pixels (default: 300px which represents standard 48.26cm/19" rack) */
|
|
@@ -628,6 +722,8 @@ interface RackDevice extends DeviceImageOptions {
|
|
|
628
722
|
type: RackDeviceType;
|
|
629
723
|
/** Device width configuration */
|
|
630
724
|
width?: Width;
|
|
725
|
+
/** Device mount behavior within a rack */
|
|
726
|
+
mountMode?: RackMountMode;
|
|
631
727
|
/** Device role in network */
|
|
632
728
|
role?: string;
|
|
633
729
|
/** Current status of the device */
|
|
@@ -1299,7 +1395,7 @@ declare const netboxRackToNetworkNode: (rack: NetBoxRack) => NetworkNode;
|
|
|
1299
1395
|
/**
|
|
1300
1396
|
* Convert NetBox device data to NetworkNode
|
|
1301
1397
|
*/
|
|
1302
|
-
declare const netboxDeviceToNetworkNode: (device: NetBoxDevice) => NetworkNode;
|
|
1398
|
+
declare const netboxDeviceToNetworkNode: (device: NetBoxDevice, options?: NetBoxDeviceTransformOptions) => NetworkNode;
|
|
1303
1399
|
/**
|
|
1304
1400
|
* Convert NetBox cable data to NetworkEdge
|
|
1305
1401
|
*/
|
|
@@ -1311,7 +1407,7 @@ declare const netboxToNetworkDiagram: (data: {
|
|
|
1311
1407
|
racks: NetBoxRack[];
|
|
1312
1408
|
devices: NetBoxDevice[];
|
|
1313
1409
|
cables: NetBoxCable[];
|
|
1314
|
-
}) => {
|
|
1410
|
+
}, options?: NetBoxDeviceTransformOptions) => {
|
|
1315
1411
|
nodes: NetworkNode[];
|
|
1316
1412
|
edges: NetworkEdge[];
|
|
1317
1413
|
};
|
|
@@ -1342,7 +1438,7 @@ declare const findNextAvailableUPosition: (rack: NetworkNode, device: NetworkNod
|
|
|
1342
1438
|
/**
|
|
1343
1439
|
* Calculate device position based on U position within a rack
|
|
1344
1440
|
*/
|
|
1345
|
-
declare const calculateDevicePositionFromU: (rack: NetworkNode, uPosition: number, deviceHeight?: number) => {
|
|
1441
|
+
declare const calculateDevicePositionFromU: (rack: NetworkNode, uPosition: number, deviceHeight?: number, deviceData?: Pick<NetworkNode["data"], "mountMode">) => {
|
|
1346
1442
|
x: number;
|
|
1347
1443
|
y: number;
|
|
1348
1444
|
};
|
|
@@ -1836,7 +1932,7 @@ declare function removeSpliceFromTray(trays: SpliceTrayConfig[], trayId: string,
|
|
|
1836
1932
|
* Power connector utilities for consistent styling across devices and PDUs
|
|
1837
1933
|
*/
|
|
1838
1934
|
interface PowerConnectorConfig {
|
|
1839
|
-
type: 'C13' | 'C14' | 'C19' | 'C20';
|
|
1935
|
+
type: 'C13' | 'C14' | 'C19' | 'C20' | 'AC';
|
|
1840
1936
|
color: string;
|
|
1841
1937
|
borderColor: string;
|
|
1842
1938
|
amperage: number;
|
|
@@ -1998,6 +2094,276 @@ interface ReplaceEdgeOptions {
|
|
|
1998
2094
|
*/
|
|
1999
2095
|
declare function replaceEdge(options: ReplaceEdgeOptions): Edge[] | null;
|
|
2000
2096
|
|
|
2097
|
+
/**
|
|
2098
|
+
* Template Schema V2 — unified device template model.
|
|
2099
|
+
*
|
|
2100
|
+
* Supports rackable devices (1U+), 0U/unrackable devices (vertical PDUs),
|
|
2101
|
+
* and hybrid front/rear pass-through devices. Strictly more expressive than
|
|
2102
|
+
* NetBox device-type YAML while remaining import-compatible.
|
|
2103
|
+
*
|
|
2104
|
+
* @public
|
|
2105
|
+
*/
|
|
2106
|
+
|
|
2107
|
+
/** Current schema version constant. */
|
|
2108
|
+
declare const TEMPLATE_SCHEMA_VERSION = 2;
|
|
2109
|
+
/** Device mount class — distinguishes rackable from 0U/standalone devices. */
|
|
2110
|
+
type MountClass = 'rackable' | 'zero-u';
|
|
2111
|
+
/** Device width within a rack (full 19" or half 9.5"). */
|
|
2112
|
+
type TemplateWidth = 'full' | 'half';
|
|
2113
|
+
/**
|
|
2114
|
+
* Individual port inside a template port block.
|
|
2115
|
+
* @public
|
|
2116
|
+
*/
|
|
2117
|
+
interface TemplatePort {
|
|
2118
|
+
/** Stable identifier for the port (must be unique within the template). */
|
|
2119
|
+
id: string;
|
|
2120
|
+
/** Human-readable label. */
|
|
2121
|
+
label: string;
|
|
2122
|
+
/** Port classification for styling and validation. */
|
|
2123
|
+
type?: PortType;
|
|
2124
|
+
/** Cable type hint. */
|
|
2125
|
+
cableType?: PortCableType;
|
|
2126
|
+
/** Power connector classification. */
|
|
2127
|
+
connectorType?: 'C13' | 'C14' | 'C19' | 'C20' | 'AC';
|
|
2128
|
+
/** Explicit handle placement. */
|
|
2129
|
+
position?: PortPosition;
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Group of related ports on a single face.
|
|
2133
|
+
* @public
|
|
2134
|
+
*/
|
|
2135
|
+
interface TemplatePortBlock {
|
|
2136
|
+
/** Group name. */
|
|
2137
|
+
name: string;
|
|
2138
|
+
/** Ports in this group. */
|
|
2139
|
+
ports: TemplatePort[];
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Per-face data container for front or rear.
|
|
2143
|
+
* @public
|
|
2144
|
+
*/
|
|
2145
|
+
interface TemplateFaceData {
|
|
2146
|
+
/** Port blocks on this face. */
|
|
2147
|
+
portBlocks: TemplatePortBlock[];
|
|
2148
|
+
/** Optional image URL for this face. */
|
|
2149
|
+
imageUrl?: string;
|
|
2150
|
+
/** Optional attribution for the image. */
|
|
2151
|
+
imageAttribution?: string;
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* Explicit front-to-rear pass-through link between ports.
|
|
2155
|
+
* @public
|
|
2156
|
+
*/
|
|
2157
|
+
interface TemplateFrontRearPortLink {
|
|
2158
|
+
/** Port ID on the front face. */
|
|
2159
|
+
frontPortId: string;
|
|
2160
|
+
/** Port ID on the rear face. */
|
|
2161
|
+
rearPortId: string;
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* Source provenance for an imported template.
|
|
2165
|
+
* @public
|
|
2166
|
+
*/
|
|
2167
|
+
interface TemplateSource {
|
|
2168
|
+
/** Source system kind (e.g. 'netbox', 'manual'). */
|
|
2169
|
+
kind: string;
|
|
2170
|
+
/** Source repository URL. */
|
|
2171
|
+
repository?: string;
|
|
2172
|
+
/** Path within the repository. */
|
|
2173
|
+
path?: string;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Canonical device template schema V2.
|
|
2177
|
+
* @public
|
|
2178
|
+
*/
|
|
2179
|
+
interface DeviceTemplateV2 {
|
|
2180
|
+
/** Schema version — always 2. */
|
|
2181
|
+
templateSchemaVersion: 2;
|
|
2182
|
+
/** Unique identifier (e.g. 'cisco-c9300-48p'). */
|
|
2183
|
+
id: string;
|
|
2184
|
+
/** URL-safe slug. */
|
|
2185
|
+
slug: string;
|
|
2186
|
+
/** Device manufacturer. */
|
|
2187
|
+
manufacturer: string;
|
|
2188
|
+
/** Device model. */
|
|
2189
|
+
model: string;
|
|
2190
|
+
/** Device role (e.g. 'switch', 'pdu', 'server'). */
|
|
2191
|
+
role: string;
|
|
2192
|
+
/** Mount class — rackable (1U+) or zero-u. */
|
|
2193
|
+
mountClass: MountClass;
|
|
2194
|
+
/** Height in rack units (0 for zero-u devices). */
|
|
2195
|
+
uHeight: number;
|
|
2196
|
+
/** Width within a rack. */
|
|
2197
|
+
width: TemplateWidth;
|
|
2198
|
+
/** Per-face port and image data. */
|
|
2199
|
+
faces: {
|
|
2200
|
+
front: TemplateFaceData;
|
|
2201
|
+
rear: TemplateFaceData;
|
|
2202
|
+
};
|
|
2203
|
+
/** Explicit front-to-rear pass-through links. */
|
|
2204
|
+
frontRearPortLinks: TemplateFrontRearPortLink[];
|
|
2205
|
+
/** Optional image configuration. */
|
|
2206
|
+
images?: {
|
|
2207
|
+
front?: string | null;
|
|
2208
|
+
rear?: string | null;
|
|
2209
|
+
};
|
|
2210
|
+
/** Source provenance. */
|
|
2211
|
+
source?: TemplateSource;
|
|
2212
|
+
/** Optional tags for search/filtering. */
|
|
2213
|
+
tags?: string[];
|
|
2214
|
+
}
|
|
2215
|
+
/**
|
|
2216
|
+
* Single validation issue from the parser pipeline.
|
|
2217
|
+
* @public
|
|
2218
|
+
*/
|
|
2219
|
+
interface TemplateValidationIssue {
|
|
2220
|
+
/** Severity level. */
|
|
2221
|
+
severity: 'error' | 'warning';
|
|
2222
|
+
/** Machine-readable code. */
|
|
2223
|
+
code: string;
|
|
2224
|
+
/** Human-readable description. */
|
|
2225
|
+
message: string;
|
|
2226
|
+
/** Optional path to the problematic field. */
|
|
2227
|
+
path?: string;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Validation report emitted by the parser pipeline.
|
|
2231
|
+
* @public
|
|
2232
|
+
*/
|
|
2233
|
+
interface TemplateValidationReport {
|
|
2234
|
+
/** Whether the template is valid (no errors — warnings are allowed). */
|
|
2235
|
+
valid: boolean;
|
|
2236
|
+
/** List of issues found. */
|
|
2237
|
+
issues: TemplateValidationIssue[];
|
|
2238
|
+
/** Summary counts per face. */
|
|
2239
|
+
portCounts: {
|
|
2240
|
+
front: number;
|
|
2241
|
+
rear: number;
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Result of the full parser pipeline.
|
|
2246
|
+
* @public
|
|
2247
|
+
*/
|
|
2248
|
+
interface TemplateParseResult {
|
|
2249
|
+
/** Parsed template (present when valid). */
|
|
2250
|
+
template: DeviceTemplateV2 | null;
|
|
2251
|
+
/** Validation report. */
|
|
2252
|
+
report: TemplateValidationReport;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* NetBox → Template V2 parser pipeline.
|
|
2257
|
+
*
|
|
2258
|
+
* Five stages: Ingest → Normalize → Enrich → Validate → Export.
|
|
2259
|
+
*
|
|
2260
|
+
* **Port position semantics**: Positions use `xPercent` / `yPercent` (0-100)
|
|
2261
|
+
* to express where the port CENTER should be relative to the device face.
|
|
2262
|
+
* The renderer (`DeviceNode`) converts these to pixel coordinates and clamps
|
|
2263
|
+
* them so the port stays fully inside the device bounds. Clamp bounds are
|
|
2264
|
+
* computed from the **actual** rendered port dimensions (which vary by port
|
|
2265
|
+
* type — e.g., power C13/C19 connectors are larger than generic ethernet
|
|
2266
|
+
* handles). Templates therefore do NOT need to account for port size; the
|
|
2267
|
+
* renderer handles that.
|
|
2268
|
+
*
|
|
2269
|
+
* @public
|
|
2270
|
+
*/
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Raw port entry from a NetBox-style template.
|
|
2274
|
+
* @public
|
|
2275
|
+
*/
|
|
2276
|
+
interface RawTemplatePort {
|
|
2277
|
+
id?: string;
|
|
2278
|
+
name?: string;
|
|
2279
|
+
label?: string;
|
|
2280
|
+
type?: string;
|
|
2281
|
+
connectorType?: string;
|
|
2282
|
+
connector_type?: string;
|
|
2283
|
+
position?: {
|
|
2284
|
+
side?: string;
|
|
2285
|
+
offsetPercent?: number;
|
|
2286
|
+
offset_percent?: number;
|
|
2287
|
+
offsetPx?: number;
|
|
2288
|
+
offset_px?: number;
|
|
2289
|
+
xPercent?: number;
|
|
2290
|
+
x_percent?: number;
|
|
2291
|
+
yPercent?: number;
|
|
2292
|
+
y_percent?: number;
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
/**
|
|
2296
|
+
* Raw port block from a NetBox-style template.
|
|
2297
|
+
* @public
|
|
2298
|
+
*/
|
|
2299
|
+
interface RawTemplatePortBlock {
|
|
2300
|
+
name?: string;
|
|
2301
|
+
ports?: RawTemplatePort[];
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Raw NetBox-style template input for the parser.
|
|
2305
|
+
* @public
|
|
2306
|
+
*/
|
|
2307
|
+
interface RawNetboxTemplate {
|
|
2308
|
+
id?: string;
|
|
2309
|
+
slug?: string;
|
|
2310
|
+
manufacturer?: string;
|
|
2311
|
+
model?: string;
|
|
2312
|
+
role?: string;
|
|
2313
|
+
deviceType?: string;
|
|
2314
|
+
device_type?: string;
|
|
2315
|
+
uHeight?: number;
|
|
2316
|
+
u_height?: number;
|
|
2317
|
+
width?: string;
|
|
2318
|
+
ports?: RawTemplatePortBlock[];
|
|
2319
|
+
rearPorts?: RawTemplatePortBlock[];
|
|
2320
|
+
rear_ports?: RawTemplatePortBlock[];
|
|
2321
|
+
frontRearPortLinks?: Array<{
|
|
2322
|
+
frontPortId?: string;
|
|
2323
|
+
rearPortId?: string;
|
|
2324
|
+
front_port_id?: string;
|
|
2325
|
+
rear_port_id?: string;
|
|
2326
|
+
}>;
|
|
2327
|
+
front_rear_port_links?: Array<{
|
|
2328
|
+
frontPortId?: string;
|
|
2329
|
+
rearPortId?: string;
|
|
2330
|
+
front_port_id?: string;
|
|
2331
|
+
rear_port_id?: string;
|
|
2332
|
+
}>;
|
|
2333
|
+
frontImageUrl?: string;
|
|
2334
|
+
front_image_url?: string;
|
|
2335
|
+
rearImageUrl?: string;
|
|
2336
|
+
rear_image_url?: string;
|
|
2337
|
+
frontImageAttribution?: string;
|
|
2338
|
+
rearImageAttribution?: string;
|
|
2339
|
+
tags?: string[];
|
|
2340
|
+
sourceRepository?: string;
|
|
2341
|
+
source_repository?: string;
|
|
2342
|
+
sourcePath?: string;
|
|
2343
|
+
source_path?: string;
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Parse a raw NetBox-style template through the full 5-stage pipeline.
|
|
2347
|
+
*
|
|
2348
|
+
* Returns a `TemplateParseResult` containing the validated V2 template
|
|
2349
|
+
* (or `null` if validation failed) and a full validation report.
|
|
2350
|
+
*
|
|
2351
|
+
* @public
|
|
2352
|
+
*/
|
|
2353
|
+
declare function parseNetboxTemplate(raw: RawNetboxTemplate): TemplateParseResult;
|
|
2354
|
+
/**
|
|
2355
|
+
* Count the total number of ports on a given face of a V2 template.
|
|
2356
|
+
* @public
|
|
2357
|
+
*/
|
|
2358
|
+
declare function countTemplateFacePorts(face: TemplateFaceData): number;
|
|
2359
|
+
/**
|
|
2360
|
+
* Validate that rendered handle counts match the template port counts.
|
|
2361
|
+
* Returns issues when counts diverge — used as a regression guardrail.
|
|
2362
|
+
*
|
|
2363
|
+
* @public
|
|
2364
|
+
*/
|
|
2365
|
+
declare function validateRenderFidelity(template: DeviceTemplateV2, renderedFrontHandleCount: number, renderedRearHandleCount: number): TemplateValidationIssue[];
|
|
2366
|
+
|
|
2001
2367
|
interface NetworkDiagramState {
|
|
2002
2368
|
nodes: NetworkNode[];
|
|
2003
2369
|
edges: NetworkEdge[];
|
|
@@ -2033,4 +2399,4 @@ declare function useNetworkDiagram(store: NetworkDiagramStore): NetworkDiagramSt
|
|
|
2033
2399
|
declare function useNodes(store: NetworkDiagramStore): NetworkNode[];
|
|
2034
2400
|
declare function useEdges(store: NetworkDiagramStore): NetworkEdge[];
|
|
2035
2401
|
|
|
2036
|
-
export { COUPLERS_PER_PANEL, COUPLER_SLOT_HEIGHT_PX, COUPLER_WIDTH_PX, CableNode, ClosureNode, CouplerNode, type DeviceImageFit, type DeviceImageOptions, type DeviceImageRepeat, DeviceNode, DevicePlacementError, type DevicePlacementValidation, DiagramErrorBoundary, type DiagramErrorBoundaryProps, FIBER_COLORS_12, type FiberCable, type FiberColorId, FiberEdge, FiberNode, FibreCableWithTubesExpanded, type FibreFlowCable, type FibreFlowCableKind, type FibreFlowCableNodeData, type FibreFlowCircuit, type FibreFlowClosure, type FibreFlowClosureNodeData, type FibreFlowEndpoint, FibreFlowMap, type FibreFlowMapProps, type FibreFlowSplice, FibreSplitNode, HANDLE_EXTENSION_PX, MultiTubeCableNode, NetworkDiagram, type NetworkDiagramFitViewOptions, type NetworkDiagramFlowMethods, type NetworkDiagramFlowObject, type NetworkDiagramOptions, type NetworkDiagramProps, type NetworkDiagramStoreApi, type NetworkDiagramToImageOptions, type NetworkEdge, type NetworkEdgeData, type NetworkNode, type NetworkNodeData, type NetworkNodeDataBase, type NetworkNodeDataByType, PANEL_BORDER_WIDTH, PANEL_HEADER_HEIGHT, PANEL_HEIGHT_PX, PANEL_PADDING, PANEL_TUBE_TRAY_SPACING, PANEL_WIDTH_PX, POWER_CONNECTORS, PatchPanelNode, type Port, type PortBlock, type PortCableType, type PortType, PowerEdge, RACK_HEADER_HEIGHT, RACK_WIDTH_PX, type RackConfig, type RackDevice, RackNode, type RackSchemaOptions, type ReplaceEdgeOptions, type SpliceConfig, SpliceNode, SplicePlacementError, type SplicePlacementValidation, type SpliceSchemaOptions, type SpliceTrayConfig, SpliceTrayNode, TubeNode, U_HEIGHT_PX, type ValidateConnectionParams, type ValidationResult, VerticalPDU, Width, addDeviceToRack, addSpliceToTray, baseColorFor, buildNodesFromRackConfig, buildNodesFromSpliceConfig, calculateClosureDimensions, calculateCouplerRightX, calculateCouplerSlotSpacing, calculateCouplerSpacing, calculateDevicePositionFromU, calculatePanelDimensions, calculateSlotPositionFromY, calculateSplicePositionFromNumber, calculateUPositions, calculateYFromSlotPosition, createNetworkDiagramStore, createRackConfigFromNodes, createSpliceConfigFromNodes, fiberSolidOrStriped, findNearestRack, findNextAvailableHolderPosition, findNextAvailableUPosition, generateLayout, getConnectorConfig, getCouplerDimensions, getDeviceConnectorType, getFiberColor, getInnerContentWidth, getPDUPortType, getPanelHeight, getPanelWidth, getPowerPortStyle, getRackBounds, getStatusColor, getTrayDimensions, getTubeDimensions, inventoryCableToNetworkEdge, inventoryDeviceToNetworkNode, inventoryRackToNetworkNode, inventoryToNetworkDiagram, isHighPowerConnector, isPointInRack, isStriped, isUPositionAvailable, netboxCableToNetworkEdge, netboxDeviceToNetworkNode, netboxRackToNetworkNode, netboxToNetworkDiagram, removeDeviceFromRack, removeSpliceFromTray, replaceEdge, snapToCouplerPosition, snapToSplicePosition, snapToUPosition, updateDeviceUPosition$1 as updateDeviceUPosition, updateDeviceUPosition as updateDeviceUPositionInSchema, updateSpliceHolderPosition, useEdges as useDiagramEdges, useNodes as useDiagramNodes, useNetworkDiagram, validateAndSnapDevice, validateRackDevicePlacements, validateSplicePlacements };
|
|
2402
|
+
export { COUPLERS_PER_PANEL, COUPLER_SLOT_HEIGHT_PX, COUPLER_WIDTH_PX, CableNode, ClosureNode, CouplerNode, type DeviceImageFit, type DeviceImageOptions, type DeviceImageRepeat, DeviceNode, DevicePlacementError, type DevicePlacementValidation, type DeviceTemplateV2, DiagramErrorBoundary, type DiagramErrorBoundaryProps, FIBER_COLORS_12, type FiberCable, type FiberColorId, FiberEdge, FiberNode, FibreCableWithTubesExpanded, type FibreFlowCable, type FibreFlowCableKind, type FibreFlowCableNodeData, type FibreFlowCircuit, type FibreFlowClosure, type FibreFlowClosureNodeData, type FibreFlowEndpoint, FibreFlowMap, type FibreFlowMapProps, type FibreFlowSplice, FibreSplitNode, HANDLE_EXTENSION_PX, type MountClass, MultiTubeCableNode, NetworkDiagram, type NetworkDiagramFitViewOptions, type NetworkDiagramFlowMethods, type NetworkDiagramFlowObject, type NetworkDiagramOptions, type NetworkDiagramProps, type NetworkDiagramStoreApi, type NetworkDiagramToImageOptions, type NetworkEdge, type NetworkEdgeData, type NetworkNode, type NetworkNodeData, type NetworkNodeDataBase, type NetworkNodeDataByType, PANEL_BORDER_WIDTH, PANEL_HEADER_HEIGHT, PANEL_HEIGHT_PX, PANEL_PADDING, PANEL_TUBE_TRAY_SPACING, PANEL_WIDTH_PX, POWER_CONNECTORS, PatchPanelNode, type Port, type PortBlock, type PortCableType, type PortType, PowerEdge, RACK_HEADER_HEIGHT, RACK_WIDTH_PX, type RackConfig, type RackDevice, type RackLayoutMode, type RackMountMode, RackNode, type RackSchemaOptions, type RawNetboxTemplate, type RawTemplatePort, type RawTemplatePortBlock, type ReplaceEdgeOptions, type SpliceConfig, SpliceNode, SplicePlacementError, type SplicePlacementValidation, type SpliceSchemaOptions, type SpliceTrayConfig, SpliceTrayNode, TEMPLATE_SCHEMA_VERSION, type TemplateFaceData, type TemplateFrontRearPortLink, type TemplateParseResult, type TemplatePort, type TemplatePortBlock, type TemplateSource, type TemplateValidationIssue, type TemplateValidationReport, type TemplateWidth, TubeNode, U_HEIGHT_PX, type ValidateConnectionParams, type ValidationResult, VerticalPDU, Width, addDeviceToRack, addSpliceToTray, baseColorFor, buildNodesFromRackConfig, buildNodesFromSpliceConfig, calculateClosureDimensions, calculateCouplerRightX, calculateCouplerSlotSpacing, calculateCouplerSpacing, calculateDevicePositionFromU, calculatePanelDimensions, calculateSlotPositionFromY, calculateSplicePositionFromNumber, calculateUPositions, calculateYFromSlotPosition, countTemplateFacePorts, createNetworkDiagramStore, createRackConfigFromNodes, createSpliceConfigFromNodes, fiberSolidOrStriped, findNearestRack, findNextAvailableHolderPosition, findNextAvailableUPosition, generateLayout, getConnectorConfig, getCouplerDimensions, getDeviceConnectorType, getFiberColor, getInnerContentWidth, getPDUPortType, getPanelHeight, getPanelWidth, getPowerPortStyle, getRackBounds, getStatusColor, getTrayDimensions, getTubeDimensions, inventoryCableToNetworkEdge, inventoryDeviceToNetworkNode, inventoryRackToNetworkNode, inventoryToNetworkDiagram, isHighPowerConnector, isPointInRack, isStriped, isUPositionAvailable, netboxCableToNetworkEdge, netboxDeviceToNetworkNode, netboxRackToNetworkNode, netboxToNetworkDiagram, parseNetboxTemplate, removeDeviceFromRack, removeSpliceFromTray, replaceEdge, snapToCouplerPosition, snapToSplicePosition, snapToUPosition, updateDeviceUPosition$1 as updateDeviceUPosition, updateDeviceUPosition as updateDeviceUPositionInSchema, updateSpliceHolderPosition, useEdges as useDiagramEdges, useNodes as useDiagramNodes, useNetworkDiagram, validateAndSnapDevice, validateRackDevicePlacements, validateRenderFidelity, validateSplicePlacements };
|