@highstate/library 0.7.11 → 0.9.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.js CHANGED
@@ -7,11 +7,12 @@ var __export = (target, all) => {
7
7
  // src/common.ts
8
8
  var common_exports = {};
9
9
  __export(common_exports, {
10
- endpointEntity: () => endpointEntity,
11
10
  existingServer: () => existingServer,
12
11
  fileContentEntity: () => fileContentEntity,
13
12
  fileEntity: () => fileEntity,
14
13
  fileMetaEntity: () => fileMetaEntity,
14
+ l3EndpointEntity: () => l3EndpointEntity,
15
+ l4EndpointEntity: () => l4EndpointEntity,
15
16
  script: () => script,
16
17
  serverEntity: () => serverEntity
17
18
  });
@@ -84,14 +85,25 @@ var serverEntity = defineEntity2({
84
85
  color: "#009688"
85
86
  }
86
87
  });
87
- var endpointEntity = defineEntity2({
88
- type: "common.endpoint",
88
+ var l3EndpointEntity = defineEntity2({
89
+ type: "common.l3-endpoint",
89
90
  schema: Type2.Object({
90
91
  endpoint: Type2.String()
91
92
  }),
92
93
  meta: {
93
- color: "#FFC107",
94
- description: "The L3-L4 endpoint for some network service."
94
+ color: "#1B5E20",
95
+ description: "The L3 endpoint for some service. May be a domain name or an IP address."
96
+ }
97
+ });
98
+ var l4EndpointEntity = defineEntity2({
99
+ type: "common.l4-endpoint",
100
+ schema: Type2.Object({
101
+ endpoint: Type2.String(),
102
+ port: Type2.Number()
103
+ }),
104
+ meta: {
105
+ color: "#F57F17",
106
+ description: "The L4 endpoint for some service. Extends an L3 endpoint with a port."
95
107
  }
96
108
  });
97
109
  var existingServer = defineUnit2({
@@ -360,6 +372,7 @@ __export(k8s_exports, {
360
372
  deploymentSpecSchema: () => deploymentSpecSchema,
361
373
  dns01TlsIssuer: () => dns01TlsIssuer,
362
374
  existingCluster: () => existingCluster,
375
+ gatewayApi: () => gatewayApi,
363
376
  gatewayEntity: () => gatewayEntity,
364
377
  interfaceEntity: () => interfaceEntity,
365
378
  internalIpsPolicySchema: () => internalIpsPolicySchema,
@@ -372,9 +385,11 @@ __export(k8s_exports, {
372
385
  serviceTypeSchema: () => serviceTypeSchema,
373
386
  sharedClusterArgs: () => sharedClusterArgs,
374
387
  statefulSetEntity: () => statefulSetEntity,
375
- tlsIssuerEntity: () => tlsIssuerEntity
388
+ tlsIssuerEntity: () => tlsIssuerEntity,
389
+ tunDevicePolicySchema: () => tunDevicePolicySchema
376
390
  });
377
391
  import { defineEntity as defineEntity5, defineUnit as defineUnit5, Type as Type5 } from "@highstate/contract";
392
+ import { Literal } from "@sinclair/typebox";
378
393
 
379
394
  // src/dns.ts
380
395
  var dns_exports = {};
@@ -419,11 +434,32 @@ var record = defineUnit4({
419
434
  });
420
435
 
421
436
  // src/k8s.ts
437
+ var tunDevicePolicySchema = Type5.Union([
438
+ Type5.Object({
439
+ type: Literal("host")
440
+ }),
441
+ Type5.Object({
442
+ type: Literal("plugin"),
443
+ resourceName: Type5.String(),
444
+ resourceValue: Type5.String()
445
+ })
446
+ ]);
422
447
  var clusterInfoSchema = Type5.Object({
423
448
  id: Type5.String(),
424
449
  name: Type5.String(),
425
450
  cni: Type5.Optional(Type5.String()),
426
- externalIps: Type5.Array(Type5.String())
451
+ externalIps: Type5.Array(Type5.String()),
452
+ fqdn: Type5.Optional(Type5.String()),
453
+ kubeApiServerIp: Type5.Optional(Type5.String()),
454
+ kubeApiServerPort: Type5.Optional(Type5.Number()),
455
+ /**
456
+ * Specifies the policy for using the tun device inside containers.
457
+ *
458
+ * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
459
+ *
460
+ * For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.
461
+ */
462
+ tunDevicePolicy: Type5.Optional(tunDevicePolicySchema)
427
463
  });
428
464
  var serviceTypeSchema = Type5.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
429
465
  var metadataSchema = Type5.Object({
@@ -530,7 +566,24 @@ var sharedClusterArgs = {
530
566
  var existingCluster = defineUnit5({
531
567
  type: "k8s.existing-cluster",
532
568
  args: {
533
- ...sharedClusterArgs
569
+ ...sharedClusterArgs,
570
+ /**
571
+ * The policy for using the tun device inside containers.
572
+ *
573
+ * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
574
+ *
575
+ * For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.
576
+ *
577
+ * @schema
578
+ */
579
+ tunDevicePolicy: {
580
+ ...Type5.Optional(tunDevicePolicySchema),
581
+ description: `The policy for using the tun device inside containers.
582
+
583
+ If not provided, the default policy is \`host\` which assumes just mounting /dev/net/tun from the host.
584
+
585
+ For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.`
586
+ }
534
587
  },
535
588
  secrets: {
536
589
  /**
@@ -585,14 +638,14 @@ var tlsIssuerEntity = defineEntity5({
585
638
  }
586
639
  });
587
640
  var accessPointEntity = defineEntity5({
588
- type: "common.access-point",
641
+ type: "k8s.access-point",
589
642
  schema: Type5.Object({
590
643
  gateway: gatewayEntity.schema,
591
644
  tlsIssuer: tlsIssuerEntity.schema,
592
- dnsProvider: providerEntity.schema
645
+ dnsProviders: Type5.Array(providerEntity.schema)
593
646
  }),
594
647
  meta: {
595
- color: "#FFC107"
648
+ color: "#F57F17"
596
649
  }
597
650
  });
598
651
  var accessPoint = defineUnit5({
@@ -600,7 +653,10 @@ var accessPoint = defineUnit5({
600
653
  inputs: {
601
654
  gateway: gatewayEntity,
602
655
  tlsIssuer: tlsIssuerEntity,
603
- dnsProvider: providerEntity
656
+ dnsProviders: {
657
+ entity: providerEntity,
658
+ multiple: true
659
+ }
604
660
  },
605
661
  outputs: {
606
662
  accessPoint: accessPointEntity
@@ -635,9 +691,27 @@ var certManager = defineUnit5({
635
691
  });
636
692
  var dns01TlsIssuer = defineUnit5({
637
693
  type: "k8s.dns01-issuer",
694
+ args: {
695
+ /**
696
+ * The top-level domains to filter the DNS01 challenge for.
697
+ *
698
+ * If not provided, will use all domains passed to the DNS providers.
699
+ *
700
+ * @schema
701
+ */
702
+ domains: {
703
+ ...Type5.Optional(Type5.Array(Type5.String())),
704
+ description: `The top-level domains to filter the DNS01 challenge for.
705
+
706
+ If not provided, will use all domains passed to the DNS providers.`
707
+ }
708
+ },
638
709
  inputs: {
639
710
  k8sCluster: clusterEntity2,
640
- dnsProvider: providerEntity
711
+ dnsProviders: {
712
+ entity: providerEntity,
713
+ multiple: true
714
+ }
641
715
  },
642
716
  outputs: {
643
717
  tlsIssuer: tlsIssuerEntity
@@ -715,6 +789,25 @@ var interfaceEntity = defineEntity5({
715
789
  description: "The interface in a network space of pod kernel which can accept or transmit packets."
716
790
  }
717
791
  });
792
+ var gatewayApi = defineUnit5({
793
+ type: "k8s.gateway-api",
794
+ inputs: {
795
+ k8sCluster: clusterEntity2
796
+ },
797
+ outputs: {
798
+ k8sCluster: clusterEntity2
799
+ },
800
+ meta: {
801
+ displayName: "Gateway API",
802
+ description: "Installs the Gateway API CRDs to the cluster.",
803
+ primaryIcon: "mdi:kubernetes",
804
+ primaryIconColor: "#4CAF50"
805
+ },
806
+ source: {
807
+ package: "@highstate/k8s",
808
+ path: "units/gateway-api"
809
+ }
810
+ });
718
811
 
719
812
  // src/talos.ts
720
813
  var talos_exports = {};
@@ -910,7 +1003,7 @@ var network = defineUnit7({
910
1003
  * @schema
911
1004
  */
912
1005
  backend: {
913
- ...backendSchema,
1006
+ ...Type7.Default(backendSchema, "wireguard"),
914
1007
  description: `The backend to use for the WireGuard network.
915
1008
 
916
1009
  Possible values are:
@@ -1172,7 +1265,7 @@ var peer = defineUnit7({
1172
1265
  * @schema
1173
1266
  */
1174
1267
  publicKey: {
1175
- ...Type7.String(),
1268
+ ...Type7.Optional(Type7.String()),
1176
1269
  description: `The public key of the WireGuard peer.`
1177
1270
  }
1178
1271
  },
@@ -1192,6 +1285,34 @@ var peer = defineUnit7({
1192
1285
  description: `The network to use for the WireGuard peer.
1193
1286
 
1194
1287
  If not provided, the peer will use default network configuration.`
1288
+ },
1289
+ /**
1290
+ * The existing WireGuard peer to extend.
1291
+ *
1292
+ * @schema
1293
+ */
1294
+ peer: {
1295
+ ...{
1296
+ entity: peerEntity,
1297
+ required: false
1298
+ },
1299
+ description: `The existing WireGuard peer to extend.`
1300
+ },
1301
+ /**
1302
+ * The L4 endpoint of the peer.
1303
+ *
1304
+ * Will take priority over all calculated endpoints if provided.
1305
+ *
1306
+ * @schema
1307
+ */
1308
+ l4Endpoint: {
1309
+ ...{
1310
+ entity: l4EndpointEntity,
1311
+ required: false
1312
+ },
1313
+ description: `The L4 endpoint of the peer.
1314
+
1315
+ Will take priority over all calculated endpoints if provided.`
1195
1316
  }
1196
1317
  },
1197
1318
  outputs: {
@@ -1245,6 +1366,8 @@ var identity = defineUnit7({
1245
1366
  *
1246
1367
  * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
1247
1368
  *
1369
+ * Will take priority over all calculated endpoints and `l4Endpoint` input.
1370
+ *
1248
1371
  * @schema
1249
1372
  */
1250
1373
  endpoint: {
@@ -1253,13 +1376,16 @@ var identity = defineUnit7({
1253
1376
 
1254
1377
  By default, the endpoint is calculated as \`externalIp:listenPort\`.
1255
1378
 
1256
- If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.`
1379
+ If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
1380
+
1381
+ Will take priority over all calculated endpoints and \`l4Endpoint\` input.`
1257
1382
  },
1258
1383
  /**
1259
1384
  * The FQDN of the WireGuard identity.
1260
1385
  * Will be used as endpoint for the peer.
1261
1386
  *
1262
- * If `dnsProvider` is provided and `externalIp` is available, the FQDN will be registered automatically.
1387
+ * If `dnsProvider` is provided, external IP is available and `registerFqdn` is set to `true`, and FQDN is provided explicitly (not obtained from the k8s cluster),
1388
+ * the FQDN will be registered with the DNS provider.
1263
1389
  *
1264
1390
  * @schema
1265
1391
  */
@@ -1268,7 +1394,21 @@ var identity = defineUnit7({
1268
1394
  description: `The FQDN of the WireGuard identity.
1269
1395
  Will be used as endpoint for the peer.
1270
1396
 
1271
- If \`dnsProvider\` is provided and \`externalIp\` is available, the FQDN will be registered automatically.`
1397
+ If \`dnsProvider\` is provided, external IP is available and \`registerFqdn\` is set to \`true\`, and FQDN is provided explicitly (not obtained from the k8s cluster),
1398
+ the FQDN will be registered with the DNS provider.`
1399
+ },
1400
+ /**
1401
+ * Whether to register the FQDN of the identity with the matching DNS providers.
1402
+ *
1403
+ * By default, `true`.
1404
+ *
1405
+ * @schema
1406
+ */
1407
+ registerFqdn: {
1408
+ ...Type7.Default(Type7.Boolean(), true),
1409
+ description: `Whether to register the FQDN of the identity with the matching DNS providers.
1410
+
1411
+ By default, \`true\`.`
1272
1412
  }
1273
1413
  },
1274
1414
  secrets: {
@@ -1333,14 +1473,59 @@ var identity = defineUnit7({
1333
1473
 
1334
1474
  Their IP addresses will be added to the \`allowedIps\` of the identity and passed to the node to set up network policies.`
1335
1475
  },
1336
- dnsProvider: {
1337
- entity: providerEntity,
1338
- required: false
1476
+ /**
1477
+ * The Kubernetes cluster associated with the identity.
1478
+ *
1479
+ * If provided, will be used to obtain the external IP or FQDN of the identity.
1480
+ *
1481
+ * @schema
1482
+ */
1483
+ k8sCluster: {
1484
+ ...{
1485
+ entity: clusterEntity2,
1486
+ required: false
1487
+ },
1488
+ description: `The Kubernetes cluster associated with the identity.
1489
+
1490
+ If provided, will be used to obtain the external IP or FQDN of the identity.`
1491
+ },
1492
+ /**
1493
+ * The L4 endpoint of the identity.
1494
+ *
1495
+ * Will take priority over all calculated endpoints if provided.
1496
+ *
1497
+ * @schema
1498
+ */
1499
+ l4Endpoint: {
1500
+ ...{
1501
+ entity: l4EndpointEntity,
1502
+ required: false
1503
+ },
1504
+ description: `The L4 endpoint of the identity.
1505
+
1506
+ Will take priority over all calculated endpoints if provided.`
1507
+ },
1508
+ /**
1509
+ * The DNS providers to register the FQDN of the identity with.
1510
+ *
1511
+ * @schema
1512
+ */
1513
+ dnsProviders: {
1514
+ ...{
1515
+ entity: providerEntity,
1516
+ required: false,
1517
+ multiple: true
1518
+ },
1519
+ description: `The DNS providers to register the FQDN of the identity with.`
1339
1520
  }
1340
1521
  },
1341
1522
  outputs: {
1342
1523
  identity: identityEntity,
1343
- peer: peerEntity
1524
+ peer: peerEntity,
1525
+ l4Endpoint: {
1526
+ entity: l4EndpointEntity,
1527
+ required: false
1528
+ }
1344
1529
  },
1345
1530
  meta: {
1346
1531
  description: "The WireGuard identity with the public key.",
@@ -2100,13 +2285,20 @@ __export(k3s_exports, {
2100
2285
  cluster: () => cluster2
2101
2286
  });
2102
2287
  import { defineUnit as defineUnit21 } from "@highstate/contract";
2288
+ import { Type as Type21 } from "@sinclair/typebox";
2103
2289
  var cluster2 = defineUnit21({
2104
2290
  type: "k3s.cluster",
2105
2291
  args: {
2106
- ...sharedClusterArgs
2292
+ ...sharedClusterArgs,
2293
+ config: Type21.Optional(Type21.Record(Type21.String(), Type21.Any()))
2107
2294
  },
2108
2295
  inputs: {
2109
- server: serverEntity
2296
+ server: serverEntity,
2297
+ dnsProviders: {
2298
+ entity: providerEntity,
2299
+ required: false,
2300
+ multiple: true
2301
+ }
2110
2302
  },
2111
2303
  outputs: {
2112
2304
  k8sCluster: clusterEntity2
@@ -2130,17 +2322,26 @@ __export(mullvad_exports, {
2130
2322
  endpointType: () => endpointType,
2131
2323
  peer: () => peer2
2132
2324
  });
2133
- import { defineUnit as defineUnit22, Type as Type21 } from "@highstate/contract";
2134
- var endpointType = Type21.Union([
2135
- Type21.Literal("fqdn"),
2136
- Type21.Literal("ipv4"),
2137
- Type21.Literal("ipv6")
2325
+ import { defineUnit as defineUnit22, Type as Type22 } from "@highstate/contract";
2326
+ var endpointType = Type22.Union([
2327
+ Type22.Literal("fqdn"),
2328
+ Type22.Literal("ipv4"),
2329
+ Type22.Literal("ipv6")
2138
2330
  ]);
2139
2331
  var peer2 = defineUnit22({
2140
2332
  type: "mullvad.peer",
2141
2333
  args: {
2142
- hostname: Type21.Optional(Type21.String()),
2143
- endpointType: Type21.Optional({ ...endpointType, default: "fqdn" })
2334
+ hostname: Type22.Optional(Type22.String()),
2335
+ endpointType: Type22.Optional({ ...endpointType, default: "fqdn" }),
2336
+ /**
2337
+ * Whether to include Mullvad DNS servers in the peer configuration.
2338
+ *
2339
+ * @schema
2340
+ */
2341
+ includeDns: {
2342
+ ...Type22.Default(Type22.Boolean(), true),
2343
+ description: `Whether to include Mullvad DNS servers in the peer configuration.`
2344
+ }
2144
2345
  },
2145
2346
  inputs: {
2146
2347
  /**
@@ -2154,7 +2355,8 @@ var peer2 = defineUnit22({
2154
2355
  }
2155
2356
  },
2156
2357
  outputs: {
2157
- peer: peerEntity
2358
+ peer: peerEntity,
2359
+ l4Endpoint: l4EndpointEntity
2158
2360
  },
2159
2361
  meta: {
2160
2362
  displayName: "Mullvad Peer",
@@ -2176,18 +2378,18 @@ __export(timeweb_exports, {
2176
2378
  connectionEntity: () => connectionEntity,
2177
2379
  virtualMachine: () => virtualMachine2
2178
2380
  });
2179
- import { defineEntity as defineEntity12, defineUnit as defineUnit23, Type as Type22 } from "@highstate/contract";
2381
+ import { defineEntity as defineEntity12, defineUnit as defineUnit23, Type as Type23 } from "@highstate/contract";
2180
2382
  var connectionEntity = defineEntity12({
2181
2383
  type: "timeweb.connection",
2182
- schema: Type22.Object({
2183
- name: Type22.String(),
2184
- apiToken: Type22.String()
2384
+ schema: Type23.Object({
2385
+ name: Type23.String(),
2386
+ apiToken: Type23.String()
2185
2387
  })
2186
2388
  });
2187
2389
  var connection3 = defineUnit23({
2188
2390
  type: "timeweb.connection",
2189
2391
  secrets: {
2190
- apiToken: Type22.String()
2392
+ apiToken: Type23.String()
2191
2393
  },
2192
2394
  outputs: {
2193
2395
  connection: connectionEntity
@@ -2205,9 +2407,9 @@ var connection3 = defineUnit23({
2205
2407
  var virtualMachine2 = defineUnit23({
2206
2408
  type: "timeweb.virtual-machine",
2207
2409
  args: {
2208
- presetId: Type22.Optional(Type22.Number()),
2209
- osId: Type22.Optional(Type22.Number()),
2210
- availabilityZone: Type22.String()
2410
+ presetId: Type23.Optional(Type23.Number()),
2411
+ osId: Type23.Optional(Type23.Number()),
2412
+ availabilityZone: Type23.String()
2211
2413
  },
2212
2414
  inputs: {
2213
2415
  connection: connectionEntity,
@@ -2217,7 +2419,7 @@ var virtualMachine2 = defineUnit23({
2217
2419
  }
2218
2420
  },
2219
2421
  secrets: {
2220
- sshPrivateKey: Type22.Optional(Type22.String())
2422
+ sshPrivateKey: Type23.Optional(Type23.String())
2221
2423
  },
2222
2424
  outputs: {
2223
2425
  server: serverEntity
@@ -2244,11 +2446,11 @@ __export(nixos_exports, {
2244
2446
  remoteFlake: () => remoteFlake,
2245
2447
  system: () => system
2246
2448
  });
2247
- import { defineEntity as defineEntity13, defineUnit as defineUnit24, Type as Type23 } from "@highstate/contract";
2449
+ import { defineEntity as defineEntity13, defineUnit as defineUnit24, Type as Type24 } from "@highstate/contract";
2248
2450
  var inlineModuleEntity = defineEntity13({
2249
2451
  type: "nixos.inline-module",
2250
- schema: Type23.Object({
2251
- code: Type23.String()
2452
+ schema: Type24.Object({
2453
+ code: Type24.String()
2252
2454
  }),
2253
2455
  meta: {
2254
2456
  displayName: "NixOS Inline Module",
@@ -2259,7 +2461,7 @@ var inlineModuleEntity = defineEntity13({
2259
2461
  var inlineModule = defineUnit24({
2260
2462
  type: "nixos.inline-module",
2261
2463
  args: {
2262
- code: Type23.String({ language: "nix" })
2464
+ code: Type24.String({ language: "nix" })
2263
2465
  },
2264
2466
  inputs: {
2265
2467
  files: {
@@ -2285,8 +2487,8 @@ var inlineModule = defineUnit24({
2285
2487
  });
2286
2488
  var flakeEntity = defineEntity13({
2287
2489
  type: "nixos.flake",
2288
- schema: Type23.Object({
2289
- url: Type23.String()
2490
+ schema: Type24.Object({
2491
+ url: Type24.String()
2290
2492
  }),
2291
2493
  meta: {
2292
2494
  displayName: "NixOS Flake",
@@ -2297,7 +2499,7 @@ var flakeEntity = defineEntity13({
2297
2499
  var remoteFlake = defineUnit24({
2298
2500
  type: "nixos.remote-flake",
2299
2501
  args: {
2300
- url: Type23.String()
2502
+ url: Type24.String()
2301
2503
  },
2302
2504
  outputs: {
2303
2505
  flake: flakeEntity
@@ -2318,7 +2520,7 @@ var remoteFlake = defineUnit24({
2318
2520
  var inlineFlake = defineUnit24({
2319
2521
  type: "nixos.inline-flake",
2320
2522
  args: {
2321
- code: Type23.String({ language: "nix" })
2523
+ code: Type24.String({ language: "nix" })
2322
2524
  },
2323
2525
  inputs: {
2324
2526
  flakes: {
@@ -2355,7 +2557,7 @@ var inlineFlake = defineUnit24({
2355
2557
  var system = defineUnit24({
2356
2558
  type: "nixos.system",
2357
2559
  args: {
2358
- system: Type23.Optional(Type23.String())
2560
+ system: Type24.Optional(Type24.String())
2359
2561
  },
2360
2562
  inputs: {
2361
2563
  flake: flakeEntity,
@@ -2387,11 +2589,11 @@ var sops_exports = {};
2387
2589
  __export(sops_exports, {
2388
2590
  secrets: () => secrets
2389
2591
  });
2390
- import { defineUnit as defineUnit25, Type as Type24 } from "@highstate/contract";
2592
+ import { defineUnit as defineUnit25, Type as Type25 } from "@highstate/contract";
2391
2593
  var secrets = defineUnit25({
2392
2594
  type: "sops.secrets",
2393
2595
  args: {
2394
- secrets: Type24.Record(Type24.String(), Type24.Any())
2596
+ secrets: Type25.Record(Type25.String(), Type25.Any())
2395
2597
  },
2396
2598
  inputs: {
2397
2599
  servers: {
@@ -2413,6 +2615,152 @@ var secrets = defineUnit25({
2413
2615
  path: "secrets"
2414
2616
  }
2415
2617
  });
2618
+
2619
+ // src/obfuscators/index.ts
2620
+ var obfuscators_exports = {};
2621
+ __export(obfuscators_exports, {
2622
+ phantun: () => phantun_exports
2623
+ });
2624
+
2625
+ // src/obfuscators/phantun.ts
2626
+ var phantun_exports = {};
2627
+ __export(phantun_exports, {
2628
+ deobfuscator: () => deobfuscator,
2629
+ obfuscator: () => obfuscator
2630
+ });
2631
+ import { defineUnit as defineUnit26 } from "@highstate/contract";
2632
+
2633
+ // src/obfuscators/shared.ts
2634
+ import { Type as Type26 } from "@sinclair/typebox";
2635
+ var deobfuscatorSpec = {
2636
+ args: {
2637
+ /**
2638
+ * The L4 endpoint to forward deobfuscated traffic to.
2639
+ *
2640
+ * Will take precedence over the `targetEndpoint` input.
2641
+ *
2642
+ * @schema
2643
+ */
2644
+ targetEndpoint: {
2645
+ ...Type26.Optional(Type26.String()),
2646
+ description: `The L4 endpoint to forward deobfuscated traffic to.
2647
+
2648
+ Will take precedence over the \`targetEndpoint\` input.`
2649
+ }
2650
+ },
2651
+ inputs: {
2652
+ /**
2653
+ * The Kubernetes cluster to deploy the deobfuscator on.
2654
+ *
2655
+ * @schema
2656
+ */
2657
+ k8sCluster: {
2658
+ ...clusterEntity2,
2659
+ description: `The Kubernetes cluster to deploy the deobfuscator on.`
2660
+ },
2661
+ /**
2662
+ * The L4 endpoint to forward deobfuscated traffic to.
2663
+ *
2664
+ * @schema
2665
+ */
2666
+ targetEndpoint: {
2667
+ ...l4EndpointEntity,
2668
+ description: `The L4 endpoint to forward deobfuscated traffic to.`
2669
+ }
2670
+ },
2671
+ outputs: {
2672
+ /**
2673
+ * The L4 endpoint of the deobfuscator accepting obfuscated traffic.
2674
+ *
2675
+ * @schema
2676
+ */
2677
+ endpoint: {
2678
+ ...l4EndpointEntity,
2679
+ description: `The L4 endpoint of the deobfuscator accepting obfuscated traffic.`
2680
+ }
2681
+ }
2682
+ };
2683
+ var obfuscatorSpec = {
2684
+ args: {
2685
+ /**
2686
+ * The endpoint of the deobfuscator to pass obfuscated traffic to.
2687
+ *
2688
+ * Will take precedence over the `l4Endpoint` input.
2689
+ *
2690
+ * @schema
2691
+ */
2692
+ endpoint: {
2693
+ ...Type26.Optional(Type26.String()),
2694
+ description: `The endpoint of the deobfuscator to pass obfuscated traffic to.
2695
+
2696
+ Will take precedence over the \`l4Endpoint\` input.`
2697
+ }
2698
+ },
2699
+ inputs: {
2700
+ /**
2701
+ * The Kubernetes cluster to deploy the obfuscator on.
2702
+ *
2703
+ * @schema
2704
+ */
2705
+ k8sCluster: {
2706
+ ...clusterEntity2,
2707
+ description: `The Kubernetes cluster to deploy the obfuscator on.`
2708
+ },
2709
+ /**
2710
+ * The L4 endpoint of the deobfuscator to pass obfuscated traffic to.
2711
+ *
2712
+ * @schema
2713
+ */
2714
+ endpoint: {
2715
+ ...{
2716
+ entity: l4EndpointEntity,
2717
+ required: false
2718
+ },
2719
+ description: `The L4 endpoint of the deobfuscator to pass obfuscated traffic to.`
2720
+ }
2721
+ },
2722
+ outputs: {
2723
+ /**
2724
+ * The L4 endpoint accepting unobfuscated traffic.
2725
+ *
2726
+ * @schema
2727
+ */
2728
+ entryEndpoint: {
2729
+ ...l4EndpointEntity,
2730
+ description: `The L4 endpoint accepting unobfuscated traffic.`
2731
+ }
2732
+ }
2733
+ };
2734
+
2735
+ // src/obfuscators/phantun.ts
2736
+ var deobfuscator = defineUnit26({
2737
+ type: "obfuscators.phantun.deobfuscator",
2738
+ ...deobfuscatorSpec,
2739
+ meta: {
2740
+ displayName: "Phantun Deobfuscator",
2741
+ description: "The Phantun Deobfuscator deployed on Kubernetes.",
2742
+ primaryIcon: "mdi:network-outline",
2743
+ secondaryIcon: "mdi:hide"
2744
+ },
2745
+ source: {
2746
+ package: "@highstate/obfuscators",
2747
+ path: "phantun/deobfuscator"
2748
+ }
2749
+ });
2750
+ var obfuscator = defineUnit26({
2751
+ type: "obfuscators.phantun.obfuscator",
2752
+ ...obfuscatorSpec,
2753
+ meta: {
2754
+ displayName: "Phantun Obfuscator",
2755
+ description: "The Phantun Obfuscator deployed on Kubernetes.",
2756
+ primaryIcon: "mdi:network-outline",
2757
+ secondaryIcon: "mdi:hide"
2758
+ },
2759
+ source: {
2760
+ package: "@highstate/obfuscators",
2761
+ path: "phantun/obfuscator"
2762
+ }
2763
+ });
2416
2764
  export {
2417
2765
  apps_exports as apps,
2418
2766
  cloudflare_exports as cloudflare,
@@ -2422,6 +2770,7 @@ export {
2422
2770
  k8s_exports as k8s,
2423
2771
  mullvad_exports as mullvad,
2424
2772
  nixos_exports as nixos,
2773
+ obfuscators_exports as obfuscators,
2425
2774
  proxmox_exports as proxmox,
2426
2775
  restic_exports as restic,
2427
2776
  sops_exports as sops,