@highstate/library 0.9.3 → 0.9.5

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
@@ -11,12 +11,13 @@ __export(common_exports, {
11
11
  fileContentEntity: () => fileContentEntity,
12
12
  fileEntity: () => fileEntity,
13
13
  fileMetaEntity: () => fileMetaEntity,
14
- l3EndpointEntity: () => l3EndpointEntity,
15
- l4EndpointEntity: () => l4EndpointEntity,
16
14
  script: () => script,
17
- serverEntity: () => serverEntity
15
+ serverDns: () => serverDns,
16
+ serverEntity: () => serverEntity,
17
+ serverOutputs: () => serverOutputs,
18
+ serverPatch: () => serverPatch
18
19
  });
19
- import { defineEntity as defineEntity2, defineUnit as defineUnit2, Type as Type2 } from "@highstate/contract";
20
+ import { defineEntity as defineEntity4, defineUnit as defineUnit3, Type as Type5 } from "@highstate/contract";
20
21
 
21
22
  // src/ssh.ts
22
23
  var ssh_exports = {};
@@ -26,34 +27,171 @@ __export(ssh_exports, {
26
27
  keyPairEntity: () => keyPairEntity,
27
28
  keyTypeSchema: () => keyTypeSchema
28
29
  });
30
+ import { defineEntity as defineEntity2, defineUnit as defineUnit2, Type as Type2 } from "@highstate/contract";
31
+
32
+ // src/network.ts
33
+ var network_exports = {};
34
+ __export(network_exports, {
35
+ endpointFilterSchema: () => endpointFilterSchema,
36
+ endpointVisibilitySchema: () => endpointVisibilitySchema,
37
+ l3Endpoint: () => l3Endpoint,
38
+ l3EndpointEntity: () => l3EndpointEntity,
39
+ l4Endpoint: () => l4Endpoint,
40
+ l4EndpointEntity: () => l4EndpointEntity,
41
+ l4ProtocolSchema: () => l4ProtocolSchema,
42
+ portInfoSchema: () => portInfoSchema
43
+ });
29
44
  import { defineEntity, defineUnit, Type } from "@highstate/contract";
