@highstate/library 0.7.2 → 0.7.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/dist/index.js ADDED
@@ -0,0 +1,2111 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/common.ts
8
+ var common_exports = {};
9
+ __export(common_exports, {
10
+ endpointEntity: () => endpointEntity,
11
+ existingServer: () => existingServer,
12
+ serverEntity: () => serverEntity
13
+ });
14
+ import { defineEntity as defineEntity2, defineUnit as defineUnit2, Type as Type2 } from "@highstate/contract";
15
+
16
+ // src/ssh.ts
17
+ var ssh_exports = {};
18
+ __export(ssh_exports, {
19
+ credentialsSchema: () => credentialsSchema,
20
+ keyPair: () => keyPair,
21
+ keyPairEntity: () => keyPairEntity,
22
+ keyTypeSchema: () => keyTypeSchema
23
+ });
24
+ import { defineEntity, defineUnit, Type } from "@highstate/contract";
25
+ var keyTypeSchema = Type.Union([
26
+ //
27
+ Type.Literal("rsa"),
28
+ Type.Literal("ed25519")
29
+ ]);
30
+ var keyPairEntity = defineEntity({
31
+ type: "ssh.key-pair",
32
+ schema: Type.Object({
33
+ type: keyTypeSchema,
34
+ privateKey: Type.String(),
35
+ publicKey: Type.String()
36
+ }),
37
+ meta: {
38
+ color: "#2b5797"
39
+ }
40
+ });
41
+ var credentialsSchema = Type.Object({
42
+ endpoint: Type.Optional(Type.String()),
43
+ user: Type.Optional(Type.String()),
44
+ port: Type.Optional(Type.Number()),
45
+ password: Type.Optional(Type.String()),
46
+ privateKey: Type.Optional(Type.String())
47
+ });
48
+ var keyPair = defineUnit({
49
+ type: "ssh.key-pair",
50
+ secrets: {
51
+ privateKey: Type.Optional(Type.String())
52
+ },
53
+ outputs: {
54
+ keyPair: keyPairEntity
55
+ },
56
+ meta: {
57
+ displayName: "SSH Key Pair",
58
+ description: "Holds the ED25519 SSH key pair and generates the private key if not provided.",
59
+ category: "ssh",
60
+ primaryIcon: "charm:key",
61
+ primaryIconColor: "#ffffff",
62
+ secondaryIcon: "mdi:lock",
63
+ secondaryIconColor: "#ffffff"
64
+ },
65
+ source: {
66
+ package: "@highstate/common",
67
+ path: "ssh/key-pair"
68
+ }
69
+ });
70
+
71
+ // src/common.ts
72
+ var serverEntity = defineEntity2({
73
+ type: "common.server",
74
+ schema: Type2.Object({
75
+ endpoint: Type2.String(),
76
+ hostname: Type2.String(),
77
+ sshCredentials: Type2.Optional(credentialsSchema)
78
+ }),
79
+ meta: {
80
+ color: "#009688"
81
+ }
82
+ });
83
+ var endpointEntity = defineEntity2({
84
+ type: "common.endpoint",
85
+ schema: Type2.Object({
86
+ endpoint: Type2.String()
87
+ }),
88
+ meta: {
89
+ color: "#FFC107",
90
+ description: "The L3-L4 endpoint for some network service."
91
+ }
92
+ });
93
+ var existingServer = defineUnit2({
94
+ type: "common.existing-server",
95
+ args: {
96
+ endpoint: Type2.String(),
97
+ sshUser: Type2.Optional(Type2.String({ default: "root" })),
98
+ sshPort: Type2.Optional(Type2.Number({ default: 22 }))
99
+ },
100
+ secrets: {
101
+ sshPassword: Type2.Optional(Type2.String()),
102
+ sshPrivateKey: Type2.Optional(Type2.String())
103
+ },
104
+ inputs: {
105
+ sshKeyPair: {
106
+ entity: keyPairEntity,
107
+ required: false
108
+ }
109
+ },
110
+ outputs: {
111
+ server: serverEntity
112
+ },
113
+ meta: {
114
+ displayName: "Existing Server",
115
+ description: "An existing server that can be used in the configuration.",
116
+ primaryIcon: "mdi:server",
117
+ defaultNamePrefix: "server"
118
+ },
119
+ source: {
120
+ package: "@highstate/common",
121
+ path: "existing-server"
122
+ }
123
+ });
124
+
125
+ // src/proxmox.ts
126
+ var proxmox_exports = {};
127
+ __export(proxmox_exports, {
128
+ clusterEntity: () => clusterEntity,
129
+ connection: () => connection,
130
+ existingImage: () => existingImage,
131
+ image: () => image,
132
+ imageEntity: () => imageEntity,
133
+ virtualMachine: () => virtualMachine
134
+ });
135
+ import { defineEntity as defineEntity3, defineUnit as defineUnit3, Type as Type3 } from "@highstate/contract";
136
+ var clusterEntity = defineEntity3({
137
+ type: "proxmox.cluster",
138
+ schema: Type3.Object({
139
+ endpoint: Type3.String(),
140
+ insecure: Type3.Optional(Type3.Boolean()),
141
+ username: Type3.Optional(Type3.String()),
142
+ defaultNodeName: Type3.String(),
143
+ defaultDatastoreId: Type3.String(),
144
+ password: Type3.Optional(Type3.String()),
145
+ apiToken: Type3.Optional(Type3.String())
146
+ }),
147
+ meta: {
148
+ color: "#e56901"
149
+ }
150
+ });
151
+ var imageEntity = defineEntity3({
152
+ type: "proxmox.image",
153
+ schema: Type3.Object({
154
+ id: Type3.String()
155
+ }),
156
+ meta: {
157
+ color: "#e56901"
158
+ }
159
+ });
160
+ var connection = defineUnit3({
161
+ type: "proxmox.connection",
162
+ args: {
163
+ endpoint: Type3.String(),
164
+ insecure: Type3.Optional(Type3.Boolean()),
165
+ username: Type3.Optional(Type3.String()),
166
+ defaultNodeName: Type3.Optional(Type3.String()),
167
+ defaultDatastoreId: Type3.Optional(Type3.String())
168
+ },
169
+ secrets: {
170
+ password: Type3.Optional(Type3.String()),
171
+ apiToken: Type3.Optional(Type3.String())
172
+ },
173
+ outputs: {
174
+ proxmoxCluster: clusterEntity
175
+ },
176
+ meta: {
177
+ displayName: "Proxmox Connection",
178
+ description: "The connection to an existing Proxmox cluster.",
179
+ category: "Proxmox",
180
+ primaryIcon: "simple-icons:proxmox",
181
+ primaryIconColor: "#e56901",
182
+ secondaryIcon: "codicon:vm"
183
+ },
184
+ source: {
185
+ package: "@highstate/proxmox",
186
+ path: "connection"
187
+ }
188
+ });
189
+ var image = defineUnit3({
190
+ type: "proxmox.image",
191
+ args: {
192
+ url: Type3.String(),
193
+ nodeName: Type3.Optional(Type3.String()),
194
+ sha256: Type3.Optional(Type3.String()),
195
+ datastoreId: Type3.Optional(Type3.String())
196
+ },
197
+ inputs: {
198
+ proxmoxCluster: clusterEntity
199
+ },
200
+ outputs: {
201
+ image: imageEntity
202
+ },
203
+ meta: {
204
+ displayName: "Proxmox Image",
205
+ description: "The image to upload to a Proxmox cluster.",
206
+ category: "Proxmox",
207
+ primaryIcon: "simple-icons:proxmox",
208
+ primaryIconColor: "#e56901",
209
+ secondaryIcon: "mage:compact-disk-fill"
210
+ },
211
+ source: {
212
+ package: "@highstate/proxmox",
213
+ path: "image"
214
+ }
215
+ });
216
+ var existingImage = defineUnit3({
217
+ type: "proxmox.existing-image",
218
+ args: {
219
+ id: Type3.String()
220
+ },
221
+ outputs: {
222
+ image: imageEntity
223
+ },
224
+ meta: {
225
+ displayName: "Proxmox Existing Image",
226
+ description: "The existing image on a Proxmox cluster.",
227
+ category: "Proxmox",
228
+ primaryIcon: "simple-icons:proxmox",
229
+ primaryIconColor: "#e56901",
230
+ secondaryIcon: "mage:compact-disk-fill"
231
+ },
232
+ source: {
233
+ package: "@highstate/proxmox",
234
+ path: "existing-image"
235
+ }
236
+ });
237
+ var virtualMachine = defineUnit3({
238
+ type: "proxmox.virtual-machine",
239
+ args: {
240
+ nodeName: Type3.Optional(Type3.String()),
241
+ cpuType: Type3.Optional(Type3.String({ default: "host" })),
242
+ cores: Type3.Optional(Type3.Number({ default: 1 })),
243
+ sockets: Type3.Optional(Type3.Number({ default: 1 })),
244
+ memory: Type3.Optional(Type3.Number({ default: 512 })),
245
+ ipv4: Type3.Optional(Type3.String()),
246
+ ipv4Gateway: Type3.Optional(Type3.String()),
247
+ dns: Type3.Optional(Type3.Array(Type3.String())),
248
+ datastoreId: Type3.Optional(Type3.String()),
249
+ diskSize: Type3.Optional(Type3.Number({ default: 8 })),
250
+ bridge: Type3.Optional(Type3.String({ default: "vmbr0" })),
251
+ sshPort: Type3.Optional(Type3.Number({ default: 22 })),
252
+ sshUser: Type3.Optional(Type3.String({ default: "root" })),
253
+ waitForAgent: Type3.Optional(Type3.Boolean({ default: true }))
254
+ },
255
+ inputs: {
256
+ proxmoxCluster: clusterEntity,
257
+ image: imageEntity,
258
+ sshKeyPair: {
259
+ entity: keyPairEntity,
260
+ required: false
261
+ }
262
+ },
263
+ secrets: {
264
+ sshPassword: Type3.Optional(Type3.String())
265
+ },
266
+ outputs: {
267
+ server: serverEntity
268
+ },
269
+ meta: {
270
+ displayName: "Proxmox Virtual Machine",
271
+ description: "The virtual machine on a Proxmox cluster.",
272
+ category: "Proxmox",
273
+ primaryIcon: "simple-icons:proxmox",
274
+ primaryIconColor: "#e56901",
275
+ secondaryIcon: "codicon:vm"
276
+ },
277
+ source: {
278
+ package: "@highstate/proxmox",
279
+ path: "virtual-machine"
280
+ }
281
+ });
282
+
283
+ // src/k8s.ts
284
+ var k8s_exports = {};
285
+ __export(k8s_exports, {
286
+ accessPoint: () => accessPoint,
287
+ accessPointEntity: () => accessPointEntity,
288
+ certManager: () => certManager,
289
+ clusterEntity: () => clusterEntity2,
290
+ clusterInfoSchema: () => clusterInfoSchema,
291
+ containerSchema: () => containerSchema,
292
+ deploymentEntity: () => deploymentEntity,
293
+ deploymentSpecSchema: () => deploymentSpecSchema,
294
+ dns01TlsIssuer: () => dns01TlsIssuer,
295
+ existingCluster: () => existingCluster,
296
+ gatewayEntity: () => gatewayEntity,
297
+ interfaceEntity: () => interfaceEntity,
298
+ internalIpsPolicySchema: () => internalIpsPolicySchema,
299
+ labelSelectorSchema: () => labelSelectorSchema,
300
+ metadataSchema: () => metadataSchema,
301
+ persistentVolumeClaimEntity: () => persistentVolumeClaimEntity,
302
+ serviceEntity: () => serviceEntity,
303
+ servicePortSchema: () => servicePortSchema,
304
+ serviceSpecSchema: () => serviceSpecSchema,
305
+ serviceTypeSchema: () => serviceTypeSchema,
306
+ statefulSetEntity: () => statefulSetEntity,
307
+ tlsIssuerEntity: () => tlsIssuerEntity
308
+ });
309
+ import { defineEntity as defineEntity5, defineUnit as defineUnit5, Type as Type5 } from "@highstate/contract";
310
+
311
+ // src/dns.ts
312
+ var dns_exports = {};
313
+ __export(dns_exports, {
314
+ providerEntity: () => providerEntity,
315
+ record: () => record
316
+ });
317
+ import { defineEntity as defineEntity4, defineUnit as defineUnit4, Type as Type4 } from "@highstate/contract";
318
+ var providerEntity = defineEntity4({
319
+ type: "dns.provider",
320
+ schema: Type4.Object({
321
+ name: Type4.String(),
322
+ type: Type4.String(),
323
+ data: Type4.Record(Type4.String(), Type4.Unknown()),
324
+ domain: Type4.String()
325
+ }),
326
+ meta: {
327
+ color: "#FF5722"
328
+ }
329
+ });
330
+ var record = defineUnit4({
331
+ type: "common.dns-record",
332
+ args: {
333
+ name: Type4.String(),
334
+ type: Type4.String(),
335
+ value: Type4.String(),
336
+ ttl: Type4.Optional(Type4.Number())
337
+ },
338
+ inputs: {
339
+ dnsProvider: providerEntity
340
+ },
341
+ meta: {
342
+ displayName: "DNS Record",
343
+ description: "A DNS record to create.",
344
+ primaryIcon: "mdi:server",
345
+ defaultNamePrefix: "record"
346
+ },
347
+ source: {
348
+ package: "@highstate/common",
349
+ path: "dns/record"
350
+ }
351
+ });
352
+
353
+ // src/k8s.ts
354
+ var clusterInfoSchema = Type5.Object({
355
+ id: Type5.String(),
356
+ name: Type5.String(),
357
+ cni: Type5.Optional(Type5.String()),
358
+ externalIps: Type5.Array(Type5.String())
359
+ });
360
+ var serviceTypeSchema = Type5.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
361
+ var metadataSchema = Type5.Object({
362
+ namespace: Type5.Optional(Type5.String()),
363
+ name: Type5.String(),
364
+ labels: Type5.Optional(Type5.Record(Type5.String(), Type5.String())),
365
+ annotations: Type5.Optional(Type5.Record(Type5.String(), Type5.String()))
366
+ });
367
+ var servicePortSchema = Type5.Object({
368
+ name: Type5.Optional(Type5.String()),
369
+ port: Type5.Optional(Type5.Number()),
370
+ targetPort: Type5.Optional(Type5.Union([Type5.Number(), Type5.String()])),
371
+ protocol: Type5.Optional(Type5.String())
372
+ });
373
+ var serviceSpecSchema = Type5.Object({
374
+ type: Type5.Optional(Type5.String()),
375
+ selector: Type5.Record(Type5.String(), Type5.String()),
376
+ ports: Type5.Array(servicePortSchema),
377
+ clusterIP: Type5.Optional(Type5.String()),
378
+ clusterIPs: Type5.Optional(Type5.Array(Type5.String())),
379
+ externalIPs: Type5.Optional(Type5.Array(Type5.String()))
380
+ });
381
+ var serviceEntity = defineEntity5({
382
+ type: "k8s.service",
383
+ schema: Type5.Object({
384
+ type: Type5.Literal("k8s.service"),
385
+ clusterInfo: clusterInfoSchema,
386
+ metadata: metadataSchema,
387
+ spec: serviceSpecSchema
388
+ }),
389
+ meta: {
390
+ color: "#2196F3"
391
+ }
392
+ });
393
+ var clusterEntity2 = defineEntity5({
394
+ type: "k8s.cluster",
395
+ schema: Type5.Object({
396
+ info: clusterInfoSchema,
397
+ kubeconfig: Type5.String()
398
+ }),
399
+ meta: {
400
+ color: "#2196F3"
401
+ }
402
+ });
403
+ var internalIpsPolicySchema = Type5.StringEnum(["always", "public", "never"]);
404
+ var existingCluster = defineUnit5({
405
+ type: "k8s.existing-cluster",
406
+ args: {
407
+ /**
408
+ * The list of external IPs of the cluster nodes allowed to be used for external access.
409
+ *
410
+ * If not provided, will be automatically detected by querying the cluster nodes.
411
+ *
412
+ * @schema
413
+ */
414
+ externalIps: {
415
+ ...Type5.Optional(Type5.Array(Type5.String())),
416
+ description: `The list of external IPs of the cluster nodes allowed to be used for external access.
417
+
418
+ If not provided, will be automatically detected by querying the cluster nodes.`
419
+ },
420
+ /**
421
+ * The policy for using internal IPs of the nodes as external IPs.
422
+ *
423
+ * - `always`: always use internal IPs as external IPs;
424
+ * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
425
+ * - `never`: never use internal IPs as external IPs.
426
+ *
427
+ * @schema
428
+ */
429
+ internalIpsPolicy: {
430
+ ...{ ...internalIpsPolicySchema, default: "public" },
431
+ description: `The policy for using internal IPs of the nodes as external IPs.
432
+
433
+ - \`always\`: always use internal IPs as external IPs;
434
+ - \`public\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
435
+ - \`never\`: never use internal IPs as external IPs.`
436
+ },
437
+ /**
438
+ * The FQDN to register the cluster nodes with.
439
+ *
440
+ * If provided and `registerFqdn` is set to `true`, the corresponding DNS provider must be provided to set up the DNS records.
441
+ *
442
+ * @schema
443
+ */
444
+ fqdn: {
445
+ ...Type5.Optional(Type5.String()),
446
+ description: `The FQDN to register the cluster nodes with.
447
+
448
+ If provided and \`registerFqdn\` is set to \`true\`, the corresponding DNS provider must be provided to set up the DNS records.`
449
+ },
450
+ /**
451
+ * Whether to register the cluster nodes with the provided FQDN.
452
+ *
453
+ * By default, `true`.
454
+ *
455
+ * @schema
456
+ */
457
+ registerFqdn: {
458
+ ...Type5.Boolean({ default: true }),
459
+ description: `Whether to register the cluster nodes with the provided FQDN.
460
+
461
+ By default, \`true\`.`
462
+ }
463
+ },
464
+ secrets: {
465
+ /**
466
+ * The kubeconfig of the cluster to use for connecting to the cluster.
467
+ *
468
+ * Will be available for all components using `cluster` output of this unit.
469
+ *
470
+ * @schema
471
+ */
472
+ kubeconfig: {
473
+ ...Type5.Record(Type5.String(), Type5.Any()),
474
+ description: `The kubeconfig of the cluster to use for connecting to the cluster.
475
+
476
+ Will be available for all components using \`cluster\` output of this unit.`
477
+ }
478
+ },
479
+ outputs: {
480
+ cluster: clusterEntity2
481
+ },
482
+ meta: {
483
+ displayName: "Existing Cluster",
484
+ description: "An existing Kubernetes cluster.",
485
+ primaryIcon: "mdi:kubernetes"
486
+ },
487
+ source: {
488
+ package: "@highstate/k8s",
489
+ path: "existing-cluster"
490
+ }
491
+ });
492
+ var gatewayEntity = defineEntity5({
493
+ type: "k8s.gateway",
494
+ schema: Type5.Object({
495
+ clusterInfo: clusterInfoSchema,
496
+ gatewayClassName: Type5.String(),
497
+ httpListenerPort: Type5.Number(),
498
+ httpsListenerPort: Type5.Number(),
499
+ ip: Type5.String(),
500
+ service: Type5.Optional(serviceEntity.schema)
501
+ }),
502
+ meta: {
503
+ color: "#4CAF50"
504
+ }
505
+ });
506
+ var tlsIssuerEntity = defineEntity5({
507
+ type: "k8s.tls-issuer",
508
+ schema: Type5.Object({
509
+ clusterInfo: clusterInfoSchema,
510
+ clusterIssuerName: Type5.String()
511
+ }),
512
+ meta: {
513
+ color: "#f06292"
514
+ }
515
+ });
516
+ var accessPointEntity = defineEntity5({
517
+ type: "common.access-point",
518
+ schema: Type5.Object({
519
+ gateway: gatewayEntity.schema,
520
+ tlsIssuer: tlsIssuerEntity.schema,
521
+ dnsProvider: providerEntity.schema
522
+ }),
523
+ meta: {
524
+ color: "#FFC107"
525
+ }
526
+ });
527
+ var accessPoint = defineUnit5({
528
+ type: "k8s.access-point",
529
+ inputs: {
530
+ gateway: gatewayEntity,
531
+ tlsIssuer: tlsIssuerEntity,
532
+ dnsProvider: providerEntity
533
+ },
534
+ outputs: {
535
+ accessPoint: accessPointEntity
536
+ },
537
+ meta: {
538
+ displayName: "Access Point",
539
+ description: "An access point which can be used to connect to services.",
540
+ primaryIcon: "mdi:access-point"
541
+ },
542
+ source: {
543
+ package: "@highstate/k8s",
544
+ path: "access-point"
545
+ }
546
+ });
547
+ var certManager = defineUnit5({
548
+ type: "k8s.cert-manager",
549
+ inputs: {
550
+ k8sCluster: clusterEntity2
551
+ },
552
+ outputs: {
553
+ k8sCluster: clusterEntity2
554
+ },
555
+ meta: {
556
+ displayName: "Cert Manager",
557
+ description: "A certificate manager for managing TLS certificates.",
558
+ primaryIcon: "simple-icons:letsencrypt"
559
+ },
560
+ source: {
561
+ package: "@highstate/k8s",
562
+ path: "cert-manager"
563
+ }
564
+ });
565
+ var dns01TlsIssuer = defineUnit5({
566
+ type: "k8s.dns01-issuer",
567
+ inputs: {
568
+ k8sCluster: clusterEntity2,
569
+ dnsProvider: providerEntity
570
+ },
571
+ outputs: {
572
+ tlsIssuer: tlsIssuerEntity
573
+ },
574
+ meta: {
575
+ displayName: "DNS01 Issuer",
576
+ description: "A TLS issuer for issuing certificate using DNS01 challenge.",
577
+ primaryIcon: "mdi:certificate"
578
+ },
579
+ source: {
580
+ package: "@highstate/k8s",
581
+ path: "dns01-issuer"
582
+ }
583
+ });
584
+ var containerSchema = Type5.Object({
585
+ name: Type5.String(),
586
+ image: Type5.String()
587
+ });
588
+ var labelSelectorSchema = Type5.Object({
589
+ matchLabels: Type5.Record(Type5.String(), Type5.String())
590
+ });
591
+ var deploymentSpecSchema = Type5.Object({
592
+ replicas: Type5.Number(),
593
+ selector: labelSelectorSchema,
594
+ template: Type5.Object({
595
+ metadata: metadataSchema,
596
+ spec: Type5.Object({
597
+ containers: Type5.Array(containerSchema)
598
+ })
599
+ })
600
+ });
601
+ var deploymentEntity = defineEntity5({
602
+ type: "k8s.deployment",
603
+ schema: Type5.Object({
604
+ type: Type5.Literal("k8s.deployment"),
605
+ clusterInfo: clusterInfoSchema,
606
+ metadata: metadataSchema,
607
+ service: Type5.Optional(serviceEntity.schema)
608
+ }),
609
+ meta: {
610
+ color: "#4CAF50"
611
+ }
612
+ });
613
+ var statefulSetEntity = defineEntity5({
614
+ type: "k8s.stateful-set",
615
+ schema: Type5.Object({
616
+ type: Type5.Literal("k8s.stateful-set"),
617
+ clusterInfo: clusterInfoSchema,
618
+ metadata: metadataSchema,
619
+ service: Type5.Optional(serviceEntity.schema)
620
+ }),
621
+ meta: {
622
+ color: "#FFC107"
623
+ }
624
+ });
625
+ var persistentVolumeClaimEntity = defineEntity5({
626
+ type: "k8s.persistent-volume-claim",
627
+ schema: Type5.Object({
628
+ type: Type5.Literal("k8s.persistent-volume-claim"),
629
+ clusterInfo: clusterInfoSchema,
630
+ metadata: metadataSchema
631
+ }),
632
+ meta: {
633
+ color: "#FFC107"
634
+ }
635
+ });
636
+ var interfaceEntity = defineEntity5({
637
+ type: "k8s.interface",
638
+ schema: Type5.Object({
639
+ name: Type5.String(),
640
+ deployment: deploymentEntity.schema
641
+ }),
642
+ meta: {
643
+ color: "#2196F3",
644
+ description: "The interface in a network space of pod kernel which can accept or transmit packets."
645
+ }
646
+ });
647
+
648
+ // src/talos.ts
649
+ var talos_exports = {};
650
+ __export(talos_exports, {
651
+ cluster: () => cluster,
652
+ clusterEntity: () => clusterEntity3,
653
+ cniSchema: () => cniSchema,
654
+ csiSchema: () => csiSchema
655
+ });
656
+ import { defineEntity as defineEntity6, defineUnit as defineUnit6, Type as Type6 } from "@highstate/contract";
657
+ var clusterEntity3 = defineEntity6({
658
+ type: "talos.cluster",
659
+ schema: Type6.Object({
660
+ clientConfiguration: Type6.String(),
661
+ machineSecrets: Type6.String()
662
+ }),
663
+ meta: {
664
+ color: "#2d2d2d"
665
+ }
666
+ });
667
+ var cniSchema = Type6.StringEnum(["none", "cilium", "flannel"]);
668
+ var csiSchema = Type6.StringEnum(["none", "local-path-provisioner"]);
669
+ var cluster = defineUnit6({
670
+ type: "talos.cluster",
671
+ args: {
672
+ /**
673
+ * Allow scheduling workloads on the master nodes.
674
+ *
675
+ * By default, "true" if no worker nodes are provided.
676
+ */
677
+ scheduleOnMasters: Type6.Boolean(),
678
+ /**
679
+ * The endpoint of the cluster.
680
+ *
681
+ * By default, the first master node's endpoint is used.
682
+ */
683
+ endpoint: Type6.Optional(Type6.String()),
684
+ /**
685
+ * The name of the cluster.
686
+ *
687
+ * By default, the name of the instance is used.
688
+ */
689
+ clusterName: Type6.Optional(Type6.String()),
690
+ /**
691
+ * The CNI plugin to use.
692
+ *
693
+ * The following options are available:
694
+ * - "cilium" (default)
695
+ * - "flannel" (built-in in Talos)
696
+ * - "none" (disable CNI, must be installed manually)
697
+ *
698
+ * The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.
699
+ */
700
+ cni: { ...cniSchema, default: "cilium" },
701
+ /**
702
+ * The CSI plugin to use.
703
+ *
704
+ * The following options are available:
705
+ * - "local-path-provisioner" (default)
706
+ * - "none" (disable CSI, must be installed manually if needed)
707
+ */
708
+ csi: { ...csiSchema, default: "local-path-provisioner" },
709
+ /**
710
+ * The shared configuration patch.
711
+ * It will be applied to all nodes.
712
+ */
713
+ sharedConfigPatch: Type6.Optional(Type6.Record(Type6.String(), Type6.Any())),
714
+ /**
715
+ * The master configuration patch.
716
+ * It will be applied to all master nodes.
717
+ */
718
+ masterConfigPatch: Type6.Optional(Type6.Record(Type6.String(), Type6.Any())),
719
+ /**
720
+ * The worker configuration patch.
721
+ * It will be applied to all worker nodes.
722
+ */
723
+ workerConfigPatch: Type6.Optional(Type6.Record(Type6.String(), Type6.Any()))
724
+ },
725
+ inputs: {
726
+ masters: {
727
+ entity: serverEntity,
728
+ multiple: true
729
+ },
730
+ workers: {
731
+ entity: serverEntity,
732
+ multiple: true,
733
+ required: false
734
+ }
735
+ },
736
+ outputs: {
737
+ k8sCluster: clusterEntity2,
738
+ talosCluster: clusterEntity3
739
+ },
740
+ meta: {
741
+ displayName: "Talos Cluster",
742
+ description: "A Kubernetes cluster managed by Talos.",
743
+ category: "Talos",
744
+ color: "#2d2d2d",
745
+ primaryIcon: "simple-icons:talos",
746
+ secondaryIcon: "devicon:kubernetes"
747
+ },
748
+ source: {
749
+ package: "@highstate/talos",
750
+ path: "cluster"
751
+ }
752
+ });
753
+
754
+ // src/wireguard.ts
755
+ var wireguard_exports = {};
756
+ __export(wireguard_exports, {
757
+ backendSchema: () => backendSchema,
758
+ config: () => config,
759
+ configBundle: () => configBundle,
760
+ identity: () => identity,
761
+ identityEntity: () => identityEntity,
762
+ k8sNodeEntity: () => k8sNodeEntity,
763
+ network: () => network,
764
+ networkEntity: () => networkEntity,
765
+ node: () => node,
766
+ peer: () => peer,
767
+ peerEntity: () => peerEntity,
768
+ presharedKeyModeSchema: () => presharedKeyModeSchema
769
+ });
770
+ import { defineEntity as defineEntity7, defineUnit as defineUnit7, Type as Type7 } from "@highstate/contract";
771
+ var backendSchema = Type7.StringEnum(["wireguard", "amneziawg"]);
772
+ var presharedKeyModeSchema = Type7.StringEnum(["none", "global", "secure"]);
773
+ var networkEntity = defineEntity7({
774
+ type: "wireguard.network",
775
+ schema: Type7.Object({
776
+ backend: Type7.Optional(backendSchema),
777
+ presharedKeyMode: presharedKeyModeSchema,
778
+ globalPresharedKey: Type7.Optional(Type7.String()),
779
+ ipv6: Type7.Optional(Type7.Boolean())
780
+ })
781
+ });
782
+ var identityEntity = defineEntity7({
783
+ type: "wireguard.identity",
784
+ schema: Type7.Object({
785
+ name: Type7.String(),
786
+ network: Type7.Optional(networkEntity.schema),
787
+ address: Type7.Optional(Type7.String()),
788
+ privateKey: Type7.String(),
789
+ presharedKeyPart: Type7.Optional(Type7.String()),
790
+ k8sServices: Type7.Array(serviceEntity.schema),
791
+ exitNode: Type7.Boolean(),
792
+ listenPort: Type7.Optional(Type7.Number()),
793
+ externalIp: Type7.Optional(Type7.String()),
794
+ endpoint: Type7.Optional(Type7.String()),
795
+ fqdn: Type7.Optional(Type7.String())
796
+ }),
797
+ meta: {
798
+ color: "#F44336"
799
+ }
800
+ });
801
+ var peerEntity = defineEntity7({
802
+ type: "wireguard.peer",
803
+ schema: Type7.Object({
804
+ name: Type7.String(),
805
+ network: Type7.Optional(networkEntity.schema),
806
+ publicKey: Type7.String(),
807
+ address: Type7.Optional(Type7.String()),
808
+ allowedIps: Type7.Array(Type7.String()),
809
+ endpoint: Type7.Optional(Type7.String()),
810
+ presharedKeyPart: Type7.Optional(Type7.String()),
811
+ excludedIps: Type7.Optional(Type7.Array(Type7.String())),
812
+ dns: Type7.Optional(Type7.Array(Type7.String()))
813
+ }),
814
+ meta: {
815
+ color: "#673AB7"
816
+ }
817
+ });
818
+ var k8sNodeEntity = defineEntity7({
819
+ type: "wireguard.node",
820
+ schema: Type7.Object({
821
+ network: Type7.String(),
822
+ address: Type7.String(),
823
+ endpoint: Type7.Optional(Type7.String()),
824
+ peers: Type7.Array(Type7.String())
825
+ })
826
+ });
827
+ var network = defineUnit7({
828
+ type: "wireguard.network",
829
+ args: {
830
+ /**
831
+ * The backend to use for the WireGuard network.
832
+ *
833
+ * Possible values are:
834
+ * 1. `wireguard` - The default backend.
835
+ * 2. `amneziawg` - The censorship-resistant fork of WireGuard.
836
+ *
837
+ * By default, the `wireguard` backend is used.
838
+ *
839
+ * @schema
840
+ */
841
+ backend: {
842
+ ...backendSchema,
843
+ description: `The backend to use for the WireGuard network.
844
+
845
+ Possible values are:
846
+ 1. \`wireguard\` - The default backend.
847
+ 2. \`amneziawg\` - The censorship-resistant fork of WireGuard.
848
+
849
+ By default, the \`wireguard\` backend is used.`
850
+ },
851
+ /**
852
+ * The option which defines how to handle pre-shared keys between peers.
853
+ *
854
+ * 1. `none` - No pre-shared keys will be used.
855
+ * 2. `global` - A single pre-shared key will be used for all peer pairs in the network.
856
+ * 3. `secure` - Each peer pair will have its own pre-shared key.
857
+ * In this case, each identity generates `presharedKeyPart` and the actual pre-shared key
858
+ * for each peer pair will be computed as `xor(peer1.presharedKeyPart, peer2.presharedKeyPart)`.
859
+ *
860
+ * If the whole network is managed by the HighState, the `secure` mode is recommended.
861
+ *
862
+ * By default, the `none` mode is used.
863
+ *
864
+ * @schema
865
+ */
866
+ presharedKeyMode: {
867
+ ...Type7.Optional(presharedKeyModeSchema),
868
+ description: `The option which defines how to handle pre-shared keys between peers.
869
+
870
+ 1. \`none\` - No pre-shared keys will be used.
871
+ 2. \`global\` - A single pre-shared key will be used for all peer pairs in the network.
872
+ 3. \`secure\` - Each peer pair will have its own pre-shared key.
873
+ In this case, each identity generates \`presharedKeyPart\` and the actual pre-shared key
874
+ for each peer pair will be computed as \`xor(peer1.presharedKeyPart, peer2.presharedKeyPart)\`.
875
+
876
+ If the whole network is managed by the HighState, the \`secure\` mode is recommended.
877
+
878
+ By default, the \`none\` mode is used.`
879
+ },
880
+ /**
881
+ * The option to enable IPv6 support in the network.
882
+ *
883
+ * By default, IPv6 support is disabled.
884
+ *
885
+ * @schema
886
+ */
887
+ ipv6: {
888
+ ...Type7.Optional(Type7.Boolean()),
889
+ description: `The option to enable IPv6 support in the network.
890
+
891
+ By default, IPv6 support is disabled.`
892
+ }
893
+ },
894
+ secrets: {
895
+ /**
896
+ * The global pre-shared key to use for all peer pairs in the network.
897
+ *
898
+ * Will be used only if `presharedKeyMode` is set to `global`.
899
+ * Will be generated automatically if not provided.
900
+ *
901
+ * @schema
902
+ */
903
+ globalPresharedKey: {
904
+ ...Type7.Optional(Type7.String()),
905
+ description: `The global pre-shared key to use for all peer pairs in the network.
906
+
907
+ Will be used only if \`presharedKeyMode\` is set to \`global\`.
908
+ Will be generated automatically if not provided.`
909
+ }
910
+ },
911
+ outputs: {
912
+ network: networkEntity
913
+ },
914
+ meta: {
915
+ description: "The WireGuard network with some shared configuration.",
916
+ primaryIcon: "simple-icons:wireguard",
917
+ primaryIconColor: "#88171a",
918
+ secondaryIcon: "mdi:local-area-network-connect"
919
+ },
920
+ source: {
921
+ package: "@highstate/wireguard",
922
+ path: "network"
923
+ }
924
+ });
925
+ var sharedPeerArgs = {
926
+ /**
927
+ * The name of the WireGuard peer.
928
+ *
929
+ * If not provided, the peer will be named after the unit.
930
+ *
931
+ * @schema
932
+ */
933
+ peerName: {
934
+ ...Type7.Optional(Type7.String()),
935
+ description: `The name of the WireGuard peer.
936
+
937
+ If not provided, the peer will be named after the unit.`
938
+ },
939
+ /**
940
+ * The address of the WireGuard interface.
941
+ *
942
+ * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
943
+ *
944
+ * @schema
945
+ */
946
+ address: {
947
+ ...Type7.Optional(Type7.String()),
948
+ description: `The address of the WireGuard interface.
949
+
950
+ The address may be any IPv4 or IPv6 address. CIDR notation is also supported.`
951
+ },
952
+ /**
953
+ * The list of allowed IPs for the peer.
954
+ *
955
+ * @schema
956
+ */
957
+ allowedIps: {
958
+ ...Type7.Optional(Type7.Array(Type7.String())),
959
+ description: `The list of allowed IPs for the peer.`
960
+ },
961
+ /**
962
+ * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.
963
+ *
964
+ * Will be merged with the `allowedIps` if provided.
965
+ *
966
+ * @schema
967
+ */
968
+ exitNode: {
969
+ ...Type7.Optional(Type7.Boolean()),
970
+ description: `The convenience option to set \`allowedIps\` to \`0.0.0.0/0, ::/0\`.
971
+
972
+ Will be merged with the \`allowedIps\` if provided.`
973
+ },
974
+ /**
975
+ * The list of IP ranges to exclude from the tunnel.
976
+ *
977
+ * Implementation notes:
978
+ *
979
+ * - This list will not be used to generate the allowed IPs for the peer.
980
+ * - Instead, the node will setup extra direct routes to these IPs via default gateway.
981
+ * - This allows to use `0.0.0.0/0, ::/0` in the `allowedIps` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.
982
+ *
983
+ * @schema
984
+ */
985
+ excludedIps: {
986
+ ...Type7.Optional(Type7.Array(Type7.String())),
987
+ description: `The list of IP ranges to exclude from the tunnel.
988
+
989
+ Implementation notes:
990
+
991
+ - This list will not be used to generate the allowed IPs for the peer.
992
+ - Instead, the node will setup extra direct routes to these IPs via default gateway.
993
+ - This allows to use \`0.0.0.0/0, ::/0\` in the \`allowedIps\` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.`
994
+ },
995
+ /**
996
+ * The convenience option to exclude private IPs from the tunnel.
997
+ *
998
+ * For IPv4, the private IPs are:
999
+ *
1000
+ * - `10.0.0.0/8`
1001
+ * - `172.16.0.0/12`
1002
+ * - `192.168.0.0/16`
1003
+ *
1004
+ * For IPv6, the private IPs are:
1005
+ *
1006
+ * - `fc00::/7`
1007
+ * - `fe80::/10`
1008
+ *
1009
+ * Will be merged with `excludedIps` if provided.
1010
+ *
1011
+ * @schema
1012
+ */
1013
+ excludePrivateIps: {
1014
+ ...Type7.Optional(Type7.Boolean()),
1015
+ description: `The convenience option to exclude private IPs from the tunnel.
1016
+
1017
+ For IPv4, the private IPs are:
1018
+
1019
+ - \`10.0.0.0/8\`
1020
+ - \`172.16.0.0/12\`
1021
+ - \`192.168.0.0/16\`
1022
+
1023
+ For IPv6, the private IPs are:
1024
+
1025
+ - \`fc00::/7\`
1026
+ - \`fe80::/10\`
1027
+
1028
+ Will be merged with \`excludedIps\` if provided.`
1029
+ },
1030
+ /**
1031
+ * The endpoint of the WireGuard peer.
1032
+ *
1033
+ * @schema
1034
+ */
1035
+ endpoint: {
1036
+ ...Type7.Optional(Type7.String()),
1037
+ description: `The endpoint of the WireGuard peer.`
1038
+ },
1039
+ /**
1040
+ * The DNS servers that should be used by the interface connected to the WireGuard peer.
1041
+ *
1042
+ * If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).
1043
+ *
1044
+ * @schema
1045
+ */
1046
+ dns: {
1047
+ ...Type7.Optional(Type7.Array(Type7.String())),
1048
+ description: `The DNS servers that should be used by the interface connected to the WireGuard peer.
1049
+
1050
+ If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).`
1051
+ },
1052
+ /**
1053
+ * The convenience option to include the DNS servers to the allowed IPs.
1054
+ *
1055
+ * By default, is `true`.
1056
+ *
1057
+ * @schema
1058
+ */
1059
+ includeDns: {
1060
+ ...Type7.Optional(Type7.Boolean({ default: true })),
1061
+ description: `The convenience option to include the DNS servers to the allowed IPs.
1062
+
1063
+ By default, is \`true\`.`
1064
+ }
1065
+ };
1066
+ var sharedInterfaceArgs = {
1067
+ /**
1068
+ * The port to listen on.
1069
+ *
1070
+ * Will override the `listenPort` of the identity if provided.
1071
+ *
1072
+ * @schema
1073
+ */
1074
+ listenPort: {
1075
+ ...Type7.Optional(Type7.Number()),
1076
+ description: `The port to listen on.
1077
+
1078
+ Will override the \`listenPort\` of the identity if provided.`
1079
+ },
1080
+ /**
1081
+ * The DNS servers that should be used by the interface connected to the WireGuard node.
1082
+ *
1083
+ * Will be merged with the DNS servers of the peers.
1084
+ *
1085
+ * @schema
1086
+ */
1087
+ dns: {
1088
+ ...Type7.Optional(Type7.Array(Type7.String())),
1089
+ description: `The DNS servers that should be used by the interface connected to the WireGuard node.
1090
+
1091
+ Will be merged with the DNS servers of the peers.`
1092
+ }
1093
+ };
1094
+ var peer = defineUnit7({
1095
+ type: "wireguard.peer",
1096
+ args: {
1097
+ ...sharedPeerArgs,
1098
+ /**
1099
+ * The public key of the WireGuard peer.
1100
+ *
1101
+ * @schema
1102
+ */
1103
+ publicKey: {
1104
+ ...Type7.String(),
1105
+ description: `The public key of the WireGuard peer.`
1106
+ }
1107
+ },
1108
+ inputs: {
1109
+ /**
1110
+ * The network to use for the WireGuard peer.
1111
+ *
1112
+ * If not provided, the peer will use default network configuration.
1113
+ *
1114
+ * @schema
1115
+ */
1116
+ network: {
1117
+ ...{
1118
+ entity: networkEntity,
1119
+ required: false
1120
+ },
1121
+ description: `The network to use for the WireGuard peer.
1122
+
1123
+ If not provided, the peer will use default network configuration.`
1124
+ }
1125
+ },
1126
+ outputs: {
1127
+ peer: peerEntity
1128
+ },
1129
+ meta: {
1130
+ description: "The WireGuard peer with the public key.",
1131
+ primaryIcon: "simple-icons:wireguard",
1132
+ primaryIconColor: "#88171a",
1133
+ secondaryIcon: "mdi:badge-account-horizontal"
1134
+ },
1135
+ source: {
1136
+ package: "@highstate/wireguard",
1137
+ path: "peer"
1138
+ }
1139
+ });
1140
+ var identity = defineUnit7({
1141
+ type: "wireguard.identity",
1142
+ args: {
1143
+ ...sharedPeerArgs,
1144
+ /**
1145
+ * The port to listen on.
1146
+ *
1147
+ * Used by the implementation of the identity and to calculate the endpoint of the peer.
1148
+ *
1149
+ * @schema
1150
+ */
1151
+ listenPort: {
1152
+ ...Type7.Optional(Type7.Number()),
1153
+ description: `The port to listen on.
1154
+
1155
+ Used by the implementation of the identity and to calculate the endpoint of the peer.`
1156
+ },
1157
+ /**
1158
+ * The external IP address of the WireGuard identity.
1159
+ *
1160
+ * Used by the implementation of the identity and to calculate the endpoint of the peer.
1161
+ *
1162
+ * @schema
1163
+ */
1164
+ externalIp: {
1165
+ ...Type7.Optional(Type7.String()),
1166
+ description: `The external IP address of the WireGuard identity.
1167
+
1168
+ Used by the implementation of the identity and to calculate the endpoint of the peer.`
1169
+ },
1170
+ /**
1171
+ * The endpoint of the WireGuard peer.
1172
+ *
1173
+ * By default, the endpoint is calculated as `externalIp:listenPort`.
1174
+ *
1175
+ * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
1176
+ *
1177
+ * @schema
1178
+ */
1179
+ endpoint: {
1180
+ ...Type7.Optional(Type7.String()),
1181
+ description: `The endpoint of the WireGuard peer.
1182
+
1183
+ By default, the endpoint is calculated as \`externalIp:listenPort\`.
1184
+
1185
+ If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.`
1186
+ },
1187
+ /**
1188
+ * The FQDN of the WireGuard identity.
1189
+ * Will be used as endpoint for the peer.
1190
+ *
1191
+ * If `dnsProvider` is provided and `externalIp` is available, the FQDN will be registered automatically.
1192
+ *
1193
+ * @schema
1194
+ */
1195
+ fqdn: {
1196
+ ...Type7.Optional(Type7.String()),
1197
+ description: `The FQDN of the WireGuard identity.
1198
+ Will be used as endpoint for the peer.
1199
+
1200
+ If \`dnsProvider\` is provided and \`externalIp\` is available, the FQDN will be registered automatically.`
1201
+ }
1202
+ },
1203
+ secrets: {
1204
+ /**
1205
+ * The private key of the WireGuard identity.
1206
+ *
1207
+ * If not provided, the key will be generated automatically.
1208
+ *
1209
+ * @schema
1210
+ */
1211
+ privateKey: {
1212
+ ...Type7.Optional(Type7.String()),
1213
+ description: `The private key of the WireGuard identity.
1214
+
1215
+ If not provided, the key will be generated automatically.`
1216
+ },
1217
+ /**
1218
+ * The part of the pre-shared of the WireGuard identity.
1219
+ *
1220
+ * Will be generated automatically if not provided.
1221
+ *
1222
+ * @schema
1223
+ */
1224
+ presharedKeyPart: {
1225
+ ...Type7.Optional(Type7.String()),
1226
+ description: `The part of the pre-shared of the WireGuard identity.
1227
+
1228
+ Will be generated automatically if not provided.`
1229
+ }
1230
+ },
1231
+ inputs: {
1232
+ /**
1233
+ * The network to use for the WireGuard identity.
1234
+ *
1235
+ * If not provided, the identity will use default network configuration.
1236
+ *
1237
+ * @schema
1238
+ */
1239
+ network: {
1240
+ ...{
1241
+ entity: networkEntity,
1242
+ required: false
1243
+ },
1244
+ description: `The network to use for the WireGuard identity.
1245
+
1246
+ If not provided, the identity will use default network configuration.`
1247
+ },
1248
+ /**
1249
+ * The list of Kubernetes services to expose the WireGuard identity.
1250
+ *
1251
+ * Their IP addresses will be added to the `allowedIps` of the identity and passed to the node to set up network policies.
1252
+ *
1253
+ * @schema
1254
+ */
1255
+ k8sServices: {
1256
+ ...{
1257
+ entity: serviceEntity,
1258
+ multiple: true,
1259
+ required: false
1260
+ },
1261
+ description: `The list of Kubernetes services to expose the WireGuard identity.
1262
+
1263
+ Their IP addresses will be added to the \`allowedIps\` of the identity and passed to the node to set up network policies.`
1264
+ },
1265
+ dnsProvider: {
1266
+ entity: providerEntity,
1267
+ required: false
1268
+ }
1269
+ },
1270
+ outputs: {
1271
+ identity: identityEntity,
1272
+ peer: peerEntity
1273
+ },
1274
+ meta: {
1275
+ description: "The WireGuard identity with the public key.",
1276
+ primaryIcon: "simple-icons:wireguard",
1277
+ primaryIconColor: "#88171a",
1278
+ secondaryIcon: "mdi:account"
1279
+ },
1280
+ source: {
1281
+ package: "@highstate/wireguard",
1282
+ path: "identity"
1283
+ }
1284
+ });
1285
+ var node = defineUnit7({
1286
+ type: "wireguard.node",
1287
+ args: {
1288
+ appName: Type7.Optional(Type7.String()),
1289
+ serviceType: Type7.Optional(serviceTypeSchema),
1290
+ ...sharedInterfaceArgs,
1291
+ /**
1292
+ * The external IP address of the WireGuard node.
1293
+ *
1294
+ * Will override the `externalIp` of the identity if provided.
1295
+ *
1296
+ * @schema
1297
+ */
1298
+ externalIp: {
1299
+ ...Type7.Optional(Type7.String()),
1300
+ description: `The external IP address of the WireGuard node.
1301
+
1302
+ Will override the \`externalIp\` of the identity if provided.`
1303
+ },
1304
+ /**
1305
+ * The extra specification of the container which runs the WireGuard node.
1306
+ *
1307
+ * Will override any overlapping fields.
1308
+ *
1309
+ * @schema
1310
+ */
1311
+ containerSpec: {
1312
+ ...Type7.Optional(Type7.Record(Type7.String(), Type7.Any())),
1313
+ description: `The extra specification of the container which runs the WireGuard node.
1314
+
1315
+ Will override any overlapping fields.`
1316
+ }
1317
+ },
1318
+ inputs: {
1319
+ identity: identityEntity,
1320
+ k8sCluster: clusterEntity2,
1321
+ deployment: {
1322
+ entity: deploymentEntity,
1323
+ required: false
1324
+ },
1325
+ statefulSet: {
1326
+ entity: statefulSetEntity,
1327
+ required: false
1328
+ },
1329
+ interface: {
1330
+ entity: interfaceEntity,
1331
+ required: false
1332
+ },
1333
+ peers: {
1334
+ entity: peerEntity,
1335
+ multiple: true,
1336
+ required: false
1337
+ }
1338
+ },
1339
+ outputs: {
1340
+ deployment: {
1341
+ entity: deploymentEntity,
1342
+ required: false
1343
+ },
1344
+ interface: {
1345
+ entity: interfaceEntity,
1346
+ required: false
1347
+ },
1348
+ service: {
1349
+ entity: serviceEntity,
1350
+ required: false
1351
+ }
1352
+ },
1353
+ meta: {
1354
+ description: "The WireGuard node running on the Kubernetes.",
1355
+ primaryIcon: "simple-icons:wireguard",
1356
+ primaryIconColor: "#88171a",
1357
+ secondaryIcon: "mdi:server"
1358
+ },
1359
+ source: {
1360
+ package: "@highstate/wireguard",
1361
+ path: "node"
1362
+ }
1363
+ });
1364
+ var config = defineUnit7({
1365
+ type: "wireguard.config",
1366
+ args: {
1367
+ ...sharedInterfaceArgs,
1368
+ /**
1369
+ * The name of the "default" interface where non-tunneled traffic should go.
1370
+ *
1371
+ * If not provided, the config will not respect `excludedIps`.
1372
+ *
1373
+ * @schema
1374
+ */
1375
+ defaultInterface: {
1376
+ ...Type7.Optional(Type7.String()),
1377
+ description: `The name of the "default" interface where non-tunneled traffic should go.
1378
+
1379
+ If not provided, the config will not respect \`excludedIps\`.`
1380
+ }
1381
+ },
1382
+ inputs: {
1383
+ identity: identityEntity,
1384
+ peers: {
1385
+ entity: peerEntity,
1386
+ multiple: true,
1387
+ required: false
1388
+ }
1389
+ },
1390
+ meta: {
1391
+ displayName: "WireGuard Config",
1392
+ description: "Just the WireGuard configuration for the identity and peers.",
1393
+ primaryIcon: "simple-icons:wireguard",
1394
+ primaryIconColor: "#88171a",
1395
+ secondaryIcon: "mdi:settings"
1396
+ },
1397
+ source: {
1398
+ package: "@highstate/wireguard",
1399
+ path: "config"
1400
+ }
1401
+ });
1402
+ var configBundle = defineUnit7({
1403
+ type: "wireguard.config-bundle",
1404
+ inputs: {
1405
+ identity: identityEntity,
1406
+ peers: {
1407
+ entity: peerEntity,
1408
+ multiple: true
1409
+ },
1410
+ sharedPeers: {
1411
+ entity: peerEntity,
1412
+ multiple: true,
1413
+ required: false
1414
+ }
1415
+ },
1416
+ meta: {
1417
+ displayName: "WireGuard Config Bundle",
1418
+ description: "The WireGuard configuration bundle for the identity and peers.",
1419
+ primaryIcon: "simple-icons:wireguard",
1420
+ primaryIconColor: "#88171a",
1421
+ secondaryIcon: "mdi:folder-settings-variant"
1422
+ },
1423
+ source: {
1424
+ package: "@highstate/wireguard",
1425
+ path: "config-bundle"
1426
+ }
1427
+ });
1428
+
1429
+ // src/apps/index.ts
1430
+ var apps_exports = {};
1431
+ __export(apps_exports, {
1432
+ backupModeSchema: () => backupModeSchema,
1433
+ codeServer: () => codeServer,
1434
+ deployment: () => deployment,
1435
+ grocy: () => grocy,
1436
+ kubernetesDashboard: () => kubernetesDashboard,
1437
+ mariadb: () => mariadb,
1438
+ mariadbDatabase: () => mariadbDatabase,
1439
+ mariadbEntity: () => mariadbEntity,
1440
+ maybe: () => maybe,
1441
+ mongodb: () => mongodb,
1442
+ mongodbDatabase: () => mongodbDatabase,
1443
+ mongodbEntity: () => mongodbEntity,
1444
+ postgresql: () => postgresql,
1445
+ postgresqlDatabase: () => postgresqlDatabase,
1446
+ postgresqlEntity: () => postgresqlEntity,
1447
+ syncthing: () => syncthing,
1448
+ traefikGateway: () => traefikGateway,
1449
+ vaultwarden: () => vaultwarden
1450
+ });
1451
+
1452
+ // src/apps/mariadb.ts
1453
+ import { defineEntity as defineEntity9, defineUnit as defineUnit9, Type as Type9 } from "@highstate/contract";
1454
+
1455
+ // src/restic.ts
1456
+ var restic_exports = {};
1457
+ __export(restic_exports, {
1458
+ repo: () => repo,
1459
+ repoEntity: () => repoEntity
1460
+ });
1461
+ import { defineEntity as defineEntity8, defineUnit as defineUnit8, Type as Type8 } from "@highstate/contract";
1462
+ var repoEntity = defineEntity8({
1463
+ type: "restic.repo",
1464
+ schema: Type8.Object({
1465
+ password: Type8.String(),
1466
+ remoteDomains: Type8.Array(Type8.String()),
1467
+ type: Type8.Literal("rclone"),
1468
+ rcloneConfig: Type8.String(),
1469
+ remoteName: Type8.String(),
1470
+ basePath: Type8.String()
1471
+ }),
1472
+ meta: {
1473
+ color: "#e56901"
1474
+ }
1475
+ });
1476
+ var repo = defineUnit8({
1477
+ type: "restic.repo",
1478
+ args: {
1479
+ remoteDomains: Type8.Optional(Type8.Array(Type8.String())),
1480
+ basePath: Type8.Optional(Type8.String())
1481
+ },
1482
+ secrets: {
1483
+ password: Type8.Optional(Type8.String()),
1484
+ rcloneConfig: Type8.String({ multiline: true })
1485
+ },
1486
+ outputs: {
1487
+ repo: repoEntity
1488
+ },
1489
+ meta: {
1490
+ displayName: "Restic Repo",
1491
+ description: "Holds the configuration for a Restic repository and its remote storage.",
1492
+ primaryIconColor: "#e56901",
1493
+ primaryIcon: "material-symbols:backup"
1494
+ },
1495
+ source: {
1496
+ package: "@highstate/restic",
1497
+ path: "repo"
1498
+ }
1499
+ });
1500
+
1501
+ // src/apps/mariadb.ts
1502
+ var mariadbEntity = defineEntity9({
1503
+ type: "apps.mariadb",
1504
+ schema: Type9.Object({
1505
+ service: Type9.Optional(serviceEntity.schema),
1506
+ host: Type9.String(),
1507
+ port: Type9.Number(),
1508
+ rootPassword: Type9.String()
1509
+ }),
1510
+ meta: {
1511
+ color: "#f06292"
1512
+ }
1513
+ });
1514
+ var mariadb = defineUnit9({
1515
+ type: "apps.mariadb",
1516
+ args: {
1517
+ fqdn: Type9.Optional(Type9.String()),
1518
+ appName: Type9.Optional(Type9.String())
1519
+ },
1520
+ secrets: {
1521
+ rootPassword: Type9.Optional(Type9.String())
1522
+ },
1523
+ inputs: {
1524
+ k8sCluster: clusterEntity2,
1525
+ resticRepo: {
1526
+ entity: repoEntity,
1527
+ required: false
1528
+ },
1529
+ dnsProvider: {
1530
+ entity: providerEntity,
1531
+ required: false
1532
+ }
1533
+ },
1534
+ outputs: {
1535
+ mariadb: mariadbEntity,
1536
+ service: serviceEntity
1537
+ },
1538
+ meta: {
1539
+ displayName: "MariaDB",
1540
+ description: "The MariaDB database deployed on Kubernetes.",
1541
+ primaryIcon: "simple-icons:mariadb",
1542
+ secondaryIcon: "mdi:database"
1543
+ },
1544
+ source: {
1545
+ package: "@highstate/apps",
1546
+ path: "mariadb/app"
1547
+ }
1548
+ });
1549
+ var mariadbDatabase = defineUnit9({
1550
+ type: "apps.mariadb.database",
1551
+ args: {
1552
+ database: Type9.Optional(Type9.String()),
1553
+ username: Type9.Optional(Type9.String())
1554
+ },
1555
+ secrets: {
1556
+ password: Type9.Optional(Type9.String())
1557
+ },
1558
+ inputs: {
1559
+ k8sCluster: clusterEntity2,
1560
+ mariadb: mariadbEntity
1561
+ },
1562
+ meta: {
1563
+ displayName: "MariaDB Database",
1564
+ description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
1565
+ primaryIcon: "simple-icons:mariadb",
1566
+ secondaryIcon: "mdi:database-plus"
1567
+ },
1568
+ source: {
1569
+ package: "@highstate/apps",
1570
+ path: "mariadb/database"
1571
+ }
1572
+ });
1573
+
1574
+ // src/apps/postgresql.ts
1575
+ import { defineEntity as defineEntity10, defineUnit as defineUnit10, Type as Type10 } from "@highstate/contract";
1576
+ var postgresqlEntity = defineEntity10({
1577
+ type: "apps.postgresql",
1578
+ schema: Type10.Object({
1579
+ service: Type10.Optional(serviceEntity.schema),
1580
+ host: Type10.String(),
1581
+ port: Type10.Number(),
1582
+ rootPassword: Type10.String()
1583
+ }),
1584
+ meta: {
1585
+ color: "#336791"
1586
+ }
1587
+ });
1588
+ var postgresql = defineUnit10({
1589
+ type: "apps.postgresql",
1590
+ args: {
1591
+ fqdn: Type10.Optional(Type10.String()),
1592
+ appName: Type10.Optional(Type10.String())
1593
+ },
1594
+ secrets: {
1595
+ rootPassword: Type10.Optional(Type10.String())
1596
+ },
1597
+ inputs: {
1598
+ k8sCluster: clusterEntity2,
1599
+ resticRepo: {
1600
+ entity: repoEntity,
1601
+ required: false
1602
+ },
1603
+ dnsProvider: {
1604
+ entity: providerEntity,
1605
+ required: false
1606
+ }
1607
+ },
1608
+ outputs: {
1609
+ postgresql: postgresqlEntity,
1610
+ service: serviceEntity
1611
+ },
1612
+ meta: {
1613
+ displayName: "PostgreSQL",
1614
+ description: "The PostgreSQL database deployed on Kubernetes.",
1615
+ primaryIcon: "simple-icons:postgresql",
1616
+ secondaryIcon: "mdi:database"
1617
+ },
1618
+ source: {
1619
+ package: "@highstate/apps",
1620
+ path: "postgresql/app"
1621
+ }
1622
+ });
1623
+ var postgresqlDatabase = defineUnit10({
1624
+ type: "apps.postgresql.database",
1625
+ args: {
1626
+ database: Type10.Optional(Type10.String()),
1627
+ username: Type10.Optional(Type10.String())
1628
+ },
1629
+ secrets: {
1630
+ password: Type10.Optional(Type10.String())
1631
+ },
1632
+ inputs: {
1633
+ k8sCluster: clusterEntity2,
1634
+ postgresql: postgresqlEntity
1635
+ },
1636
+ meta: {
1637
+ displayName: "PostgreSQL Database",
1638
+ description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
1639
+ primaryIcon: "simple-icons:postgresql",
1640
+ secondaryIcon: "mdi:database-plus"
1641
+ },
1642
+ source: {
1643
+ package: "@highstate/apps",
1644
+ path: "postgresql/database"
1645
+ }
1646
+ });
1647
+
1648
+ // src/apps/vaultwarden.ts
1649
+ import { defineUnit as defineUnit11, Type as Type11 } from "@highstate/contract";
1650
+ var vaultwarden = defineUnit11({
1651
+ type: "apps.vaultwarden",
1652
+ args: {
1653
+ fqdn: Type11.String(),
1654
+ appName: Type11.Optional(Type11.String())
1655
+ },
1656
+ inputs: {
1657
+ mariadb: mariadbEntity,
1658
+ accessPoint: accessPointEntity,
1659
+ k8sCluster: clusterEntity2
1660
+ },
1661
+ secrets: {
1662
+ mariadbPassword: Type11.Optional(Type11.String())
1663
+ },
1664
+ meta: {
1665
+ displayName: "Vaultwarden",
1666
+ description: "The Vaultwarden password manager deployed on Kubernetes.",
1667
+ primaryIcon: "simple-icons:vaultwarden"
1668
+ },
1669
+ source: {
1670
+ package: "@highstate/apps",
1671
+ path: "vaultwarden"
1672
+ }
1673
+ });
1674
+
1675
+ // src/apps/traefik.ts
1676
+ import { defineUnit as defineUnit12, Type as Type12 } from "@highstate/contract";
1677
+ var traefikGateway = defineUnit12({
1678
+ type: "apps.traefik-gateway",
1679
+ args: {
1680
+ appName: Type12.Optional(Type12.String()),
1681
+ className: Type12.Optional(Type12.String()),
1682
+ serviceType: Type12.Optional(serviceTypeSchema)
1683
+ },
1684
+ inputs: {
1685
+ k8sCluster: clusterEntity2
1686
+ },
1687
+ outputs: {
1688
+ gateway: gatewayEntity,
1689
+ service: serviceEntity
1690
+ },
1691
+ meta: {
1692
+ displayName: "Traefik Gateway",
1693
+ description: "A Traefik gateway for routing traffic to services.",
1694
+ primaryIcon: "simple-icons:traefikproxy"
1695
+ },
1696
+ source: {
1697
+ package: "@highstate/apps",
1698
+ path: "traefik"
1699
+ }
1700
+ });
1701
+
1702
+ // src/apps/kubernetes-dashboard.ts
1703
+ import { defineUnit as defineUnit13, Type as Type13 } from "@highstate/contract";
1704
+ var kubernetesDashboard = defineUnit13({
1705
+ type: "apps.kubernetes-dashboard",
1706
+ args: {
1707
+ fqdn: Type13.String(),
1708
+ appName: Type13.Optional(Type13.String())
1709
+ },
1710
+ inputs: {
1711
+ k8sCluster: clusterEntity2,
1712
+ accessPoint: accessPointEntity
1713
+ },
1714
+ meta: {
1715
+ displayName: "Kubernetes Dashboard",
1716
+ description: "The Kubernetes Dashboard deployed on Kubernetes.",
1717
+ primaryIcon: "simple-icons:kubernetes",
1718
+ secondaryIcon: "mdi:dashboard"
1719
+ },
1720
+ source: {
1721
+ package: "@highstate/apps",
1722
+ path: "kubernetes-dashboard"
1723
+ }
1724
+ });
1725
+
1726
+ // src/apps/grocy.ts
1727
+ import { defineUnit as defineUnit14, Type as Type14 } from "@highstate/contract";
1728
+ var grocy = defineUnit14({
1729
+ type: "apps.grocy",
1730
+ args: {
1731
+ fqdn: Type14.String(),
1732
+ appName: Type14.Optional(Type14.String())
1733
+ },
1734
+ inputs: {
1735
+ resticRepo: {
1736
+ entity: repoEntity,
1737
+ required: false
1738
+ },
1739
+ accessPoint: accessPointEntity,
1740
+ k8sCluster: clusterEntity2
1741
+ },
1742
+ meta: {
1743
+ displayName: "Grocy",
1744
+ description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
1745
+ primaryIcon: "simple-icons:grocy"
1746
+ },
1747
+ source: {
1748
+ package: "@highstate/apps",
1749
+ path: "grocy"
1750
+ }
1751
+ });
1752
+
1753
+ // src/apps/maybe.ts
1754
+ import { defineUnit as defineUnit15, Type as Type15 } from "@highstate/contract";
1755
+ var maybe = defineUnit15({
1756
+ type: "apps.maybe",
1757
+ args: {
1758
+ fqdn: Type15.String(),
1759
+ appName: Type15.Optional(Type15.String())
1760
+ },
1761
+ inputs: {
1762
+ postgresql: postgresqlEntity,
1763
+ accessPoint: accessPointEntity,
1764
+ k8sCluster: clusterEntity2,
1765
+ resticRepo: {
1766
+ entity: repoEntity,
1767
+ required: false
1768
+ }
1769
+ },
1770
+ secrets: {
1771
+ postgresqlPassword: Type15.Optional(Type15.String()),
1772
+ secretKey: Type15.Optional(Type15.String())
1773
+ },
1774
+ meta: {
1775
+ displayName: "Maybe",
1776
+ description: "The OS for your personal finances.",
1777
+ primaryIcon: "arcticons:finance-manager"
1778
+ },
1779
+ source: {
1780
+ package: "@highstate/apps",
1781
+ path: "maybe"
1782
+ }
1783
+ });
1784
+
1785
+ // src/apps/mongodb.ts
1786
+ import { defineEntity as defineEntity11, defineUnit as defineUnit16, Type as Type16 } from "@highstate/contract";
1787
+ var mongodbEntity = defineEntity11({
1788
+ type: "apps.mongodb",
1789
+ schema: Type16.Object({
1790
+ service: Type16.Optional(serviceEntity.schema),
1791
+ host: Type16.String(),
1792
+ port: Type16.Number(),
1793
+ rootPassword: Type16.String()
1794
+ }),
1795
+ meta: {
1796
+ color: "#13aa52"
1797
+ }
1798
+ });
1799
+ var mongodb = defineUnit16({
1800
+ type: "apps.mongodb",
1801
+ args: {
1802
+ fqdn: Type16.Optional(Type16.String()),
1803
+ appName: Type16.Optional(Type16.String()),
1804
+ serviceType: Type16.Optional(serviceTypeSchema)
1805
+ },
1806
+ secrets: {
1807
+ rootPassword: Type16.Optional(Type16.String())
1808
+ },
1809
+ inputs: {
1810
+ k8sCluster: clusterEntity2,
1811
+ resticRepo: {
1812
+ entity: repoEntity,
1813
+ required: false
1814
+ },
1815
+ dnsProvider: {
1816
+ entity: providerEntity,
1817
+ required: false
1818
+ }
1819
+ },
1820
+ outputs: {
1821
+ mongodb: mongodbEntity,
1822
+ service: serviceEntity
1823
+ },
1824
+ meta: {
1825
+ displayName: "MongoDB",
1826
+ description: "The MongoDB instance deployed on Kubernetes.",
1827
+ primaryIcon: "simple-icons:mongodb",
1828
+ secondaryIcon: "mdi:database"
1829
+ },
1830
+ source: {
1831
+ package: "@highstate/apps",
1832
+ path: "mongodb/app"
1833
+ }
1834
+ });
1835
+ var mongodbDatabase = defineUnit16({
1836
+ type: "apps.mongodb.database",
1837
+ args: {
1838
+ database: Type16.Optional(Type16.String()),
1839
+ username: Type16.Optional(Type16.String())
1840
+ },
1841
+ secrets: {
1842
+ password: Type16.Optional(Type16.String())
1843
+ },
1844
+ inputs: {
1845
+ k8sCluster: clusterEntity2,
1846
+ mongodb: mongodbEntity
1847
+ },
1848
+ meta: {
1849
+ displayName: "MongoDB Database",
1850
+ description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
1851
+ primaryIcon: "simple-icons:mongodb",
1852
+ secondaryIcon: "mdi:database-plus"
1853
+ },
1854
+ source: {
1855
+ package: "@highstate/apps",
1856
+ path: "mongodb/database"
1857
+ }
1858
+ });
1859
+
1860
+ // src/apps/deployment.ts
1861
+ import { defineUnit as defineUnit17, Type as Type17 } from "@highstate/contract";
1862
+ var deployment = defineUnit17({
1863
+ type: "apps.deployment",
1864
+ args: {
1865
+ appName: Type17.Optional(Type17.String()),
1866
+ fqdn: Type17.Optional(Type17.String()),
1867
+ serviceType: Type17.Optional(serviceTypeSchema),
1868
+ image: Type17.Optional(Type17.String()),
1869
+ port: Type17.Optional(Type17.Number()),
1870
+ replicas: Type17.Optional(Type17.Number()),
1871
+ dataPath: Type17.Optional(Type17.String()),
1872
+ env: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1873
+ mariadbEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1874
+ postgresqlEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1875
+ mongodbEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1876
+ manifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1877
+ serviceManifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
1878
+ httpRouteManifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any()))
1879
+ },
1880
+ inputs: {
1881
+ k8sCluster: clusterEntity2,
1882
+ mariadb: {
1883
+ entity: mariadbEntity,
1884
+ required: false
1885
+ },
1886
+ postgresql: {
1887
+ entity: postgresqlEntity,
1888
+ required: false
1889
+ },
1890
+ mongodb: {
1891
+ entity: mongodbEntity,
1892
+ required: false
1893
+ },
1894
+ resticRepo: {
1895
+ entity: repoEntity,
1896
+ required: false
1897
+ },
1898
+ dnsProvider: {
1899
+ entity: providerEntity,
1900
+ required: false
1901
+ }
1902
+ },
1903
+ outputs: {
1904
+ deployment: deploymentEntity,
1905
+ service: serviceEntity
1906
+ },
1907
+ secrets: {
1908
+ mariadbPassword: Type17.Optional(Type17.String()),
1909
+ postgresqlPassword: Type17.Optional(Type17.String()),
1910
+ mongodbPassword: Type17.Optional(Type17.String())
1911
+ },
1912
+ meta: {
1913
+ displayName: "Kubernetes Deployment",
1914
+ description: "A generic Kubernetes deployment with optional service and gateway routes.",
1915
+ primaryIcon: "mdi:kubernetes",
1916
+ secondaryIcon: "mdi:cube-outline"
1917
+ },
1918
+ source: {
1919
+ package: "@highstate/apps",
1920
+ path: "deployment"
1921
+ }
1922
+ });
1923
+
1924
+ // src/apps/syncthing.ts
1925
+ import { defineUnit as defineUnit18, Type as Type18 } from "@highstate/contract";
1926
+ var backupModeSchema = Type18.Union([Type18.Literal("metadata"), Type18.Literal("full")]);
1927
+ var syncthing = defineUnit18({
1928
+ type: "apps.syncthing",
1929
+ args: {
1930
+ fqdn: Type18.String(),
1931
+ deviceFqdn: Type18.Optional(Type18.String()),
1932
+ appName: Type18.Optional(Type18.String()),
1933
+ backupMode: Type18.Optional({ ...backupModeSchema, default: "metadata" })
1934
+ },
1935
+ inputs: {
1936
+ accessPoint: accessPointEntity,
1937
+ k8sCluster: clusterEntity2,
1938
+ resticRepo: {
1939
+ entity: repoEntity,
1940
+ required: false
1941
+ },
1942
+ volume: {
1943
+ entity: persistentVolumeClaimEntity,
1944
+ required: false
1945
+ }
1946
+ },
1947
+ outputs: {
1948
+ service: serviceEntity,
1949
+ volume: persistentVolumeClaimEntity
1950
+ },
1951
+ meta: {
1952
+ displayName: "Syncthing",
1953
+ description: "The Syncthing instance deployed on Kubernetes.",
1954
+ primaryIcon: "simple-icons:syncthing"
1955
+ },
1956
+ source: {
1957
+ package: "@highstate/apps",
1958
+ path: "syncthing"
1959
+ }
1960
+ });
1961
+
1962
+ // src/apps/code-server.ts
1963
+ import { defineUnit as defineUnit19, Type as Type19 } from "@highstate/contract";
1964
+ var codeServer = defineUnit19({
1965
+ type: "apps.code-server",
1966
+ args: {
1967
+ fqdn: Type19.String(),
1968
+ appName: Type19.Optional(Type19.String())
1969
+ },
1970
+ secrets: {
1971
+ password: Type19.Optional(Type19.String()),
1972
+ sudoPassword: Type19.Optional(Type19.String())
1973
+ },
1974
+ inputs: {
1975
+ accessPoint: accessPointEntity,
1976
+ k8sCluster: clusterEntity2,
1977
+ resticRepo: {
1978
+ entity: repoEntity,
1979
+ required: false
1980
+ },
1981
+ volume: {
1982
+ entity: persistentVolumeClaimEntity,
1983
+ required: false
1984
+ }
1985
+ },
1986
+ outputs: {
1987
+ statefulSet: statefulSetEntity,
1988
+ volume: persistentVolumeClaimEntity
1989
+ },
1990
+ meta: {
1991
+ displayName: "Code Server",
1992
+ description: "The Code Server instance deployed on Kubernetes.",
1993
+ primaryIcon: "material-icon-theme:vscode"
1994
+ },
1995
+ source: {
1996
+ package: "@highstate/apps",
1997
+ path: "code-server"
1998
+ }
1999
+ });
2000
+
2001
+ // src/cloudflare.ts
2002
+ var cloudflare_exports = {};
2003
+ __export(cloudflare_exports, {
2004
+ connection: () => connection2
2005
+ });
2006
+ import { defineUnit as defineUnit20, Type as Type20 } from "@highstate/contract";
2007
+ var connection2 = defineUnit20({
2008
+ type: "cloudflare.connection",
2009
+ secrets: {
2010
+ apiToken: Type20.String()
2011
+ },
2012
+ outputs: {
2013
+ dnsProvider: providerEntity
2014
+ },
2015
+ meta: {
2016
+ displayName: "Cloudflare Connection",
2017
+ description: "Creates a new Cloudflare connection for one zone.",
2018
+ primaryIcon: "simple-icons:cloudflare"
2019
+ },
2020
+ source: {
2021
+ package: "@highstate/cloudflare",
2022
+ path: "connection"
2023
+ }
2024
+ });
2025
+
2026
+ // src/k3s.ts
2027
+ var k3s_exports = {};
2028
+ __export(k3s_exports, {
2029
+ cluster: () => cluster2
2030
+ });
2031
+ import { defineUnit as defineUnit21 } from "@highstate/contract";
2032
+ var cluster2 = defineUnit21({
2033
+ type: "k3s.cluster",
2034
+ inputs: {
2035
+ server: serverEntity
2036
+ },
2037
+ outputs: {
2038
+ k8sCluster: clusterEntity2
2039
+ },
2040
+ meta: {
2041
+ displayName: "K3s Cluster",
2042
+ description: "The K3s cluster created on top of the server.",
2043
+ category: "k3s",
2044
+ primaryIcon: "devicon:k3s",
2045
+ secondaryIcon: "devicon:kubernetes"
2046
+ },
2047
+ source: {
2048
+ package: "@highstate/k3s",
2049
+ path: "cluster"
2050
+ }
2051
+ });
2052
+
2053
+ // src/mullvad.ts
2054
+ var mullvad_exports = {};
2055
+ __export(mullvad_exports, {
2056
+ endpointType: () => endpointType,
2057
+ peer: () => peer2
2058
+ });
2059
+ import { defineUnit as defineUnit22, Type as Type21 } from "@highstate/contract";
2060
+ var endpointType = Type21.Union([
2061
+ Type21.Literal("fqdn"),
2062
+ Type21.Literal("ipv4"),
2063
+ Type21.Literal("ipv6")
2064
+ ]);
2065
+ var peer2 = defineUnit22({
2066
+ type: "mullvad.peer",
2067
+ args: {
2068
+ hostname: Type21.Optional(Type21.String()),
2069
+ endpointType: Type21.Optional({ ...endpointType, default: "fqdn" })
2070
+ },
2071
+ inputs: {
2072
+ /**
2073
+ * The network to use for the WireGuard peer.
2074
+ *
2075
+ * If not provided, the peer will use default network configuration.
2076
+ */
2077
+ network: {
2078
+ entity: networkEntity,
2079
+ required: false
2080
+ }
2081
+ },
2082
+ outputs: {
2083
+ peer: peerEntity
2084
+ },
2085
+ meta: {
2086
+ displayName: "Mullvad Peer",
2087
+ description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
2088
+ primaryIcon: "simple-icons:mullvad",
2089
+ secondaryIcon: "cib:wireguard",
2090
+ secondaryIconColor: "#88171a"
2091
+ },
2092
+ source: {
2093
+ package: "@highstate/mullvad",
2094
+ path: "peer"
2095
+ }
2096
+ });
2097
+ export {
2098
+ apps_exports as apps,
2099
+ cloudflare_exports as cloudflare,
2100
+ common_exports as common,
2101
+ dns_exports as dns,
2102
+ k3s_exports as k3s,
2103
+ k8s_exports as k8s,
2104
+ mullvad_exports as mullvad,
2105
+ proxmox_exports as proxmox,
2106
+ restic_exports as restic,
2107
+ ssh_exports as ssh,
2108
+ talos_exports as talos,
2109
+ wireguard_exports as wireguard
2110
+ };
2111
+ //# sourceMappingURL=index.js.map