30
- var keyTypeSchema = Type.Union([
31
- //
32
- Type.Literal("rsa"),
33
- Type.Literal("ed25519")
45
+ var endpointVisibilitySchema = Type.StringEnum([
46
+ "public",
47
+ // Reachable from the public internet
48
+ "external",
49
+ // Reachable from outside the system boundary, but not public
50
+ "internal"
51
+ // Reachable only from within the system or cluster
34
52
  ]);
35
- var keyPairEntity = defineEntity({
53
+ var endpointFilterSchema = Type.Array(endpointVisibilitySchema);
54
+ var l3EndpointEntity = defineEntity({
55
+ type: "network.l3-endpoint",
56
+ schema: Type.Intersect([
57
+ Type.Object({
58
+ visibility: endpointVisibilitySchema,
59
+ metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown()))
60
+ }),
61
+ Type.Union([
62
+ Type.Object({
63
+ type: Type.Literal("hostname"),
64
+ /**
65
+ * The hostname of the endpoint in the format of a domain name.
66
+ */
67
+ hostname: Type.String()
68
+ }),
69
+ Type.Object({
70
+ type: Type.Literal("ipv4"),
71
+ /**
72
+ * The IPv4 address of the endpoint.
73
+ */
74
+ address: Type.String()
75
+ }),
76
+ Type.Object({
77
+ type: Type.Literal("ipv6"),
78
+ /**
79
+ * The IPv6 address of the endpoint.
80
+ */
81
+ address: Type.String()
82
+ })
83
+ ])
84
+ ]),
85
+ meta: {
86
+ color: "#4CAF50",
87
+ description: "The L3 endpoint for some service. May be a domain name or an IP address."
88
+ }
89
+ });
90
+ var l4ProtocolSchema = Type.StringEnum(["tcp", "udp"]);
91
+ var portInfoSchema = Type.Object({
92
+ port: Type.Number(),
93
+ protocol: l4ProtocolSchema
94
+ });
95
+ var l4EndpointEntity = defineEntity({
96
+ type: "network.l4-endpoint",
97
+ schema: Type.Intersect([l3EndpointEntity.schema, portInfoSchema]),
98
+ meta: {
99
+ color: "#2196F3",
100
+ description: "The L4 endpoint for some service. Extends an L3 endpoint with a port."
101
+ }
102
+ });
103
+ var l3Endpoint = defineUnit({
104
+ type: "network.l3-endpoint",
105
+ args: {
106
+ /**
107
+ * The string representation of the endpoint.
108
+ *
109
+ * May be a domain name or an IP address.
110
+ */
111
+ endpoint: Type.String(),
112
+ /**
113
+ * The visibility of the endpoint.
114
+ */
115
+ visibility: Type.Default(endpointVisibilitySchema, "public")
116
+ },
117
+ outputs: {
118
+ endpoint: l3EndpointEntity
119
+ },
120
+ meta: {
121
+ displayName: "L3 Endpoint",
122
+ description: "An L3 endpoint for some service. May be a domain name or an IP address.",
123
+ primaryIcon: "mdi:network-outline",
124
+ primaryIconColor: "#4CAF50",
125
+ defaultNamePrefix: "endpoint",
126
+ category: "Network"
127
+ },
128
+ source: {
129
+ package: "@highstate/common",
130
+ path: "units/network/l3-endpoint"
131
+ }
132
+ });
133
+ var l4Endpoint = defineUnit({
134
+ type: "network.l4-endpoint",
135
+ args: {
136
+ /**
137
+ * The string representation of the endpoint.
138
+ *
139
+ * May be a domain name or an IP address + port/protocol.
140
+ *
141
+ * The possible formats are:
142
+ *
143
+ * - `endpoint:port` (TCP by default)
144
+ * - `tcp://endpoint:port`
145
+ * - `udp://endpoint:port`
146
+ */
147
+ endpoint: Type.String(),
148
+ /**
149
+ * The visibility of the endpoint.
150
+ */
151
+ visibility: Type.Default(endpointVisibilitySchema, "public")
152
+ },
153
+ outputs: {
154
+ endpoint: l4EndpointEntity
155
+ },
156
+ meta: {
157
+ displayName: "L4 Endpoint",
158
+ description: "An L4 endpoint for some service. Extends an L3 endpoint with a port.",
159
+ primaryIcon: "mdi:network-outline",
160
+ primaryIconColor: "#2196F3",
161
+ defaultNamePrefix: "endpoint",
162
+ category: "Network"
163
+ },
164
+ source: {
165
+ package: "@highstate/common",
166
+ path: "units/network/l4-endpoint"
167
+ }
168
+ });
169
+
170
+ // src/ssh.ts
171
+ var keyTypeSchema = Type2.StringEnum(["ed25519"]);
172
+ var keyPairEntity = defineEntity2({
36
173
  type: "ssh.key-pair",
37
- schema: Type.Object({
174
+ schema: Type2.Object({
38
175
  type: keyTypeSchema,
39
- privateKey: Type.String(),
40
- publicKey: Type.String()
176
+ fingerprint: Type2.String(),
177
+ publicKey: Type2.String(),
178
+ privateKey: Type2.String()
41
179
  }),
42
180
  meta: {
43
181
  color: "#2b5797"
44
182
  }
45
183
  });
46
- var credentialsSchema = Type.Object({
47
- endpoint: Type.Optional(Type.String()),
48
- user: Type.Optional(Type.String()),
49
- port: Type.Optional(Type.Number()),
50
- password: Type.Optional(Type.String()),
51
- privateKey: Type.Optional(Type.String())
184
+ var credentialsSchema = Type2.Object({
185
+ endpoints: Type2.Array(l4EndpointEntity.schema),
186
+ hostKey: Type2.String(),
187
+ user: Type2.String(),
188
+ password: Type2.Optional(Type2.String()),
189
+ keyPair: Type2.Optional(keyPairEntity.schema)
52
190
  });
53
- var keyPair = defineUnit({
191
+ var keyPair = defineUnit2({
54
192
  type: "ssh.key-pair",
55
193
  secrets: {
56
- privateKey: Type.Optional(Type.String())
194
+ privateKey: Type2.Optional(Type2.String())
57
195
  },
58
196
  outputs: {
59
197
  keyPair: keyPairEntity
@@ -69,80 +207,291 @@ var keyPair = defineUnit({
69
207
  },
70
208
  source: {
71
209
  package: "@highstate/common",
72
- path: "ssh/key-pair"
210
+ path: "units/ssh/key-pair"
73
211
  }
74
212
  });
75
213
 
76
- // src/common.ts
77
- var serverEntity = defineEntity2({
78
- type: "common.server",
79
- schema: Type2.Object({
80
- endpoint: Type2.String(),
81
- hostname: Type2.String(),
82
- sshCredentials: Type2.Optional(credentialsSchema)
214
+ // src/dns.ts
215
+ var dns_exports = {};
216
+ __export(dns_exports, {
217
+ createArgs: () => createArgs,
218
+ inputs: () => inputs,
219
+ providerEntity: () => providerEntity
220
+ });
221
+ import { defineEntity as defineEntity3, Type as Type4 } from "@highstate/contract";
222
+
223
+ // src/utils.ts
224
+ import { Type as Type3 } from "@highstate/contract";
225
+ function prefixWith(string, prefix) {
226
+ return prefix ? `${prefix}${string.charAt(0).toUpperCase()}${string.slice(1)}` : string;
227
+ }
228
+ function prefixKeysWith(prefix, obj) {
229
+ return Object.fromEntries(
230
+ Object.entries(obj).map(([key, value]) => [prefixWith(key, prefix), value])
231
+ );
232
+ }
233
+ var arrayPatchModeSchema = Type3.StringEnum(["prepend", "replace"]);
234
+
235
+ // src/dns.ts
236
+ var providerEntity = defineEntity3({
237
+ type: "dns.provider",
238
+ schema: Type4.Object({
239
+ name: Type4.String(),
240
+ type: Type4.String(),
241
+ data: Type4.Record(Type4.String(), Type4.Unknown()),
242
+ domain: Type4.String()
83
243
  }),
84
244
  meta: {
85
- color: "#009688"
245
+ color: "#FF5722"
86
246
  }
87
247
  });
88
- var l3EndpointEntity = defineEntity2({
89
- type: "common.l3-endpoint",
90
- schema: Type2.Object({
91
- endpoint: Type2.String()
92
- }),
93
- meta: {
94
- color: "#1B5E20",
95
- description: "The L3 endpoint for some service. May be a domain name or an IP address."
248
+ function createArgs(prefix) {
249
+ return prefixKeysWith(prefix, {
250
+ /**
251
+ * The FQDN to register the existing endpoints with.
252
+ *
253
+ * Will be inserted at the beginning of the resulting endpoint list.
254
+ *
255
+ * Will throw an error if no matching provider is found.
256
+ *
257
+ * @schema
258
+ */
259
+ fqdn: {
260
+ ...Type4.Optional(Type4.String()),
261
+ description: `The FQDN to register the existing endpoints with.
262
+
263
+ Will be inserted at the beginning of the resulting endpoint list.
264
+
265
+ Will throw an error if no matching provider is found.`
266
+ },
267
+ /**
268
+ * The endpoint filter to filter the endpoints before creating the DNS records.
269
+ *
270
+ * Possible values:
271
+ *
272
+ * - `public`: Only endpoints exposed to the public internet.
273
+ * - `external`: Reachable from outside the system but not public (e.g., LAN, VPC).
274
+ * - `internal`: Reachable only from within the system boundary (e.g., inside a cluster).
275
+ *
276
+ * You can select one or more values.
277
+ *
278
+ * If no value is provided, the endpoints will be filtered by the most accessible type:
279
+ *
280
+ * - If any public endpoints exist, all public endpoints are selected;
281
+ * - Otherwise, if any external endpoints exist, all external endpoints are selected;
282
+ * - If neither exist, all internal endpoints are selected.
283
+ *
284
+ * @schema
285
+ */
286
+ endpointFilter: {
287
+ ...Type4.Default(endpointFilterSchema, []),
288
+ description: `The endpoint filter to filter the endpoints before creating the DNS records.
289
+
290
+ Possible values:
291
+
292
+ - \`public\`: Only endpoints exposed to the public internet.
293
+ - \`external\`: Reachable from outside the system but not public (e.g., LAN, VPC).
294
+ - \`internal\`: Reachable only from within the system boundary (e.g., inside a cluster).
295
+
296
+ You can select one or more values.
297
+
298
+ If no value is provided, the endpoints will be filtered by the most accessible type:
299
+
300
+ - If any public endpoints exist, all public endpoints are selected;
301
+ - Otherwise, if any external endpoints exist, all external endpoints are selected;
302
+ - If neither exist, all internal endpoints are selected.`
303
+ },
304
+ /**
305
+ * The mode to use for patching the existing endpoints.
306
+ *
307
+ * - `prepend`: Prepend the FQDN to the existing endpoints. It will make them prioritized.
308
+ * - `replace`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.
309
+ *
310
+ * The default is `prepend`.
311
+ *
312
+ * @schema
313
+ */
314
+ patchMode: {
315
+ ...Type4.Default(arrayPatchModeSchema, "prepend"),
316
+ description: `The mode to use for patching the existing endpoints.
317
+
318
+ - \`prepend\`: Prepend the FQDN to the existing endpoints. It will make them prioritized.
319
+ - \`replace\`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.
320
+
321
+ The default is \`prepend\`.`
322
+ }
323
+ });
324
+ }
325
+ var inputs = {
326
+ /**
327
+ * The DNS providers to use to create the DNS records.
328
+ *
329
+ * If multiple providers match the domain, all of them will be used and multiple DNS records will be created.
330
+ *
331
+ * @schema
332
+ */
333
+ dnsProviders: {
334
+ ...{
335
+ entity: providerEntity,
336
+ multiple: true
337
+ },
338
+ description: `The DNS providers to use to create the DNS records.
339
+
340
+ If multiple providers match the domain, all of them will be used and multiple DNS records will be created.`
96
341
  }
97
- });
98
- var l4EndpointEntity = defineEntity2({
99
- type: "common.l4-endpoint",
100
- schema: Type2.Object({
101
- endpoint: Type2.String(),
102
- port: Type2.Number()
342
+ };
343
+
344
+ // src/common.ts
345
+ var serverEntity = defineEntity4({
346
+ type: "common.server",
347
+ schema: Type5.Object({
348
+ hostname: Type5.String(),
349
+ endpoints: Type5.Array(l3EndpointEntity.schema),
350
+ ssh: Type5.Optional(credentialsSchema)
103
351
  }),
104
352
  meta: {
105
- color: "#F57F17",
106
- description: "The L4 endpoint for some service. Extends an L3 endpoint with a port."
353
+ color: "#009688"
107
354
  }
108
355
  });
109
- var existingServer = defineUnit2({
356
+ var serverOutputs = {
357
+ server: serverEntity,
358
+ endpoints: {
359
+ entity: l3EndpointEntity,
360
+ multiple: true
361
+ }
362
+ };
363
+ var existingServer = defineUnit3({
110
364
  type: "common.existing-server",
111
365
  args: {
112
- endpoint: Type2.String(),
113
- sshUser: Type2.Optional(Type2.String({ default: "root" })),
114
- sshPort: Type2.Optional(Type2.Number({ default: 22 }))
366
+ /**
367
+ * The endpoint of the server.
368
+ *
369
+ * Takes precedence over the `endpoint` input.
370
+ */
371
+ endpoint: Type5.Optional(Type5.String()),
372
+ /**
373
+ * The SSH user to use for connecting to the server.
374
+ */
375
+ sshUser: Type5.Default(Type5.String(), "root"),
376
+ /**
377
+ * The SSH port to use for connecting to the server.
378
+ */
379
+ sshPort: Type5.Default(Type5.Number(), 22)
115
380
  },
116
381
  secrets: {
117
- sshPassword: Type2.Optional(Type2.String()),
118
- sshPrivateKey: Type2.Optional(Type2.String())
382
+ sshPassword: Type5.Optional(Type5.String()),
383
+ sshPrivateKey: Type5.Optional(Type5.String())
119
384
  },
120
385
  inputs: {
121
386
  sshKeyPair: {
122
387
  entity: keyPairEntity,
123
388
  required: false
389
+ },
390
+ endpoint: {
391
+ entity: l3EndpointEntity,
392
+ required: false
124
393
  }
125
394
  },
126
- outputs: {
127
- server: serverEntity
128
- },
395
+ outputs: serverOutputs,
129
396
  meta: {
130
397
  displayName: "Existing Server",
131
398
  description: "An existing server that can be used in the configuration.",
132
399
  primaryIcon: "mdi:server",
133
- defaultNamePrefix: "server"
400
+ defaultNamePrefix: "server",
401
+ category: "Infrastructure"
402
+ },
403
+ source: {
404
+ package: "@highstate/common",
405
+ path: "units/existing-server"
406
+ }
407
+ });
408
+ var serverPatch = defineUnit3({
409
+ type: "common.server-patch",
410
+ args: {
411
+ /**
412
+ * The endpoints of the server.
413
+ *
414
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
415
+ *
416
+ * The same server may also be represented by multiple entries (e.g. a node with private and public IP).
417
+ *
418
+ * @schema
419
+ */
420
+ endpoints: {
421
+ ...Type5.Default(Type5.Array(Type5.String()), []),
422
+ description: `The endpoints of the server.
423
+
424
+ The entry may represent real node endpoint or virtual endpoint (like a load balancer).
425
+
426
+ The same server may also be represented by multiple entries (e.g. a node with private and public IP).`
427
+ },
428
+ /**
429
+ * The mode to use for patching the endpoints.
430
+ *
431
+ * - `prepend`: prepend the new endpoints to the existing ones (default);
432
+ * - `replace`: replace the existing endpoints with the new ones.
433
+ */
434
+ endpointsPatchMode: Type5.Default(arrayPatchModeSchema, "prepend")
435
+ },
436
+ inputs: {
437
+ server: serverEntity,
438
+ endpoints: {
439
+ entity: l3EndpointEntity,
440
+ required: false,
441
+ multiple: true
442
+ }
443
+ },
444
+ outputs: {
445
+ server: serverEntity,
446
+ endpoints: {
447
+ entity: l3EndpointEntity,
448
+ multiple: true
449
+ }
450
+ },
451
+ meta: {
452
+ displayName: "Server Patch",
453
+ description: "Patches some properties of the server.",
454
+ primaryIcon: "mdi:server",
455
+ secondaryIcon: "fluent:patch-20-filled",
456
+ category: "Infrastructure"
457
+ },
458
+ source: {
459
+ package: "@highstate/common",
460
+ path: "units/server-patch"
461
+ }
462
+ });
463
+ var serverDns = defineUnit3({
464
+ type: "common.server-dns",
465
+ args: createArgs(),
466
+ inputs: {
467
+ server: serverEntity,
468
+ ...inputs
469
+ },
470
+ outputs: {
471
+ server: serverEntity,
472
+ endpoints: {
473
+ entity: l3EndpointEntity,
474
+ multiple: true
475
+ }
476
+ },
477
+ meta: {
478
+ displayName: "Server DNS",
479
+ description: "Creates DNS records for the server and updates endpoints.",
480
+ primaryIcon: "mdi:server",
481
+ secondaryIcon: "mdi:dns",
482
+ category: "Infrastructure"
134
483
  },
135
484
  source: {
136
485
  package: "@highstate/common",
137
- path: "existing-server"
486
+ path: "units/server-dns"
138
487
  }
139
488
  });
140
- var script = defineUnit2({
489
+ var script = defineUnit3({
141
490
  type: "common.script",
142
491
  args: {
143
- script: Type2.String({ language: "shell" }),
144
- updateScript: Type2.Optional(Type2.String({ language: "shell" })),
145
- deleteScript: Type2.Optional(Type2.String({ language: "shell" }))
492
+ script: Type5.String({ language: "shell" }),
493
+ updateScript: Type5.Optional(Type5.String({ language: "shell" })),
494
+ deleteScript: Type5.Optional(Type5.String({ language: "shell" }))
146
495
  },
147
496
  inputs: {
148
497
  server: serverEntity
@@ -153,36 +502,37 @@ var script = defineUnit2({
153
502
  meta: {
154
503
  displayName: "Shell Script",
155
504
  description: "Run a shell script on the server.",
156
- primaryIcon: "mdi:bash"
505
+ primaryIcon: "mdi:bash",
506
+ category: "Infrastructure"
157
507
  },
158
508
  source: {
159
509
  package: "@highstate/common",
160
- path: "script"
510
+ path: "units/script"
161
511
  }
162
512
  });
163
- var fileMetaEntity = defineEntity2({
513
+ var fileMetaEntity = defineEntity4({
164
514
  type: "common.file-meta",
165
- schema: Type2.Object({
166
- name: Type2.String(),
167
- size: Type2.Number(),
168
- isBinary: Type2.Optional(Type2.Boolean()),
169
- isExecutable: Type2.Optional(Type2.Boolean())
515
+ schema: Type5.Object({
516
+ name: Type5.String(),
517
+ size: Type5.Number(),
518
+ mode: Type5.Number(),
519
+ isBinary: Type5.Optional(Type5.Boolean())
170
520
  }),
171
521
  meta: {
172
522
  color: "#FF5722",
173
523
  description: "Metadata for a file."
174
524
  }
175
525
  });
176
- var fileContentEntity = defineEntity2({
526
+ var fileContentEntity = defineEntity4({
177
527
  type: "common.file-content",
178
- schema: Type2.Union([
179
- Type2.Object({
180
- type: Type2.Literal("inline"),
181
- content: Type2.String()
528
+ schema: Type5.Union([
529
+ Type5.Object({
530
+ type: Type5.Literal("inline"),
531
+ content: Type5.String()
182
532
  }),
183
- Type2.Object({
184
- type: Type2.Literal("remote"),
185
- url: Type2.String()
533
+ Type5.Object({
534
+ type: Type5.Literal("remote"),
535
+ url: Type5.String()
186
536
  })
187
537
  ]),
188
538
  meta: {
@@ -190,9 +540,9 @@ var fileContentEntity = defineEntity2({
190
540
  description: "The content of a file."
191
541
  }
192
542
  });
193
- var fileEntity = defineEntity2({
543
+ var fileEntity = defineEntity4({
194
544
  type: "common.file",
195
- schema: Type2.Object({
545
+ schema: Type5.Object({
196
546
  meta: fileMetaEntity.schema,
197
547
  content: fileContentEntity.schema
198
548
  }),
@@ -211,43 +561,43 @@ __export(proxmox_exports, {
211
561
  imageEntity: () => imageEntity,
212
562
  virtualMachine: () => virtualMachine
213
563
  });
214
- import { defineEntity as defineEntity3, defineUnit as defineUnit3, Type as Type3 } from "@highstate/contract";
215
- var clusterEntity = defineEntity3({
564
+ import { defineEntity as defineEntity5, defineUnit as defineUnit4, Type as Type6 } from "@highstate/contract";
565
+ var clusterEntity = defineEntity5({
216
566
  type: "proxmox.cluster",
217
- schema: Type3.Object({
218
- endpoint: Type3.String(),
219
- insecure: Type3.Optional(Type3.Boolean()),
220
- username: Type3.Optional(Type3.String()),
221
- defaultNodeName: Type3.String(),
222
- defaultDatastoreId: Type3.String(),
223
- password: Type3.Optional(Type3.String()),
224
- apiToken: Type3.Optional(Type3.String())
567
+ schema: Type6.Object({
568
+ endpoint: Type6.String(),
569
+ insecure: Type6.Optional(Type6.Boolean()),
570
+ username: Type6.Optional(Type6.String()),
571
+ defaultNodeName: Type6.String(),
572
+ defaultDatastoreId: Type6.String(),
573
+ password: Type6.Optional(Type6.String()),
574
+ apiToken: Type6.Optional(Type6.String())
225
575
  }),
226
576
  meta: {
227
577
  color: "#e56901"
228
578
  }
229
579
  });
230
- var imageEntity = defineEntity3({
580
+ var imageEntity = defineEntity5({
231
581
  type: "proxmox.image",
232
- schema: Type3.Object({
233
- id: Type3.String()
582
+ schema: Type6.Object({
583
+ id: Type6.String()
234
584
  }),
235
585
  meta: {
236
586
  color: "#e56901"
237
587
  }
238
588
  });
239
- var connection = defineUnit3({
589
+ var connection = defineUnit4({
240
590
  type: "proxmox.connection",
241
591
  args: {
242
- endpoint: Type3.String(),
243
- insecure: Type3.Optional(Type3.Boolean()),
244
- username: Type3.Optional(Type3.String()),
245
- defaultNodeName: Type3.Optional(Type3.String()),
246
- defaultDatastoreId: Type3.Optional(Type3.String())
592
+ endpoint: Type6.String(),
593
+ insecure: Type6.Optional(Type6.Boolean()),
594
+ username: Type6.Optional(Type6.String()),
595
+ defaultNodeName: Type6.Optional(Type6.String()),
596
+ defaultDatastoreId: Type6.Optional(Type6.String())
247
597
  },
248
598
  secrets: {
249
- password: Type3.Optional(Type3.String()),
250
- apiToken: Type3.Optional(Type3.String())
599
+ password: Type6.Optional(Type6.String()),
600
+ apiToken: Type6.Optional(Type6.String())
251
601
  },
252
602
  outputs: {
253
603
  proxmoxCluster: clusterEntity
@@ -257,21 +607,20 @@ var connection = defineUnit3({
257
607
  description: "The connection to an existing Proxmox cluster.",
258
608
  category: "Proxmox",
259
609
  primaryIcon: "simple-icons:proxmox",
260
- primaryIconColor: "#e56901",
261
- secondaryIcon: "codicon:vm"
610
+ primaryIconColor: "#e56901"
262
611
  },
263
612
  source: {
264
613
  package: "@highstate/proxmox",
265
614
  path: "connection"
266
615
  }
267
616
  });
268
- var image = defineUnit3({
617
+ var image = defineUnit4({
269
618
  type: "proxmox.image",
270
619
  args: {
271
- url: Type3.String(),
272
- nodeName: Type3.Optional(Type3.String()),
273
- sha256: Type3.Optional(Type3.String()),
274
- datastoreId: Type3.Optional(Type3.String())
620
+ url: Type6.String(),
621
+ nodeName: Type6.Optional(Type6.String()),
622
+ sha256: Type6.Optional(Type6.String()),
623
+ datastoreId: Type6.Optional(Type6.String())
275
624
  },
276
625
  inputs: {
277
626
  proxmoxCluster: clusterEntity
@@ -292,10 +641,13 @@ var image = defineUnit3({
292
641
  path: "image"
293
642
  }
294
643
  });
295
- var existingImage = defineUnit3({
644
+ var existingImage = defineUnit4({
296
645
  type: "proxmox.existing-image",
297
646
  args: {
298
- id: Type3.String()
647
+ id: Type6.String()
648
+ },
649
+ inputs: {
650
+ proxmoxCluster: clusterEntity
299
651
  },
300
652
  outputs: {
301
653
  image: imageEntity
@@ -313,23 +665,26 @@ var existingImage = defineUnit3({
313
665
  path: "existing-image"
314
666
  }
315
667
  });
316
- var virtualMachine = defineUnit3({
668
+ var virtualMachine = defineUnit4({
317
669
  type: "proxmox.virtual-machine",
318
670
  args: {
319
- nodeName: Type3.Optional(Type3.String()),
320
- cpuType: Type3.Optional(Type3.String({ default: "host" })),
321
- cores: Type3.Optional(Type3.Number({ default: 1 })),
322
- sockets: Type3.Optional(Type3.Number({ default: 1 })),
323
- memory: Type3.Optional(Type3.Number({ default: 512 })),
324
- ipv4: Type3.Optional(Type3.String()),
325
- ipv4Gateway: Type3.Optional(Type3.String()),
326
- dns: Type3.Optional(Type3.Array(Type3.String())),
327
- datastoreId: Type3.Optional(Type3.String()),
328
- diskSize: Type3.Optional(Type3.Number({ default: 8 })),
329
- bridge: Type3.Optional(Type3.String({ default: "vmbr0" })),
330
- sshPort: Type3.Optional(Type3.Number({ default: 22 })),
331
- sshUser: Type3.Optional(Type3.String({ default: "root" })),
332
- waitForAgent: Type3.Optional(Type3.Boolean({ default: true }))
671
+ nodeName: Type6.Optional(Type6.String()),
672
+ cpuType: Type6.Optional(Type6.String({ default: "host" })),
673
+ cores: Type6.Optional(Type6.Number({ default: 1 })),
674
+ sockets: Type6.Optional(Type6.Number({ default: 1 })),
675
+ memory: Type6.Optional(Type6.Number({ default: 512 })),
676
+ ipv4: Type6.Optional(Type6.String()),
677
+ ipv4Gateway: Type6.Optional(Type6.String()),
678
+ dns: Type6.Optional(Type6.Array(Type6.String())),
679
+ datastoreId: Type6.Optional(Type6.String()),
680
+ diskSize: Type6.Optional(Type6.Number({ default: 8 })),
681
+ bridge: Type6.Optional(Type6.String({ default: "vmbr0" })),
682
+ sshPort: Type6.Optional(Type6.Number({ default: 22 })),
683
+ sshUser: Type6.Optional(Type6.String({ default: "root" })),
684
+ waitForAgent: Type6.Optional(Type6.Boolean({ default: true }))
685
+ },
686
+ secrets: {
687
+ sshPassword: Type6.Optional(Type6.String())
333
688
  },
334
689
  inputs: {
335
690
  proxmoxCluster: clusterEntity,
@@ -339,12 +694,7 @@ var virtualMachine = defineUnit3({
339
694
  required: false
340
695
  }
341
696
  },
342
- secrets: {
343
- sshPassword: Type3.Optional(Type3.String())
344
- },
345
- outputs: {
346
- server: serverEntity
347
- },
697
+ outputs: serverOutputs,
348
698
  meta: {
349
699
  displayName: "Proxmox Virtual Machine",
350
700
  description: "The virtual machine on a Proxmox cluster.",
@@ -365,224 +715,298 @@ __export(k8s_exports, {
365
715
  accessPoint: () => accessPoint,
366
716
  accessPointEntity: () => accessPointEntity,
367
717
  certManager: () => certManager,
718
+ clusterDns: () => clusterDns,
368
719
  clusterEntity: () => clusterEntity2,
369
- clusterInfoSchema: () => clusterInfoSchema,
370
- containerSchema: () => containerSchema,
720
+ clusterInfoProperties: () => clusterInfoProperties,
721
+ clusterInputs: () => clusterInputs,
722
+ clusterOutputs: () => clusterOutputs,
723
+ clusterPatch: () => clusterPatch,
724
+ clusterQuirksSchema: () => clusterQuirksSchema,
725
+ cniSchema: () => cniSchema,
371
726
  deploymentEntity: () => deploymentEntity,
372
- deploymentSpecSchema: () => deploymentSpecSchema,
373
727
  dns01TlsIssuer: () => dns01TlsIssuer,
374
728
  existingCluster: () => existingCluster,
729
+ exposableWorkloadEntity: () => exposableWorkloadEntity,
730
+ externalServiceTypeSchema: () => externalServiceTypeSchema,
731
+ fallbackKubeApiAccessSchema: () => fallbackKubeApiAccessSchema,
375
732
  gatewayApi: () => gatewayApi,
376
733
  gatewayEntity: () => gatewayEntity,
377
734
  interfaceEntity: () => interfaceEntity,
378
735
  internalIpsPolicySchema: () => internalIpsPolicySchema,
379
- labelSelectorSchema: () => labelSelectorSchema,
380
736
  metadataSchema: () => metadataSchema,
381
737
  persistentVolumeClaimEntity: () => persistentVolumeClaimEntity,
738
+ resourceSchema: () => resourceSchema,
739
+ scheduleOnMastersPolicyArgs: () => scheduleOnMastersPolicyArgs,
740
+ scheduleOnMastersPolicySchema: () => scheduleOnMastersPolicySchema,
382
741
  serviceEntity: () => serviceEntity,
383
- servicePortSchema: () => servicePortSchema,
384
- serviceSpecSchema: () => serviceSpecSchema,
385
742
  serviceTypeSchema: () => serviceTypeSchema,
386
- sharedClusterArgs: () => sharedClusterArgs,
387
743
  statefulSetEntity: () => statefulSetEntity,
388
744
  tlsIssuerEntity: () => tlsIssuerEntity,
389
745
  tunDevicePolicySchema: () => tunDevicePolicySchema
390
746
  });
391
- import { defineEntity as defineEntity5, defineUnit as defineUnit5, Type as Type5 } from "@highstate/contract";
747
+ import { defineEntity as defineEntity6, defineUnit as defineUnit5, Type as Type7 } from "@highstate/contract";
392
748
  import { Literal } from "@sinclair/typebox";
393
-
394
- // src/dns.ts
395
- var dns_exports = {};
396
- __export(dns_exports, {
397
- providerEntity: () => providerEntity,
398
- record: () => record
399
- });
400
- import { defineEntity as defineEntity4, defineUnit as defineUnit4, Type as Type4 } from "@highstate/contract";
401
- var providerEntity = defineEntity4({
402
- type: "dns.provider",
403
- schema: Type4.Object({
404
- name: Type4.String(),
405
- type: Type4.String(),
406
- data: Type4.Record(Type4.String(), Type4.Unknown()),
407
- domain: Type4.String()
408
- }),
409
- meta: {
410
- color: "#FF5722"
411
- }
749
+ var fallbackKubeApiAccessSchema = Type7.Object({
750
+ serverIp: Type7.String(),
751
+ serverPort: Type7.Number()
412
752
  });
413
- var record = defineUnit4({
414
- type: "common.dns-record",
415
- args: {
416
- name: Type4.String(),
417
- type: Type4.String(),
418
- value: Type4.String(),
419
- ttl: Type4.Optional(Type4.Number())
420
- },
421
- inputs: {
422
- dnsProvider: providerEntity
423
- },
424
- meta: {
425
- displayName: "DNS Record",
426
- description: "A DNS record to create.",
427
- primaryIcon: "mdi:server",
428
- defaultNamePrefix: "record"
429
- },
430
- source: {
431
- package: "@highstate/common",
432
- path: "dns/record"
433
- }
434
- });
435
-
436
- // src/k8s.ts
437
- var tunDevicePolicySchema = Type5.Union([
438
- Type5.Object({
753
+ var tunDevicePolicySchema = Type7.Union([
754
+ Type7.Object({
439
755
  type: Literal("host")
440
756
  }),
441
- Type5.Object({
757
+ Type7.Object({
442
758
  type: Literal("plugin"),
443
- resourceName: Type5.String(),
444
- resourceValue: Type5.String()
759
+ resourceName: Type7.String(),
760
+ resourceValue: Type7.String()
445
761
  })
446
762
  ]);
447
- var clusterInfoSchema = Type5.Object({
448
- id: Type5.String(),
449
- name: Type5.String(),
450
- cni: Type5.Optional(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()),
763
+ var externalServiceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer"]);
764
+ var scheduleOnMastersPolicySchema = Type7.StringEnum(["always", "when-no-workers", "never"]);
765
+ var cniSchema = Type7.StringEnum(["cilium", "other"]);
766
+ var clusterQuirksSchema = Type7.Object({
767
+ /**
768
+ * The IP and port of the kube-apiserver available from the cluster.
769
+ *
770
+ * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
771
+ *
772
+ * @schema
773
+ */
774
+ fallbackKubeApiAccess: {
775
+ ...Type7.Optional(fallbackKubeApiAccessSchema),
776
+ description: `The IP and port of the kube-apiserver available from the cluster.
777
+
778
+ Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.`
779
+ },
455
780
  /**
456
781
  * Specifies the policy for using the tun device inside containers.
457
782
  *
458
783
  * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
459
784
  *
460
785
  * 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.
786
+ *
787
+ * @schema
461
788
  */
462
- tunDevicePolicy: Type5.Optional(tunDevicePolicySchema)
463
- });
464
- var serviceTypeSchema = Type5.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
465
- var metadataSchema = Type5.Object({
466
- namespace: Type5.Optional(Type5.String()),
467
- name: Type5.String(),
468
- labels: Type5.Optional(Type5.Record(Type5.String(), Type5.String())),
469
- annotations: Type5.Optional(Type5.Record(Type5.String(), Type5.String()))
470
- });
471
- var servicePortSchema = Type5.Object({
472
- name: Type5.Optional(Type5.String()),
473
- port: Type5.Optional(Type5.Number()),
474
- targetPort: Type5.Optional(Type5.Union([Type5.Number(), Type5.String()])),
475
- protocol: Type5.Optional(Type5.String())
476
- });
477
- var serviceSpecSchema = Type5.Object({
478
- type: Type5.Optional(Type5.String()),
479
- selector: Type5.Record(Type5.String(), Type5.String()),
480
- ports: Type5.Array(servicePortSchema),
481
- clusterIP: Type5.Optional(Type5.String()),
482
- clusterIPs: Type5.Optional(Type5.Array(Type5.String())),
483
- externalIPs: Type5.Optional(Type5.Array(Type5.String()))
484
- });
485
- var serviceEntity = defineEntity5({
486
- type: "k8s.service",
487
- schema: Type5.Object({
488
- type: Type5.Literal("k8s.service"),
489
- clusterInfo: clusterInfoSchema,
490
- metadata: metadataSchema,
491
- spec: serviceSpecSchema
492
- }),
493
- meta: {
494
- color: "#2196F3"
495
- }
496
- });
497
- var clusterEntity2 = defineEntity5({
498
- type: "k8s.cluster",
499
- schema: Type5.Object({
500
- info: clusterInfoSchema,
501
- kubeconfig: Type5.String()
502
- }),
503
- meta: {
504
- color: "#2196F3"
789
+ tunDevicePolicy: {
790
+ ...Type7.Optional(tunDevicePolicySchema),
791
+ description: `Specifies the policy for using the tun device inside containers.
792
+
793
+ If not provided, the default policy is \`host\` which assumes just mounting /dev/net/tun from the host.
794
+
795
+ 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.`
796
+ },
797
+ /**
798
+ * The service type to use for external services.
799
+ *
800
+ * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
801
+ *
802
+ * @schema
803
+ */
804
+ externalServiceType: {
805
+ ...Type7.Optional(externalServiceTypeSchema),
806
+ description: `The service type to use for external services.
807
+
808
+ If not provided, the default service type is \`NodePort\` since \`LoadBalancer\` may not be available.`
505
809
  }
506
810
  });
507
- var internalIpsPolicySchema = Type5.StringEnum(["always", "public", "never"]);
508
- var sharedClusterArgs = {
811
+ var clusterInfoProperties = {
509
812
  /**
510
- * The list of external IPs of the cluster nodes allowed to be used for external access.
813
+ * The unique identifier of the cluster.
511
814
  *
512
- * If not provided, will be automatically detected by querying the cluster nodes.
815
+ * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.
513
816
  *
514
817
  * @schema
515
818
  */
516
- externalIps: {
517
- ...Type5.Optional(Type5.Array(Type5.String())),
518
- description: `The list of external IPs of the cluster nodes allowed to be used for external access.
819
+ id: {
820
+ ...Type7.String(),
821
+ description: `The unique identifier of the cluster.
519
822
 
520
- If not provided, will be automatically detected by querying the cluster nodes.`
823
+ Should be defined as a UUID of the \`kube-system\` namespace which is always present in the cluster.`
521
824
  },
522
825
  /**
523
- * The policy for using internal IPs of the nodes as external IPs.
826
+ * The name of the cluster.
524
827
  *
525
- * - `always`: always use internal IPs as external IPs;
526
- * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
527
- * - `never`: never use internal IPs as external IPs.
828
+ * @schema
829
+ */
830
+ name: {
831
+ ...Type7.String(),
832
+ description: `The name of the cluster.`
833
+ },
834
+ /**
835
+ * The name of the CNI plugin used by the cluster.
836
+ *
837
+ * Supported values are:
838
+ * - `cilium`
839
+ * - `other`
528
840
  *
529
841
  * @schema
530
842
  */
531
- internalIpsPolicy: {
532
- ...{ ...internalIpsPolicySchema, default: "public" },
533
- description: `The policy for using internal IPs of the nodes as external IPs.
843
+ cni: {
844
+ ...cniSchema,
845
+ description: `The name of the CNI plugin used by the cluster.
534
846
 
535
- - \`always\`: always use internal IPs as external IPs;
536
- - \`public\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
537
- - \`never\`: never use internal IPs as external IPs.`
847
+ Supported values are:
848
+ - \`cilium\`
849
+ - \`other\``
538
850
  },
539
851
  /**
540
- * The FQDN to register the cluster nodes with.
852
+ * The endpoints of the cluster nodes.
541
853
  *
542
- * If provided and `registerFqdn` is set to `true`, the corresponding DNS provider must be provided to set up the DNS records.
854
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
855
+ *
856
+ * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
543
857
  *
544
858
  * @schema
545
859
  */
546
- fqdn: {
547
- ...Type5.Optional(Type5.String()),
548
- description: `The FQDN to register the cluster nodes with.
860
+ endpoints: {
861
+ ...Type7.Array(l3EndpointEntity.schema),
862
+ description: `The endpoints of the cluster nodes.
863
+
864
+ The entry may represent real node endpoint or virtual endpoint (like a load balancer).
549
865
 
550
- If provided and \`registerFqdn\` is set to \`true\`, the corresponding DNS provider must be provided to set up the DNS records.`
866
+ The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
867
+ },
868
+ /**
869
+ * The endpoints of the API server.
870
+ *
871
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
872
+ *
873
+ * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
874
+ */
875
+ apiEndpoints: Type7.Array(l4EndpointEntity.schema),
876
+ /**
877
+ * The external IPs of the cluster nodes allowed to be used for external access.
878
+ *
879
+ * @schema
880
+ */
881
+ externalIps: {
882
+ ...Type7.Array(Type7.String()),
883
+ description: `The external IPs of the cluster nodes allowed to be used for external access.`
551
884
  },
552
885
  /**
553
- * Whether to register the cluster nodes with the provided FQDN.
886
+ * The extra quirks of the cluster to improve compatibility.
887
+ *
888
+ * @schema
889
+ */
890
+ quirks: {
891
+ ...Type7.Optional(clusterQuirksSchema),
892
+ description: `The extra quirks of the cluster to improve compatibility.`
893
+ }
894
+ };
895
+ var serviceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
896
+ var metadataSchema = Type7.Object({
897
+ name: Type7.String(),
898
+ namespace: Type7.String(),
899
+ labels: Type7.Optional(Type7.Record(Type7.String(), Type7.String())),
900
+ annotations: Type7.Optional(Type7.Record(Type7.String(), Type7.String()))
901
+ });
902
+ var resourceSchema = Type7.Object({
903
+ clusterId: Type7.String(),
904
+ metadata: metadataSchema
905
+ });
906
+ var serviceEntity = defineEntity6({
907
+ type: "k8s.service",
908
+ schema: Type7.Object({
909
+ type: Type7.Literal("k8s.service"),
910
+ ...resourceSchema.properties,
911
+ endpoints: Type7.Array(l4EndpointEntity.schema)
912
+ }),
913
+ meta: {
914
+ color: "#2196F3"
915
+ }
916
+ });
917
+ var clusterEntity2 = defineEntity6({
918
+ type: "k8s.cluster",
919
+ schema: Type7.Object({
920
+ ...clusterInfoProperties,
921
+ kubeconfig: Type7.String()
922
+ }),
923
+ meta: {
924
+ color: "#2196F3"
925
+ }
926
+ });
927
+ var internalIpsPolicySchema = Type7.StringEnum(["always", "public", "never"]);
928
+ var scheduleOnMastersPolicyArgs = {
929
+ /**
930
+ * The policy for scheduling workloads on master nodes.
554
931
  *
555
- * By default, `true`.
932
+ * - `always`: always schedule workloads on master nodes regardless of the number of workers;
933
+ * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
934
+ * - `never`: never schedule workloads on master nodes.
556
935
  *
557
936
  * @schema
558
937
  */
559
- registerFqdn: {
560
- ...Type5.Boolean({ default: true }),
561
- description: `Whether to register the cluster nodes with the provided FQDN.
938
+ scheduleOnMastersPolicy: {
939
+ ...Type7.Default(scheduleOnMastersPolicySchema, "when-no-workers"),
940
+ description: `The policy for scheduling workloads on master nodes.
562
941
 
563
- By default, \`true\`.`
942
+ - \`always\`: always schedule workloads on master nodes regardless of the number of workers;
943
+ - \`when-no-workers\`: schedule workloads on master nodes only if there are no workers (default);
944
+ - \`never\`: never schedule workloads on master nodes.`
945
+ }
946
+ };
947
+ var clusterInputs = {
948
+ masters: {
949
+ entity: serverEntity,
950
+ multiple: true
951
+ },
952
+ workers: {
953
+ entity: serverEntity,
954
+ multiple: true,
955
+ required: false
956
+ }
957
+ };
958
+ var clusterOutputs = {
959
+ k8sCluster: clusterEntity2,
960
+ apiEndpoints: {
961
+ entity: l4EndpointEntity,
962
+ multiple: true
963
+ },
964
+ endpoints: {
965
+ entity: l3EndpointEntity,
966
+ multiple: true
564
967
  }
565
968
  };
566
969
  var existingCluster = defineUnit5({
567
970
  type: "k8s.existing-cluster",
568
971
  args: {
569
- ...sharedClusterArgs,
570
972
  /**
571
- * The policy for using the tun device inside containers.
973
+ * The list of external IPs of the cluster nodes allowed to be used for external access.
572
974
  *
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.
975
+ * If not provided, will be automatically detected by querying the cluster nodes.
576
976
  *
577
977
  * @schema
578
978
  */
579
- tunDevicePolicy: {
580
- ...Type5.Optional(tunDevicePolicySchema),
581
- description: `The policy for using the tun device inside containers.
979
+ externalIps: {
980
+ ...Type7.Optional(Type7.Array(Type7.String())),
981
+ description: `The list of external IPs of the cluster nodes allowed to be used for external access.
582
982
 
583
- If not provided, the default policy is \`host\` which assumes just mounting /dev/net/tun from the host.
983
+ If not provided, will be automatically detected by querying the cluster nodes.`
984
+ },
985
+ /**
986
+ * The policy for using internal IPs of the nodes as external IPs.
987
+ *
988
+ * - `always`: always use internal IPs as external IPs;
989
+ * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
990
+ * - `never`: never use internal IPs as external IPs.
991
+ *
992
+ * @schema
993
+ */
994
+ internalIpsPolicy: {
995
+ ...Type7.Default(internalIpsPolicySchema, "public"),
996
+ description: `The policy for using internal IPs of the nodes as external IPs.
584
997
 
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.`
998
+ - \`always\`: always use internal IPs as external IPs;
999
+ - \`public\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
1000
+ - \`never\`: never use internal IPs as external IPs.`
1001
+ },
1002
+ /**
1003
+ * The extra quirks of the cluster to improve compatibility.
1004
+ *
1005
+ * @schema
1006
+ */
1007
+ quirks: {
1008
+ ...Type7.Optional(clusterQuirksSchema),
1009
+ description: `The extra quirks of the cluster to improve compatibility.`
586
1010
  }
587
1011
  },
588
1012
  secrets: {
@@ -594,55 +1018,155 @@ var existingCluster = defineUnit5({
594
1018
  * @schema
595
1019
  */
596
1020
  kubeconfig: {
597
- ...Type5.Record(Type5.String(), Type5.Any()),
1021
+ ...Type7.Record(Type7.String(), Type7.Any()),
598
1022
  description: `The kubeconfig of the cluster to use for connecting to the cluster.
599
1023
 
600
1024
  Will be available for all components using \`cluster\` output of this unit.`
601
1025
  }
602
1026
  },
603
- outputs: {
604
- cluster: clusterEntity2
1027
+ outputs: clusterOutputs,
1028
+ meta: {
1029
+ displayName: "Existing Cluster",
1030
+ description: "An existing Kubernetes cluster.",
1031
+ primaryIcon: "devicon:kubernetes",
1032
+ category: "Kubernetes"
1033
+ },
1034
+ source: {
1035
+ package: "@highstate/k8s",
1036
+ path: "units/existing-cluster"
1037
+ }
1038
+ });
1039
+ var clusterPatch = defineUnit5({
1040
+ type: "k8s.cluster-patch",
1041
+ args: {
1042
+ /**
1043
+ * The endpoints of the API server.
1044
+ *
1045
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1046
+ *
1047
+ * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1048
+ *
1049
+ * @schema
1050
+ */
1051
+ apiEndpoints: {
1052
+ ...Type7.Default(Type7.Array(Type7.String()), []),
1053
+ description: `The endpoints of the API server.
1054
+
1055
+ The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1056
+
1057
+ The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
1058
+ },
1059
+ /**
1060
+ * The mode to use for patching the API endpoints.
1061
+ *
1062
+ * - `prepend`: prepend the new endpoints to the existing ones (default);
1063
+ * - `replace`: replace the existing endpoints with the new ones.
1064
+ */
1065
+ apiEndpointsPatchMode: Type7.Default(arrayPatchModeSchema, "prepend"),
1066
+ /**
1067
+ * The endpoints of the cluster nodes.
1068
+ *
1069
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1070
+ *
1071
+ * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1072
+ *
1073
+ * @schema
1074
+ */
1075
+ endpoints: {
1076
+ ...Type7.Default(Type7.Array(Type7.String()), []),
1077
+ description: `The endpoints of the cluster nodes.
1078
+
1079
+ The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1080
+
1081
+ The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
1082
+ },
1083
+ /**
1084
+ * The mode to use for patching the endpoints.
1085
+ *
1086
+ * - `prepend`: prepend the new endpoints to the existing ones (default);
1087
+ * - `replace`: replace the existing endpoints with the new ones.
1088
+ */
1089
+ endpointsPatchMode: Type7.Default(arrayPatchModeSchema, "prepend")
1090
+ },
1091
+ inputs: {
1092
+ k8sCluster: clusterEntity2,
1093
+ apiEndpoints: {
1094
+ entity: l4EndpointEntity,
1095
+ required: false,
1096
+ multiple: true
1097
+ },
1098
+ endpoints: {
1099
+ entity: l3EndpointEntity,
1100
+ required: false,
1101
+ multiple: true
1102
+ }
1103
+ },
1104
+ outputs: clusterOutputs,
1105
+ meta: {
1106
+ displayName: "Cluster Patch",
1107
+ description: "Patches some properties of the cluster.",
1108
+ primaryIcon: "devicon:kubernetes",
1109
+ secondaryIcon: "fluent:patch-20-filled",
1110
+ category: "Kubernetes"
1111
+ },
1112
+ source: {
1113
+ package: "@highstate/k8s",
1114
+ path: "units/cluster-patch"
1115
+ }
1116
+ });
1117
+ var clusterDns = defineUnit5({
1118
+ type: "cluster-dns",
1119
+ args: {
1120
+ ...createArgs(),
1121
+ ...createArgs("api")
1122
+ },
1123
+ inputs: {
1124
+ k8sCluster: clusterEntity2,
1125
+ ...inputs
605
1126
  },
1127
+ outputs: clusterOutputs,
606
1128
  meta: {
607
- displayName: "Existing Cluster",
608
- description: "An existing Kubernetes cluster.",
609
- primaryIcon: "mdi:kubernetes"
1129
+ displayName: "Cluster DNS",
1130
+ description: "Creates DNS records for the cluster and updates endpoints.",
1131
+ primaryIcon: "devicon:kubernetes",
1132
+ secondaryIcon: "mdi:dns",
1133
+ category: "Kubernetes"
610
1134
  },
611
1135
  source: {
612
1136
  package: "@highstate/k8s",
613
- path: "units/existing-cluster"
1137
+ path: "units/cluster-dns"
614
1138
  }
615
1139
  });
616
- var gatewayEntity = defineEntity5({
1140
+ var gatewayEntity = defineEntity6({
617
1141
  type: "k8s.gateway",
618
- schema: Type5.Object({
619
- clusterInfo: clusterInfoSchema,
620
- gatewayClassName: Type5.String(),
621
- httpListenerPort: Type5.Number(),
622
- httpsListenerPort: Type5.Number(),
623
- ip: Type5.String(),
624
- service: Type5.Optional(serviceEntity.schema)
1142
+ schema: Type7.Object({
1143
+ clusterId: Type7.String(),
1144
+ gatewayClassName: Type7.String(),
1145
+ httpListenerPort: Type7.Number(),
1146
+ httpsListenerPort: Type7.Number(),
1147
+ endpoints: Type7.Array(l3EndpointEntity.schema)
625
1148
  }),
626
1149
  meta: {
627
1150
  color: "#4CAF50"
628
1151
  }
629
1152
  });
630
- var tlsIssuerEntity = defineEntity5({
1153
+ var tlsIssuerEntity = defineEntity6({
631
1154
  type: "k8s.tls-issuer",
632
- schema: Type5.Object({
633
- clusterInfo: clusterInfoSchema,
634
- clusterIssuerName: Type5.String()
1155
+ schema: Type7.Object({
1156
+ clusterId: Type7.String(),
1157
+ clusterIssuerName: Type7.String()
635
1158
  }),
636
1159
  meta: {
637
1160
  color: "#f06292"
638
1161
  }
639
1162
  });
640
- var accessPointEntity = defineEntity5({
1163
+ var accessPointEntity = defineEntity6({
641
1164
  type: "k8s.access-point",
642
- schema: Type5.Object({
1165
+ schema: Type7.Object({
1166
+ clusterId: Type7.String(),
643
1167
  gateway: gatewayEntity.schema,
644
1168
  tlsIssuer: tlsIssuerEntity.schema,
645
- dnsProviders: Type5.Array(providerEntity.schema)
1169
+ dnsProviders: Type7.Array(providerEntity.schema)
646
1170
  }),
647
1171
  meta: {
648
1172
  color: "#F57F17"
@@ -664,7 +1188,8 @@ var accessPoint = defineUnit5({
664
1188
  meta: {
665
1189
  displayName: "Access Point",
666
1190
  description: "An access point which can be used to connect to services.",
667
- primaryIcon: "mdi:access-point"
1191
+ primaryIcon: "mdi:access-point",
1192
+ category: "Kubernetes"
668
1193
  },
669
1194
  source: {
670
1195
  package: "@highstate/k8s",
@@ -682,7 +1207,8 @@ var certManager = defineUnit5({
682
1207
  meta: {
683
1208
  displayName: "Cert Manager",
684
1209
  description: "A certificate manager for managing TLS certificates.",
685
- primaryIcon: "simple-icons:letsencrypt"
1210
+ primaryIcon: "simple-icons:letsencrypt",
1211
+ category: "Kubernetes"
686
1212
  },
687
1213
  source: {
688
1214
  package: "@highstate/k8s",
@@ -700,7 +1226,7 @@ var dns01TlsIssuer = defineUnit5({
700
1226
  * @schema
701
1227
  */
702
1228
  domains: {
703
- ...Type5.Optional(Type5.Array(Type5.String())),
1229
+ ...Type7.Optional(Type7.Array(Type7.String())),
704
1230
  description: `The top-level domains to filter the DNS01 challenge for.
705
1231
 
706
1232
  If not provided, will use all domains passed to the DNS providers.`
@@ -719,70 +1245,58 @@ var dns01TlsIssuer = defineUnit5({
719
1245
  meta: {
720
1246
  displayName: "DNS01 Issuer",
721
1247
  description: "A TLS issuer for issuing certificate using DNS01 challenge.",
722
- primaryIcon: "mdi:certificate"
1248
+ primaryIcon: "mdi:certificate",
1249
+ category: "Kubernetes"
723
1250
  },
724
1251
  source: {
725
1252
  package: "@highstate/k8s",
726
1253
  path: "units/dns01-issuer"
727
1254
  }
728
1255
  });
729
- var containerSchema = Type5.Object({
730
- name: Type5.String(),
731
- image: Type5.String()
732
- });
733
- var labelSelectorSchema = Type5.Object({
734
- matchLabels: Type5.Record(Type5.String(), Type5.String())
735
- });
736
- var deploymentSpecSchema = Type5.Object({
737
- replicas: Type5.Number(),
738
- selector: labelSelectorSchema,
739
- template: Type5.Object({
740
- metadata: metadataSchema,
741
- spec: Type5.Object({
742
- containers: Type5.Array(containerSchema)
743
- })
744
- })
745
- });
746
- var deploymentEntity = defineEntity5({
1256
+ var deploymentEntity = defineEntity6({
747
1257
  type: "k8s.deployment",
748
- schema: Type5.Object({
749
- type: Type5.Literal("k8s.deployment"),
750
- clusterInfo: clusterInfoSchema,
751
- metadata: metadataSchema,
752
- service: Type5.Optional(serviceEntity.schema)
1258
+ schema: Type7.Object({
1259
+ type: Type7.Literal("k8s.deployment"),
1260
+ ...resourceSchema.properties,
1261
+ service: Type7.Optional(serviceEntity.schema)
753
1262
  }),
754
1263
  meta: {
755
1264
  color: "#4CAF50"
756
1265
  }
757
1266
  });
758
- var statefulSetEntity = defineEntity5({
1267
+ var statefulSetEntity = defineEntity6({
759
1268
  type: "k8s.stateful-set",
760
- schema: Type5.Object({
761
- type: Type5.Literal("k8s.stateful-set"),
762
- clusterInfo: clusterInfoSchema,
763
- metadata: metadataSchema,
764
- service: Type5.Optional(serviceEntity.schema)
1269
+ schema: Type7.Object({
1270
+ type: Type7.Literal("k8s.stateful-set"),
1271
+ ...resourceSchema.properties,
1272
+ service: serviceEntity.schema
765
1273
  }),
766
1274
  meta: {
767
1275
  color: "#FFC107"
768
1276
  }
769
1277
  });
770
- var persistentVolumeClaimEntity = defineEntity5({
1278
+ var exposableWorkloadEntity = defineEntity6({
1279
+ type: "k8s.exposable-workload",
1280
+ schema: Type7.Union([deploymentEntity.schema, statefulSetEntity.schema]),
1281
+ meta: {
1282
+ color: "#4CAF50"
1283
+ }
1284
+ });
1285
+ var persistentVolumeClaimEntity = defineEntity6({
771
1286
  type: "k8s.persistent-volume-claim",
772
- schema: Type5.Object({
773
- type: Type5.Literal("k8s.persistent-volume-claim"),
774
- clusterInfo: clusterInfoSchema,
775
- metadata: metadataSchema
1287
+ schema: Type7.Object({
1288
+ type: Type7.Literal("k8s.persistent-volume-claim"),
1289
+ ...resourceSchema.properties
776
1290
  }),
777
1291
  meta: {
778
1292
  color: "#FFC107"
779
1293
  }
780
1294
  });
781
- var interfaceEntity = defineEntity5({
1295
+ var interfaceEntity = defineEntity6({
782
1296
  type: "k8s.interface",
783
- schema: Type5.Object({
784
- name: Type5.String(),
785
- deployment: deploymentEntity.schema
1297
+ schema: Type7.Object({
1298
+ name: Type7.String(),
1299
+ workload: exposableWorkloadEntity.schema
786
1300
  }),
787
1301
  meta: {
788
1302
  color: "#2196F3",
@@ -800,8 +1314,10 @@ var gatewayApi = defineUnit5({
800
1314
  meta: {
801
1315
  displayName: "Gateway API",
802
1316
  description: "Installs the Gateway API CRDs to the cluster.",
803
- primaryIcon: "mdi:kubernetes",
804
- primaryIconColor: "#4CAF50"
1317
+ primaryIcon: "devicon:kubernetes",
1318
+ secondaryIcon: "mdi:api",
1319
+ secondaryIconColor: "#4CAF50",
1320
+ category: "Kubernetes"
805
1321
  },
806
1322
  source: {
807
1323
  package: "@highstate/k8s",
@@ -814,55 +1330,26 @@ var talos_exports = {};
814
1330
  __export(talos_exports, {
815
1331
  cluster: () => cluster,
816
1332
  clusterEntity: () => clusterEntity3,
817
- cniSchema: () => cniSchema,
1333
+ cniSchema: () => cniSchema2,
818
1334
  csiSchema: () => csiSchema
819
1335
  });
820
- import { defineEntity as defineEntity6, defineUnit as defineUnit6, Type as Type6 } from "@highstate/contract";
821
- var clusterEntity3 = defineEntity6({
1336
+ import { defineEntity as defineEntity7, defineUnit as defineUnit6, Type as Type8 } from "@highstate/contract";
1337
+ var clusterEntity3 = defineEntity7({
822
1338
  type: "talos.cluster",
823
- schema: Type6.Object({
824
- clientConfiguration: Type6.String(),
825
- machineSecrets: Type6.String()
1339
+ schema: Type8.Object({
1340
+ clientConfiguration: Type8.String(),
1341
+ machineSecrets: Type8.String()
826
1342
  }),
827
1343
  meta: {
828
1344
  color: "#2d2d2d"
829
1345
  }
830
1346
  });
831
- var cniSchema = Type6.StringEnum(["none", "cilium", "flannel"]);
832
- var csiSchema = Type6.StringEnum(["none", "local-path-provisioner"]);
1347
+ var cniSchema2 = Type8.StringEnum(["none", "cilium", "flannel"]);
1348
+ var csiSchema = Type8.StringEnum(["none", "local-path-provisioner"]);
833
1349
  var cluster = defineUnit6({
834
1350
  type: "talos.cluster",
835
1351
  args: {
836
- /**
837
- * Allow scheduling workloads on the master nodes.
838
- *
839
- * If no workers are specified, this option is ignored and the master nodes are used as workers.
840
- *
841
- * By default, this option is set to false.
842
- *
843
- * @schema
844
- */
845
- scheduleOnMasters: {
846
- ...Type6.Default(Type6.Boolean(), false),
847
- description: `Allow scheduling workloads on the master nodes.
848
-
849
- If no workers are specified, this option is ignored and the master nodes are used as workers.
850
-
851
- By default, this option is set to false.`
852
- },
853
- /**
854
- * The endpoint of the cluster.
855
- *
856
- * By default, the first master node's endpoint is used.
857
- *
858
- * @schema
859
- */
860
- endpoint: {
861
- ...Type6.Optional(Type6.String()),
862
- description: `The endpoint of the cluster.
863
-
864
- By default, the first master node's endpoint is used.`
865
- },
1352
+ ...scheduleOnMastersPolicyArgs,
866
1353
  /**
867
1354
  * The name of the cluster.
868
1355
  *
@@ -871,7 +1358,7 @@ var cluster = defineUnit6({
871
1358
  * @schema
872
1359
  */
873
1360
  clusterName: {
874
- ...Type6.Optional(Type6.String()),
1361
+ ...Type8.Optional(Type8.String()),
875
1362
  description: `The name of the cluster.
876
1363
 
877
1364
  By default, the name of the instance is used.`
@@ -889,7 +1376,7 @@ var cluster = defineUnit6({
889
1376
  * @schema
890
1377
  */
891
1378
  cni: {
892
- ...Type6.Default(cniSchema, "cilium"),
1379
+ ...Type8.Default(cniSchema2, "cilium"),
893
1380
  description: `The CNI plugin to use.
894
1381
 
895
1382
  The following options are available:
@@ -909,7 +1396,7 @@ var cluster = defineUnit6({
909
1396
  * @schema
910
1397
  */
911
1398
  csi: {
912
- ...Type6.Default(csiSchema, "local-path-provisioner"),
1399
+ ...Type8.Default(csiSchema, "local-path-provisioner"),
913
1400
  description: `The CSI plugin to use.
914
1401
 
915
1402
  The following options are available:
@@ -923,7 +1410,7 @@ var cluster = defineUnit6({
923
1410
  * @schema
924
1411
  */
925
1412
  sharedConfigPatch: {
926
- ...Type6.Optional(Type6.Record(Type6.String(), Type6.Any())),
1413
+ ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
927
1414
  description: `The shared configuration patch.
928
1415
  It will be applied to all nodes.`
929
1416
  },
@@ -934,7 +1421,7 @@ var cluster = defineUnit6({
934
1421
  * @schema
935
1422
  */
936
1423
  masterConfigPatch: {
937
- ...Type6.Optional(Type6.Record(Type6.String(), Type6.Any())),
1424
+ ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
938
1425
  description: `The master configuration patch.
939
1426
  It will be applied to all master nodes.`
940
1427
  },
@@ -945,24 +1432,22 @@ var cluster = defineUnit6({
945
1432
  * @schema
946
1433
  */
947
1434
  workerConfigPatch: {
948
- ...Type6.Optional(Type6.Record(Type6.String(), Type6.Any())),
1435
+ ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
949
1436
  description: `The worker configuration patch.
950
1437
  It will be applied to all worker nodes.`
951
- }
952
- },
953
- inputs: {
954
- masters: {
955
- entity: serverEntity,
956
- multiple: true
957
1438
  },
958
- workers: {
959
- entity: serverEntity,
960
- multiple: true,
961
- required: false
962
- }
1439
+ /**
1440
+ * Whether to enable the Tun device plugin.
1441
+ *
1442
+ * There is the only option for Talos to get tun device in containers.
1443
+ *
1444
+ * By default, this option is set to true.
1445
+ */
1446
+ enableTunDevicePlugin: Type8.Default(Type8.Boolean(), true)
963
1447
  },
1448
+ inputs: clusterInputs,
964
1449
  outputs: {
965
- k8sCluster: clusterEntity2,
1450
+ ...clusterOutputs,
966
1451
  talosCluster: clusterEntity3
967
1452
  },
968
1453
  meta: {
@@ -987,71 +1472,67 @@ __export(wireguard_exports, {
987
1472
  configBundle: () => configBundle,
988
1473
  identity: () => identity,
989
1474
  identityEntity: () => identityEntity,
990
- k8sNodeEntity: () => k8sNodeEntity,
991
1475
  network: () => network,
992
1476
  networkEntity: () => networkEntity,
993
1477
  node: () => node,
1478
+ nodeExposePolicySchema: () => nodeExposePolicySchema,
994
1479
  peer: () => peer,
995
1480
  peerEntity: () => peerEntity,
996
- presharedKeyModeSchema: () => presharedKeyModeSchema
1481
+ peerPatch: () => peerPatch
997
1482
  });
998
- import { defineEntity as defineEntity7, defineUnit as defineUnit7, Type as Type7 } from "@highstate/contract";
999
- var backendSchema = Type7.StringEnum(["wireguard", "amneziawg"]);
1000
- var presharedKeyModeSchema = Type7.StringEnum(["none", "global", "secure"]);
1001
- var networkEntity = defineEntity7({
1483
+ import { defineEntity as defineEntity8, defineUnit as defineUnit7, Type as Type9 } from "@highstate/contract";
1484
+ import { omit } from "remeda";
1485
+ var backendSchema = Type9.StringEnum(["wireguard", "amneziawg"]);
1486
+ var networkEntity = defineEntity8({
1002
1487
  type: "wireguard.network",
1003
- schema: Type7.Object({
1004
- backend: Type7.Optional(backendSchema),
1005
- presharedKeyMode: presharedKeyModeSchema,
1006
- globalPresharedKey: Type7.Optional(Type7.String()),
1007
- ipv6: Type7.Optional(Type7.Boolean())
1488
+ schema: Type9.Object({
1489
+ backend: backendSchema,
1490
+ ipv6: Type9.Boolean()
1008
1491
  })
1009
1492
  });
1010
- var identityEntity = defineEntity7({
1011
- type: "wireguard.identity",
1012
- schema: Type7.Object({
1013
- name: Type7.String(),
1014
- network: Type7.Optional(networkEntity.schema),
1015
- address: Type7.Optional(Type7.String()),
1016
- privateKey: Type7.String(),
1017
- presharedKeyPart: Type7.Optional(Type7.String()),
1018
- k8sServices: Type7.Array(serviceEntity.schema),
1019
- exitNode: Type7.Boolean(),
1020
- listenPort: Type7.Optional(Type7.Number()),
1021
- externalIp: Type7.Optional(Type7.String()),
1022
- endpoint: Type7.Optional(Type7.String()),
1023
- fqdn: Type7.Optional(Type7.String())
1493
+ var nodeExposePolicySchema = Type9.StringEnum(["always", "when-has-endpoint", "never"]);
1494
+ var peerEntity = defineEntity8({
1495
+ type: "wireguard.peer",
1496
+ schema: Type9.Object({
1497
+ name: Type9.String(),
1498
+ network: Type9.Optional(networkEntity.schema),
1499
+ publicKey: Type9.String(),
1500
+ address: Type9.Optional(Type9.String()),
1501
+ allowedIps: Type9.Array(Type9.String()),
1502
+ endpoints: Type9.Array(l4EndpointEntity.schema),
1503
+ allowedEndpoints: Type9.Array(Type9.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),
1504
+ /**
1505
+ * The pre-shared key of the WireGuard peer.
1506
+ *
1507
+ * If one of two peers has `presharedKey` set, the other peer must have `presharedKey` set too and they must be equal.
1508
+ *
1509
+ * Will be ignored if both peers have `presharedKeyPart` set.
1510
+ */
1511
+ presharedKey: Type9.Optional(Type9.String()),
1512
+ /**
1513
+ * The pre-shared key part of the WireGuard peer.
1514
+ *
1515
+ * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as XOR of the two parts.
1516
+ */
1517
+ presharedKeyPart: Type9.Optional(Type9.String()),
1518
+ excludedIps: Type9.Array(Type9.String()),
1519
+ dns: Type9.Array(Type9.String()),
1520
+ listenPort: Type9.Optional(Type9.Number())
1024
1521
  }),
1025
1522
  meta: {
1026
- color: "#F44336"
1523
+ color: "#673AB7"
1027
1524
  }
1028
1525
  });
1029
- var peerEntity = defineEntity7({
1030
- type: "wireguard.peer",
1031
- schema: Type7.Object({
1032
- name: Type7.String(),
1033
- network: Type7.Optional(networkEntity.schema),
1034
- publicKey: Type7.String(),
1035
- address: Type7.Optional(Type7.String()),
1036
- allowedIps: Type7.Array(Type7.String()),
1037
- endpoint: Type7.Optional(Type7.String()),
1038
- presharedKeyPart: Type7.Optional(Type7.String()),
1039
- excludedIps: Type7.Optional(Type7.Array(Type7.String())),
1040
- dns: Type7.Optional(Type7.Array(Type7.String()))
1526
+ var identityEntity = defineEntity8({
1527
+ type: "wireguard.identity",
1528
+ schema: Type9.Object({
1529
+ peer: peerEntity.schema,
1530
+ privateKey: Type9.String()
1041
1531
  }),
1042
1532
  meta: {
1043
- color: "#673AB7"
1533
+ color: "#F44336"
1044
1534
  }
1045
1535
  });
1046
- var k8sNodeEntity = defineEntity7({
1047
- type: "wireguard.node",
1048
- schema: Type7.Object({
1049
- network: Type7.String(),
1050
- address: Type7.String(),
1051
- endpoint: Type7.Optional(Type7.String()),
1052
- peers: Type7.Array(Type7.String())
1053
- })
1054
- });
1055
1536
  var network = defineUnit7({
1056
1537
  type: "wireguard.network",
1057
1538
  args: {
@@ -1067,7 +1548,7 @@ var network = defineUnit7({
1067
1548
  * @schema
1068
1549
  */
1069
1550
  backend: {
1070
- ...Type7.Default(backendSchema, "wireguard"),
1551
+ ...Type9.Default(backendSchema, "wireguard"),
1071
1552
  description: `The backend to use for the WireGuard network.
1072
1553
 
1073
1554
  Possible values are:
@@ -1075,35 +1556,6 @@ var network = defineUnit7({
1075
1556
  2. \`amneziawg\` - The censorship-resistant fork of WireGuard.
1076
1557
 
1077
1558
  By default, the \`wireguard\` backend is used.`
1078
- },
1079
- /**
1080
- * The option which defines how to handle pre-shared keys between peers.
1081
- *
1082
- * 1. `none` - No pre-shared keys will be used.
1083
- * 2. `global` - A single pre-shared key will be used for all peer pairs in the network.
1084
- * 3. `secure` - Each peer pair will have its own pre-shared key.
1085
- * In this case, each identity generates `presharedKeyPart` and the actual pre-shared key
1086
- * for each peer pair will be computed as `xor(peer1.presharedKeyPart, peer2.presharedKeyPart)`.
1087
- *
1088
- * If the whole network is managed by the HighState, the `secure` mode is recommended.
1089
- *
1090
- * By default, the `none` mode is used.
1091
- *
1092
- * @schema
1093
- */
1094
- presharedKeyMode: {
1095
- ...Type7.Optional(presharedKeyModeSchema),
1096
- description: `The option which defines how to handle pre-shared keys between peers.
1097
-
1098
- 1. \`none\` - No pre-shared keys will be used.
1099
- 2. \`global\` - A single pre-shared key will be used for all peer pairs in the network.
1100
- 3. \`secure\` - Each peer pair will have its own pre-shared key.
1101
- In this case, each identity generates \`presharedKeyPart\` and the actual pre-shared key
1102
- for each peer pair will be computed as \`xor(peer1.presharedKeyPart, peer2.presharedKeyPart)\`.
1103
-
1104
- If the whole network is managed by the HighState, the \`secure\` mode is recommended.
1105
-
1106
- By default, the \`none\` mode is used.`
1107
1559
  },
1108
1560
  /**
1109
1561
  * The option to enable IPv6 support in the network.
@@ -1113,29 +1565,12 @@ var network = defineUnit7({
1113
1565
  * @schema
1114
1566
  */
1115
1567
  ipv6: {
1116
- ...Type7.Optional(Type7.Boolean()),
1568
+ ...Type9.Default(Type9.Boolean(), false),
1117
1569
  description: `The option to enable IPv6 support in the network.
1118
1570
 
1119
1571
  By default, IPv6 support is disabled.`
1120
1572
  }
1121
1573
  },
1122
- secrets: {
1123
- /**
1124
- * The global pre-shared key to use for all peer pairs in the network.
1125
- *
1126
- * Will be used only if `presharedKeyMode` is set to `global`.
1127
- * Will be generated automatically if not provided.
1128
- *
1129
- * @schema
1130
- */
1131
- globalPresharedKey: {
1132
- ...Type7.Optional(Type7.String()),
1133
- description: `The global pre-shared key to use for all peer pairs in the network.
1134
-
1135
- Will be used only if \`presharedKeyMode\` is set to \`global\`.
1136
- Will be generated automatically if not provided.`
1137
- }
1138
- },
1139
1574
  outputs: {
1140
1575
  network: networkEntity
1141
1576
  },
@@ -1143,7 +1578,8 @@ var network = defineUnit7({
1143
1578
  description: "The WireGuard network with some shared configuration.",
1144
1579
  primaryIcon: "simple-icons:wireguard",
1145
1580
  primaryIconColor: "#88171a",
1146
- secondaryIcon: "mdi:local-area-network-connect"
1581
+ secondaryIcon: "mdi:local-area-network-connect",
1582
+ category: "VPN"
1147
1583
  },
1148
1584
  source: {
1149
1585
  package: "@highstate/wireguard",
@@ -1159,7 +1595,7 @@ var sharedPeerArgs = {
1159
1595
  * @schema
1160
1596
  */
1161
1597
  peerName: {
1162
- ...Type7.Optional(Type7.String()),
1598
+ ...Type9.Optional(Type9.String()),
1163
1599
  description: `The name of the WireGuard peer.
1164
1600
 
1165
1601
  If not provided, the peer will be named after the unit.`
@@ -1172,20 +1608,11 @@ var sharedPeerArgs = {
1172
1608
  * @schema
1173
1609
  */
1174
1610
  address: {
1175
- ...Type7.Optional(Type7.String()),
1611
+ ...Type9.Optional(Type9.String()),
1176
1612
  description: `The address of the WireGuard interface.
1177
1613
 
1178
1614
  The address may be any IPv4 or IPv6 address. CIDR notation is also supported.`
1179
1615
  },
1180
- /**
1181
- * The list of allowed IPs for the peer.
1182
- *
1183
- * @schema
1184
- */
1185
- allowedIps: {
1186
- ...Type7.Optional(Type7.Array(Type7.String())),
1187
- description: `The list of allowed IPs for the peer.`
1188
- },
1189
1616
  /**
1190
1617
  * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.
1191
1618
  *
@@ -1194,7 +1621,7 @@ var sharedPeerArgs = {
1194
1621
  * @schema
1195
1622
  */
1196
1623
  exitNode: {
1197
- ...Type7.Optional(Type7.Boolean()),
1624
+ ...Type9.Default(Type9.Boolean(), false),
1198
1625
  description: `The convenience option to set \`allowedIps\` to \`0.0.0.0/0, ::/0\`.
1199
1626
 
1200
1627
  Will be merged with the \`allowedIps\` if provided.`
@@ -1211,7 +1638,7 @@ var sharedPeerArgs = {
1211
1638
  * @schema
1212
1639
  */
1213
1640
  excludedIps: {
1214
- ...Type7.Optional(Type7.Array(Type7.String())),
1641
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1215
1642
  description: `The list of IP ranges to exclude from the tunnel.
1216
1643
 
1217
1644
  Implementation notes:
@@ -1239,7 +1666,7 @@ var sharedPeerArgs = {
1239
1666
  * @schema
1240
1667
  */
1241
1668
  excludePrivateIps: {
1242
- ...Type7.Optional(Type7.Boolean()),
1669
+ ...Type9.Default(Type9.Boolean(), false),
1243
1670
  description: `The convenience option to exclude private IPs from the tunnel.
1244
1671
 
1245
1672
  For IPv4, the private IPs are:
@@ -1256,13 +1683,26 @@ var sharedPeerArgs = {
1256
1683
  Will be merged with \`excludedIps\` if provided.`
1257
1684
  },
1258
1685
  /**
1259
- * The endpoint of the WireGuard peer.
1686
+ * The endpoints of the WireGuard peer.
1687
+ *
1688
+ * @schema
1689
+ */
1690
+ endpoints: {
1691
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1692
+ description: `The endpoints of the WireGuard peer.`
1693
+ },
1694
+ /**
1695
+ * The allowed endpoints of the WireGuard peer.
1696
+ *
1697
+ * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
1260
1698
  *
1261
1699
  * @schema
1262
1700
  */
1263
- endpoint: {
1264
- ...Type7.Optional(Type7.String()),
1265
- description: `The endpoint of the WireGuard peer.`
1701
+ allowedEndpoints: {
1702
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1703
+ description: `The allowed endpoints of the WireGuard peer.
1704
+
1705
+ The non \`hostname\` endpoints will be added to the \`allowedIps\` of the peer.`
1266
1706
  },
1267
1707
  /**
1268
1708
  * The DNS servers that should be used by the interface connected to the WireGuard peer.
@@ -1272,7 +1712,7 @@ var sharedPeerArgs = {
1272
1712
  * @schema
1273
1713
  */
1274
1714
  dns: {
1275
- ...Type7.Optional(Type7.Array(Type7.String())),
1715
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1276
1716
  description: `The DNS servers that should be used by the interface connected to the WireGuard peer.
1277
1717
 
1278
1718
  If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).`
@@ -1285,38 +1725,121 @@ var sharedPeerArgs = {
1285
1725
  * @schema
1286
1726
  */
1287
1727
  includeDns: {
1288
- ...Type7.Optional(Type7.Boolean({ default: true })),
1728
+ ...Type9.Default(Type9.Boolean(), true),
1289
1729
  description: `The convenience option to include the DNS servers to the allowed IPs.
1290
1730
 
1291
1731
  By default, is \`true\`.`
1732
+ },
1733
+ /**
1734
+ * The port to listen on.
1735
+ *
1736
+ * @schema
1737
+ */
1738
+ listenPort: {
1739
+ ...Type9.Optional(Type9.Number()),
1740
+ description: `The port to listen on.`
1292
1741
  }
1293
1742
  };
1294
- var sharedInterfaceArgs = {
1743
+ var sharedPeerInputs = {
1295
1744
  /**
1296
- * The port to listen on.
1745
+ * The network to use for the WireGuard identity.
1297
1746
  *
1298
- * Will override the `listenPort` of the identity if provided.
1747
+ * If not provided, the identity will use default network configuration.
1299
1748
  *
1300
1749
  * @schema
1301
1750
  */
1302
- listenPort: {
1303
- ...Type7.Optional(Type7.Number()),
1304
- description: `The port to listen on.
1751
+ network: {
1752
+ ...{
1753
+ entity: networkEntity,
1754
+ required: false
1755
+ },
1756
+ description: `The network to use for the WireGuard identity.
1305
1757
 
1306
- Will override the \`listenPort\` of the identity if provided.`
1758
+ If not provided, the identity will use default network configuration.`
1307
1759
  },
1308
1760
  /**
1309
- * The DNS servers that should be used by the interface connected to the WireGuard node.
1761
+ * The L3 endpoints of the identity.
1310
1762
  *
1311
- * Will be merged with the DNS servers of the peers.
1763
+ * Will produce L4 endpoints for each of the provided L3 endpoints.
1312
1764
  *
1313
1765
  * @schema
1314
1766
  */
1315
- dns: {
1316
- ...Type7.Optional(Type7.Array(Type7.String())),
1317
- description: `The DNS servers that should be used by the interface connected to the WireGuard node.
1767
+ l3Endpoints: {
1768
+ ...{
1769
+ entity: l3EndpointEntity,
1770
+ multiple: true,
1771
+ required: false
1772
+ },
1773
+ description: `The L3 endpoints of the identity.
1774
+
1775
+ Will produce L4 endpoints for each of the provided L3 endpoints.`
1776
+ },
1777
+ /**
1778
+ * The L4 endpoints of the identity.
1779
+ *
1780
+ * Will take priority over all calculated endpoints if provided.
1781
+ *
1782
+ * @schema
1783
+ */
1784
+ l4Endpoints: {
1785
+ ...{
1786
+ entity: l4EndpointEntity,
1787
+ required: false,
1788
+ multiple: true
1789
+ },
1790
+ description: `The L4 endpoints of the identity.
1791
+
1792
+ Will take priority over all calculated endpoints if provided.`
1793
+ },
1794
+ /**
1795
+ * The L3 endpoints to add to the allowed IPs of the identity.
1796
+ *
1797
+ * `hostname` endpoints will be ignored.
1798
+ *
1799
+ * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1800
+ * the corresponding network policy will be created.
1801
+ *
1802
+ * @schema
1803
+ */
1804
+ allowedL3Endpoints: {
1805
+ ...{
1806
+ entity: l3EndpointEntity,
1807
+ multiple: true,
1808
+ required: false
1809
+ },
1810
+ description: `The L3 endpoints to add to the allowed IPs of the identity.
1811
+
1812
+ \`hostname\` endpoints will be ignored.
1813
+
1814
+ If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1815
+ the corresponding network policy will be created.`
1816
+ },
1817
+ /**
1818
+ * The L4 endpoints to add to the allowed IPs of the identity.
1819
+ *
1820
+ * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1821
+ * the corresponding network policy will be created.
1822
+ *
1823
+ * @schema
1824
+ */
1825
+ allowedL4Endpoints: {
1826
+ ...{
1827
+ entity: l4EndpointEntity,
1828
+ multiple: true,
1829
+ required: false
1830
+ },
1831
+ description: `The L4 endpoints to add to the allowed IPs of the identity.
1318
1832
 
1319
- Will be merged with the DNS servers of the peers.`
1833
+ If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1834
+ the corresponding network policy will be created.`
1835
+ }
1836
+ };
1837
+ var sharedPeerOutputs = {
1838
+ peer: peerEntity,
1839
+ endpoints: {
1840
+ entity: l4EndpointEntity,
1841
+ required: false,
1842
+ multiple: true
1320
1843
  }
1321
1844
  };
1322
1845
  var peer = defineUnit7({
@@ -1329,68 +1852,99 @@ var peer = defineUnit7({
1329
1852
  * @schema
1330
1853
  */
1331
1854
  publicKey: {
1332
- ...Type7.Optional(Type7.String()),
1855
+ ...Type9.String(),
1333
1856
  description: `The public key of the WireGuard peer.`
1334
1857
  }
1335
1858
  },
1336
- inputs: {
1859
+ secrets: {
1337
1860
  /**
1338
- * The network to use for the WireGuard peer.
1339
- *
1340
- * If not provided, the peer will use default network configuration.
1861
+ * The pre-shared key which should be used for the peer.
1341
1862
  *
1342
1863
  * @schema
1343
1864
  */
1344
- network: {
1345
- ...{
1346
- entity: networkEntity,
1347
- required: false
1348
- },
1349
- description: `The network to use for the WireGuard peer.
1350
-
1351
- If not provided, the peer will use default network configuration.`
1352
- },
1865
+ presharedKey: {
1866
+ ...Type9.Optional(Type9.String()),
1867
+ description: `The pre-shared key which should be used for the peer.`
1868
+ }
1869
+ },
1870
+ inputs: sharedPeerInputs,
1871
+ outputs: sharedPeerOutputs,
1872
+ meta: {
1873
+ description: "The WireGuard peer with the public key.",
1874
+ primaryIcon: "simple-icons:wireguard",
1875
+ primaryIconColor: "#88171a",
1876
+ secondaryIcon: "mdi:badge-account-horizontal",
1877
+ category: "VPN"
1878
+ },
1879
+ source: {
1880
+ package: "@highstate/wireguard",
1881
+ path: "peer"
1882
+ }
1883
+ });
1884
+ var peerPatch = defineUnit7({
1885
+ type: "wireguard.peer-patch",
1886
+ args: {
1353
1887
  /**
1354
- * The existing WireGuard peer to extend.
1888
+ * The endpoints of the WireGuard peer.
1355
1889
  *
1356
1890
  * @schema
1357
1891
  */
1358
- peer: {
1359
- ...{
1360
- entity: peerEntity,
1361
- required: false
1362
- },
1363
- description: `The existing WireGuard peer to extend.`
1892
+ endpoints: {
1893
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1894
+ description: `The endpoints of the WireGuard peer.`
1364
1895
  },
1365
1896
  /**
1366
- * The L4 endpoint of the peer.
1897
+ * The mode to use for patching the endpoints.
1898
+ *
1899
+ * - `prepend`: prepend the new endpoints to the existing ones (default);
1900
+ * - `replace`: replace the existing endpoints with the new ones.
1901
+ */
1902
+ endpointsPatchMode: Type9.Default(arrayPatchModeSchema, "prepend"),
1903
+ /**
1904
+ * The allowed endpoints of the WireGuard peer.
1367
1905
  *
1368
- * Will take priority over all calculated endpoints if provided.
1906
+ * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
1369
1907
  *
1370
1908
  * @schema
1371
1909
  */
1372
- l4Endpoint: {
1373
- ...{
1374
- entity: l4EndpointEntity,
1375
- required: false
1376
- },
1377
- description: `The L4 endpoint of the peer.
1910
+ allowedEndpoints: {
1911
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1912
+ description: `The allowed endpoints of the WireGuard peer.
1378
1913
 
1379
- Will take priority over all calculated endpoints if provided.`
1380
- }
1914
+ The non \`hostname\` endpoints will be added to the \`allowedIps\` of the peer.`
1915
+ },
1916
+ /**
1917
+ * The mode to use for patching the allowed endpoints.
1918
+ *
1919
+ * - `prepend`: prepend the new endpoints to the existing ones (default);
1920
+ * - `replace`: replace the existing endpoints with the new ones.
1921
+ */
1922
+ allowedEndpointsPatchMode: Type9.Default(arrayPatchModeSchema, "prepend"),
1923
+ ...omit(sharedPeerArgs, ["endpoints", "allowedEndpoints"])
1924
+ },
1925
+ inputs: {
1926
+ peer: peerEntity,
1927
+ ...sharedPeerInputs
1381
1928
  },
1382
1929
  outputs: {
1383
- peer: peerEntity
1930
+ peer: peerEntity,
1931
+ endpoints: {
1932
+ entity: l4EndpointEntity,
1933
+ required: false,
1934
+ multiple: true
1935
+ }
1384
1936
  },
1385
1937
  meta: {
1386
- description: "The WireGuard peer with the public key.",
1938
+ displayName: "WireGuard Peer Patch",
1939
+ description: "Patches some properties of the WireGuard peer.",
1387
1940
  primaryIcon: "simple-icons:wireguard",
1388
1941
  primaryIconColor: "#88171a",
1389
- secondaryIcon: "mdi:badge-account-horizontal"
1942
+ secondaryIcon: "mdi:badge-account-horizontal",
1943
+ category: "VPN"
1390
1944
  },
1391
1945
  source: {
1392
1946
  package: "@highstate/wireguard",
1393
- path: "peer"
1947
+ path: "peer-patch"
1394
1948
  }
1395
1949
  });
1396
1950
  var identity = defineUnit7({
@@ -1405,74 +1959,27 @@ var identity = defineUnit7({
1405
1959
  * @schema
1406
1960
  */
1407
1961
  listenPort: {
1408
- ...Type7.Optional(Type7.Number()),
1409
- description: `The port to listen on.
1410
-
1411
- Used by the implementation of the identity and to calculate the endpoint of the peer.`
1412
- },
1413
- /**
1414
- * The external IP address of the WireGuard identity.
1415
- *
1416
- * Used by the implementation of the identity and to calculate the endpoint of the peer.
1417
- *
1418
- * @schema
1419
- */
1420
- externalIp: {
1421
- ...Type7.Optional(Type7.String()),
1422
- description: `The external IP address of the WireGuard identity.
1962
+ ...Type9.Optional(Type9.Number()),
1963
+ description: `The port to listen on.
1423
1964
 
1424
1965
  Used by the implementation of the identity and to calculate the endpoint of the peer.`
1425
1966
  },
1426
1967
  /**
1427
1968
  * The endpoint of the WireGuard peer.
1428
1969
  *
1429
- * By default, the endpoint is calculated as `externalIp:listenPort`.
1430
- *
1431
1970
  * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
1432
1971
  *
1433
1972
  * Will take priority over all calculated endpoints and `l4Endpoint` input.
1434
1973
  *
1435
1974
  * @schema
1436
1975
  */
1437
- endpoint: {
1438
- ...Type7.Optional(Type7.String()),
1976
+ endpoints: {
1977
+ ...Type9.Default(Type9.Array(Type9.String()), []),
1439
1978
  description: `The endpoint of the WireGuard peer.
1440
1979
 
1441
- By default, the endpoint is calculated as \`externalIp:listenPort\`.
1442
-
1443
1980
  If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
1444
1981
 
1445
1982
  Will take priority over all calculated endpoints and \`l4Endpoint\` input.`
1446
- },
1447
- /**
1448
- * The FQDN of the WireGuard identity.
1449
- * Will be used as endpoint for the peer.
1450
- *
1451
- * 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),
1452
- * the FQDN will be registered with the DNS provider.
1453
- *
1454
- * @schema
1455
- */
1456
- fqdn: {
1457
- ...Type7.Optional(Type7.String()),
1458
- description: `The FQDN of the WireGuard identity.
1459
- Will be used as endpoint for the peer.
1460
-
1461
- 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),
1462
- the FQDN will be registered with the DNS provider.`
1463
- },
1464
- /**
1465
- * Whether to register the FQDN of the identity with the matching DNS providers.
1466
- *
1467
- * By default, `true`.
1468
- *
1469
- * @schema
1470
- */
1471
- registerFqdn: {
1472
- ...Type7.Default(Type7.Boolean(), true),
1473
- description: `Whether to register the FQDN of the identity with the matching DNS providers.
1474
-
1475
- By default, \`true\`.`
1476
1983
  }
1477
1984
  },
1478
1985
  secrets: {
@@ -1484,7 +1991,7 @@ var identity = defineUnit7({
1484
1991
  * @schema
1485
1992
  */
1486
1993
  privateKey: {
1487
- ...Type7.Optional(Type7.String()),
1994
+ ...Type9.Optional(Type9.String()),
1488
1995
  description: `The private key of the WireGuard identity.
1489
1996
 
1490
1997
  If not provided, the key will be generated automatically.`
@@ -1497,105 +2004,23 @@ var identity = defineUnit7({
1497
2004
  * @schema
1498
2005
  */
1499
2006
  presharedKeyPart: {
1500
- ...Type7.Optional(Type7.String()),
2007
+ ...Type9.Optional(Type9.String()),
1501
2008
  description: `The part of the pre-shared of the WireGuard identity.
1502
2009
 
1503
2010
  Will be generated automatically if not provided.`
1504
2011
  }
1505
2012
  },
1506
- inputs: {
1507
- /**
1508
- * The network to use for the WireGuard identity.
1509
- *
1510
- * If not provided, the identity will use default network configuration.
1511
- *
1512
- * @schema
1513
- */
1514
- network: {
1515
- ...{
1516
- entity: networkEntity,
1517
- required: false
1518
- },
1519
- description: `The network to use for the WireGuard identity.
1520
-
1521
- If not provided, the identity will use default network configuration.`
1522
- },
1523
- /**
1524
- * The list of Kubernetes services to expose the WireGuard identity.
1525
- *
1526
- * Their IP addresses will be added to the `allowedIps` of the identity and passed to the node to set up network policies.
1527
- *
1528
- * @schema
1529
- */
1530
- k8sServices: {
1531
- ...{
1532
- entity: serviceEntity,
1533
- multiple: true,
1534
- required: false
1535
- },
1536
- description: `The list of Kubernetes services to expose the WireGuard identity.
1537
-
1538
- Their IP addresses will be added to the \`allowedIps\` of the identity and passed to the node to set up network policies.`
1539
- },
1540
- /**
1541
- * The Kubernetes cluster associated with the identity.
1542
- *
1543
- * If provided, will be used to obtain the external IP or FQDN of the identity.
1544
- *
1545
- * @schema
1546
- */
1547
- k8sCluster: {
1548
- ...{
1549
- entity: clusterEntity2,
1550
- required: false
1551
- },
1552
- description: `The Kubernetes cluster associated with the identity.
1553
-
1554
- If provided, will be used to obtain the external IP or FQDN of the identity.`
1555
- },
1556
- /**
1557
- * The L4 endpoint of the identity.
1558
- *
1559
- * Will take priority over all calculated endpoints if provided.
1560
- *
1561
- * @schema
1562
- */
1563
- l4Endpoint: {
1564
- ...{
1565
- entity: l4EndpointEntity,
1566
- required: false
1567
- },
1568
- description: `The L4 endpoint of the identity.
1569
-
1570
- Will take priority over all calculated endpoints if provided.`
1571
- },
1572
- /**
1573
- * The DNS providers to register the FQDN of the identity with.
1574
- *
1575
- * @schema
1576
- */
1577
- dnsProviders: {
1578
- ...{
1579
- entity: providerEntity,
1580
- required: false,
1581
- multiple: true
1582
- },
1583
- description: `The DNS providers to register the FQDN of the identity with.`
1584
- }
1585
- },
2013
+ inputs: sharedPeerInputs,
1586
2014
  outputs: {
1587
2015
  identity: identityEntity,
1588
- peer: peerEntity,
1589
- l4Endpoint: {
1590
- entity: l4EndpointEntity,
1591
- required: false
1592
- }
2016
+ ...sharedPeerOutputs
1593
2017
  },
1594
2018
  meta: {
1595
2019
  description: "The WireGuard identity with the public key.",
1596
2020
  primaryIcon: "simple-icons:wireguard",
1597
2021
  primaryIconColor: "#88171a",
1598
- secondaryIcon: "mdi:account"
2022
+ secondaryIcon: "mdi:account",
2023
+ category: "VPN"
1599
2024
  },
1600
2025
  source: {
1601
2026
  package: "@highstate/wireguard",
@@ -1605,22 +2030,38 @@ var identity = defineUnit7({
1605
2030
  var node = defineUnit7({
1606
2031
  type: "wireguard.node",
1607
2032
  args: {
1608
- appName: Type7.Optional(Type7.String()),
1609
- serviceType: Type7.Optional(serviceTypeSchema),
1610
- ...sharedInterfaceArgs,
1611
2033
  /**
1612
- * The external IP address of the WireGuard node.
2034
+ * The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
1613
2035
  *
1614
- * Will override the `externalIp` of the identity if provided.
2036
+ * By default, the name is `wg-${identity.name}`.
1615
2037
  *
1616
2038
  * @schema
1617
2039
  */
1618
- externalIp: {
1619
- ...Type7.Optional(Type7.String()),
1620
- description: `The external IP address of the WireGuard node.
2040
+ appName: {
2041
+ ...Type9.Optional(Type9.String()),
2042
+ description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
1621
2043
 
1622
- Will override the \`externalIp\` of the identity if provided.`
2044
+ By default, the name is \`wg-\${identity.name}\`.`
1623
2045
  },
2046
+ /**
2047
+ * Whether to expose the WireGuard node to the outside world.
2048
+ *
2049
+ * @schema
2050
+ */
2051
+ external: {
2052
+ ...Type9.Default(Type9.Boolean(), false),
2053
+ description: `Whether to expose the WireGuard node to the outside world.`
2054
+ },
2055
+ /**
2056
+ * The policy to use for exposing the WireGuard node.
2057
+ *
2058
+ * - `always` - The node will be exposed and the service will be created.
2059
+ * - `when-has-endpoint` - The node will be exposed only if the provided idenity has at least one endpoint.
2060
+ * - `never` - The node will not be exposed and the service will not be created.
2061
+ *
2062
+ * * By default, the `when-has-endpoint` policy is used.
2063
+ */
2064
+ exposePolicy: Type9.Default(nodeExposePolicySchema, "when-has-endpoint"),
1624
2065
  /**
1625
2066
  * The extra specification of the container which runs the WireGuard node.
1626
2067
  *
@@ -1629,7 +2070,7 @@ var node = defineUnit7({
1629
2070
  * @schema
1630
2071
  */
1631
2072
  containerSpec: {
1632
- ...Type7.Optional(Type7.Record(Type7.String(), Type7.Any())),
2073
+ ...Type9.Optional(Type9.Record(Type9.String(), Type9.Any())),
1633
2074
  description: `The extra specification of the container which runs the WireGuard node.
1634
2075
 
1635
2076
  Will override any overlapping fields.`
@@ -1638,12 +2079,8 @@ var node = defineUnit7({
1638
2079
  inputs: {
1639
2080
  identity: identityEntity,
1640
2081
  k8sCluster: clusterEntity2,
1641
- deployment: {
1642
- entity: deploymentEntity,
1643
- required: false
1644
- },
1645
- statefulSet: {
1646
- entity: statefulSetEntity,
2082
+ workload: {
2083
+ entity: exposableWorkloadEntity,
1647
2084
  required: false
1648
2085
  },
1649
2086
  interface: {
@@ -1657,24 +2094,26 @@ var node = defineUnit7({
1657
2094
  }
1658
2095
  },
1659
2096
  outputs: {
1660
- deployment: {
1661
- entity: deploymentEntity,
1662
- required: false
1663
- },
1664
2097
  interface: {
1665
2098
  entity: interfaceEntity,
1666
2099
  required: false
1667
2100
  },
1668
- service: {
1669
- entity: serviceEntity,
2101
+ peer: {
2102
+ entity: peerEntity,
1670
2103
  required: false
2104
+ },
2105
+ endpoints: {
2106
+ entity: l4EndpointEntity,
2107
+ required: false,
2108
+ multiple: true
1671
2109
  }
1672
2110
  },
1673
2111
  meta: {
1674
2112
  description: "The WireGuard node running on the Kubernetes.",
1675
2113
  primaryIcon: "simple-icons:wireguard",
1676
2114
  primaryIconColor: "#88171a",
1677
- secondaryIcon: "mdi:server"
2115
+ secondaryIcon: "mdi:server",
2116
+ category: "VPN"
1678
2117
  },
1679
2118
  source: {
1680
2119
  package: "@highstate/wireguard",
@@ -1684,7 +2123,6 @@ var node = defineUnit7({
1684
2123
  var config = defineUnit7({
1685
2124
  type: "wireguard.config",
1686
2125
  args: {
1687
- ...sharedInterfaceArgs,
1688
2126
  /**
1689
2127
  * The name of the "default" interface where non-tunneled traffic should go.
1690
2128
  *
@@ -1693,7 +2131,7 @@ var config = defineUnit7({
1693
2131
  * @schema
1694
2132
  */
1695
2133
  defaultInterface: {
1696
- ...Type7.Optional(Type7.String()),
2134
+ ...Type9.Optional(Type9.String()),
1697
2135
  description: `The name of the "default" interface where non-tunneled traffic should go.
1698
2136
 
1699
2137
  If not provided, the config will not respect \`excludedIps\`.`
@@ -1712,7 +2150,8 @@ var config = defineUnit7({
1712
2150
  description: "Just the WireGuard configuration for the identity and peers.",
1713
2151
  primaryIcon: "simple-icons:wireguard",
1714
2152
  primaryIconColor: "#88171a",
1715
- secondaryIcon: "mdi:settings"
2153
+ secondaryIcon: "mdi:settings",
2154
+ category: "VPN"
1716
2155
  },
1717
2156
  source: {
1718
2157
  package: "@highstate/wireguard",
@@ -1738,7 +2177,8 @@ var configBundle = defineUnit7({
1738
2177
  description: "The WireGuard configuration bundle for the identity and peers.",
1739
2178
  primaryIcon: "simple-icons:wireguard",
1740
2179
  primaryIconColor: "#88171a",
1741
- secondaryIcon: "mdi:folder-settings-variant"
2180
+ secondaryIcon: "mdi:folder-settings-variant",
2181
+ category: "VPN"
1742
2182
  },
1743
2183
  source: {
1744
2184
  package: "@highstate/wireguard",
@@ -1751,7 +2191,11 @@ var apps_exports = {};
1751
2191
  __export(apps_exports, {
1752
2192
  backupModeSchema: () => backupModeSchema,
1753
2193
  codeServer: () => codeServer,
2194
+ createArgs: () => createArgs2,
2195
+ createInputs: () => createInputs,
1754
2196
  deployment: () => deployment,
2197
+ endpointFilter: () => endpointFilter,
2198
+ explicitEndpointFilterSchema: () => explicitEndpointFilterSchema,
1755
2199
  grocy: () => grocy,
1756
2200
  kubernetesDashboard: () => kubernetesDashboard,
1757
2201
  mariadb: () => mariadb,
@@ -1764,13 +2208,18 @@ __export(apps_exports, {
1764
2208
  postgresql: () => postgresql,
1765
2209
  postgresqlDatabase: () => postgresqlDatabase,
1766
2210
  postgresqlEntity: () => postgresqlEntity,
2211
+ recordSet: () => recordSet,
2212
+ sharedArgs: () => sharedArgs,
1767
2213
  syncthing: () => syncthing,
1768
2214
  traefikGateway: () => traefikGateway,
1769
2215
  vaultwarden: () => vaultwarden
1770
2216
  });
1771
2217
 
1772
2218
  // src/apps/mariadb.ts
1773
- import { defineEntity as defineEntity9, defineUnit as defineUnit9, Type as Type9 } from "@highstate/contract";
2219
+ import { defineEntity as defineEntity10, defineUnit as defineUnit9, Type as Type12 } from "@highstate/contract";
2220
+
2221
+ // src/apps/shared.ts
2222
+ import { Type as Type11 } from "@highstate/contract";
1774
2223
 
1775
2224
  // src/restic.ts
1776
2225
  var restic_exports = {};
@@ -1778,16 +2227,16 @@ __export(restic_exports, {
1778
2227
  repo: () => repo,
1779
2228
  repoEntity: () => repoEntity
1780
2229
  });
1781
- import { defineEntity as defineEntity8, defineUnit as defineUnit8, Type as Type8 } from "@highstate/contract";
1782
- var repoEntity = defineEntity8({
2230
+ import { defineEntity as defineEntity9, defineUnit as defineUnit8, Type as Type10 } from "@highstate/contract";
2231
+ var repoEntity = defineEntity9({
1783
2232
  type: "restic.repo",
1784
- schema: Type8.Object({
1785
- password: Type8.String(),
1786
- remoteDomains: Type8.Array(Type8.String()),
1787
- type: Type8.Literal("rclone"),
1788
- rcloneConfig: Type8.String(),
1789
- remoteName: Type8.String(),
1790
- basePath: Type8.String()
2233
+ schema: Type10.Object({
2234
+ password: Type10.String(),
2235
+ remoteEndpoints: Type10.Array(Type10.String()),
2236
+ type: Type10.Literal("rclone"),
2237
+ rcloneConfig: Type10.String(),
2238
+ remoteName: Type10.String(),
2239
+ basePath: Type10.String()
1791
2240
  }),
1792
2241
  meta: {
1793
2242
  color: "#e56901"
@@ -1796,12 +2245,12 @@ var repoEntity = defineEntity8({
1796
2245
  var repo = defineUnit8({
1797
2246
  type: "restic.repo",
1798
2247
  args: {
1799
- remoteDomains: Type8.Optional(Type8.Array(Type8.String())),
1800
- basePath: Type8.Optional(Type8.String())
2248
+ remoteDomains: Type10.Optional(Type10.Array(Type10.String())),
2249
+ basePath: Type10.Optional(Type10.String())
1801
2250
  },
1802
2251
  secrets: {
1803
- password: Type8.Optional(Type8.String()),
1804
- rcloneConfig: Type8.String({ multiline: true })
2252
+ password: Type10.Optional(Type10.String()),
2253
+ rcloneConfig: Type10.String({ multiline: true })
1805
2254
  },
1806
2255
  outputs: {
1807
2256
  repo: repoEntity
@@ -1810,7 +2259,8 @@ var repo = defineUnit8({
1810
2259
  displayName: "Restic Repo",
1811
2260
  description: "Holds the configuration for a Restic repository and its remote storage.",
1812
2261
  primaryIconColor: "#e56901",
1813
- primaryIcon: "material-symbols:backup"
2262
+ primaryIcon: "material-symbols:backup",
2263
+ category: "Infrastructure"
1814
2264
  },
1815
2265
  source: {
1816
2266
  package: "@highstate/restic",
@@ -1818,39 +2268,126 @@ var repo = defineUnit8({
1818
2268
  }
1819
2269
  });
1820
2270
 
2271
+ // src/apps/shared.ts
2272
+ var extraArgsDefinitions = {
2273
+ fqdn: {
2274
+ schema: Type11.String()
2275
+ },
2276
+ endpoints: {
2277
+ schema: Type11.Array(Type11.String()),
2278
+ required: false
2279
+ },
2280
+ external: {
2281
+ schema: Type11.Boolean(),
2282
+ required: false
2283
+ }
2284
+ };
2285
+ var eagerExtraInputDefinitions = {
2286
+ accessPoint: {
2287
+ entity: accessPointEntity
2288
+ },
2289
+ resticRepo: {
2290
+ entity: repoEntity,
2291
+ required: false
2292
+ },
2293
+ dnsProviders: {
2294
+ entity: providerEntity,
2295
+ required: false,
2296
+ multiple: true
2297
+ },
2298
+ volume: {
2299
+ entity: persistentVolumeClaimEntity,
2300
+ required: false
2301
+ }
2302
+ };
2303
+ var extraInputDefinitions = {
2304
+ ...eagerExtraInputDefinitions
2305
+ };
2306
+ function createArgs2(defaultAppName, extraArgs) {
2307
+ const base = {
2308
+ appName: Type11.Default(Type11.String(), defaultAppName)
2309
+ };
2310
+ const dynamicArgs = {};
2311
+ if (Array.isArray(extraArgs)) {
2312
+ for (const name of extraArgs) {
2313
+ dynamicArgs[name] = extraArgsDefinitions[name];
2314
+ }
2315
+ } else {
2316
+ const { required, optional } = extraArgs ?? {};
2317
+ for (const name of required ?? []) {
2318
+ dynamicArgs[name] = {
2319
+ ...extraArgsDefinitions[name],
2320
+ required: true
2321
+ };
2322
+ }
2323
+ for (const name of optional ?? []) {
2324
+ dynamicArgs[name] = {
2325
+ ...extraArgsDefinitions[name],
2326
+ required: false
2327
+ };
2328
+ }
2329
+ }
2330
+ return {
2331
+ ...base,
2332
+ ...dynamicArgs
2333
+ };
2334
+ }
2335
+ function createInputs(inputs2) {
2336
+ const base = {
2337
+ k8sCluster: clusterEntity2
2338
+ };
2339
+ const dynamicInputs = {};
2340
+ if (Array.isArray(inputs2)) {
2341
+ for (const name of inputs2) {
2342
+ dynamicInputs[name] = extraInputDefinitions[name];
2343
+ }
2344
+ } else {
2345
+ const { required, optional } = inputs2 ?? {};
2346
+ for (const name of required ?? []) {
2347
+ dynamicInputs[name] = {
2348
+ ...extraInputDefinitions[name],
2349
+ required: true
2350
+ };
2351
+ }
2352
+ for (const name of optional ?? []) {
2353
+ dynamicInputs[name] = {
2354
+ ...extraInputDefinitions[name],
2355
+ required: false
2356
+ };
2357
+ }
2358
+ }
2359
+ return {
2360
+ ...base,
2361
+ ...dynamicInputs
2362
+ };
2363
+ }
2364
+ function createSource(path) {
2365
+ return {
2366
+ package: "@highstate/apps",
2367
+ path
2368
+ };
2369
+ }
2370
+ var databaseSchema = Type11.Object({
2371
+ endpoints: Type11.Array(l4EndpointEntity.schema),
2372
+ service: Type11.Optional(serviceEntity.schema),
2373
+ rootPassword: Type11.String()
2374
+ });
2375
+
1821
2376
  // src/apps/mariadb.ts
1822
- var mariadbEntity = defineEntity9({
2377
+ var mariadbEntity = defineEntity10({
1823
2378
  type: "apps.mariadb",
1824
- schema: Type9.Object({
1825
- service: Type9.Optional(serviceEntity.schema),
1826
- host: Type9.String(),
1827
- port: Type9.Number(),
1828
- rootPassword: Type9.String()
1829
- }),
2379
+ schema: databaseSchema,
1830
2380
  meta: {
1831
2381
  color: "#f06292"
1832
2382
  }
1833
2383
  });
1834
2384
  var mariadb = defineUnit9({
1835
2385
  type: "apps.mariadb",
1836
- args: {
1837
- fqdn: Type9.Optional(Type9.String()),
1838
- appName: Type9.Optional(Type9.String())
1839
- },
2386
+ args: createArgs2("mariadb", ["external"]),
1840
2387
  secrets: {
1841
- rootPassword: Type9.Optional(Type9.String())
1842
- },
1843
- inputs: {
1844
- k8sCluster: clusterEntity2,
1845
- resticRepo: {
1846
- entity: repoEntity,
1847
- required: false
1848
- },
1849
- dnsProvider: {
1850
- entity: providerEntity,
1851
- required: false
1852
- }
2388
+ rootPassword: Type12.Optional(Type12.String())
1853
2389
  },
2390
+ inputs: createInputs(["resticRepo"]),
1854
2391
  outputs: {
1855
2392
  mariadb: mariadbEntity,
1856
2393
  service: serviceEntity
@@ -1859,72 +2396,51 @@ var mariadb = defineUnit9({
1859
2396
  displayName: "MariaDB",
1860
2397
  description: "The MariaDB database deployed on Kubernetes.",
1861
2398
  primaryIcon: "simple-icons:mariadb",
1862
- secondaryIcon: "mdi:database"
2399
+ secondaryIcon: "mdi:database",
2400
+ category: "Databases"
1863
2401
  },
1864
- source: {
1865
- package: "@highstate/apps",
1866
- path: "mariadb/app"
1867
- }
2402
+ source: createSource("mariadb/app")
1868
2403
  });
2404
+ extraInputDefinitions.mariadb = {
2405
+ entity: mariadbEntity,
2406
+ displayName: "MariaDB"
2407
+ };
1869
2408
  var mariadbDatabase = defineUnit9({
1870
2409
  type: "apps.mariadb.database",
1871
2410
  args: {
1872
- database: Type9.Optional(Type9.String()),
1873
- username: Type9.Optional(Type9.String())
2411
+ database: Type12.Optional(Type12.String()),
2412
+ username: Type12.Optional(Type12.String())
1874
2413
  },
2414
+ inputs: createInputs(["mariadb"]),
1875
2415
  secrets: {
1876
- password: Type9.Optional(Type9.String())
1877
- },
1878
- inputs: {
1879
- k8sCluster: clusterEntity2,
1880
- mariadb: mariadbEntity
2416
+ password: Type12.Optional(Type12.String())
1881
2417
  },
1882
2418
  meta: {
1883
2419
  displayName: "MariaDB Database",
1884
2420
  description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
1885
2421
  primaryIcon: "simple-icons:mariadb",
1886
- secondaryIcon: "mdi:database-plus"
2422
+ secondaryIcon: "mdi:database-plus",
2423
+ category: "Databases"
1887
2424
  },
1888
- source: {
1889
- package: "@highstate/apps",
1890
- path: "mariadb/database"
1891
- }
2425
+ source: createSource("mariadb/database")
1892
2426
  });
1893
2427
 
1894
2428
  // src/apps/postgresql.ts
1895
- import { defineEntity as defineEntity10, defineUnit as defineUnit10, Type as Type10 } from "@highstate/contract";
1896
- var postgresqlEntity = defineEntity10({
2429
+ import { defineEntity as defineEntity11, defineUnit as defineUnit10, Type as Type13 } from "@highstate/contract";
2430
+ var postgresqlEntity = defineEntity11({
1897
2431
  type: "apps.postgresql",
1898
- schema: Type10.Object({
1899
- service: Type10.Optional(serviceEntity.schema),
1900
- host: Type10.String(),
1901
- port: Type10.Number(),
1902
- rootPassword: Type10.String()
1903
- }),
2432
+ schema: databaseSchema,
1904
2433
  meta: {
1905
2434
  color: "#336791"
1906
2435
  }
1907
2436
  });
1908
2437
  var postgresql = defineUnit10({
1909
2438
  type: "apps.postgresql",
1910
- args: {
1911
- fqdn: Type10.Optional(Type10.String()),
1912
- appName: Type10.Optional(Type10.String())
1913
- },
2439
+ args: createArgs2("postgresql", ["external"]),
1914
2440
  secrets: {
1915
- rootPassword: Type10.Optional(Type10.String())
1916
- },
1917
- inputs: {
1918
- k8sCluster: clusterEntity2,
1919
- resticRepo: {
1920
- entity: repoEntity,
1921
- required: false
1922
- },
1923
- dnsProvider: {
1924
- entity: providerEntity,
1925
- required: false
1926
- }
2441
+ rootPassword: Type13.Optional(Type13.String())
1927
2442
  },
2443
+ inputs: createInputs(["resticRepo", "dnsProviders"]),
1928
2444
  outputs: {
1929
2445
  postgresql: postgresqlEntity,
1930
2446
  service: serviceEntity
@@ -1933,77 +2449,259 @@ var postgresql = defineUnit10({
1933
2449
  displayName: "PostgreSQL",
1934
2450
  description: "The PostgreSQL database deployed on Kubernetes.",
1935
2451
  primaryIcon: "simple-icons:postgresql",
1936
- secondaryIcon: "mdi:database"
2452
+ secondaryIcon: "mdi:database",
2453
+ category: "Databases"
1937
2454
  },
1938
- source: {
1939
- package: "@highstate/apps",
1940
- path: "postgresql/app"
1941
- }
2455
+ source: createSource("postgresql/app")
1942
2456
  });
2457
+ extraInputDefinitions.postgresql = {
2458
+ entity: postgresqlEntity,
2459
+ displayName: "PostgreSQL"
2460
+ };
1943
2461
  var postgresqlDatabase = defineUnit10({
1944
2462
  type: "apps.postgresql.database",
1945
2463
  args: {
1946
- database: Type10.Optional(Type10.String()),
1947
- username: Type10.Optional(Type10.String())
2464
+ database: Type13.Optional(Type13.String()),
2465
+ username: Type13.Optional(Type13.String())
1948
2466
  },
1949
2467
  secrets: {
1950
- password: Type10.Optional(Type10.String())
1951
- },
1952
- inputs: {
1953
- k8sCluster: clusterEntity2,
1954
- postgresql: postgresqlEntity
2468
+ password: Type13.Optional(Type13.String())
1955
2469
  },
2470
+ inputs: createInputs(["postgresql"]),
1956
2471
  meta: {
1957
2472
  displayName: "PostgreSQL Database",
1958
2473
  description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
1959
2474
  primaryIcon: "simple-icons:postgresql",
1960
- secondaryIcon: "mdi:database-plus"
2475
+ secondaryIcon: "mdi:database-plus",
2476
+ category: "Databases"
1961
2477
  },
1962
- source: {
1963
- package: "@highstate/apps",
1964
- path: "postgresql/database"
1965
- }
2478
+ source: createSource("postgresql/database")
1966
2479
  });
1967
2480
 
1968
2481
  // src/apps/vaultwarden.ts
1969
- import { defineUnit as defineUnit11, Type as Type11 } from "@highstate/contract";
2482
+ import { defineUnit as defineUnit11, Type as Type14 } from "@highstate/contract";
1970
2483
  var vaultwarden = defineUnit11({
1971
2484
  type: "apps.vaultwarden",
2485
+ args: createArgs2("vaultwarden", ["fqdn"]),
2486
+ secrets: {
2487
+ mariadbPassword: Type14.Optional(Type14.String())
2488
+ },
2489
+ inputs: createInputs(["accessPoint", "mariadb"]),
2490
+ meta: {
2491
+ displayName: "Vaultwarden",
2492
+ description: "The Vaultwarden password manager deployed on Kubernetes.",
2493
+ primaryIcon: "simple-icons:vaultwarden",
2494
+ category: "Security"
2495
+ },
2496
+ source: createSource("vaultwarden")
2497
+ });
2498
+
2499
+ // src/apps/mongodb.ts
2500
+ import { defineEntity as defineEntity12, defineUnit as defineUnit12, Type as Type15 } from "@highstate/contract";
2501
+ var mongodbEntity = defineEntity12({
2502
+ type: "apps.mongodb",
2503
+ schema: databaseSchema,
2504
+ meta: {
2505
+ color: "#13aa52"
2506
+ }
2507
+ });
2508
+ var mongodb = defineUnit12({
2509
+ type: "apps.mongodb",
2510
+ args: createArgs2("mongodb", ["external"]),
2511
+ secrets: {
2512
+ rootPassword: Type15.Optional(Type15.String())
2513
+ },
2514
+ inputs: createInputs(["resticRepo"]),
2515
+ outputs: {
2516
+ mongodb: mongodbEntity,
2517
+ service: serviceEntity
2518
+ },
2519
+ meta: {
2520
+ displayName: "MongoDB",
2521
+ description: "The MongoDB instance deployed on Kubernetes.",
2522
+ primaryIcon: "simple-icons:mongodb",
2523
+ secondaryIcon: "mdi:database",
2524
+ category: "Databases"
2525
+ },
2526
+ source: createSource("mongodb/app")
2527
+ });
2528
+ extraInputDefinitions.mongodb = {
2529
+ entity: mongodbEntity,
2530
+ displayName: "MongoDB"
2531
+ };
2532
+ var mongodbDatabase = defineUnit12({
2533
+ type: "apps.mongodb.database",
2534
+ args: {
2535
+ database: Type15.Optional(Type15.String()),
2536
+ username: Type15.Optional(Type15.String())
2537
+ },
2538
+ secrets: {
2539
+ password: Type15.Optional(Type15.String())
2540
+ },
2541
+ inputs: createInputs(["mongodb"]),
2542
+ meta: {
2543
+ displayName: "MongoDB Database",
2544
+ description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
2545
+ primaryIcon: "simple-icons:mongodb",
2546
+ secondaryIcon: "mdi:database-plus",
2547
+ category: "Databases"
2548
+ },
2549
+ source: createSource("mongodb/database")
2550
+ });
2551
+
2552
+ // src/apps/network.ts
2553
+ import { defineUnit as defineUnit13, Type as Type16 } from "@highstate/contract";
2554
+ var explicitEndpointFilterSchema = Type16.StringEnum(["public", "external", "internal"]);
2555
+ var endpointFilter = defineUnit13({
2556
+ type: "apps.endpoint-filter",
1972
2557
  args: {
1973
- fqdn: Type11.String(),
1974
- appName: Type11.Optional(Type11.String())
2558
+ /**
2559
+ * The filter to apply to the endpoints.
2560
+ *
2561
+ * - `public`: Only public endpoints accessible from the internet.
2562
+ * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
2563
+ * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
2564
+ */
2565
+ filter: Type16.Default(explicitEndpointFilterSchema, "public")
1975
2566
  },
1976
2567
  inputs: {
1977
- mariadb: mariadbEntity,
1978
- accessPoint: accessPointEntity,
1979
- k8sCluster: clusterEntity2
2568
+ l3Endpoints: {
2569
+ entity: l3EndpointEntity,
2570
+ multiple: true,
2571
+ required: false
2572
+ },
2573
+ l4Endpoints: {
2574
+ entity: l4EndpointEntity,
2575
+ multiple: true,
2576
+ required: false
2577
+ }
2578
+ },
2579
+ outputs: {
2580
+ l3Endpoints: {
2581
+ entity: l3EndpointEntity,
2582
+ multiple: true
2583
+ },
2584
+ l4Endpoints: {
2585
+ entity: l4EndpointEntity,
2586
+ multiple: true
2587
+ }
2588
+ },
2589
+ meta: {
2590
+ displayName: "Endpoint Filter",
2591
+ description: "Explicitly filter endpoints by their accessibility.",
2592
+ primaryIcon: "mdi:network-outline",
2593
+ primaryIconColor: "#FF9800",
2594
+ secondaryIcon: "mdi:filter-outline",
2595
+ category: "Network"
2596
+ },
2597
+ source: createSource("endpoint-filter")
2598
+ });
2599
+
2600
+ // src/apps/dns.ts
2601
+ import { defineUnit as defineUnit14, Type as Type17 } from "@highstate/contract";
2602
+ var endpointFilterSchema2 = Type17.StringEnum(["all", "public", "external", "internal"]);
2603
+ var recordSet = defineUnit14({
2604
+ type: "apps.dns-record-set",
2605
+ args: {
2606
+ /**
2607
+ * The name of the DNS record.
2608
+ *
2609
+ * If not provided, will use the name of the unit.
2610
+ */
2611
+ recordName: Type17.Optional(Type17.String()),
2612
+ /**
2613
+ * The type of the DNS record.
2614
+ *
2615
+ * If not specified, will use the default type for the provider.
2616
+ */
2617
+ type: Type17.Optional(Type17.String()),
2618
+ /**
2619
+ * The values of the DNS record.
2620
+ */
2621
+ values: Type17.Array(Type17.String()),
2622
+ /**
2623
+ * The TTL of the DNS record.
2624
+ */
2625
+ ttl: Type17.Optional(Type17.Number()),
2626
+ /**
2627
+ * The priority of the DNS record.
2628
+ */
2629
+ priority: Type17.Optional(Type17.Number()),
2630
+ /**
2631
+ * Whether the DNS record is proxied.
2632
+ *
2633
+ * Available only for public IPs and some DNS providers like Cloudflare.
2634
+ */
2635
+ proxied: Type17.Optional(Type17.Boolean()),
2636
+ /**
2637
+ * The filter to apply to the endpoints.
2638
+ *
2639
+ * - `all`: All endpoints.
2640
+ * - `public`: Only public endpoints accessible from the internet (default).
2641
+ * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
2642
+ * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
2643
+ */
2644
+ endpointFilter: Type17.Default(endpointFilterSchema2, "public")
2645
+ },
2646
+ inputs: {
2647
+ dnsProviders: {
2648
+ entity: providerEntity,
2649
+ multiple: true
2650
+ },
2651
+ l3Endpoints: {
2652
+ entity: l3EndpointEntity,
2653
+ required: false,
2654
+ multiple: true
2655
+ },
2656
+ l4Endpoints: {
2657
+ entity: l4EndpointEntity,
2658
+ required: false,
2659
+ multiple: true
2660
+ }
1980
2661
  },
1981
- secrets: {
1982
- mariadbPassword: Type11.Optional(Type11.String())
2662
+ outputs: {
2663
+ /**
2664
+ * The single L3 endpoint representing created DNS records.
2665
+ */
2666
+ l3Endpoint: l3EndpointEntity,
2667
+ /**
2668
+ * Multiple L4 endpoints representing created DNS records for each unique port/protocol combination from the input L4 endpoints.
2669
+ */
2670
+ l4Endpoints: {
2671
+ entity: l4EndpointEntity,
2672
+ multiple: true
2673
+ }
1983
2674
  },
1984
2675
  meta: {
1985
- displayName: "Vaultwarden",
1986
- description: "The Vaultwarden password manager deployed on Kubernetes.",
1987
- primaryIcon: "simple-icons:vaultwarden"
2676
+ displayName: "DNS Record Set",
2677
+ description: "A set of DNS records to be created.",
2678
+ primaryIcon: "mdi:server",
2679
+ defaultNamePrefix: "record",
2680
+ category: "Network"
1988
2681
  },
1989
- source: {
1990
- package: "@highstate/apps",
1991
- path: "vaultwarden"
1992
- }
2682
+ source: createSource("dns-record-set")
1993
2683
  });
2684
+ var sharedArgs = {
2685
+ /**
2686
+ * The FQDN to register the cluster nodes with.
2687
+ *
2688
+ * @schema
2689
+ */
2690
+ fqdn: {
2691
+ ...Type17.Optional(Type17.String()),
2692
+ description: `The FQDN to register the cluster nodes with.`
2693
+ }
2694
+ };
1994
2695
 
1995
2696
  // src/apps/traefik.ts
1996
- import { defineUnit as defineUnit12, Type as Type12 } from "@highstate/contract";
1997
- var traefikGateway = defineUnit12({
2697
+ import { defineUnit as defineUnit15, Type as Type18 } from "@highstate/contract";
2698
+ var traefikGateway = defineUnit15({
1998
2699
  type: "apps.traefik-gateway",
1999
2700
  args: {
2000
- appName: Type12.Optional(Type12.String()),
2001
- className: Type12.Optional(Type12.String()),
2002
- serviceType: Type12.Optional(serviceTypeSchema)
2003
- },
2004
- inputs: {
2005
- k8sCluster: clusterEntity2
2701
+ ...createArgs2("traefik", ["external"]),
2702
+ className: Type18.Optional(Type18.String())
2006
2703
  },
2704
+ inputs: createInputs(),
2007
2705
  outputs: {
2008
2706
  gateway: gatewayEntity,
2009
2707
  service: serviceEntity
@@ -2011,7 +2709,8 @@ var traefikGateway = defineUnit12({
2011
2709
  meta: {
2012
2710
  displayName: "Traefik Gateway",
2013
2711
  description: "A Traefik gateway for routing traffic to services.",
2014
- primaryIcon: "simple-icons:traefikproxy"
2712
+ primaryIcon: "simple-icons:traefikproxy",
2713
+ category: "Network"
2015
2714
  },
2016
2715
  source: {
2017
2716
  package: "@highstate/apps",
@@ -2020,250 +2719,128 @@ var traefikGateway = defineUnit12({
2020
2719
  });
2021
2720
 
2022
2721
  // src/apps/kubernetes-dashboard.ts
2023
- import { defineUnit as defineUnit13, Type as Type13 } from "@highstate/contract";
2024
- var kubernetesDashboard = defineUnit13({
2722
+ import { defineUnit as defineUnit16 } from "@highstate/contract";
2723
+ var kubernetesDashboard = defineUnit16({
2025
2724
  type: "apps.kubernetes-dashboard",
2026
- args: {
2027
- fqdn: Type13.String(),
2028
- appName: Type13.Optional(Type13.String())
2029
- },
2030
- inputs: {
2031
- k8sCluster: clusterEntity2,
2032
- accessPoint: accessPointEntity
2033
- },
2725
+ args: createArgs2("kubernetes-dashboard", ["fqdn"]),
2726
+ inputs: createInputs(["accessPoint"]),
2034
2727
  meta: {
2035
2728
  displayName: "Kubernetes Dashboard",
2036
2729
  description: "The Kubernetes Dashboard deployed on Kubernetes.",
2037
- primaryIcon: "simple-icons:kubernetes",
2038
- secondaryIcon: "mdi:dashboard"
2730
+ primaryIcon: "devicon:kubernetes",
2731
+ secondaryIcon: "material-symbols:dashboard",
2732
+ category: "Kubernetes"
2039
2733
  },
2040
- source: {
2041
- package: "@highstate/apps",
2042
- path: "kubernetes-dashboard"
2043
- }
2734
+ source: createSource("kubernetes-dashboard")
2044
2735
  });
2045
2736
 
2046
2737
  // src/apps/grocy.ts
2047
- import { defineUnit as defineUnit14, Type as Type14 } from "@highstate/contract";
2048
- var grocy = defineUnit14({
2738
+ import { defineUnit as defineUnit17 } from "@highstate/contract";
2739
+ var grocy = defineUnit17({
2049
2740
  type: "apps.grocy",
2050
- args: {
2051
- fqdn: Type14.String(),
2052
- appName: Type14.Optional(Type14.String())
2053
- },
2054
- inputs: {
2055
- resticRepo: {
2056
- entity: repoEntity,
2057
- required: false
2058
- },
2059
- accessPoint: accessPointEntity,
2060
- k8sCluster: clusterEntity2
2061
- },
2741
+ args: createArgs2("grocy", ["fqdn"]),
2742
+ inputs: createInputs(["accessPoint", "resticRepo"]),
2062
2743
  meta: {
2063
2744
  displayName: "Grocy",
2064
2745
  description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
2065
- primaryIcon: "simple-icons:grocy"
2746
+ primaryIcon: "simple-icons:grocy",
2747
+ category: "Productivity"
2066
2748
  },
2067
- source: {
2068
- package: "@highstate/apps",
2069
- path: "grocy"
2070
- }
2749
+ source: createSource("grocy")
2071
2750
  });
2072
2751
 
2073
2752
  // src/apps/maybe.ts
2074
- import { defineUnit as defineUnit15, Type as Type15 } from "@highstate/contract";
2075
- var maybe = defineUnit15({
2753
+ import { defineUnit as defineUnit18, Type as Type19 } from "@highstate/contract";
2754
+ var maybe = defineUnit18({
2076
2755
  type: "apps.maybe",
2077
- args: {
2078
- fqdn: Type15.String(),
2079
- appName: Type15.Optional(Type15.String())
2080
- },
2081
- inputs: {
2082
- postgresql: postgresqlEntity,
2083
- accessPoint: accessPointEntity,
2084
- k8sCluster: clusterEntity2,
2085
- resticRepo: {
2086
- entity: repoEntity,
2087
- required: false
2088
- }
2089
- },
2756
+ args: createArgs2("maybe", ["fqdn"]),
2090
2757
  secrets: {
2091
- postgresqlPassword: Type15.Optional(Type15.String()),
2092
- secretKey: Type15.Optional(Type15.String())
2758
+ postgresqlPassword: Type19.Optional(Type19.String()),
2759
+ secretKey: Type19.Optional(Type19.String())
2093
2760
  },
2761
+ inputs: createInputs(["accessPoint", "resticRepo", "postgresql"]),
2094
2762
  meta: {
2095
2763
  displayName: "Maybe",
2096
2764
  description: "The OS for your personal finances.",
2097
- primaryIcon: "arcticons:finance-manager"
2098
- },
2099
- source: {
2100
- package: "@highstate/apps",
2101
- path: "maybe"
2102
- }
2103
- });
2104
-
2105
- // src/apps/mongodb.ts
2106
- import { defineEntity as defineEntity11, defineUnit as defineUnit16, Type as Type16 } from "@highstate/contract";
2107
- var mongodbEntity = defineEntity11({
2108
- type: "apps.mongodb",
2109
- schema: Type16.Object({
2110
- service: Type16.Optional(serviceEntity.schema),
2111
- host: Type16.String(),
2112
- port: Type16.Number(),
2113
- rootPassword: Type16.String()
2114
- }),
2115
- meta: {
2116
- color: "#13aa52"
2117
- }
2118
- });
2119
- var mongodb = defineUnit16({
2120
- type: "apps.mongodb",
2121
- args: {
2122
- fqdn: Type16.Optional(Type16.String()),
2123
- appName: Type16.Optional(Type16.String()),
2124
- serviceType: Type16.Optional(serviceTypeSchema)
2125
- },
2126
- secrets: {
2127
- rootPassword: Type16.Optional(Type16.String())
2128
- },
2129
- inputs: {
2130
- k8sCluster: clusterEntity2,
2131
- resticRepo: {
2132
- entity: repoEntity,
2133
- required: false
2134
- },
2135
- dnsProvider: {
2136
- entity: providerEntity,
2137
- required: false
2138
- }
2139
- },
2140
- outputs: {
2141
- mongodb: mongodbEntity,
2142
- service: serviceEntity
2143
- },
2144
- meta: {
2145
- displayName: "MongoDB",
2146
- description: "The MongoDB instance deployed on Kubernetes.",
2147
- primaryIcon: "simple-icons:mongodb",
2148
- secondaryIcon: "mdi:database"
2149
- },
2150
- source: {
2151
- package: "@highstate/apps",
2152
- path: "mongodb/app"
2153
- }
2154
- });
2155
- var mongodbDatabase = defineUnit16({
2156
- type: "apps.mongodb.database",
2157
- args: {
2158
- database: Type16.Optional(Type16.String()),
2159
- username: Type16.Optional(Type16.String())
2160
- },
2161
- secrets: {
2162
- password: Type16.Optional(Type16.String())
2163
- },
2164
- inputs: {
2165
- k8sCluster: clusterEntity2,
2166
- mongodb: mongodbEntity
2167
- },
2168
- meta: {
2169
- displayName: "MongoDB Database",
2170
- description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
2171
- primaryIcon: "simple-icons:mongodb",
2172
- secondaryIcon: "mdi:database-plus"
2765
+ primaryIcon: "arcticons:finance-manager",
2766
+ category: "Finance"
2173
2767
  },
2174
- source: {
2175
- package: "@highstate/apps",
2176
- path: "mongodb/database"
2177
- }
2768
+ source: createSource("maybe")
2178
2769
  });
2179
2770
 
2180
2771
  // src/apps/deployment.ts
2181
- import { defineUnit as defineUnit17, Type as Type17 } from "@highstate/contract";
2182
- var deployment = defineUnit17({
2772
+ import { defineUnit as defineUnit19, Type as Type20 } from "@highstate/contract";
2773
+ var deployment = defineUnit19({
2183
2774
  type: "apps.deployment",
2184
2775
  args: {
2185
- appName: Type17.Optional(Type17.String()),
2186
- fqdn: Type17.Optional(Type17.String()),
2187
- serviceType: Type17.Optional(serviceTypeSchema),
2188
- image: Type17.Optional(Type17.String()),
2189
- port: Type17.Optional(Type17.Number()),
2190
- replicas: Type17.Optional(Type17.Number()),
2191
- dataPath: Type17.Optional(Type17.String()),
2192
- env: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2193
- mariadbEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2194
- postgresqlEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2195
- mongodbEnvMapping: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2196
- manifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2197
- serviceManifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any())),
2198
- httpRouteManifest: Type17.Optional(Type17.Record(Type17.String(), Type17.Any()))
2199
- },
2200
- inputs: {
2201
- k8sCluster: clusterEntity2,
2202
- mariadb: {
2203
- entity: mariadbEntity,
2204
- required: false
2205
- },
2206
- postgresql: {
2207
- entity: postgresqlEntity,
2208
- required: false
2209
- },
2210
- mongodb: {
2211
- entity: mongodbEntity,
2212
- required: false
2213
- },
2214
- resticRepo: {
2215
- entity: repoEntity,
2216
- required: false
2217
- },
2218
- dnsProvider: {
2219
- entity: providerEntity,
2220
- required: false
2221
- }
2776
+ appName: Type20.Optional(Type20.String()),
2777
+ fqdn: Type20.Optional(Type20.String()),
2778
+ serviceType: Type20.Optional(serviceTypeSchema),
2779
+ image: Type20.Optional(Type20.String()),
2780
+ port: Type20.Optional(Type20.Number()),
2781
+ replicas: Type20.Optional(Type20.Number()),
2782
+ dataPath: Type20.Optional(Type20.String()),
2783
+ env: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2784
+ mariadbEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2785
+ postgresqlEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2786
+ mongodbEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2787
+ manifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2788
+ serviceManifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2789
+ httpRouteManifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any()))
2222
2790
  },
2791
+ secrets: {
2792
+ mariadbPassword: Type20.Optional(Type20.String()),
2793
+ postgresqlPassword: Type20.Optional(Type20.String()),
2794
+ mongodbPassword: Type20.Optional(Type20.String())
2795
+ },
2796
+ inputs: createInputs([
2797
+ "accessPoint",
2798
+ "mariadb",
2799
+ "postgresql",
2800
+ "mongodb",
2801
+ "resticRepo",
2802
+ "dnsProviders"
2803
+ ]),
2223
2804
  outputs: {
2224
2805
  deployment: deploymentEntity,
2225
2806
  service: serviceEntity
2226
2807
  },
2227
- secrets: {
2228
- mariadbPassword: Type17.Optional(Type17.String()),
2229
- postgresqlPassword: Type17.Optional(Type17.String()),
2230
- mongodbPassword: Type17.Optional(Type17.String())
2231
- },
2232
2808
  meta: {
2233
2809
  displayName: "Kubernetes Deployment",
2234
2810
  description: "A generic Kubernetes deployment with optional service and gateway routes.",
2235
- primaryIcon: "mdi:kubernetes",
2236
- secondaryIcon: "mdi:cube-outline"
2811
+ primaryIcon: "devicon:kubernetes",
2812
+ secondaryIcon: "mdi:cube-outline",
2813
+ category: "Kubernetes"
2237
2814
  },
2238
- source: {
2239
- package: "@highstate/apps",
2240
- path: "deployment"
2241
- }
2815
+ source: createSource("deployment")
2242
2816
  });
2243
2817
 
2244
2818
  // src/apps/syncthing.ts
2245
- import { defineUnit as defineUnit18, Type as Type18 } from "@highstate/contract";
2246
- var backupModeSchema = Type18.Union([Type18.Literal("metadata"), Type18.Literal("full")]);
2247
- var syncthing = defineUnit18({
2819
+ import { defineUnit as defineUnit20, Type as Type21 } from "@highstate/contract";
2820
+ var backupModeSchema = Type21.StringEnum(["state", "full"]);
2821
+ var syncthing = defineUnit20({
2248
2822
  type: "apps.syncthing",
2249
2823
  args: {
2250
- fqdn: Type18.String(),
2251
- deviceFqdn: Type18.Optional(Type18.String()),
2252
- appName: Type18.Optional(Type18.String()),
2253
- backupMode: Type18.Optional({ ...backupModeSchema, default: "metadata" })
2254
- },
2255
- inputs: {
2256
- accessPoint: accessPointEntity,
2257
- k8sCluster: clusterEntity2,
2258
- resticRepo: {
2259
- entity: repoEntity,
2260
- required: false
2261
- },
2262
- volume: {
2263
- entity: persistentVolumeClaimEntity,
2264
- required: false
2265
- }
2824
+ ...createArgs2("syncthing", ["fqdn"]),
2825
+ /**
2826
+ * The FQDN of the Syncthing instance used to sync with other devices.
2827
+ *
2828
+ * The `fqdn` argument unlike this one points to the gateway and used to
2829
+ * access the Syncthing Web UI.
2830
+ */
2831
+ deviceFqdn: Type21.Optional(Type21.String()),
2832
+ /**
2833
+ * The backup mode to use for the Syncthing instance.
2834
+ *
2835
+ * - `state`: Only the state is backed up. When the instance is restored, it will
2836
+ * sync files from the other devices automatically.
2837
+ * - `full`: A full backup is created including all files.
2838
+ *
2839
+ * The default is `state`.
2840
+ */
2841
+ backupMode: Type21.Default(backupModeSchema, "state")
2266
2842
  },
2843
+ inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
2267
2844
  outputs: {
2268
2845
  service: serviceEntity,
2269
2846
  volume: persistentVolumeClaimEntity
@@ -2271,38 +2848,22 @@ var syncthing = defineUnit18({
2271
2848
  meta: {
2272
2849
  displayName: "Syncthing",
2273
2850
  description: "The Syncthing instance deployed on Kubernetes.",
2274
- primaryIcon: "simple-icons:syncthing"
2851
+ primaryIcon: "simple-icons:syncthing",
2852
+ category: "File Sync"
2275
2853
  },
2276
- source: {
2277
- package: "@highstate/apps",
2278
- path: "syncthing"
2279
- }
2854
+ source: createSource("syncthing")
2280
2855
  });
2281
2856
 
2282
2857
  // src/apps/code-server.ts
2283
- import { defineUnit as defineUnit19, Type as Type19 } from "@highstate/contract";
2284
- var codeServer = defineUnit19({
2858
+ import { defineUnit as defineUnit21, Type as Type22 } from "@highstate/contract";
2859
+ var codeServer = defineUnit21({
2285
2860
  type: "apps.code-server",
2286
- args: {
2287
- fqdn: Type19.String(),
2288
- appName: Type19.Optional(Type19.String())
2289
- },
2861
+ args: createArgs2("code-server", ["fqdn"]),
2290
2862
  secrets: {
2291
- password: Type19.Optional(Type19.String()),
2292
- sudoPassword: Type19.Optional(Type19.String())
2293
- },
2294
- inputs: {
2295
- accessPoint: accessPointEntity,
2296
- k8sCluster: clusterEntity2,
2297
- resticRepo: {
2298
- entity: repoEntity,
2299
- required: false
2300
- },
2301
- volume: {
2302
- entity: persistentVolumeClaimEntity,
2303
- required: false
2304
- }
2863
+ password: Type22.Optional(Type22.String()),
2864
+ sudoPassword: Type22.Optional(Type22.String())
2305
2865
  },
2866
+ inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
2306
2867
  outputs: {
2307
2868
  statefulSet: statefulSetEntity,
2308
2869
  volume: persistentVolumeClaimEntity
@@ -2310,7 +2871,8 @@ var codeServer = defineUnit19({
2310
2871
  meta: {
2311
2872
  displayName: "Code Server",
2312
2873
  description: "The Code Server instance deployed on Kubernetes.",
2313
- primaryIcon: "material-icon-theme:vscode"
2874
+ primaryIcon: "material-icon-theme:vscode",
2875
+ category: "Development"
2314
2876
  },
2315
2877
  source: {
2316
2878
  package: "@highstate/apps",
@@ -2323,11 +2885,11 @@ var cloudflare_exports = {};
2323
2885
  __export(cloudflare_exports, {
2324
2886
  connection: () => connection2
2325
2887
  });
2326
- import { defineUnit as defineUnit20, Type as Type20 } from "@highstate/contract";
2327
- var connection2 = defineUnit20({
2888
+ import { defineUnit as defineUnit22, Type as Type23 } from "@highstate/contract";
2889
+ var connection2 = defineUnit22({
2328
2890
  type: "cloudflare.connection",
2329
2891
  secrets: {
2330
- apiToken: Type20.String()
2892
+ apiToken: Type23.String()
2331
2893
  },
2332
2894
  outputs: {
2333
2895
  dnsProvider: providerEntity
@@ -2335,7 +2897,8 @@ var connection2 = defineUnit20({
2335
2897
  meta: {
2336
2898
  displayName: "Cloudflare Connection",
2337
2899
  description: "Creates a new Cloudflare connection for one zone.",
2338
- primaryIcon: "simple-icons:cloudflare"
2900
+ primaryIcon: "simple-icons:cloudflare",
2901
+ category: "Cloudflare"
2339
2902
  },
2340
2903
  source: {
2341
2904
  package: "@highstate/cloudflare",
@@ -2348,25 +2911,39 @@ var k3s_exports = {};
2348
2911
  __export(k3s_exports, {
2349
2912
  cluster: () => cluster2
2350
2913
  });
2351
- import { defineUnit as defineUnit21 } from "@highstate/contract";
2352
- import { Type as Type21 } from "@sinclair/typebox";
2353
- var cluster2 = defineUnit21({
2914
+ import { defineUnit as defineUnit23, Type as Type24 } from "@highstate/contract";
2915
+ var cluster2 = defineUnit23({
2354
2916
  type: "k3s.cluster",
2355
2917
  args: {
2356
- ...sharedClusterArgs,
2357
- config: Type21.Optional(Type21.Record(Type21.String(), Type21.Any()))
2358
- },
2359
- inputs: {
2360
- server: serverEntity,
2361
- dnsProviders: {
2362
- entity: providerEntity,
2363
- required: false,
2364
- multiple: true
2918
+ /**
2919
+ * The K3S configuration to pass to each server or agent in the cluster.
2920
+ *
2921
+ * See: https://docs.k3s.io/installation/configuration
2922
+ *
2923
+ * @schema
2924
+ */
2925
+ config: {
2926
+ ...Type24.Optional(Type24.Record(Type24.String(), Type24.Any())),
2927
+ description: `The K3S configuration to pass to each server or agent in the cluster.
2928
+
2929
+ See: https://docs.k3s.io/installation/configuration`
2930
+ },
2931
+ /**
2932
+ * The configuration of the registries to use for the K3S cluster.
2933
+ *
2934
+ * See: https://docs.k3s.io/installation/private-registry
2935
+ *
2936
+ * @schema
2937
+ */
2938
+ registries: {
2939
+ ...Type24.Optional(Type24.Record(Type24.String(), Type24.Any())),
2940
+ description: `The configuration of the registries to use for the K3S cluster.
2941
+
2942
+ See: https://docs.k3s.io/installation/private-registry`
2365
2943
  }
2366
2944
  },
2367
- outputs: {
2368
- k8sCluster: clusterEntity2
2369
- },
2945
+ inputs: clusterInputs,
2946
+ outputs: clusterOutputs,
2370
2947
  meta: {
2371
2948
  displayName: "K3s Cluster",
2372
2949
  description: "The K3s cluster created on top of the server.",
@@ -2383,27 +2960,20 @@ var cluster2 = defineUnit21({
2383
2960
  // src/mullvad.ts
2384
2961
  var mullvad_exports = {};
2385
2962
  __export(mullvad_exports, {
2386
- endpointType: () => endpointType,
2387
2963
  peer: () => peer2
2388
2964
  });
2389
- import { defineUnit as defineUnit22, Type as Type22 } from "@highstate/contract";
2390
- var endpointType = Type22.Union([
2391
- Type22.Literal("fqdn"),
2392
- Type22.Literal("ipv4"),
2393
- Type22.Literal("ipv6")
2394
- ]);
2395
- var peer2 = defineUnit22({
2965
+ import { defineUnit as defineUnit24, Type as Type25 } from "@highstate/contract";
2966
+ var peer2 = defineUnit24({
2396
2967
  type: "mullvad.peer",
2397
2968
  args: {
2398
- hostname: Type22.Optional(Type22.String()),
2399
- endpointType: Type22.Optional({ ...endpointType, default: "fqdn" }),
2969
+ hostname: Type25.Optional(Type25.String()),
2400
2970
  /**
2401
2971
  * Whether to include Mullvad DNS servers in the peer configuration.
2402
2972
  *
2403
2973
  * @schema
2404
2974
  */
2405
2975
  includeDns: {
2406
- ...Type22.Default(Type22.Boolean(), true),
2976
+ ...Type25.Default(Type25.Boolean(), true),
2407
2977
  description: `Whether to include Mullvad DNS servers in the peer configuration.`
2408
2978
  }
2409
2979
  },
@@ -2420,14 +2990,18 @@ var peer2 = defineUnit22({
2420
2990
  },
2421
2991
  outputs: {
2422
2992
  peer: peerEntity,
2423
- l4Endpoint: l4EndpointEntity
2993
+ endpoints: {
2994
+ entity: l4EndpointEntity,
2995
+ multiple: true
2996
+ }
2424
2997
  },
2425
2998
  meta: {
2426
2999
  displayName: "Mullvad Peer",
2427
3000
  description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
2428
3001
  primaryIcon: "simple-icons:mullvad",
2429
3002
  secondaryIcon: "cib:wireguard",
2430
- secondaryIconColor: "#88171a"
3003
+ secondaryIconColor: "#88171a",
3004
+ category: "VPN"
2431
3005
  },
2432
3006
  source: {
2433
3007
  package: "@highstate/mullvad",
@@ -2442,18 +3016,18 @@ __export(timeweb_exports, {
2442
3016
  connectionEntity: () => connectionEntity,
2443
3017
  virtualMachine: () => virtualMachine2
2444
3018
  });
2445
- import { defineEntity as defineEntity12, defineUnit as defineUnit23, Type as Type23 } from "@highstate/contract";
2446
- var connectionEntity = defineEntity12({
3019
+ import { defineEntity as defineEntity13, defineUnit as defineUnit25, Type as Type26 } from "@highstate/contract";
3020
+ var connectionEntity = defineEntity13({
2447
3021
  type: "timeweb.connection",
2448
- schema: Type23.Object({
2449
- name: Type23.String(),
2450
- apiToken: Type23.String()
3022
+ schema: Type26.Object({
3023
+ name: Type26.String(),
3024
+ apiToken: Type26.String()
2451
3025
  })
2452
3026
  });
2453
- var connection3 = defineUnit23({
3027
+ var connection3 = defineUnit25({
2454
3028
  type: "timeweb.connection",
2455
3029
  secrets: {
2456
- apiToken: Type23.String()
3030
+ apiToken: Type26.String()
2457
3031
  },
2458
3032
  outputs: {
2459
3033
  connection: connectionEntity
@@ -2461,19 +3035,20 @@ var connection3 = defineUnit23({
2461
3035
  meta: {
2462
3036
  displayName: "Timeweb Connection",
2463
3037
  description: "Creates a new Timeweb connection.",
2464
- primaryIcon: "material-symbols:cloud"
3038
+ primaryIcon: "material-symbols:cloud",
3039
+ category: "Timeweb"
2465
3040
  },
2466
3041
  source: {
2467
3042
  package: "@highstate/timeweb",
2468
3043
  path: "connection"
2469
3044
  }
2470
3045
  });
2471
- var virtualMachine2 = defineUnit23({
3046
+ var virtualMachine2 = defineUnit25({
2472
3047
  type: "timeweb.virtual-machine",
2473
3048
  args: {
2474
- presetId: Type23.Optional(Type23.Number()),
2475
- osId: Type23.Optional(Type23.Number()),
2476
- availabilityZone: Type23.String()
3049
+ presetId: Type26.Optional(Type26.Number()),
3050
+ osId: Type26.Optional(Type26.Number()),
3051
+ availabilityZone: Type26.String()
2477
3052
  },
2478
3053
  inputs: {
2479
3054
  connection: connectionEntity,
@@ -2483,7 +3058,7 @@ var virtualMachine2 = defineUnit23({
2483
3058
  }
2484
3059
  },
2485
3060
  secrets: {
2486
- sshPrivateKey: Type23.Optional(Type23.String())
3061
+ sshPrivateKey: Type26.Optional(Type26.String())
2487
3062
  },
2488
3063
  outputs: {
2489
3064
  server: serverEntity
@@ -2492,7 +3067,8 @@ var virtualMachine2 = defineUnit23({
2492
3067
  displayName: "Timeweb Virtual Machine",
2493
3068
  description: "Creates a new Timeweb virtual machine.",
2494
3069
  primaryIcon: "material-symbols:cloud",
2495
- secondaryIcon: "codicon:vm"
3070
+ secondaryIcon: "codicon:vm",
3071
+ category: "Timeweb"
2496
3072
  },
2497
3073
  source: {
2498
3074
  package: "@highstate/timeweb",
@@ -2510,11 +3086,11 @@ __export(nixos_exports, {
2510
3086
  remoteFlake: () => remoteFlake,
2511
3087
  system: () => system
2512
3088
  });
2513
- import { defineEntity as defineEntity13, defineUnit as defineUnit24, Type as Type24 } from "@highstate/contract";
2514
- var inlineModuleEntity = defineEntity13({
3089
+ import { defineEntity as defineEntity14, defineUnit as defineUnit26, Type as Type27 } from "@highstate/contract";
3090
+ var inlineModuleEntity = defineEntity14({
2515
3091
  type: "nixos.inline-module",
2516
- schema: Type24.Object({
2517
- code: Type24.String()
3092
+ schema: Type27.Object({
3093
+ code: Type27.String()
2518
3094
  }),
2519
3095
  meta: {
2520
3096
  displayName: "NixOS Inline Module",
@@ -2522,10 +3098,10 @@ var inlineModuleEntity = defineEntity13({
2522
3098
  color: "#5277c3"
2523
3099
  }
2524
3100
  });
2525
- var inlineModule = defineUnit24({
3101
+ var inlineModule = defineUnit26({
2526
3102
  type: "nixos.inline-module",
2527
3103
  args: {
2528
- code: Type24.String({ language: "nix" })
3104
+ code: Type27.String({ language: "nix" })
2529
3105
  },
2530
3106
  inputs: {
2531
3107
  files: {
@@ -2542,17 +3118,18 @@ var inlineModule = defineUnit24({
2542
3118
  description: "Creates a NixOS module from inline code.",
2543
3119
  primaryIcon: "simple-icons:nixos",
2544
3120
  primaryIconColor: "#7ebae4",
2545
- secondaryIcon: "mdi:file-code"
3121
+ secondaryIcon: "mdi:file-code",
3122
+ category: "NixOS"
2546
3123
  },
2547
3124
  source: {
2548
3125
  package: "@highstate/nixos",
2549
3126
  path: "inline-module"
2550
3127
  }
2551
3128
  });
2552
- var flakeEntity = defineEntity13({
3129
+ var flakeEntity = defineEntity14({
2553
3130
  type: "nixos.flake",
2554
- schema: Type24.Object({
2555
- url: Type24.String()
3131
+ schema: Type27.Object({
3132
+ url: Type27.String()
2556
3133
  }),
2557
3134
  meta: {
2558
3135
  displayName: "NixOS Flake",
@@ -2560,10 +3137,10 @@ var flakeEntity = defineEntity13({
2560
3137
  color: "#5277c3"
2561
3138
  }
2562
3139
  });
2563
- var remoteFlake = defineUnit24({
3140
+ var remoteFlake = defineUnit26({
2564
3141
  type: "nixos.remote-flake",
2565
3142
  args: {
2566
- url: Type24.String()
3143
+ url: Type27.String()
2567
3144
  },
2568
3145
  outputs: {
2569
3146
  flake: flakeEntity
@@ -2574,17 +3151,18 @@ var remoteFlake = defineUnit24({
2574
3151
  primaryIcon: "simple-icons:nixos",
2575
3152
  primaryIconColor: "#7ebae4",
2576
3153
  secondaryIcon: "simple-icons:git",
2577
- secondaryIconColor: "#f1502f"
3154
+ secondaryIconColor: "#f1502f",
3155
+ category: "NixOS"
2578
3156
  },
2579
3157
  source: {
2580
3158
  package: "@highstate/nixos",
2581
3159
  path: "flake"
2582
3160
  }
2583
3161
  });
2584
- var inlineFlake = defineUnit24({
3162
+ var inlineFlake = defineUnit26({
2585
3163
  type: "nixos.inline-flake",
2586
3164
  args: {
2587
- code: Type24.String({ language: "nix" })
3165
+ code: Type27.String({ language: "nix" })
2588
3166
  },
2589
3167
  inputs: {
2590
3168
  flakes: {
@@ -2611,17 +3189,18 @@ var inlineFlake = defineUnit24({
2611
3189
  description: "Creates a NixOS flake from inline code.",
2612
3190
  primaryIcon: "simple-icons:nixos",
2613
3191
  primaryIconColor: "#7ebae4",
2614
- secondaryIcon: "mdi:file-code"
3192
+ secondaryIcon: "mdi:file-code",
3193
+ category: "NixOS"
2615
3194
  },
2616
3195
  source: {
2617
3196
  package: "@highstate/nixos",
2618
3197
  path: "inline-flake"
2619
3198
  }
2620
3199
  });
2621
- var system = defineUnit24({
3200
+ var system = defineUnit26({
2622
3201
  type: "nixos.system",
2623
3202
  args: {
2624
- system: Type24.Optional(Type24.String())
3203
+ system: Type27.Optional(Type27.String())
2625
3204
  },
2626
3205
  inputs: {
2627
3206
  flake: flakeEntity,
@@ -2640,7 +3219,8 @@ var system = defineUnit24({
2640
3219
  description: "Creates a NixOS system on top of any server.",
2641
3220
  primaryIcon: "simple-icons:nixos",
2642
3221
  primaryIconColor: "#7ebae4",
2643
- secondaryIcon: "codicon:vm"
3222
+ secondaryIcon: "codicon:vm",
3223
+ category: "NixOS"
2644
3224
  },
2645
3225
  source: {
2646
3226
  package: "@highstate/nixos",
@@ -2653,11 +3233,11 @@ var sops_exports = {};
2653
3233
  __export(sops_exports, {
2654
3234
  secrets: () => secrets
2655
3235
  });
2656
- import { defineUnit as defineUnit25, Type as Type25 } from "@highstate/contract";
2657
- var secrets = defineUnit25({
3236
+ import { defineUnit as defineUnit27, Type as Type28 } from "@highstate/contract";
3237
+ var secrets = defineUnit27({
2658
3238
  type: "sops.secrets",
2659
3239
  args: {
2660
- secrets: Type25.Record(Type25.String(), Type25.Any())
3240
+ secrets: Type28.Record(Type28.String(), Type28.Any())
2661
3241
  },
2662
3242
  inputs: {
2663
3243
  servers: {
@@ -2672,7 +3252,8 @@ var secrets = defineUnit25({
2672
3252
  meta: {
2673
3253
  displayName: "SOPS Secrets",
2674
3254
  description: "Encrypts secrets using SOPS for the specified servers.",
2675
- primaryIcon: "mdi:file-lock"
3255
+ primaryIcon: "mdi:file-lock",
3256
+ category: "Secrets"
2676
3257
  },
2677
3258
  source: {
2678
3259
  package: "@highstate/sops",
@@ -2683,21 +3264,21 @@ var secrets = defineUnit25({
2683
3264
  // src/obfuscators/index.ts
2684
3265
  var obfuscators_exports = {};
2685
3266
  __export(obfuscators_exports, {
3267
+ deobfuscatorSpec: () => deobfuscatorSpec,
3268
+ obfuscatorSpec: () => obfuscatorSpec,
2686
3269
  phantun: () => phantun_exports
2687
3270
  });
2688
3271
 
2689
- // src/obfuscators/phantun.ts
2690
- var phantun_exports = {};
2691
- __export(phantun_exports, {
2692
- deobfuscator: () => deobfuscator,
2693
- obfuscator: () => obfuscator
2694
- });
2695
- import { defineUnit as defineUnit26 } from "@highstate/contract";
2696
-
2697
3272
  // src/obfuscators/shared.ts
2698
- import { Type as Type26 } from "@sinclair/typebox";
3273
+ import { Type as Type29 } from "@highstate/contract";
2699
3274
  var deobfuscatorSpec = {
2700
3275
  args: {
3276
+ /**
3277
+ * The name of the namespace and deployment to deploy the deobfuscator on.
3278
+ *
3279
+ * By default, calculated as `deobfs-{type}-{name}`.
3280
+ */
3281
+ appName: Type29.Optional(Type29.String()),
2701
3282
  /**
2702
3283
  * The L4 endpoint to forward deobfuscated traffic to.
2703
3284
  *
@@ -2705,11 +3286,24 @@ var deobfuscatorSpec = {
2705
3286
  *
2706
3287
  * @schema
2707
3288
  */
2708
- targetEndpoint: {
2709
- ...Type26.Optional(Type26.String()),
3289
+ targetEndpoints: {
3290
+ ...Type29.Default(Type29.Array(Type29.String()), []),
2710
3291
  description: `The L4 endpoint to forward deobfuscated traffic to.
2711
3292
 
2712
3293
  Will take precedence over the \`targetEndpoint\` input.`
3294
+ },
3295
+ /**
3296
+ * Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3297
+ *
3298
+ * By default, the service is not exposed and only accessible from within the cluster.
3299
+ *
3300
+ * @schema
3301
+ */
3302
+ external: {
3303
+ ...Type29.Default(Type29.Boolean(), false),
3304
+ description: `Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3305
+
3306
+ By default, the service is not exposed and only accessible from within the cluster.`
2713
3307
  }
2714
3308
  },
2715
3309
  inputs: {
@@ -2723,41 +3317,72 @@ var deobfuscatorSpec = {
2723
3317
  description: `The Kubernetes cluster to deploy the deobfuscator on.`
2724
3318
  },
2725
3319
  /**
2726
- * The L4 endpoint to forward deobfuscated traffic to.
3320
+ * The L4 endpoints to forward deobfuscated traffic to.
3321
+ *
3322
+ * Will select the most appropriate endpoint based on the environment.
2727
3323
  *
2728
3324
  * @schema
2729
3325
  */
2730
- targetEndpoint: {
2731
- ...l4EndpointEntity,
2732
- description: `The L4 endpoint to forward deobfuscated traffic to.`
3326
+ targetEndpoints: {
3327
+ ...{
3328
+ entity: l4EndpointEntity,
3329
+ required: false,
3330
+ multiple: true
3331
+ },
3332
+ description: `The L4 endpoints to forward deobfuscated traffic to.
3333
+
3334
+ Will select the most appropriate endpoint based on the environment.`
2733
3335
  }
2734
3336
  },
2735
3337
  outputs: {
2736
3338
  /**
2737
- * The L4 endpoint of the deobfuscator accepting obfuscated traffic.
3339
+ * The L4 endpoints of the deobfuscator accepting obfuscated traffic.
2738
3340
  *
2739
3341
  * @schema
2740
3342
  */
2741
- endpoint: {
2742
- ...l4EndpointEntity,
2743
- description: `The L4 endpoint of the deobfuscator accepting obfuscated traffic.`
3343
+ endpoints: {
3344
+ ...{
3345
+ entity: l4EndpointEntity,
3346
+ required: false,
3347
+ multiple: true
3348
+ },
3349
+ description: `The L4 endpoints of the deobfuscator accepting obfuscated traffic.`
2744
3350
  }
2745
3351
  }
2746
3352
  };
2747
3353
  var obfuscatorSpec = {
2748
3354
  args: {
3355
+ /**
3356
+ * The name of the namespace and deployment to deploy the obfuscator on.
3357
+ *
3358
+ * By default, calculated as `obfs-{type}-{name}`.
3359
+ */
3360
+ appName: Type29.Optional(Type29.String()),
2749
3361
  /**
2750
3362
  * The endpoint of the deobfuscator to pass obfuscated traffic to.
2751
3363
  *
2752
- * Will take precedence over the `l4Endpoint` input.
3364
+ * Will take precedence over the `endpoint` input.
2753
3365
  *
2754
3366
  * @schema
2755
3367
  */
2756
- endpoint: {
2757
- ...Type26.Optional(Type26.String()),
3368
+ endpoints: {
3369
+ ...Type29.Default(Type29.Array(Type29.String()), []),
2758
3370
  description: `The endpoint of the deobfuscator to pass obfuscated traffic to.
2759
3371
 
2760
- Will take precedence over the \`l4Endpoint\` input.`
3372
+ Will take precedence over the \`endpoint\` input.`
3373
+ },
3374
+ /**
3375
+ * Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
3376
+ *
3377
+ * By default, the service is not exposed and only accessible from within the cluster.
3378
+ *
3379
+ * @schema
3380
+ */
3381
+ external: {
3382
+ ...Type29.Default(Type29.Boolean(), false),
3383
+ description: `Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
3384
+
3385
+ By default, the service is not exposed and only accessible from within the cluster.`
2761
3386
  }
2762
3387
  },
2763
3388
  inputs: {
@@ -2771,54 +3396,70 @@ var obfuscatorSpec = {
2771
3396
  description: `The Kubernetes cluster to deploy the obfuscator on.`
2772
3397
  },
2773
3398
  /**
2774
- * The L4 endpoint of the deobfuscator to pass obfuscated traffic to.
3399
+ * The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
3400
+ *
3401
+ * Will select the most appropriate endpoint based on the environment.
2775
3402
  *
2776
3403
  * @schema
2777
3404
  */
2778
- endpoint: {
3405
+ endpoints: {
2779
3406
  ...{
2780
3407
  entity: l4EndpointEntity,
2781
- required: false
3408
+ required: false,
3409
+ multiple: true
2782
3410
  },
2783
- description: `The L4 endpoint of the deobfuscator to pass obfuscated traffic to.`
3411
+ description: `The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
3412
+
3413
+ Will select the most appropriate endpoint based on the environment.`
2784
3414
  }
2785
3415
  },
2786
3416
  outputs: {
2787
3417
  /**
2788
- * The L4 endpoint accepting unobfuscated traffic.
3418
+ * The L4 endpoints accepting unobfuscated traffic.
2789
3419
  *
2790
3420
  * @schema
2791
3421
  */
2792
- entryEndpoint: {
2793
- ...l4EndpointEntity,
2794
- description: `The L4 endpoint accepting unobfuscated traffic.`
3422
+ entryEndpoints: {
3423
+ ...{
3424
+ entity: l4EndpointEntity,
3425
+ multiple: true
3426
+ },
3427
+ description: `The L4 endpoints accepting unobfuscated traffic.`
2795
3428
  }
2796
3429
  }
2797
3430
  };
2798
3431
 
2799
3432
  // src/obfuscators/phantun.ts
2800
- var deobfuscator = defineUnit26({
3433
+ var phantun_exports = {};
3434
+ __export(phantun_exports, {
3435
+ deobfuscator: () => deobfuscator,
3436
+ obfuscator: () => obfuscator
3437
+ });
3438
+ import { defineUnit as defineUnit28 } from "@highstate/contract";
3439
+ var deobfuscator = defineUnit28({
2801
3440
  type: "obfuscators.phantun.deobfuscator",
2802
3441
  ...deobfuscatorSpec,
2803
3442
  meta: {
2804
3443
  displayName: "Phantun Deobfuscator",
2805
3444
  description: "The Phantun Deobfuscator deployed on Kubernetes.",
2806
3445
  primaryIcon: "mdi:network-outline",
2807
- secondaryIcon: "mdi:hide"
3446
+ secondaryIcon: "mdi:hide",
3447
+ category: "Obfuscators"
2808
3448
  },
2809
3449
  source: {
2810
3450
  package: "@highstate/obfuscators",
2811
3451
  path: "phantun/deobfuscator"
2812
3452
  }
2813
3453
  });
2814
- var obfuscator = defineUnit26({
3454
+ var obfuscator = defineUnit28({
2815
3455
  type: "obfuscators.phantun.obfuscator",
2816
3456
  ...obfuscatorSpec,
2817
3457
  meta: {
2818
3458
  displayName: "Phantun Obfuscator",
2819
3459
  description: "The Phantun Obfuscator deployed on Kubernetes.",
2820
3460
  primaryIcon: "mdi:network-outline",
2821
- secondaryIcon: "mdi:hide"
3461
+ secondaryIcon: "mdi:hide",
3462
+ category: "Obfuscators"
2822
3463
  },
2823
3464
  source: {
2824
3465
  package: "@highstate/obfuscators",
@@ -2827,14 +3468,17 @@ var obfuscator = defineUnit26({
2827
3468
  });
2828
3469
  export {
2829
3470
  apps_exports as apps,
3471
+ arrayPatchModeSchema,
2830
3472
  cloudflare_exports as cloudflare,
2831
3473
  common_exports as common,
2832
3474
  dns_exports as dns,
2833
3475
  k3s_exports as k3s,
2834
3476
  k8s_exports as k8s,
2835
3477
  mullvad_exports as mullvad,
3478
+ network_exports as network,
2836
3479
  nixos_exports as nixos,
2837
3480
  obfuscators_exports as obfuscators,
3481
+ prefixKeysWith,
2838
3482
  proxmox_exports as proxmox,
2839
3483
  restic_exports as restic,
2840
3484
  sops_exports as sops,