@highstate/library 0.9.15 → 0.9.18

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.
Files changed (46) hide show
  1. package/dist/highstate.library.msgpack +0 -0
  2. package/dist/highstate.manifest.json +5 -0
  3. package/dist/index.js +1716 -1166
  4. package/dist/index.js.map +1 -1
  5. package/package.json +8 -6
  6. package/src/abbreviations.ts +35 -0
  7. package/src/apps/code-server.ts +5 -5
  8. package/src/apps/deployment.ts +20 -20
  9. package/src/apps/dns.ts +12 -14
  10. package/src/apps/gitea.ts +2 -2
  11. package/src/apps/grocy.ts +2 -2
  12. package/src/apps/hubble.ts +2 -2
  13. package/src/apps/kubernetes-dashboard.ts +2 -2
  14. package/src/apps/mariadb.ts +10 -10
  15. package/src/apps/maybe.ts +5 -5
  16. package/src/apps/mongodb.ts +10 -10
  17. package/src/apps/network.ts +6 -6
  18. package/src/apps/postgresql.ts +10 -10
  19. package/src/apps/shared.ts +18 -19
  20. package/src/apps/syncthing.ts +6 -6
  21. package/src/apps/traefik.ts +4 -4
  22. package/src/apps/vaultwarden.ts +4 -4
  23. package/src/apps/zitadel.ts +2 -2
  24. package/src/cloudflare.ts +4 -4
  25. package/src/common.ts +25 -78
  26. package/src/distributions/index.ts +1 -0
  27. package/src/distributions/ubuntu.ts +32 -0
  28. package/src/dns.ts +10 -18
  29. package/src/files.ts +135 -0
  30. package/src/git.ts +58 -0
  31. package/src/index.ts +5 -0
  32. package/src/k3s.ts +9 -17
  33. package/src/k8s.ts +130 -146
  34. package/src/mullvad.ts +5 -9
  35. package/src/network.ts +69 -44
  36. package/src/nixos.ts +51 -86
  37. package/src/obfuscators/phantun.ts +4 -4
  38. package/src/obfuscators/shared.ts +23 -43
  39. package/src/proxmox.ts +301 -60
  40. package/src/restic.ts +17 -19
  41. package/src/sops.ts +7 -6
  42. package/src/ssh.ts +21 -19
  43. package/src/talos.ts +15 -27
  44. package/src/timeweb.ts +13 -13
  45. package/src/utils.ts +3 -3
  46. package/src/wireguard.ts +90 -127
package/dist/index.js CHANGED
@@ -1,23 +1,61 @@
1
+ import { registerKnownAbbreviations, z, defineEntity, camelCaseToHumanReadable, defineUnit, fileContentSchema as fileContentSchema$1, fileMetaSchema, unitArtifactSchema, $args, $outputs, $inputs } from '@highstate/contract';
2
+ import { omit } from 'remeda';
3
+
1
4
  var __defProp = Object.defineProperty;
2
5
  var __export = (target, all) => {
3
6
  for (var name in all)
4
7
  __defProp(target, name, { get: all[name], enumerable: true });
5
8
  };
9
+ registerKnownAbbreviations([
10
+ "ID",
11
+ "URL",
12
+ "IP",
13
+ "IPs",
14
+ "IPv4",
15
+ "IPv6",
16
+ "DNS",
17
+ "FQDN",
18
+ "SSH",
19
+ "WireGuard",
20
+ "API",
21
+ "k8s",
22
+ "TLS",
23
+ "HTTP",
24
+ "HTTPS",
25
+ "TCP",
26
+ "UDP",
27
+ "CIDR",
28
+ "CPU",
29
+ "RAM",
30
+ "GPU",
31
+ "SSD",
32
+ "HDD",
33
+ "VM",
34
+ "CNI",
35
+ "CSI",
36
+ "MariaDB",
37
+ "PostgreSQL",
38
+ "MongoDB"
39
+ ]);
6
40
 
7
41
  // src/common.ts
8
42
  var common_exports = {};
9
43
  __export(common_exports, {
44
+ checksumAlgorithmSchema: () => checksumAlgorithmSchema,
45
+ checksumSchema: () => checksumSchema,
10
46
  existingServer: () => existingServer,
11
- fileContentEntity: () => fileContentEntity,
47
+ fileContentSchema: () => fileContentSchema,
12
48
  fileEntity: () => fileEntity,
13
- fileMetaEntity: () => fileMetaEntity,
49
+ folderContentSchema: () => folderContentSchema,
50
+ folderEntity: () => folderEntity,
51
+ folderMetaSchema: () => folderMetaSchema,
52
+ remoteFile: () => remoteFile,
14
53
  script: () => script,
15
54
  serverDns: () => serverDns,
16
55
  serverEntity: () => serverEntity,
17
56
  serverOutputs: () => serverOutputs,
18
57
  serverPatch: () => serverPatch
19
58
  });
20
- import { defineEntity as defineEntity4, defineUnit as defineUnit3, Type as Type5 } from "@highstate/contract";
21
59
 
22
60
  // src/ssh.ts
23
61
  var ssh_exports = {};
@@ -27,7 +65,6 @@ __export(ssh_exports, {
27
65
  keyPairEntity: () => keyPairEntity,
28
66
  keyTypeSchema: () => keyTypeSchema
29
67
  });
30
- import { defineEntity as defineEntity2, defineUnit as defineUnit2, Type as Type2 } from "@highstate/contract";
31
68
 
32
69
  // src/network.ts
33
70
  var network_exports = {};
@@ -38,11 +75,12 @@ __export(network_exports, {
38
75
  l3EndpointEntity: () => l3EndpointEntity,
39
76
  l4Endpoint: () => l4Endpoint,
40
77
  l4EndpointEntity: () => l4EndpointEntity,
78
+ l4PortInfoSchema: () => l4PortInfoSchema,
41
79
  l4ProtocolSchema: () => l4ProtocolSchema,
42
- portInfoSchema: () => portInfoSchema
80
+ l7AppInfoSchema: () => l7AppInfoSchema,
81
+ l7EndpointEntity: () => l7EndpointEntity
43
82
  });
44
- import { defineEntity, defineUnit, Type } from "@highstate/contract";
45
- var endpointVisibilitySchema = Type.StringEnum([
83
+ var endpointVisibilitySchema = z.enum([
46
84
  "public",
47
85
  // Reachable from the public internet
48
86
  "external",
@@ -50,56 +88,80 @@ var endpointVisibilitySchema = Type.StringEnum([
50
88
  "internal"
51
89
  // Reachable only from within the system or cluster
52
90
  ]);
53
- var endpointFilterSchema = Type.Array(endpointVisibilitySchema);
91
+ var endpointFilterSchema = endpointVisibilitySchema.array();
54
92
  var l3EndpointEntity = defineEntity({
55
93
  type: "network.l3-endpoint",
56
- schema: Type.Intersect([
57
- Type.Object({
94
+ schema: z.intersection(
95
+ z.object({
58
96
  visibility: endpointVisibilitySchema,
59
- metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown()))
97
+ metadata: z.record(z.string(), z.unknown()).optional()
60
98
  }),
61
- Type.Union([
62
- Type.Object({
63
- type: Type.Literal("hostname"),
99
+ z.union([
100
+ z.object({
101
+ type: z.literal("hostname"),
64
102
  /**
65
103
  * The hostname of the endpoint in the format of a domain name.
66
104
  */
67
- hostname: Type.String()
105
+ hostname: z.string().meta({ title: camelCaseToHumanReadable("hostname"), description: `The hostname of the endpoint in the format of a domain name.` })
68
106
  }),
69
- Type.Object({
70
- type: Type.Literal("ipv4"),
107
+ z.object({
108
+ type: z.literal("ipv4"),
71
109
  /**
72
110
  * The IPv4 address of the endpoint.
73
111
  */
74
- address: Type.String()
112
+ address: z.string().meta({ title: camelCaseToHumanReadable("address"), description: `The IPv4 address of the endpoint.` })
75
113
  }),
76
- Type.Object({
77
- type: Type.Literal("ipv6"),
114
+ z.object({
115
+ type: z.literal("ipv6"),
78
116
  /**
79
117
  * The IPv6 address of the endpoint.
80
118
  */
81
- address: Type.String()
119
+ address: z.string().meta({ title: camelCaseToHumanReadable("address"), description: `The IPv6 address of the endpoint.` })
82
120
  })
83
121
  ])
84
- ]),
122
+ ),
85
123
  meta: {
86
124
  color: "#4CAF50",
87
125
  description: "The L3 endpoint for some service. May be a domain name or an IP address."
88
126
  }
89
127
  });
90
- var l4ProtocolSchema = Type.StringEnum(["tcp", "udp"]);
91
- var portInfoSchema = Type.Object({
92
- port: Type.Number(),
128
+ var l4ProtocolSchema = z.enum(["tcp", "udp"]);
129
+ var l4PortInfoSchema = z.object({
130
+ port: z.number(),
93
131
  protocol: l4ProtocolSchema
94
132
  });
95
133
  var l4EndpointEntity = defineEntity({
96
134
  type: "network.l4-endpoint",
97
- schema: Type.Intersect([l3EndpointEntity.schema, portInfoSchema]),
135
+ schema: z.intersection(l3EndpointEntity.schema, l4PortInfoSchema),
98
136
  meta: {
99
137
  color: "#2196F3",
100
138
  description: "The L4 endpoint for some service. Extends an L3 endpoint with a port."
101
139
  }
102
140
  });
141
+ var l7AppInfoSchema = z.object({
142
+ /**
143
+ * The name of the application protocol used by the endpoint.
144
+ */
145
+ appProtocol: z.string().meta({ title: camelCaseToHumanReadable("appProtocol"), description: `The name of the application protocol used by the endpoint.` }),
146
+ /**
147
+ * The resource path of the application endpoint, including query parameters.
148
+ * Must not start with a slash (`/`).
149
+ *
150
+ * Example: `api/v1/resource?query=value`, `database?param=value`, `user/repo.git`.
151
+ */
152
+ resource: z.string().optional().meta({ title: camelCaseToHumanReadable("resource"), description: `The resource path of the application endpoint, including query parameters.
153
+ Must not start with a slash (\`/\`).
154
+
155
+ Example: \`api/v1/resource?query=value\`, \`database?param=value\`, \`user/repo.git\`.` })
156
+ });
157
+ var l7EndpointEntity = defineEntity({
158
+ type: "network.l7-endpoint",
159
+ schema: z.intersection(l4EndpointEntity.schema, l7AppInfoSchema),
160
+ meta: {
161
+ color: "#FF9800",
162
+ description: "The L7 endpoint for some service. Extends an L4 endpoint with application protocol information."
163
+ }
164
+ });
103
165
  var l3Endpoint = defineUnit({
104
166
  type: "network.l3-endpoint",
105
167
  args: {
@@ -108,20 +170,32 @@ var l3Endpoint = defineUnit({
108
170
  *
109
171
  * May be a domain name or an IP address.
110
172
  */
111
- endpoint: Type.String(),
173
+ endpoint: {
174
+ schema: z.string(),
175
+ meta: {
176
+ description: `The string representation of the endpoint.
177
+
178
+ May be a domain name or an IP address.`
179
+ }
180
+ },
112
181
  /**
113
182
  * The visibility of the endpoint.
114
183
  */
115
- visibility: Type.Default(endpointVisibilitySchema, "public")
184
+ visibility: {
185
+ schema: endpointVisibilitySchema.default("public"),
186
+ meta: {
187
+ description: `The visibility of the endpoint.`
188
+ }
189
+ }
116
190
  },
117
191
  outputs: {
118
192
  endpoint: l3EndpointEntity
119
193
  },
120
194
  meta: {
121
- displayName: "L3 Endpoint",
195
+ title: "L3 Endpoint",
122
196
  description: "An L3 endpoint for some service. May be a domain name or an IP address.",
123
- primaryIcon: "mdi:network-outline",
124
- primaryIconColor: "#4CAF50",
197
+ icon: "mdi:network-outline",
198
+ iconColor: "#4CAF50",
125
199
  defaultNamePrefix: "endpoint",
126
200
  category: "Network"
127
201
  },
@@ -144,20 +218,38 @@ var l4Endpoint = defineUnit({
144
218
  * - `tcp://endpoint:port`
145
219
  * - `udp://endpoint:port`
146
220
  */
147
- endpoint: Type.String(),
221
+ endpoint: {
222
+ schema: z.string(),
223
+ meta: {
224
+ description: `The string representation of the endpoint.
225
+
226
+ May be a domain name or an IP address + port/protocol.
227
+
228
+ The possible formats are:
229
+
230
+ - \`endpoint:port\` (TCP by default)
231
+ - \`tcp://endpoint:port\`
232
+ - \`udp://endpoint:port\``
233
+ }
234
+ },
148
235
  /**
149
236
  * The visibility of the endpoint.
150
237
  */
151
- visibility: Type.Default(endpointVisibilitySchema, "public")
238
+ visibility: {
239
+ schema: endpointVisibilitySchema.default("public"),
240
+ meta: {
241
+ description: `The visibility of the endpoint.`
242
+ }
243
+ }
152
244
  },
153
245
  outputs: {
154
246
  endpoint: l4EndpointEntity
155
247
  },
156
248
  meta: {
157
- displayName: "L4 Endpoint",
249
+ title: "L4 Endpoint",
158
250
  description: "An L4 endpoint for some service. Extends an L3 endpoint with a port.",
159
- primaryIcon: "mdi:network-outline",
160
- primaryIconColor: "#2196F3",
251
+ icon: "mdi:network-outline",
252
+ iconColor: "#2196F3",
161
253
  defaultNamePrefix: "endpoint",
162
254
  category: "Network"
163
255
  },
@@ -166,42 +258,147 @@ var l4Endpoint = defineUnit({
166
258
  path: "units/network/l4-endpoint"
167
259
  }
168
260
  });
261
+ var checksumAlgorithmSchema = z.enum(["md5", "sha1", "sha256", "sha384", "sha512"]);
262
+ var checksumSchema = z.object({
263
+ algorithm: checksumAlgorithmSchema,
264
+ value: z.string()
265
+ });
266
+ var fileContentSchema = z.union([
267
+ fileContentSchema$1,
268
+ z.object({
269
+ type: z.literal("local"),
270
+ path: z.string()
271
+ }),
272
+ z.object({
273
+ type: z.literal("remote"),
274
+ endpoint: l7EndpointEntity.schema,
275
+ checksum: checksumSchema.optional()
276
+ })
277
+ ]);
278
+ var fileEntity = defineEntity({
279
+ type: "common.file",
280
+ schema: z.object({
281
+ meta: fileMetaSchema,
282
+ content: fileContentSchema
283
+ }),
284
+ meta: {
285
+ color: "#FF5722"
286
+ }
287
+ });
288
+ var folderMetaSchema = z.object({
289
+ name: z.string(),
290
+ mode: z.number().optional()
291
+ });
292
+ var folderContentSchema = z.union([
293
+ z.object({
294
+ type: z.literal("embedded"),
295
+ files: fileEntity.schema.array(),
296
+ folders: z.object({
297
+ meta: folderMetaSchema,
298
+ get content() {
299
+ return folderContentSchema;
300
+ }
301
+ }).array()
302
+ }),
303
+ z.object({
304
+ type: z.literal("artifact"),
305
+ ...unitArtifactSchema.shape
306
+ }),
307
+ z.object({
308
+ type: z.literal("local"),
309
+ path: z.string()
310
+ }),
311
+ z.object({
312
+ type: z.literal("remote"),
313
+ endpoint: l7EndpointEntity.schema
314
+ })
315
+ ]);
316
+ var folderEntity = defineEntity({
317
+ type: "common.folder",
318
+ schema: z.object({
319
+ meta: folderMetaSchema,
320
+ content: folderContentSchema
321
+ }),
322
+ meta: {
323
+ color: "#FF9800"
324
+ }
325
+ });
326
+ var remoteFile = defineUnit({
327
+ type: "common.remote-file",
328
+ args: {
329
+ /**
330
+ * The URL of the remote file.
331
+ */
332
+ url: {
333
+ schema: z.string().optional(),
334
+ meta: {
335
+ description: `The URL of the remote file.`
336
+ }
337
+ }
338
+ },
339
+ inputs: {
340
+ /**
341
+ * The L7 endpoint of the remote file.
342
+ */
343
+ endpoint: {
344
+ entity: l7EndpointEntity,
345
+ required: false,
346
+ meta: {
347
+ description: `The L7 endpoint of the remote file.`
348
+ }
349
+ }
350
+ },
351
+ outputs: {
352
+ file: fileEntity
353
+ },
354
+ meta: {
355
+ title: "Remote File",
356
+ description: "References a file from a remote URL.",
357
+ icon: "mdi:file-download",
358
+ category: "Files"
359
+ },
360
+ source: {
361
+ package: "@highstate/common",
362
+ path: "units/remote-file"
363
+ }
364
+ });
169
365
 
170
366
  // src/ssh.ts
171
- var keyTypeSchema = Type2.StringEnum(["ed25519"]);
172
- var keyPairEntity = defineEntity2({
367
+ var keyTypeSchema = z.enum(["ed25519"]);
368
+ var keyPairEntity = defineEntity({
173
369
  type: "ssh.key-pair",
174
- schema: Type2.Object({
370
+ schema: z.object({
175
371
  type: keyTypeSchema,
176
- fingerprint: Type2.String(),
177
- publicKey: Type2.String(),
178
- privateKey: Type2.String()
372
+ fingerprint: z.string(),
373
+ publicKey: z.string(),
374
+ privateKey: z.string()
179
375
  }),
180
376
  meta: {
181
377
  color: "#2b5797"
182
378
  }
183
379
  });
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)
380
+ var credentialsSchema = z.object({
381
+ endpoints: l4EndpointEntity.schema.array(),
382
+ hostKey: z.string(),
383
+ user: z.string(),
384
+ password: z.string().optional(),
385
+ keyPair: keyPairEntity.schema.optional()
190
386
  });
191
- var keyPair = defineUnit2({
387
+ var keyPair = defineUnit({
192
388
  type: "ssh.key-pair",
193
389
  secrets: {
194
- privateKey: Type2.Optional(Type2.String())
390
+ privateKey: z.string().optional()
195
391
  },
196
392
  outputs: {
197
- keyPair: keyPairEntity
393
+ keyPair: keyPairEntity,
394
+ publicKeyFile: fileEntity
198
395
  },
199
396
  meta: {
200
- displayName: "SSH Key Pair",
397
+ title: "SSH Key Pair",
201
398
  description: "Holds the ED25519 SSH key pair and generates the private key if not provided.",
202
399
  category: "ssh",
203
- primaryIcon: "charm:key",
204
- primaryIconColor: "#ffffff",
400
+ icon: "charm:key",
401
+ iconColor: "#ffffff",
205
402
  secondaryIcon: "mdi:lock",
206
403
  secondaryIconColor: "#ffffff"
207
404
  },
@@ -218,10 +415,6 @@ __export(dns_exports, {
218
415
  inputs: () => inputs,
219
416
  providerEntity: () => providerEntity
220
417
  });
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
418
  function prefixWith(string, prefix) {
226
419
  return prefix ? `${prefix}${string.charAt(0).toUpperCase()}${string.slice(1)}` : string;
227
420
  }
@@ -230,16 +423,16 @@ function prefixKeysWith(prefix, obj) {
230
423
  Object.entries(obj).map(([key, value]) => [prefixWith(key, prefix), value])
231
424
  );
232
425
  }
233
- var arrayPatchModeSchema = Type3.StringEnum(["prepend", "replace"]);
426
+ var arrayPatchModeSchema = z.enum(["prepend", "replace"]);
234
427
 
235
428
  // src/dns.ts
236
- var providerEntity = defineEntity3({
429
+ var providerEntity = defineEntity({
237
430
  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()
431
+ schema: z.object({
432
+ name: z.string(),
433
+ type: z.string(),
434
+ data: z.record(z.string(), z.unknown()),
435
+ domain: z.string()
243
436
  }),
244
437
  meta: {
245
438
  color: "#FF5722"
@@ -253,17 +446,8 @@ function createArgs(prefix) {
253
446
  * Will be inserted at the beginning of the resulting endpoint list.
254
447
  *
255
448
  * Will throw an error if no matching provider is found.
256
- *
257
- * @schema
258
449
  */
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
- },
450
+ fqdn: z.string().optional(),
267
451
  /**
268
452
  * The endpoint filter to filter the endpoints before creating the DNS records.
269
453
  *
@@ -280,27 +464,8 @@ function createArgs(prefix) {
280
464
  * - If any public endpoints exist, all public endpoints are selected;
281
465
  * - Otherwise, if any external endpoints exist, all external endpoints are selected;
282
466
  * - If neither exist, all internal endpoints are selected.
283
- *
284
- * @schema
285
467
  */
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
- },
468
+ endpointFilter: endpointFilterSchema.default([]),
304
469
  /**
305
470
  * The mode to use for patching the existing endpoints.
306
471
  *
@@ -308,18 +473,8 @@ function createArgs(prefix) {
308
473
  * - `replace`: Replace the existing endpoints with the FQDN. It will ensure that the only the FQDN is used.
309
474
  *
310
475
  * The default is `prepend`.
311
- *
312
- * @schema
313
476
  */
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
- }
477
+ patchMode: arrayPatchModeSchema.default("prepend")
323
478
  });
324
479
  }
325
480
  var inputs = {
@@ -327,27 +482,20 @@ var inputs = {
327
482
  * The DNS providers to use to create the DNS records.
328
483
  *
329
484
  * If multiple providers match the domain, all of them will be used and multiple DNS records will be created.
330
- *
331
- * @schema
332
485
  */
333
486
  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.`
487
+ entity: providerEntity,
488
+ multiple: true
341
489
  }
342
490
  };
343
491
 
344
492
  // src/common.ts
345
- var serverEntity = defineEntity4({
493
+ var serverEntity = defineEntity({
346
494
  type: "common.server",
347
- schema: Type5.Object({
348
- hostname: Type5.String(),
349
- endpoints: Type5.Array(l3EndpointEntity.schema),
350
- ssh: Type5.Optional(credentialsSchema)
495
+ schema: z.object({
496
+ hostname: z.string(),
497
+ endpoints: l3EndpointEntity.schema.array(),
498
+ ssh: credentialsSchema.optional()
351
499
  }),
352
500
  meta: {
353
501
  color: "#009688"
@@ -360,7 +508,7 @@ var serverOutputs = {
360
508
  multiple: true
361
509
  }
362
510
  };
363
- var existingServer = defineUnit3({
511
+ var existingServer = defineUnit({
364
512
  type: "common.existing-server",
365
513
  args: {
366
514
  /**
@@ -368,19 +516,36 @@ var existingServer = defineUnit3({
368
516
  *
369
517
  * Takes precedence over the `endpoint` input.
370
518
  */
371
- endpoint: Type5.Optional(Type5.String()),
519
+ endpoint: {
520
+ schema: z.string().optional(),
521
+ meta: {
522
+ description: `The endpoint of the server.
523
+
524
+ Takes precedence over the \`endpoint\` input.`
525
+ }
526
+ },
372
527
  /**
373
528
  * The SSH user to use for connecting to the server.
374
529
  */
375
- sshUser: Type5.Default(Type5.String(), "root"),
530
+ sshUser: {
531
+ schema: z.string().default("root"),
532
+ meta: {
533
+ description: `The SSH user to use for connecting to the server.`
534
+ }
535
+ },
376
536
  /**
377
537
  * The SSH port to use for connecting to the server.
378
538
  */
379
- sshPort: Type5.Default(Type5.Number(), 22)
539
+ sshPort: {
540
+ schema: z.number().default(22),
541
+ meta: {
542
+ description: `The SSH port to use for connecting to the server.`
543
+ }
544
+ }
380
545
  },
381
546
  secrets: {
382
- sshPassword: Type5.Optional(Type5.String()),
383
- sshPrivateKey: Type5.Optional(Type5.String())
547
+ sshPassword: z.string().optional(),
548
+ sshPrivateKey: z.string().optional()
384
549
  },
385
550
  inputs: {
386
551
  sshKeyPair: {
@@ -394,9 +559,9 @@ var existingServer = defineUnit3({
394
559
  },
395
560
  outputs: serverOutputs,
396
561
  meta: {
397
- displayName: "Existing Server",
562
+ title: "Existing Server",
398
563
  description: "An existing server that can be used in the configuration.",
399
- primaryIcon: "mdi:server",
564
+ icon: "mdi:server",
400
565
  defaultNamePrefix: "server",
401
566
  category: "Infrastructure"
402
567
  },
@@ -405,7 +570,7 @@ var existingServer = defineUnit3({
405
570
  path: "units/existing-server"
406
571
  }
407
572
  });
408
- var serverPatch = defineUnit3({
573
+ var serverPatch = defineUnit({
409
574
  type: "common.server-patch",
410
575
  args: {
411
576
  /**
@@ -414,16 +579,16 @@ var serverPatch = defineUnit3({
414
579
  * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
415
580
  *
416
581
  * The same server may also be represented by multiple entries (e.g. a node with private and public IP).
417
- *
418
- * @schema
419
582
  */
420
583
  endpoints: {
421
- ...Type5.Default(Type5.Array(Type5.String()), []),
422
- description: `The endpoints of the server.
584
+ schema: z.string().array().default([]),
585
+ meta: {
586
+ description: `The endpoints of the server.
423
587
 
424
588
  The entry may represent real node endpoint or virtual endpoint (like a load balancer).
425
589
 
426
590
  The same server may also be represented by multiple entries (e.g. a node with private and public IP).`
591
+ }
427
592
  },
428
593
  /**
429
594
  * The mode to use for patching the endpoints.
@@ -431,7 +596,15 @@ var serverPatch = defineUnit3({
431
596
  * - `prepend`: prepend the new endpoints to the existing ones (default);
432
597
  * - `replace`: replace the existing endpoints with the new ones.
433
598
  */
434
- endpointsPatchMode: Type5.Default(arrayPatchModeSchema, "prepend")
599
+ endpointsPatchMode: {
600
+ schema: arrayPatchModeSchema.default("prepend"),
601
+ meta: {
602
+ description: `The mode to use for patching the endpoints.
603
+
604
+ - \`prepend\`: prepend the new endpoints to the existing ones (default);
605
+ - \`replace\`: replace the existing endpoints with the new ones.`
606
+ }
607
+ }
435
608
  },
436
609
  inputs: {
437
610
  server: serverEntity,
@@ -449,9 +622,9 @@ var serverPatch = defineUnit3({
449
622
  }
450
623
  },
451
624
  meta: {
452
- displayName: "Server Patch",
625
+ title: "Server Patch",
453
626
  description: "Patches some properties of the server.",
454
- primaryIcon: "mdi:server",
627
+ icon: "mdi:server",
455
628
  secondaryIcon: "fluent:patch-20-filled",
456
629
  category: "Infrastructure"
457
630
  },
@@ -460,7 +633,7 @@ var serverPatch = defineUnit3({
460
633
  path: "units/server-patch"
461
634
  }
462
635
  });
463
- var serverDns = defineUnit3({
636
+ var serverDns = defineUnit({
464
637
  type: "common.server-dns",
465
638
  args: createArgs(),
466
639
  inputs: {
@@ -475,9 +648,9 @@ var serverDns = defineUnit3({
475
648
  }
476
649
  },
477
650
  meta: {
478
- displayName: "Server DNS",
651
+ title: "Server DNS",
479
652
  description: "Creates DNS records for the server and updates endpoints.",
480
- primaryIcon: "mdi:server",
653
+ icon: "mdi:server",
481
654
  secondaryIcon: "mdi:dns",
482
655
  category: "Infrastructure"
483
656
  },
@@ -486,12 +659,12 @@ var serverDns = defineUnit3({
486
659
  path: "units/server-dns"
487
660
  }
488
661
  });
489
- var script = defineUnit3({
662
+ var script = defineUnit({
490
663
  type: "common.script",
491
664
  args: {
492
- script: Type5.String({ language: "shell" }),
493
- updateScript: Type5.Optional(Type5.String({ language: "shell" })),
494
- deleteScript: Type5.Optional(Type5.String({ language: "shell" }))
665
+ script: z.string().meta({ language: "shell" }),
666
+ updateScript: z.string().optional().meta({ language: "shell" }),
667
+ deleteScript: z.string().optional().meta({ language: "shell" })
495
668
  },
496
669
  inputs: {
497
670
  server: serverEntity
@@ -500,9 +673,9 @@ var script = defineUnit3({
500
673
  server: serverEntity
501
674
  },
502
675
  meta: {
503
- displayName: "Shell Script",
676
+ title: "Shell Script",
504
677
  description: "Run a shell script on the server.",
505
- primaryIcon: "mdi:bash",
678
+ icon: "mdi:bash",
506
679
  category: "Infrastructure"
507
680
  },
508
681
  source: {
@@ -510,46 +683,6 @@ var script = defineUnit3({
510
683
  path: "units/script"
511
684
  }
512
685
  });
513
- var fileMetaEntity = defineEntity4({
514
- type: "common.file-meta",
515
- schema: Type5.Object({
516
- name: Type5.String(),
517
- size: Type5.Number(),
518
- mode: Type5.Number(),
519
- isBinary: Type5.Optional(Type5.Boolean())
520
- }),
521
- meta: {
522
- color: "#FF5722",
523
- description: "Metadata for a file."
524
- }
525
- });
526
- var fileContentEntity = defineEntity4({
527
- type: "common.file-content",
528
- schema: Type5.Union([
529
- Type5.Object({
530
- type: Type5.Literal("inline"),
531
- content: Type5.String()
532
- }),
533
- Type5.Object({
534
- type: Type5.Literal("remote"),
535
- url: Type5.String()
536
- })
537
- ]),
538
- meta: {
539
- color: "#FF5722",
540
- description: "The content of a file."
541
- }
542
- });
543
- var fileEntity = defineEntity4({
544
- type: "common.file",
545
- schema: Type5.Object({
546
- meta: fileMetaEntity.schema,
547
- content: fileContentEntity.schema
548
- }),
549
- meta: {
550
- color: "#FF5722"
551
- }
552
- });
553
686
 
554
687
  // src/proxmox.ts
555
688
  var proxmox_exports = {};
@@ -561,86 +694,277 @@ __export(proxmox_exports, {
561
694
  imageEntity: () => imageEntity,
562
695
  virtualMachine: () => virtualMachine
563
696
  });
564
- import { defineEntity as defineEntity5, defineUnit as defineUnit4, Type as Type6 } from "@highstate/contract";
565
- var clusterEntity = defineEntity5({
697
+ var clusterEntity = defineEntity({
566
698
  type: "proxmox.cluster",
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()),
575
- sshKeyPair: Type6.Optional(keyPairEntity.schema)
699
+ schema: z.object({
700
+ endpoint: l7EndpointEntity.schema,
701
+ insecure: z.boolean().optional(),
702
+ username: z.string().optional(),
703
+ defaultNodeName: z.string(),
704
+ defaultDatastoreId: z.string(),
705
+ password: z.string().optional(),
706
+ apiToken: z.string().optional(),
707
+ ssh: credentialsSchema.optional()
576
708
  }),
577
709
  meta: {
578
710
  color: "#e56901"
579
711
  }
580
712
  });
581
- var imageEntity = defineEntity5({
713
+ var imageEntity = defineEntity({
582
714
  type: "proxmox.image",
583
- schema: Type6.Object({
584
- id: Type6.String()
715
+ schema: z.object({
716
+ id: z.string()
585
717
  }),
586
718
  meta: {
587
719
  color: "#e56901"
588
720
  }
589
721
  });
590
- var connection = defineUnit4({
722
+ var connection = defineUnit({
591
723
  type: "proxmox.connection",
592
724
  args: {
593
- endpoint: Type6.String(),
594
- insecure: Type6.Optional(Type6.Boolean()),
595
- username: Type6.Optional(Type6.String()),
596
- defaultNodeName: Type6.Optional(Type6.String()),
597
- defaultDatastoreId: Type6.Optional(Type6.String())
725
+ /**
726
+ * The endpoint of the Proxmox API.
727
+ */
728
+ endpoint: {
729
+ schema: z.string(),
730
+ meta: {
731
+ description: `The endpoint of the Proxmox API.`
732
+ }
733
+ },
734
+ /**
735
+ * Whether to allow insecure connections to the Proxmox API.
736
+ */
737
+ insecure: {
738
+ schema: z.boolean().optional(),
739
+ meta: {
740
+ description: `Whether to allow insecure connections to the Proxmox API.`
741
+ }
742
+ },
743
+ /**
744
+ * The username to use for the Proxmox API.
745
+ *
746
+ * Only required for password token authentication.
747
+ */
748
+ username: {
749
+ schema: z.string().optional(),
750
+ meta: {
751
+ description: `The username to use for the Proxmox API.
752
+
753
+ Only required for password token authentication.`
754
+ }
755
+ },
756
+ /**
757
+ * The name of the default Proxmox node to use for operations.
758
+ *
759
+ * If not specified, the first node in the cluster will be used.
760
+ */
761
+ defaultNodeName: {
762
+ schema: z.string().optional(),
763
+ meta: {
764
+ description: `The name of the default Proxmox node to use for operations.
765
+
766
+ If not specified, the first node in the cluster will be used.`
767
+ }
768
+ },
769
+ /**
770
+ * The ID of the default Proxmox datastore to use for operations.
771
+ *
772
+ * If not specified, the first datastore in the cluster will be used.
773
+ */
774
+ defaultDatastoreId: {
775
+ schema: z.string().optional(),
776
+ meta: {
777
+ description: `The ID of the default Proxmox datastore to use for operations.
778
+
779
+ If not specified, the first datastore in the cluster will be used.`
780
+ }
781
+ },
782
+ /**
783
+ * The username to use for SSH connections to the Proxmox nodes.
784
+ *
785
+ * By default, this is set to "root".
786
+ */
787
+ sshUser: {
788
+ schema: z.string().default("root"),
789
+ meta: {
790
+ description: `The username to use for SSH connections to the Proxmox nodes.
791
+
792
+ By default, this is set to "root".`
793
+ }
794
+ },
795
+ /**
796
+ * The port to use for SSH connections to the Proxmox nodes.
797
+ *
798
+ * By default, this is set to 22.
799
+ */
800
+ sshPort: {
801
+ schema: z.number().default(22),
802
+ meta: {
803
+ description: `The port to use for SSH connections to the Proxmox nodes.
804
+
805
+ By default, this is set to 22.`
806
+ }
807
+ }
598
808
  },
599
809
  secrets: {
600
- password: Type6.Optional(Type6.String()),
601
- apiToken: Type6.Optional(Type6.String())
810
+ /**
811
+ * The password to use for the Proxmox API.
812
+ *
813
+ * Requires `username` to be set.
814
+ */
815
+ password: {
816
+ schema: z.string().optional(),
817
+ meta: {
818
+ description: `The password to use for the Proxmox API.
819
+
820
+ Requires \`username\` to be set.`,
821
+ title: "Proxmox Password"
822
+ }
823
+ },
824
+ /**
825
+ * The Proxmox API token to use for authentication.
826
+ */
827
+ apiToken: {
828
+ schema: z.string().optional(),
829
+ meta: {
830
+ description: `The Proxmox API token to use for authentication.`,
831
+ title: "Proxmox API Token"
832
+ }
833
+ },
834
+ /**
835
+ * The SSH password to use for connecting to the Proxmox nodes.
836
+ */
837
+ sshPassword: {
838
+ schema: z.string().optional(),
839
+ meta: {
840
+ description: `The SSH password to use for connecting to the Proxmox nodes.`
841
+ }
842
+ }
602
843
  },
603
844
  inputs: {
845
+ /**
846
+ * The key pair to use for SSH connections to the Proxmox nodes.
847
+ */
604
848
  sshKeyPair: {
605
849
  entity: keyPairEntity,
606
- required: false
850
+ required: false,
851
+ meta: {
852
+ description: `The key pair to use for SSH connections to the Proxmox nodes.`
853
+ }
607
854
  }
608
855
  },
609
856
  outputs: {
610
857
  proxmoxCluster: clusterEntity
611
858
  },
612
859
  meta: {
613
- displayName: "Proxmox Connection",
860
+ title: "Proxmox Connection",
614
861
  description: "The connection to an existing Proxmox cluster.",
615
862
  category: "Proxmox",
616
- primaryIcon: "simple-icons:proxmox",
617
- primaryIconColor: "#e56901"
863
+ icon: "simple-icons:proxmox",
864
+ iconColor: "#e56901"
618
865
  },
619
866
  source: {
620
867
  package: "@highstate/proxmox",
621
868
  path: "connection"
622
869
  }
623
870
  });
624
- var image = defineUnit4({
871
+ var image = defineUnit({
625
872
  type: "proxmox.image",
626
873
  args: {
627
- url: Type6.String(),
628
- nodeName: Type6.Optional(Type6.String()),
629
- sha256: Type6.Optional(Type6.String()),
630
- datastoreId: Type6.Optional(Type6.String())
874
+ /**
875
+ * The name of the image to upload.
876
+ *
877
+ * If not specified, the default name is `<unitName>-<sha256>.<extension>`
878
+ * or `<unitName>.<extension>` if `sha256` is not provided.
879
+ */
880
+ fileName: {
881
+ schema: z.string().optional(),
882
+ meta: {
883
+ description: `The name of the image to upload.
884
+
885
+ If not specified, the default name is \`<unitName>-<sha256>.<extension>\`
886
+ or \`<unitName>.<extension>\` if \`sha256\` is not provided.`
887
+ }
888
+ },
889
+ /**
890
+ * The URL of the image to upload.
891
+ */
892
+ url: {
893
+ schema: z.string().optional(),
894
+ meta: {
895
+ description: `The URL of the image to upload.`
896
+ }
897
+ },
898
+ /**
899
+ * The checksum of the image file to verify.
900
+ */
901
+ checksum: {
902
+ schema: checksumSchema.optional(),
903
+ meta: {
904
+ description: `The checksum of the image file to verify.`
905
+ }
906
+ },
907
+ /**
908
+ * The name of the Proxmox node to upload the image to.
909
+ *
910
+ * If not specified, the default node name from the cluster will be used.
911
+ */
912
+ nodeName: {
913
+ schema: z.string().optional(),
914
+ meta: {
915
+ description: `The name of the Proxmox node to upload the image to.
916
+
917
+ If not specified, the default node name from the cluster will be used.`
918
+ }
919
+ },
920
+ /**
921
+ * The ID of the Proxmox datastore to upload the image to.
922
+ *
923
+ * If not specified, the default datastore ID from the cluster will be used.
924
+ */
925
+ datastoreId: {
926
+ schema: z.string().optional(),
927
+ meta: {
928
+ description: `The ID of the Proxmox datastore to upload the image to.
929
+
930
+ If not specified, the default datastore ID from the cluster will be used.`
931
+ }
932
+ }
631
933
  },
632
934
  inputs: {
633
- proxmoxCluster: clusterEntity
935
+ /**
936
+ * The Proxmox cluster to upload the image to.
937
+ */
938
+ proxmoxCluster: {
939
+ entity: clusterEntity,
940
+ meta: {
941
+ description: `The Proxmox cluster to upload the image to.`
942
+ }
943
+ },
944
+ /**
945
+ * The file to upload as an image.
946
+ *
947
+ * If `url` is not specified, this file will be used.
948
+ */
949
+ file: {
950
+ entity: fileEntity,
951
+ required: false,
952
+ meta: {
953
+ description: `The file to upload as an image.
954
+
955
+ If \`url\` is not specified, this file will be used.`
956
+ }
957
+ }
634
958
  },
635
959
  outputs: {
636
960
  image: imageEntity
637
961
  },
638
962
  meta: {
639
- displayName: "Proxmox Image",
963
+ title: "Proxmox Image",
640
964
  description: "The image to upload to a Proxmox cluster.",
641
965
  category: "Proxmox",
642
- primaryIcon: "simple-icons:proxmox",
643
- primaryIconColor: "#e56901",
966
+ icon: "simple-icons:proxmox",
967
+ iconColor: "#e56901",
644
968
  secondaryIcon: "mage:compact-disk-fill"
645
969
  },
646
970
  source: {
@@ -648,10 +972,10 @@ var image = defineUnit4({
648
972
  path: "image"
649
973
  }
650
974
  });
651
- var existingImage = defineUnit4({
975
+ var existingImage = defineUnit({
652
976
  type: "proxmox.existing-image",
653
977
  args: {
654
- id: Type6.String()
978
+ id: z.string()
655
979
  },
656
980
  inputs: {
657
981
  proxmoxCluster: clusterEntity
@@ -660,11 +984,11 @@ var existingImage = defineUnit4({
660
984
  image: imageEntity
661
985
  },
662
986
  meta: {
663
- displayName: "Proxmox Existing Image",
987
+ title: "Proxmox Existing Image",
664
988
  description: "The existing image on a Proxmox cluster.",
665
989
  category: "Proxmox",
666
- primaryIcon: "simple-icons:proxmox",
667
- primaryIconColor: "#e56901",
990
+ icon: "simple-icons:proxmox",
991
+ iconColor: "#e56901",
668
992
  secondaryIcon: "mage:compact-disk-fill"
669
993
  },
670
994
  source: {
@@ -672,27 +996,204 @@ var existingImage = defineUnit4({
672
996
  path: "existing-image"
673
997
  }
674
998
  });
675
- var virtualMachine = defineUnit4({
999
+ var virtualMachine = defineUnit({
676
1000
  type: "proxmox.virtual-machine",
677
1001
  args: {
678
- nodeName: Type6.Optional(Type6.String()),
679
- cpuType: Type6.Default(Type6.String(), "host"),
680
- cores: Type6.Default(Type6.Number(), 1),
681
- sockets: Type6.Default(Type6.Number(), 1),
682
- memory: Type6.Default(Type6.Number(), 512),
683
- ipv4: Type6.Optional(Type6.String()),
684
- ipv4Gateway: Type6.Optional(Type6.String()),
685
- dns: Type6.Optional(Type6.Array(Type6.String())),
686
- datastoreId: Type6.Optional(Type6.String()),
687
- diskSize: Type6.Default(Type6.Number(), 8),
688
- bridge: Type6.Default(Type6.String(), "vmbr0"),
689
- sshPort: Type6.Default(Type6.Number(), 22),
690
- sshUser: Type6.Default(Type6.String(), "root"),
691
- waitForAgent: Type6.Default(Type6.Boolean(), true),
692
- vendorData: Type6.Optional(Type6.String({ language: "yaml" }))
1002
+ /**
1003
+ * The name of the node to create the virtual machine on.
1004
+ *
1005
+ * If not specified, the default node name from the cluster will be used.
1006
+ */
1007
+ nodeName: {
1008
+ schema: z.string().optional(),
1009
+ meta: {
1010
+ description: `The name of the node to create the virtual machine on.
1011
+
1012
+ If not specified, the default node name from the cluster will be used.`
1013
+ }
1014
+ },
1015
+ /**
1016
+ * The ID of the Proxmox datastore to create the virtual machine on.
1017
+ *
1018
+ * If not specified, the default datastore ID from the cluster will be used.
1019
+ */
1020
+ datastoreId: {
1021
+ schema: z.string().optional(),
1022
+ meta: {
1023
+ description: `The ID of the Proxmox datastore to create the virtual machine on.
1024
+
1025
+ If not specified, the default datastore ID from the cluster will be used.`
1026
+ }
1027
+ },
1028
+ /**
1029
+ * The type of CPU to use for the virtual machine.
1030
+ *
1031
+ * By default, this is set to "host" which offers the best performance.
1032
+ */
1033
+ cpuType: {
1034
+ schema: z.string().default("host"),
1035
+ meta: {
1036
+ description: `The type of CPU to use for the virtual machine.
1037
+
1038
+ By default, this is set to "host" which offers the best performance.`
1039
+ }
1040
+ },
1041
+ /**
1042
+ * The resources to allocate to the virtual machine.
1043
+ */
1044
+ resources: {
1045
+ schema: z.object({
1046
+ /**
1047
+ * The number of CPU cores to allocate to the virtual machine.
1048
+ *
1049
+ * By default, this is set to 1.
1050
+ */
1051
+ cores: z.number().meta({ title: camelCaseToHumanReadable("cores"), description: `The number of CPU cores to allocate to the virtual machine.
1052
+
1053
+ By default, this is set to 1.` }),
1054
+ /**
1055
+ * The number of CPU sockets to allocate to the virtual machine.
1056
+ *
1057
+ * By default, this is set to 1.
1058
+ */
1059
+ sockets: z.number().meta({ title: camelCaseToHumanReadable("sockets"), description: `The number of CPU sockets to allocate to the virtual machine.
1060
+
1061
+ By default, this is set to 1.` }),
1062
+ /**
1063
+ * The amount of dedicated memory to allocate to the virtual machine, in MB.
1064
+ *
1065
+ * By default, this is set to 512 MB.
1066
+ */
1067
+ memory: z.number().meta({ title: camelCaseToHumanReadable("memory"), description: `The amount of dedicated memory to allocate to the virtual machine, in MB.
1068
+
1069
+ By default, this is set to 512 MB.` }),
1070
+ /**
1071
+ * The size of the disk to create for the virtual machine, in GB.
1072
+ *
1073
+ * By default, this is set to 8 GB.
1074
+ */
1075
+ diskSize: z.number().meta({ title: camelCaseToHumanReadable("diskSize"), description: `The size of the disk to create for the virtual machine, in GB.
1076
+
1077
+ By default, this is set to 8 GB.` })
1078
+ }).default({
1079
+ cores: 1,
1080
+ sockets: 1,
1081
+ memory: 512,
1082
+ diskSize: 8
1083
+ }),
1084
+ meta: {
1085
+ description: `The resources to allocate to the virtual machine.`
1086
+ }
1087
+ },
1088
+ /**
1089
+ * The IPv4 address configuration for the virtual machine.
1090
+ */
1091
+ ipv4: {
1092
+ schema: z.discriminatedUnion("type", [
1093
+ z.object({
1094
+ type: z.literal("dhcp")
1095
+ }),
1096
+ z.object({
1097
+ type: z.literal("static"),
1098
+ /**
1099
+ * The IPv4 address to assign to the virtual machine.
1100
+ */
1101
+ address: z.string().meta({ title: camelCaseToHumanReadable("address"), description: `The IPv4 address to assign to the virtual machine.` }),
1102
+ /**
1103
+ * The CIDR prefix for the IPv4 address.
1104
+ *
1105
+ * By default, this is set to 24.
1106
+ */
1107
+ prefix: z.number().default(24).meta({ title: camelCaseToHumanReadable("prefix"), description: `The CIDR prefix for the IPv4 address.
1108
+
1109
+ By default, this is set to 24.` }),
1110
+ /**
1111
+ * The IPv4 gateway for the virtual machine.
1112
+ *
1113
+ * If not specified, will be set to the first address in the subnet.
1114
+ */
1115
+ gateway: z.string().optional().meta({ title: camelCaseToHumanReadable("gateway"), description: `The IPv4 gateway for the virtual machine.
1116
+
1117
+ If not specified, will be set to the first address in the subnet.` })
1118
+ })
1119
+ ]).default({ type: "dhcp" }),
1120
+ meta: {
1121
+ description: `The IPv4 address configuration for the virtual machine.`
1122
+ }
1123
+ },
1124
+ /**
1125
+ * The network configuration for the virtual machine.
1126
+ */
1127
+ network: {
1128
+ schema: z.object({
1129
+ /**
1130
+ * The list of DNS servers to use for the virtual machine.
1131
+ */
1132
+ dns: z.string().array().meta({ title: camelCaseToHumanReadable("dns"), description: `The list of DNS servers to use for the virtual machine.` }),
1133
+ /**
1134
+ * The name of the network bridge to connect the virtual machine to.
1135
+ *
1136
+ * By default, this is set to "vmbr0".
1137
+ */
1138
+ bridge: z.string().meta({ title: camelCaseToHumanReadable("bridge"), description: `The name of the network bridge to connect the virtual machine to.
1139
+
1140
+ By default, this is set to "vmbr0".` })
1141
+ }).default({ dns: [], bridge: "vmbr0" }),
1142
+ meta: {
1143
+ description: `The network configuration for the virtual machine.`
1144
+ }
1145
+ },
1146
+ /**
1147
+ * The SSH configuration for the virtual machine.
1148
+ */
1149
+ ssh: {
1150
+ schema: z.object({
1151
+ /**
1152
+ * The port to use for SSH connections to the virtual machine.
1153
+ *
1154
+ * By default, this is set to 22.
1155
+ */
1156
+ port: z.number().meta({ title: camelCaseToHumanReadable("port"), description: `The port to use for SSH connections to the virtual machine.
1157
+
1158
+ By default, this is set to 22.` }),
1159
+ /**
1160
+ * The user to use for SSH connections to the virtual machine.
1161
+ *
1162
+ * By default, this is set to "root".
1163
+ */
1164
+ user: z.string().meta({ title: camelCaseToHumanReadable("user"), description: `The user to use for SSH connections to the virtual machine.
1165
+
1166
+ By default, this is set to "root".` })
1167
+ }).default({ port: 22, user: "root" }),
1168
+ meta: {
1169
+ description: `The SSH configuration for the virtual machine.`
1170
+ }
1171
+ },
1172
+ /**
1173
+ * Whether to wait for the Proxmox agent to be ready before returning.
1174
+ */
1175
+ waitForAgent: {
1176
+ schema: z.boolean().default(true),
1177
+ meta: {
1178
+ description: `Whether to wait for the Proxmox agent to be ready before returning.`
1179
+ }
1180
+ },
1181
+ /**
1182
+ * The cloud-init vendor data to use for the virtual machine.
1183
+ *
1184
+ * Will take precedence over the `vendorData` input.
1185
+ */
1186
+ vendorData: {
1187
+ schema: z.string().optional().meta({ multiline: true }),
1188
+ meta: {
1189
+ description: `The cloud-init vendor data to use for the virtual machine.
1190
+
1191
+ Will take precedence over the \`vendorData\` input.`
1192
+ }
1193
+ }
693
1194
  },
694
1195
  secrets: {
695
- sshPassword: Type6.Optional(Type6.String())
1196
+ sshPassword: z.string().optional()
696
1197
  },
697
1198
  inputs: {
698
1199
  proxmoxCluster: clusterEntity,
@@ -700,15 +1201,29 @@ var virtualMachine = defineUnit4({
700
1201
  sshKeyPair: {
701
1202
  entity: keyPairEntity,
702
1203
  required: false
1204
+ },
1205
+ /**
1206
+ * The cloud-init vendor data to use for the virtual machine.
1207
+ *
1208
+ * You can provide a cloud-config from the distribution component.
1209
+ */
1210
+ vendorData: {
1211
+ entity: fileEntity,
1212
+ required: false,
1213
+ meta: {
1214
+ description: `The cloud-init vendor data to use for the virtual machine.
1215
+
1216
+ You can provide a cloud-config from the distribution component.`
1217
+ }
703
1218
  }
704
1219
  },
705
1220
  outputs: serverOutputs,
706
1221
  meta: {
707
- displayName: "Proxmox Virtual Machine",
1222
+ title: "Proxmox Virtual Machine",
708
1223
  description: "The virtual machine on a Proxmox cluster.",
709
1224
  category: "Proxmox",
710
- primaryIcon: "simple-icons:proxmox",
711
- primaryIconColor: "#e56901",
1225
+ icon: "simple-icons:proxmox",
1226
+ iconColor: "#e56901",
712
1227
  secondaryIcon: "codicon:vm"
713
1228
  },
714
1229
  source: {
@@ -743,6 +1258,8 @@ __export(k8s_exports, {
743
1258
  interfaceEntity: () => interfaceEntity,
744
1259
  internalIpsPolicySchema: () => internalIpsPolicySchema,
745
1260
  metadataSchema: () => metadataSchema,
1261
+ monitorWorkerParamsSchema: () => monitorWorkerParamsSchema,
1262
+ monitorWorkerResourceGroupSchema: () => monitorWorkerResourceGroupSchema,
746
1263
  persistentVolumeClaimEntity: () => persistentVolumeClaimEntity,
747
1264
  resourceSchema: () => resourceSchema,
748
1265
  scheduleOnMastersPolicyArgs: () => scheduleOnMastersPolicyArgs,
@@ -753,127 +1270,80 @@ __export(k8s_exports, {
753
1270
  tlsIssuerEntity: () => tlsIssuerEntity,
754
1271
  tunDevicePolicySchema: () => tunDevicePolicySchema
755
1272
  });
756
- import { defineEntity as defineEntity6, defineUnit as defineUnit5, Type as Type7 } from "@highstate/contract";
757
- import { Literal } from "@sinclair/typebox";
758
- var fallbackKubeApiAccessSchema = Type7.Object({
759
- serverIp: Type7.String(),
760
- serverPort: Type7.Number()
1273
+ var fallbackKubeApiAccessSchema = z.object({
1274
+ serverIp: z.string(),
1275
+ serverPort: z.number()
761
1276
  });
762
- var tunDevicePolicySchema = Type7.Union([
763
- Type7.Object({
764
- type: Literal("host")
1277
+ var tunDevicePolicySchema = z.union([
1278
+ z.object({
1279
+ type: z.literal("host")
765
1280
  }),
766
- Type7.Object({
767
- type: Literal("plugin"),
768
- resourceName: Type7.String(),
769
- resourceValue: Type7.String()
1281
+ z.object({
1282
+ type: z.literal("plugin"),
1283
+ resourceName: z.string(),
1284
+ resourceValue: z.string()
770
1285
  })
771
1286
  ]);
772
- var externalServiceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer"]);
773
- var scheduleOnMastersPolicySchema = Type7.StringEnum(["always", "when-no-workers", "never"]);
774
- var cniSchema = Type7.StringEnum(["cilium", "other"]);
775
- var clusterQuirksSchema = Type7.Object({
1287
+ var externalServiceTypeSchema = z.enum(["NodePort", "LoadBalancer"]);
1288
+ var scheduleOnMastersPolicySchema = z.enum(["always", "when-no-workers", "never"]);
1289
+ var cniSchema = z.enum(["cilium", "other"]);
1290
+ var clusterQuirksSchema = z.object({
776
1291
  /**
777
1292
  * The IP and port of the kube-apiserver available from the cluster.
778
1293
  *
779
1294
  * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
780
- *
781
- * @schema
782
1295
  */
783
- fallbackKubeApiAccess: {
784
- ...Type7.Optional(fallbackKubeApiAccessSchema),
785
- description: `The IP and port of the kube-apiserver available from the cluster.
1296
+ fallbackKubeApiAccess: fallbackKubeApiAccessSchema.optional().meta({ title: camelCaseToHumanReadable("fallbackKubeApiAccess"), description: `The IP and port of the kube-apiserver available from the cluster.
786
1297
 
787
- Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.`
788
- },
1298
+ Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.` }),
789
1299
  /**
790
1300
  * Specifies the policy for using the tun device inside containers.
791
1301
  *
792
1302
  * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
793
1303
  *
794
1304
  * 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.
795
- *
796
- * @schema
797
1305
  */
798
- tunDevicePolicy: {
799
- ...Type7.Optional(tunDevicePolicySchema),
800
- description: `Specifies the policy for using the tun device inside containers.
1306
+ tunDevicePolicy: tunDevicePolicySchema.optional().meta({ title: camelCaseToHumanReadable("tunDevicePolicy"), description: `Specifies the policy for using the tun device inside containers.
801
1307
 
802
1308
  If not provided, the default policy is \`host\` which assumes just mounting /dev/net/tun from the host.
803
1309
 
804
- 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.`
805
- },
1310
+ 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.` }),
806
1311
  /**
807
1312
  * The service type to use for external services.
808
1313
  *
809
1314
  * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
810
- *
811
- * @schema
812
1315
  */
813
- externalServiceType: {
814
- ...Type7.Optional(externalServiceTypeSchema),
815
- description: `The service type to use for external services.
1316
+ externalServiceType: externalServiceTypeSchema.optional().meta({ title: camelCaseToHumanReadable("externalServiceType"), description: `The service type to use for external services.
816
1317
 
817
- If not provided, the default service type is \`NodePort\` since \`LoadBalancer\` may not be available.`
818
- }
1318
+ If not provided, the default service type is \`NodePort\` since \`LoadBalancer\` may not be available.` })
819
1319
  });
820
1320
  var clusterInfoProperties = {
821
1321
  /**
822
1322
  * The unique identifier of the cluster.
823
1323
  *
824
1324
  * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.
825
- *
826
- * @schema
827
1325
  */
828
- id: {
829
- ...Type7.String(),
830
- description: `The unique identifier of the cluster.
831
-
832
- Should be defined as a UUID of the \`kube-system\` namespace which is always present in the cluster.`
833
- },
1326
+ id: z.string(),
834
1327
  /**
835
1328
  * The name of the cluster.
836
- *
837
- * @schema
838
1329
  */
839
- name: {
840
- ...Type7.String(),
841
- description: `The name of the cluster.`
842
- },
1330
+ name: z.string(),
843
1331
  /**
844
1332
  * The name of the CNI plugin used by the cluster.
845
1333
  *
846
1334
  * Supported values are:
847
1335
  * - `cilium`
848
1336
  * - `other`
849
- *
850
- * @schema
851
1337
  */
852
- cni: {
853
- ...cniSchema,
854
- description: `The name of the CNI plugin used by the cluster.
855
-
856
- Supported values are:
857
- - \`cilium\`
858
- - \`other\``
859
- },
1338
+ cni: cniSchema,
860
1339
  /**
861
1340
  * The endpoints of the cluster nodes.
862
1341
  *
863
1342
  * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
864
1343
  *
865
1344
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
866
- *
867
- * @schema
868
1345
  */
869
- endpoints: {
870
- ...Type7.Array(l3EndpointEntity.schema),
871
- description: `The endpoints of the cluster nodes.
872
-
873
- The entry may represent real node endpoint or virtual endpoint (like a load balancer).
874
-
875
- The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
876
- },
1346
+ endpoints: l3EndpointEntity.schema.array(),
877
1347
  /**
878
1348
  * The endpoints of the API server.
879
1349
  *
@@ -881,87 +1351,72 @@ var clusterInfoProperties = {
881
1351
  *
882
1352
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
883
1353
  */
884
- apiEndpoints: Type7.Array(l4EndpointEntity.schema),
1354
+ apiEndpoints: l4EndpointEntity.schema.array(),
885
1355
  /**
886
1356
  * The external IPs of the cluster nodes allowed to be used for external access.
887
- *
888
- * @schema
889
1357
  */
890
- externalIps: {
891
- ...Type7.Array(Type7.String()),
892
- description: `The external IPs of the cluster nodes allowed to be used for external access.`
893
- },
1358
+ externalIps: z.string().array(),
894
1359
  /**
895
1360
  * The extra quirks of the cluster to improve compatibility.
896
- *
897
- * @schema
898
1361
  */
899
- quirks: {
900
- ...Type7.Optional(clusterQuirksSchema),
901
- description: `The extra quirks of the cluster to improve compatibility.`
902
- },
1362
+ quirks: clusterQuirksSchema.optional(),
903
1363
  /**
904
1364
  * The extra metadata to attach to the cluster.
905
- *
906
- * @schema
907
1365
  */
908
- metadata: {
909
- ...Type7.Optional(Type7.Record(Type7.String(), Type7.Unknown())),
910
- description: `The extra metadata to attach to the cluster.`
911
- }
1366
+ metadata: z.record(z.string(), z.unknown()).optional()
912
1367
  };
913
- var serviceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
914
- var metadataSchema = Type7.Object({
915
- name: Type7.String(),
916
- namespace: Type7.String(),
917
- labels: Type7.Optional(Type7.Record(Type7.String(), Type7.String())),
918
- annotations: Type7.Optional(Type7.Record(Type7.String(), Type7.String()))
919
- });
920
- var resourceSchema = Type7.Object({
921
- clusterId: Type7.String(),
1368
+ var serviceTypeSchema = z.enum(["NodePort", "LoadBalancer", "ClusterIP"]);
1369
+ var metadataSchema = z.object({
1370
+ name: z.string(),
1371
+ namespace: z.string(),
1372
+ labels: z.record(z.string(), z.string()).optional(),
1373
+ annotations: z.record(z.string(), z.string()).optional()
1374
+ });
1375
+ var resourceSchema = z.object({
1376
+ clusterId: z.string(),
922
1377
  metadata: metadataSchema
923
1378
  });
924
- var serviceEntity = defineEntity6({
1379
+ var serviceEntity = defineEntity({
925
1380
  type: "k8s.service",
926
- schema: Type7.Object({
927
- type: Type7.Literal("k8s.service"),
928
- ...resourceSchema.properties,
929
- endpoints: Type7.Array(l4EndpointEntity.schema)
1381
+ schema: z.object({
1382
+ type: z.literal("k8s.service"),
1383
+ ...resourceSchema.shape,
1384
+ endpoints: l4EndpointEntity.schema.array()
930
1385
  }),
931
1386
  meta: {
932
1387
  color: "#2196F3"
933
1388
  }
934
1389
  });
935
- var clusterEntity2 = defineEntity6({
1390
+ var clusterEntity2 = defineEntity({
936
1391
  type: "k8s.cluster",
937
- schema: Type7.Object({
1392
+ schema: z.object({
938
1393
  ...clusterInfoProperties,
939
- kubeconfig: Type7.String()
1394
+ kubeconfig: z.string()
940
1395
  }),
941
1396
  meta: {
942
1397
  color: "#2196F3"
943
1398
  }
944
1399
  });
945
- var internalIpsPolicySchema = Type7.StringEnum(["always", "public", "never"]);
946
- var scheduleOnMastersPolicyArgs = {
1400
+ var internalIpsPolicySchema = z.enum(["always", "public", "never"]);
1401
+ var scheduleOnMastersPolicyArgs = $args({
947
1402
  /**
948
1403
  * The policy for scheduling workloads on master nodes.
949
1404
  *
950
1405
  * - `always`: always schedule workloads on master nodes regardless of the number of workers;
951
1406
  * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
952
1407
  * - `never`: never schedule workloads on master nodes.
953
- *
954
- * @schema
955
1408
  */
956
1409
  scheduleOnMastersPolicy: {
957
- ...Type7.Default(scheduleOnMastersPolicySchema, "when-no-workers"),
958
- description: `The policy for scheduling workloads on master nodes.
1410
+ schema: scheduleOnMastersPolicySchema.default("when-no-workers"),
1411
+ meta: {
1412
+ description: `The policy for scheduling workloads on master nodes.
959
1413
 
960
1414
  - \`always\`: always schedule workloads on master nodes regardless of the number of workers;
961
1415
  - \`when-no-workers\`: schedule workloads on master nodes only if there are no workers (default);
962
1416
  - \`never\`: never schedule workloads on master nodes.`
1417
+ }
963
1418
  }
964
- };
1419
+ });
965
1420
  var clusterInputs = {
966
1421
  masters: {
967
1422
  entity: serverEntity,
@@ -984,21 +1439,21 @@ var clusterOutputs = {
984
1439
  multiple: true
985
1440
  }
986
1441
  };
987
- var existingCluster = defineUnit5({
1442
+ var existingCluster = defineUnit({
988
1443
  type: "k8s.existing-cluster",
989
1444
  args: {
990
1445
  /**
991
1446
  * The list of external IPs of the cluster nodes allowed to be used for external access.
992
1447
  *
993
1448
  * If not provided, will be automatically detected by querying the cluster nodes.
994
- *
995
- * @schema
996
1449
  */
997
1450
  externalIps: {
998
- ...Type7.Optional(Type7.Array(Type7.String())),
999
- description: `The list of external IPs of the cluster nodes allowed to be used for external access.
1451
+ schema: z.string().array().optional(),
1452
+ meta: {
1453
+ description: `The list of external IPs of the cluster nodes allowed to be used for external access.
1000
1454
 
1001
1455
  If not provided, will be automatically detected by querying the cluster nodes.`
1456
+ }
1002
1457
  },
1003
1458
  /**
1004
1459
  * The policy for using internal IPs of the nodes as external IPs.
@@ -1006,25 +1461,25 @@ var existingCluster = defineUnit5({
1006
1461
  * - `always`: always use internal IPs as external IPs;
1007
1462
  * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
1008
1463
  * - `never`: never use internal IPs as external IPs.
1009
- *
1010
- * @schema
1011
1464
  */
1012
1465
  internalIpsPolicy: {
1013
- ...Type7.Default(internalIpsPolicySchema, "public"),
1014
- description: `The policy for using internal IPs of the nodes as external IPs.
1466
+ schema: internalIpsPolicySchema.default("public"),
1467
+ meta: {
1468
+ description: `The policy for using internal IPs of the nodes as external IPs.
1015
1469
 
1016
1470
  - \`always\`: always use internal IPs as external IPs;
1017
1471
  - \`public\`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
1018
1472
  - \`never\`: never use internal IPs as external IPs.`
1473
+ }
1019
1474
  },
1020
1475
  /**
1021
1476
  * The extra quirks of the cluster to improve compatibility.
1022
- *
1023
- * @schema
1024
1477
  */
1025
1478
  quirks: {
1026
- ...Type7.Optional(clusterQuirksSchema),
1027
- description: `The extra quirks of the cluster to improve compatibility.`
1479
+ schema: clusterQuirksSchema.optional(),
1480
+ meta: {
1481
+ description: `The extra quirks of the cluster to improve compatibility.`
1482
+ }
1028
1483
  }
1029
1484
  },
1030
1485
  secrets: {
@@ -1032,21 +1487,21 @@ var existingCluster = defineUnit5({
1032
1487
  * The kubeconfig of the cluster to use for connecting to the cluster.
1033
1488
  *
1034
1489
  * Will be available for all components using `cluster` output of this unit.
1035
- *
1036
- * @schema
1037
1490
  */
1038
1491
  kubeconfig: {
1039
- ...Type7.Record(Type7.String(), Type7.Any()),
1040
- description: `The kubeconfig of the cluster to use for connecting to the cluster.
1492
+ schema: z.record(z.string(), z.unknown()),
1493
+ meta: {
1494
+ description: `The kubeconfig of the cluster to use for connecting to the cluster.
1041
1495
 
1042
1496
  Will be available for all components using \`cluster\` output of this unit.`
1497
+ }
1043
1498
  }
1044
1499
  },
1045
1500
  outputs: clusterOutputs,
1046
1501
  meta: {
1047
- displayName: "Existing Cluster",
1502
+ title: "Existing Cluster",
1048
1503
  description: "An existing Kubernetes cluster.",
1049
- primaryIcon: "devicon:kubernetes",
1504
+ icon: "devicon:kubernetes",
1050
1505
  category: "Kubernetes"
1051
1506
  },
1052
1507
  source: {
@@ -1054,7 +1509,7 @@ var existingCluster = defineUnit5({
1054
1509
  path: "units/existing-cluster"
1055
1510
  }
1056
1511
  });
1057
- var clusterPatch = defineUnit5({
1512
+ var clusterPatch = defineUnit({
1058
1513
  type: "k8s.cluster-patch",
1059
1514
  args: {
1060
1515
  /**
@@ -1063,16 +1518,16 @@ var clusterPatch = defineUnit5({
1063
1518
  * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1064
1519
  *
1065
1520
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1066
- *
1067
- * @schema
1068
1521
  */
1069
1522
  apiEndpoints: {
1070
- ...Type7.Default(Type7.Array(Type7.String()), []),
1071
- description: `The endpoints of the API server.
1523
+ schema: z.string().array().default([]),
1524
+ meta: {
1525
+ description: `The endpoints of the API server.
1072
1526
 
1073
1527
  The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1074
1528
 
1075
1529
  The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
1530
+ }
1076
1531
  },
1077
1532
  /**
1078
1533
  * The mode to use for patching the API endpoints.
@@ -1080,23 +1535,31 @@ var clusterPatch = defineUnit5({
1080
1535
  * - `prepend`: prepend the new endpoints to the existing ones (default);
1081
1536
  * - `replace`: replace the existing endpoints with the new ones.
1082
1537
  */
1083
- apiEndpointsPatchMode: Type7.Default(arrayPatchModeSchema, "prepend"),
1538
+ apiEndpointsPatchMode: {
1539
+ schema: arrayPatchModeSchema.default("prepend"),
1540
+ meta: {
1541
+ description: `The mode to use for patching the API endpoints.
1542
+
1543
+ - \`prepend\`: prepend the new endpoints to the existing ones (default);
1544
+ - \`replace\`: replace the existing endpoints with the new ones.`
1545
+ }
1546
+ },
1084
1547
  /**
1085
1548
  * The endpoints of the cluster nodes.
1086
1549
  *
1087
1550
  * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1088
1551
  *
1089
1552
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1090
- *
1091
- * @schema
1092
1553
  */
1093
1554
  endpoints: {
1094
- ...Type7.Default(Type7.Array(Type7.String()), []),
1095
- description: `The endpoints of the cluster nodes.
1555
+ schema: z.string().array().default([]),
1556
+ meta: {
1557
+ description: `The endpoints of the cluster nodes.
1096
1558
 
1097
1559
  The entry may represent real node endpoint or virtual endpoint (like a load balancer).
1098
1560
 
1099
1561
  The same node may also be represented by multiple entries (e.g. a node with private and public IP).`
1562
+ }
1100
1563
  },
1101
1564
  /**
1102
1565
  * The mode to use for patching the endpoints.
@@ -1104,7 +1567,15 @@ var clusterPatch = defineUnit5({
1104
1567
  * - `prepend`: prepend the new endpoints to the existing ones (default);
1105
1568
  * - `replace`: replace the existing endpoints with the new ones.
1106
1569
  */
1107
- endpointsPatchMode: Type7.Default(arrayPatchModeSchema, "prepend")
1570
+ endpointsPatchMode: {
1571
+ schema: arrayPatchModeSchema.default("prepend"),
1572
+ meta: {
1573
+ description: `The mode to use for patching the endpoints.
1574
+
1575
+ - \`prepend\`: prepend the new endpoints to the existing ones (default);
1576
+ - \`replace\`: replace the existing endpoints with the new ones.`
1577
+ }
1578
+ }
1108
1579
  },
1109
1580
  inputs: {
1110
1581
  k8sCluster: clusterEntity2,
@@ -1121,9 +1592,9 @@ var clusterPatch = defineUnit5({
1121
1592
  },
1122
1593
  outputs: clusterOutputs,
1123
1594
  meta: {
1124
- displayName: "Cluster Patch",
1595
+ title: "Cluster Patch",
1125
1596
  description: "Patches some properties of the cluster.",
1126
- primaryIcon: "devicon:kubernetes",
1597
+ icon: "devicon:kubernetes",
1127
1598
  secondaryIcon: "fluent:patch-20-filled",
1128
1599
  category: "Kubernetes"
1129
1600
  },
@@ -1132,7 +1603,7 @@ var clusterPatch = defineUnit5({
1132
1603
  path: "units/cluster-patch"
1133
1604
  }
1134
1605
  });
1135
- var clusterDns = defineUnit5({
1606
+ var clusterDns = defineUnit({
1136
1607
  type: "k8s.cluster-dns",
1137
1608
  args: {
1138
1609
  ...createArgs(),
@@ -1144,9 +1615,9 @@ var clusterDns = defineUnit5({
1144
1615
  },
1145
1616
  outputs: clusterOutputs,
1146
1617
  meta: {
1147
- displayName: "Cluster DNS",
1618
+ title: "Cluster DNS",
1148
1619
  description: "Creates DNS records for the cluster and updates endpoints.",
1149
- primaryIcon: "devicon:kubernetes",
1620
+ icon: "devicon:kubernetes",
1150
1621
  secondaryIcon: "mdi:dns",
1151
1622
  category: "Kubernetes"
1152
1623
  },
@@ -1155,42 +1626,42 @@ var clusterDns = defineUnit5({
1155
1626
  path: "units/cluster-dns"
1156
1627
  }
1157
1628
  });
1158
- var gatewayEntity = defineEntity6({
1629
+ var gatewayEntity = defineEntity({
1159
1630
  type: "k8s.gateway",
1160
- schema: Type7.Object({
1161
- clusterId: Type7.String(),
1162
- gatewayClassName: Type7.String(),
1163
- httpListenerPort: Type7.Number(),
1164
- httpsListenerPort: Type7.Number(),
1165
- endpoints: Type7.Array(l3EndpointEntity.schema)
1631
+ schema: z.object({
1632
+ clusterId: z.string(),
1633
+ gatewayClassName: z.string(),
1634
+ httpListenerPort: z.number(),
1635
+ httpsListenerPort: z.number(),
1636
+ endpoints: l3EndpointEntity.schema.array()
1166
1637
  }),
1167
1638
  meta: {
1168
1639
  color: "#4CAF50"
1169
1640
  }
1170
1641
  });
1171
- var tlsIssuerEntity = defineEntity6({
1642
+ var tlsIssuerEntity = defineEntity({
1172
1643
  type: "k8s.tls-issuer",
1173
- schema: Type7.Object({
1174
- clusterId: Type7.String(),
1175
- clusterIssuerName: Type7.String()
1644
+ schema: z.object({
1645
+ clusterId: z.string(),
1646
+ clusterIssuerName: z.string()
1176
1647
  }),
1177
1648
  meta: {
1178
1649
  color: "#f06292"
1179
1650
  }
1180
1651
  });
1181
- var accessPointEntity = defineEntity6({
1652
+ var accessPointEntity = defineEntity({
1182
1653
  type: "k8s.access-point",
1183
- schema: Type7.Object({
1184
- clusterId: Type7.String(),
1654
+ schema: z.object({
1655
+ clusterId: z.string(),
1185
1656
  gateway: gatewayEntity.schema,
1186
1657
  tlsIssuer: tlsIssuerEntity.schema,
1187
- dnsProviders: Type7.Array(providerEntity.schema)
1658
+ dnsProviders: providerEntity.schema.array()
1188
1659
  }),
1189
1660
  meta: {
1190
1661
  color: "#F57F17"
1191
1662
  }
1192
1663
  });
1193
- var accessPoint = defineUnit5({
1664
+ var accessPoint = defineUnit({
1194
1665
  type: "k8s.access-point",
1195
1666
  inputs: {
1196
1667
  gateway: gatewayEntity,
@@ -1204,9 +1675,9 @@ var accessPoint = defineUnit5({
1204
1675
  accessPoint: accessPointEntity
1205
1676
  },
1206
1677
  meta: {
1207
- displayName: "Access Point",
1678
+ title: "Access Point",
1208
1679
  description: "An access point which can be used to connect to services.",
1209
- primaryIcon: "mdi:access-point",
1680
+ icon: "mdi:access-point",
1210
1681
  category: "Kubernetes"
1211
1682
  },
1212
1683
  source: {
@@ -1214,7 +1685,7 @@ var accessPoint = defineUnit5({
1214
1685
  path: "units/access-point"
1215
1686
  }
1216
1687
  });
1217
- var certManager = defineUnit5({
1688
+ var certManager = defineUnit({
1218
1689
  type: "k8s.cert-manager",
1219
1690
  inputs: {
1220
1691
  k8sCluster: clusterEntity2
@@ -1223,9 +1694,9 @@ var certManager = defineUnit5({
1223
1694
  k8sCluster: clusterEntity2
1224
1695
  },
1225
1696
  meta: {
1226
- displayName: "Cert Manager",
1697
+ title: "Cert Manager",
1227
1698
  description: "A certificate manager for managing TLS certificates.",
1228
- primaryIcon: "simple-icons:letsencrypt",
1699
+ icon: "simple-icons:letsencrypt",
1229
1700
  category: "Kubernetes"
1230
1701
  },
1231
1702
  source: {
@@ -1233,21 +1704,21 @@ var certManager = defineUnit5({
1233
1704
  path: "units/cert-manager"
1234
1705
  }
1235
1706
  });
1236
- var dns01TlsIssuer = defineUnit5({
1707
+ var dns01TlsIssuer = defineUnit({
1237
1708
  type: "k8s.dns01-issuer",
1238
1709
  args: {
1239
1710
  /**
1240
1711
  * The top-level domains to filter the DNS01 challenge for.
1241
1712
  *
1242
1713
  * If not provided, will use all domains passed to the DNS providers.
1243
- *
1244
- * @schema
1245
1714
  */
1246
1715
  domains: {
1247
- ...Type7.Optional(Type7.Array(Type7.String())),
1248
- description: `The top-level domains to filter the DNS01 challenge for.
1716
+ schema: z.string().array().optional(),
1717
+ meta: {
1718
+ description: `The top-level domains to filter the DNS01 challenge for.
1249
1719
 
1250
1720
  If not provided, will use all domains passed to the DNS providers.`
1721
+ }
1251
1722
  }
1252
1723
  },
1253
1724
  inputs: {
@@ -1261,9 +1732,9 @@ var dns01TlsIssuer = defineUnit5({
1261
1732
  tlsIssuer: tlsIssuerEntity
1262
1733
  },
1263
1734
  meta: {
1264
- displayName: "DNS01 Issuer",
1735
+ title: "DNS01 Issuer",
1265
1736
  description: "A TLS issuer for issuing certificate using DNS01 challenge.",
1266
- primaryIcon: "mdi:certificate",
1737
+ icon: "mdi:certificate",
1267
1738
  category: "Kubernetes"
1268
1739
  },
1269
1740
  source: {
@@ -1271,49 +1742,49 @@ var dns01TlsIssuer = defineUnit5({
1271
1742
  path: "units/dns01-issuer"
1272
1743
  }
1273
1744
  });
1274
- var deploymentEntity = defineEntity6({
1745
+ var deploymentEntity = defineEntity({
1275
1746
  type: "k8s.deployment",
1276
- schema: Type7.Object({
1277
- type: Type7.Literal("k8s.deployment"),
1278
- ...resourceSchema.properties,
1279
- service: Type7.Optional(serviceEntity.schema)
1747
+ schema: z.object({
1748
+ type: z.literal("k8s.deployment"),
1749
+ ...resourceSchema.shape,
1750
+ service: serviceEntity.schema.optional()
1280
1751
  }),
1281
1752
  meta: {
1282
1753
  color: "#4CAF50"
1283
1754
  }
1284
1755
  });
1285
- var statefulSetEntity = defineEntity6({
1756
+ var statefulSetEntity = defineEntity({
1286
1757
  type: "k8s.stateful-set",
1287
- schema: Type7.Object({
1288
- type: Type7.Literal("k8s.stateful-set"),
1289
- ...resourceSchema.properties,
1758
+ schema: z.object({
1759
+ type: z.literal("k8s.stateful-set"),
1760
+ ...resourceSchema.shape,
1290
1761
  service: serviceEntity.schema
1291
1762
  }),
1292
1763
  meta: {
1293
1764
  color: "#FFC107"
1294
1765
  }
1295
1766
  });
1296
- var exposableWorkloadEntity = defineEntity6({
1767
+ var exposableWorkloadEntity = defineEntity({
1297
1768
  type: "k8s.exposable-workload",
1298
- schema: Type7.Union([deploymentEntity.schema, statefulSetEntity.schema]),
1769
+ schema: z.union([deploymentEntity.schema, statefulSetEntity.schema]),
1299
1770
  meta: {
1300
1771
  color: "#4CAF50"
1301
1772
  }
1302
1773
  });
1303
- var persistentVolumeClaimEntity = defineEntity6({
1774
+ var persistentVolumeClaimEntity = defineEntity({
1304
1775
  type: "k8s.persistent-volume-claim",
1305
- schema: Type7.Object({
1306
- type: Type7.Literal("k8s.persistent-volume-claim"),
1307
- ...resourceSchema.properties
1776
+ schema: z.object({
1777
+ type: z.literal("k8s.persistent-volume-claim"),
1778
+ ...resourceSchema.shape
1308
1779
  }),
1309
1780
  meta: {
1310
1781
  color: "#FFC107"
1311
1782
  }
1312
1783
  });
1313
- var interfaceEntity = defineEntity6({
1784
+ var interfaceEntity = defineEntity({
1314
1785
  type: "k8s.interface",
1315
- schema: Type7.Object({
1316
- name: Type7.String(),
1786
+ schema: z.object({
1787
+ name: z.string(),
1317
1788
  workload: exposableWorkloadEntity.schema
1318
1789
  }),
1319
1790
  meta: {
@@ -1321,7 +1792,7 @@ var interfaceEntity = defineEntity6({
1321
1792
  description: "The interface in a network space of pod kernel which can accept or transmit packets."
1322
1793
  }
1323
1794
  });
1324
- var gatewayApi = defineUnit5({
1795
+ var gatewayApi = defineUnit({
1325
1796
  type: "k8s.gateway-api",
1326
1797
  inputs: {
1327
1798
  k8sCluster: clusterEntity2
@@ -1330,9 +1801,9 @@ var gatewayApi = defineUnit5({
1330
1801
  k8sCluster: clusterEntity2
1331
1802
  },
1332
1803
  meta: {
1333
- displayName: "Gateway API",
1804
+ title: "Gateway API",
1334
1805
  description: "Installs the Gateway API CRDs to the cluster.",
1335
- primaryIcon: "devicon:kubernetes",
1806
+ icon: "devicon:kubernetes",
1336
1807
  secondaryIcon: "mdi:api",
1337
1808
  secondaryIconColor: "#4CAF50",
1338
1809
  category: "Kubernetes"
@@ -1342,7 +1813,7 @@ var gatewayApi = defineUnit5({
1342
1813
  path: "units/gateway-api"
1343
1814
  }
1344
1815
  });
1345
- var cilium = defineUnit5({
1816
+ var cilium = defineUnit({
1346
1817
  type: "k8s.cilium",
1347
1818
  args: {
1348
1819
  /**
@@ -1352,7 +1823,16 @@ var cilium = defineUnit5({
1352
1823
  *
1353
1824
  * By default, is `false`.
1354
1825
  */
1355
- allowForbiddenFqdnResolution: Type7.Default(Type7.Boolean(), false)
1826
+ allowForbiddenFqdnResolution: {
1827
+ schema: z.boolean().default(false),
1828
+ meta: {
1829
+ description: `If set to \`true\`, the generated network policy will allow
1830
+ all DNS queries to be resolved, even if they are
1831
+ for forbidden (non-allowed) FQDNs.
1832
+
1833
+ By default, is \`false\`.`
1834
+ }
1835
+ }
1356
1836
  },
1357
1837
  inputs: {
1358
1838
  k8sCluster: clusterEntity2
@@ -1361,9 +1841,9 @@ var cilium = defineUnit5({
1361
1841
  k8sCluster: clusterEntity2
1362
1842
  },
1363
1843
  meta: {
1364
- displayName: "Cilium",
1844
+ title: "Cilium",
1365
1845
  description: "The Cilium CNI deployed on Kubernetes.",
1366
- primaryIcon: "simple-icons:cilium",
1846
+ icon: "simple-icons:cilium",
1367
1847
  secondaryIcon: "devicon:kubernetes",
1368
1848
  category: "Kubernetes"
1369
1849
  },
@@ -1372,6 +1852,21 @@ var cilium = defineUnit5({
1372
1852
  path: "unit"
1373
1853
  }
1374
1854
  });
1855
+ var monitorWorkerResourceGroupSchema = z.object({
1856
+ type: z.enum(["deployment", "statefulset", "pod", "service"]),
1857
+ namespace: z.string(),
1858
+ names: z.string().array().optional()
1859
+ });
1860
+ var monitorWorkerParamsSchema = z.object({
1861
+ /**
1862
+ * The ID of the secret containing the kubeconfig of the cluster.
1863
+ */
1864
+ kubeconfigSecretId: z.string().meta({ title: camelCaseToHumanReadable("kubeconfigSecretId"), description: `The ID of the secret containing the kubeconfig of the cluster.` }),
1865
+ /**
1866
+ * The resources to monitor in the cluster.
1867
+ */
1868
+ resourceGroups: monitorWorkerResourceGroupSchema.array().meta({ title: camelCaseToHumanReadable("resourceGroups"), description: `The resources to monitor in the cluster.` })
1869
+ });
1375
1870
 
1376
1871
  // src/talos.ts
1377
1872
  var talos_exports = {};
@@ -1381,20 +1876,19 @@ __export(talos_exports, {
1381
1876
  cniSchema: () => cniSchema2,
1382
1877
  csiSchema: () => csiSchema
1383
1878
  });
1384
- import { defineEntity as defineEntity7, defineUnit as defineUnit6, Type as Type8 } from "@highstate/contract";
1385
- var clusterEntity3 = defineEntity7({
1879
+ var clusterEntity3 = defineEntity({
1386
1880
  type: "talos.cluster",
1387
- schema: Type8.Object({
1388
- clientConfiguration: Type8.String(),
1389
- machineSecrets: Type8.String()
1881
+ schema: z.object({
1882
+ clientConfiguration: z.string(),
1883
+ machineSecrets: z.string()
1390
1884
  }),
1391
1885
  meta: {
1392
1886
  color: "#2d2d2d"
1393
1887
  }
1394
1888
  });
1395
- var cniSchema2 = Type8.StringEnum(["none", "cilium", "flannel"]);
1396
- var csiSchema = Type8.StringEnum(["none", "local-path-provisioner"]);
1397
- var cluster = defineUnit6({
1889
+ var cniSchema2 = z.enum(["none", "cilium", "flannel"]);
1890
+ var csiSchema = z.enum(["none", "local-path-provisioner"]);
1891
+ var cluster = defineUnit({
1398
1892
  type: "talos.cluster",
1399
1893
  args: {
1400
1894
  ...scheduleOnMastersPolicyArgs,
@@ -1402,14 +1896,14 @@ var cluster = defineUnit6({
1402
1896
  * The name of the cluster.
1403
1897
  *
1404
1898
  * By default, the name of the instance is used.
1405
- *
1406
- * @schema
1407
1899
  */
1408
1900
  clusterName: {
1409
- ...Type8.Optional(Type8.String()),
1410
- description: `The name of the cluster.
1901
+ schema: z.string().optional(),
1902
+ meta: {
1903
+ description: `The name of the cluster.
1411
1904
 
1412
1905
  By default, the name of the instance is used.`
1906
+ }
1413
1907
  },
1414
1908
  /**
1415
1909
  * The CNI plugin to use.
@@ -1420,12 +1914,11 @@ var cluster = defineUnit6({
1420
1914
  * - "none" (disable CNI, must be installed manually)
1421
1915
  *
1422
1916
  * The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.
1423
- *
1424
- * @schema
1425
1917
  */
1426
1918
  cni: {
1427
- ...Type8.Default(cniSchema2, "cilium"),
1428
- description: `The CNI plugin to use.
1919
+ schema: cniSchema2.default("cilium"),
1920
+ meta: {
1921
+ description: `The CNI plugin to use.
1429
1922
 
1430
1923
  The following options are available:
1431
1924
  - "cilium" (default)
@@ -1433,6 +1926,7 @@ var cluster = defineUnit6({
1433
1926
  - "none" (disable CNI, must be installed manually)
1434
1927
 
1435
1928
  The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.`
1929
+ }
1436
1930
  },
1437
1931
  /**
1438
1932
  * The CSI plugin to use.
@@ -1440,49 +1934,49 @@ var cluster = defineUnit6({
1440
1934
  * The following options are available:
1441
1935
  * - "local-path-provisioner" (default)
1442
1936
  * - "none" (disable CSI, must be installed manually if needed)
1443
- *
1444
- * @schema
1445
1937
  */
1446
1938
  csi: {
1447
- ...Type8.Default(csiSchema, "local-path-provisioner"),
1448
- description: `The CSI plugin to use.
1939
+ schema: csiSchema.default("local-path-provisioner"),
1940
+ meta: {
1941
+ description: `The CSI plugin to use.
1449
1942
 
1450
1943
  The following options are available:
1451
1944
  - "local-path-provisioner" (default)
1452
1945
  - "none" (disable CSI, must be installed manually if needed)`
1946
+ }
1453
1947
  },
1454
1948
  /**
1455
1949
  * The shared configuration patch.
1456
1950
  * It will be applied to all nodes.
1457
- *
1458
- * @schema
1459
1951
  */
1460
1952
  sharedConfigPatch: {
1461
- ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
1462
- description: `The shared configuration patch.
1953
+ schema: z.record(z.string(), z.any()).optional(),
1954
+ meta: {
1955
+ description: `The shared configuration patch.
1463
1956
  It will be applied to all nodes.`
1957
+ }
1464
1958
  },
1465
1959
  /**
1466
1960
  * The master configuration patch.
1467
1961
  * It will be applied to all master nodes.
1468
- *
1469
- * @schema
1470
1962
  */
1471
1963
  masterConfigPatch: {
1472
- ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
1473
- description: `The master configuration patch.
1964
+ schema: z.record(z.string(), z.any()).optional(),
1965
+ meta: {
1966
+ description: `The master configuration patch.
1474
1967
  It will be applied to all master nodes.`
1968
+ }
1475
1969
  },
1476
1970
  /**
1477
1971
  * The worker configuration patch.
1478
1972
  * It will be applied to all worker nodes.
1479
- *
1480
- * @schema
1481
1973
  */
1482
1974
  workerConfigPatch: {
1483
- ...Type8.Optional(Type8.Record(Type8.String(), Type8.Any())),
1484
- description: `The worker configuration patch.
1975
+ schema: z.record(z.string(), z.any()).optional(),
1976
+ meta: {
1977
+ description: `The worker configuration patch.
1485
1978
  It will be applied to all worker nodes.`
1979
+ }
1486
1980
  },
1487
1981
  /**
1488
1982
  * Whether to enable the Tun device plugin.
@@ -1491,7 +1985,16 @@ var cluster = defineUnit6({
1491
1985
  *
1492
1986
  * By default, this option is set to true.
1493
1987
  */
1494
- enableTunDevicePlugin: Type8.Default(Type8.Boolean(), true)
1988
+ enableTunDevicePlugin: {
1989
+ schema: z.boolean().default(true),
1990
+ meta: {
1991
+ description: `Whether to enable the Tun device plugin.
1992
+
1993
+ There is the only option for Talos to get tun device in containers.
1994
+
1995
+ By default, this option is set to true.`
1996
+ }
1997
+ }
1495
1998
  },
1496
1999
  inputs: clusterInputs,
1497
2000
  outputs: {
@@ -1499,11 +2002,11 @@ var cluster = defineUnit6({
1499
2002
  talosCluster: clusterEntity3
1500
2003
  },
1501
2004
  meta: {
1502
- displayName: "Talos Cluster",
2005
+ title: "Talos Cluster",
1503
2006
  description: "A Kubernetes cluster managed by Talos.",
1504
2007
  category: "Talos",
1505
2008
  color: "#2d2d2d",
1506
- primaryIcon: "simple-icons:talos",
2009
+ icon: "simple-icons:talos",
1507
2010
  secondaryIcon: "devicon:kubernetes"
1508
2011
  },
1509
2012
  source: {
@@ -1528,27 +2031,25 @@ __export(wireguard_exports, {
1528
2031
  peerEntity: () => peerEntity,
1529
2032
  peerPatch: () => peerPatch
1530
2033
  });
1531
- import { defineEntity as defineEntity8, defineUnit as defineUnit7, Type as Type9 } from "@highstate/contract";
1532
- import { omit } from "remeda";
1533
- var backendSchema = Type9.StringEnum(["wireguard", "amneziawg"]);
1534
- var networkEntity = defineEntity8({
2034
+ var backendSchema = z.enum(["wireguard", "amneziawg"]);
2035
+ var networkEntity = defineEntity({
1535
2036
  type: "wireguard.network",
1536
- schema: Type9.Object({
2037
+ schema: z.object({
1537
2038
  backend: backendSchema,
1538
- ipv6: Type9.Boolean()
2039
+ ipv6: z.boolean()
1539
2040
  })
1540
2041
  });
1541
- var nodeExposePolicySchema = Type9.StringEnum(["always", "when-has-endpoint", "never"]);
1542
- var peerEntity = defineEntity8({
2042
+ var nodeExposePolicySchema = z.enum(["always", "when-has-endpoint", "never"]);
2043
+ var peerEntity = defineEntity({
1543
2044
  type: "wireguard.peer",
1544
- schema: Type9.Object({
1545
- name: Type9.String(),
1546
- network: Type9.Optional(networkEntity.schema),
1547
- publicKey: Type9.String(),
1548
- address: Type9.Optional(Type9.String()),
1549
- allowedIps: Type9.Array(Type9.String()),
1550
- endpoints: Type9.Array(l4EndpointEntity.schema),
1551
- allowedEndpoints: Type9.Array(Type9.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),
2045
+ schema: z.object({
2046
+ name: z.string(),
2047
+ network: networkEntity.schema.optional(),
2048
+ publicKey: z.string(),
2049
+ address: z.string().optional(),
2050
+ allowedIps: z.string().array(),
2051
+ endpoints: l4EndpointEntity.schema.array(),
2052
+ allowedEndpoints: z.union([l3EndpointEntity.schema, l4EndpointEntity.schema]).array(),
1552
2053
  /**
1553
2054
  * The pre-shared key of the WireGuard peer.
1554
2055
  *
@@ -1556,32 +2057,38 @@ var peerEntity = defineEntity8({
1556
2057
  *
1557
2058
  * Will be ignored if both peers have `presharedKeyPart` set.
1558
2059
  */
1559
- presharedKey: Type9.Optional(Type9.String()),
2060
+ presharedKey: z.string().optional().meta({ title: camelCaseToHumanReadable("presharedKey"), description: `The pre-shared key of the WireGuard peer.
2061
+
2062
+ If one of two peers has \`presharedKey\` set, the other peer must have \`presharedKey\` set too and they must be equal.
2063
+
2064
+ Will be ignored if both peers have \`presharedKeyPart\` set.` }),
1560
2065
  /**
1561
2066
  * The pre-shared key part of the WireGuard peer.
1562
2067
  *
1563
2068
  * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as XOR of the two parts.
1564
2069
  */
1565
- presharedKeyPart: Type9.Optional(Type9.String()),
1566
- excludedIps: Type9.Array(Type9.String()),
1567
- dns: Type9.Array(Type9.String()),
1568
- listenPort: Type9.Optional(Type9.Number())
2070
+ presharedKeyPart: z.string().optional().meta({ title: camelCaseToHumanReadable("presharedKeyPart"), description: `The pre-shared key part of the WireGuard peer.
2071
+
2072
+ If both peers have \`presharedKeyPart\` set, their \`presharedKey\` will be calculated as XOR of the two parts.` }),
2073
+ excludedIps: z.string().array(),
2074
+ dns: z.string().array(),
2075
+ listenPort: z.number().optional()
1569
2076
  }),
1570
2077
  meta: {
1571
2078
  color: "#673AB7"
1572
2079
  }
1573
2080
  });
1574
- var identityEntity = defineEntity8({
2081
+ var identityEntity = defineEntity({
1575
2082
  type: "wireguard.identity",
1576
- schema: Type9.Object({
2083
+ schema: z.object({
1577
2084
  peer: peerEntity.schema,
1578
- privateKey: Type9.String()
2085
+ privateKey: z.string()
1579
2086
  }),
1580
2087
  meta: {
1581
2088
  color: "#F44336"
1582
2089
  }
1583
2090
  });
1584
- var network = defineUnit7({
2091
+ var network = defineUnit({
1585
2092
  type: "wireguard.network",
1586
2093
  args: {
1587
2094
  /**
@@ -1592,31 +2099,31 @@ var network = defineUnit7({
1592
2099
  * 2. `amneziawg` - The censorship-resistant fork of WireGuard.
1593
2100
  *
1594
2101
  * By default, the `wireguard` backend is used.
1595
- *
1596
- * @schema
1597
2102
  */
1598
2103
  backend: {
1599
- ...Type9.Default(backendSchema, "wireguard"),
1600
- description: `The backend to use for the WireGuard network.
2104
+ schema: backendSchema.default("wireguard"),
2105
+ meta: {
2106
+ description: `The backend to use for the WireGuard network.
1601
2107
 
1602
2108
  Possible values are:
1603
2109
  1. \`wireguard\` - The default backend.
1604
2110
  2. \`amneziawg\` - The censorship-resistant fork of WireGuard.
1605
2111
 
1606
2112
  By default, the \`wireguard\` backend is used.`
2113
+ }
1607
2114
  },
1608
2115
  /**
1609
2116
  * The option to enable IPv6 support in the network.
1610
2117
  *
1611
2118
  * By default, IPv6 support is disabled.
1612
- *
1613
- * @schema
1614
2119
  */
1615
2120
  ipv6: {
1616
- ...Type9.Default(Type9.Boolean(), false),
1617
- description: `The option to enable IPv6 support in the network.
2121
+ schema: z.boolean().default(false),
2122
+ meta: {
2123
+ description: `The option to enable IPv6 support in the network.
1618
2124
 
1619
2125
  By default, IPv6 support is disabled.`
2126
+ }
1620
2127
  }
1621
2128
  },
1622
2129
  outputs: {
@@ -1624,8 +2131,8 @@ var network = defineUnit7({
1624
2131
  },
1625
2132
  meta: {
1626
2133
  description: "The WireGuard network with some shared configuration.",
1627
- primaryIcon: "simple-icons:wireguard",
1628
- primaryIconColor: "#88171a",
2134
+ icon: "simple-icons:wireguard",
2135
+ iconColor: "#88171a",
1629
2136
  secondaryIcon: "mdi:local-area-network-connect",
1630
2137
  category: "VPN"
1631
2138
  },
@@ -1639,41 +2146,20 @@ var sharedPeerArgs = {
1639
2146
  * The name of the WireGuard peer.
1640
2147
  *
1641
2148
  * If not provided, the peer will be named after the unit.
1642
- *
1643
- * @schema
1644
2149
  */
1645
- peerName: {
1646
- ...Type9.Optional(Type9.String()),
1647
- description: `The name of the WireGuard peer.
1648
-
1649
- If not provided, the peer will be named after the unit.`
1650
- },
2150
+ peerName: z.string().optional(),
1651
2151
  /**
1652
2152
  * The address of the WireGuard interface.
1653
2153
  *
1654
2154
  * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
1655
- *
1656
- * @schema
1657
2155
  */
1658
- address: {
1659
- ...Type9.Optional(Type9.String()),
1660
- description: `The address of the WireGuard interface.
1661
-
1662
- The address may be any IPv4 or IPv6 address. CIDR notation is also supported.`
1663
- },
2156
+ address: z.string().optional(),
1664
2157
  /**
1665
2158
  * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.
1666
2159
  *
1667
2160
  * Will be merged with the `allowedIps` if provided.
1668
- *
1669
- * @schema
1670
2161
  */
1671
- exitNode: {
1672
- ...Type9.Default(Type9.Boolean(), false),
1673
- description: `The convenience option to set \`allowedIps\` to \`0.0.0.0/0, ::/0\`.
1674
-
1675
- Will be merged with the \`allowedIps\` if provided.`
1676
- },
2162
+ exitNode: z.boolean().default(false),
1677
2163
  /**
1678
2164
  * The list of IP ranges to exclude from the tunnel.
1679
2165
  *
@@ -1682,19 +2168,8 @@ var sharedPeerArgs = {
1682
2168
  * - This list will not be used to generate the allowed IPs for the peer.
1683
2169
  * - Instead, the node will setup extra direct routes to these IPs via default gateway.
1684
2170
  * - This allows to use `0.0.0.0/0, ::/0` in the `allowedIps` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.
1685
- *
1686
- * @schema
1687
2171
  */
1688
- excludedIps: {
1689
- ...Type9.Default(Type9.Array(Type9.String()), []),
1690
- description: `The list of IP ranges to exclude from the tunnel.
1691
-
1692
- Implementation notes:
1693
-
1694
- - This list will not be used to generate the allowed IPs for the peer.
1695
- - Instead, the node will setup extra direct routes to these IPs via default gateway.
1696
- - This allows to use \`0.0.0.0/0, ::/0\` in the \`allowedIps\` (and corresponding fwmark magic) and still have some IPs excluded from the tunnel.`
1697
- },
2172
+ excludedIps: z.string().array().default([]),
1698
2173
  /**
1699
2174
  * The convenience option to exclude private IPs from the tunnel.
1700
2175
  *
@@ -1710,134 +2185,64 @@ var sharedPeerArgs = {
1710
2185
  * - `fe80::/10`
1711
2186
  *
1712
2187
  * Will be merged with `excludedIps` if provided.
1713
- *
1714
- * @schema
1715
2188
  */
1716
- excludePrivateIps: {
1717
- ...Type9.Default(Type9.Boolean(), false),
1718
- description: `The convenience option to exclude private IPs from the tunnel.
1719
-
1720
- For IPv4, the private IPs are:
1721
-
1722
- - \`10.0.0.0/8\`
1723
- - \`172.16.0.0/12\`
1724
- - \`192.168.0.0/16\`
1725
-
1726
- For IPv6, the private IPs are:
1727
-
1728
- - \`fc00::/7\`
1729
- - \`fe80::/10\`
1730
-
1731
- Will be merged with \`excludedIps\` if provided.`
1732
- },
2189
+ excludePrivateIps: z.boolean().default(false),
1733
2190
  /**
1734
2191
  * The endpoints of the WireGuard peer.
1735
- *
1736
- * @schema
1737
2192
  */
1738
- endpoints: {
1739
- ...Type9.Default(Type9.Array(Type9.String()), []),
1740
- description: `The endpoints of the WireGuard peer.`
1741
- },
2193
+ endpoints: z.string().array().default([]),
1742
2194
  /**
1743
2195
  * The allowed endpoints of the WireGuard peer.
1744
2196
  *
1745
2197
  * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
1746
- *
1747
- * @schema
1748
2198
  */
1749
- allowedEndpoints: {
1750
- ...Type9.Default(Type9.Array(Type9.String()), []),
1751
- description: `The allowed endpoints of the WireGuard peer.
1752
-
1753
- The non \`hostname\` endpoints will be added to the \`allowedIps\` of the peer.`
1754
- },
2199
+ allowedEndpoints: z.string().array().default([]),
1755
2200
  /**
1756
2201
  * The DNS servers that should be used by the interface connected to the WireGuard peer.
1757
2202
  *
1758
2203
  * If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).
1759
- *
1760
- * @schema
1761
2204
  */
1762
- dns: {
1763
- ...Type9.Default(Type9.Array(Type9.String()), []),
1764
- description: `The DNS servers that should be used by the interface connected to the WireGuard peer.
1765
-
1766
- If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).`
1767
- },
2205
+ dns: z.string().array().default([]),
1768
2206
  /**
1769
2207
  * The convenience option to include the DNS servers to the allowed IPs.
1770
2208
  *
1771
2209
  * By default, is `true`.
1772
- *
1773
- * @schema
1774
2210
  */
1775
- includeDns: {
1776
- ...Type9.Default(Type9.Boolean(), true),
1777
- description: `The convenience option to include the DNS servers to the allowed IPs.
1778
-
1779
- By default, is \`true\`.`
1780
- },
2211
+ includeDns: z.boolean().default(true),
1781
2212
  /**
1782
2213
  * The port to listen on.
1783
- *
1784
- * @schema
1785
2214
  */
1786
- listenPort: {
1787
- ...Type9.Optional(Type9.Number()),
1788
- description: `The port to listen on.`
1789
- }
2215
+ listenPort: z.number().optional()
1790
2216
  };
1791
2217
  var sharedPeerInputs = {
1792
2218
  /**
1793
2219
  * The network to use for the WireGuard identity.
1794
2220
  *
1795
2221
  * If not provided, the identity will use default network configuration.
1796
- *
1797
- * @schema
1798
2222
  */
1799
2223
  network: {
1800
- ...{
1801
- entity: networkEntity,
1802
- required: false
1803
- },
1804
- description: `The network to use for the WireGuard identity.
1805
-
1806
- If not provided, the identity will use default network configuration.`
2224
+ entity: networkEntity,
2225
+ required: false
1807
2226
  },
1808
2227
  /**
1809
2228
  * The L3 endpoints of the identity.
1810
2229
  *
1811
2230
  * Will produce L4 endpoints for each of the provided L3 endpoints.
1812
- *
1813
- * @schema
1814
2231
  */
1815
2232
  l3Endpoints: {
1816
- ...{
1817
- entity: l3EndpointEntity,
1818
- multiple: true,
1819
- required: false
1820
- },
1821
- description: `The L3 endpoints of the identity.
1822
-
1823
- Will produce L4 endpoints for each of the provided L3 endpoints.`
2233
+ entity: l3EndpointEntity,
2234
+ multiple: true,
2235
+ required: false
1824
2236
  },
1825
2237
  /**
1826
2238
  * The L4 endpoints of the identity.
1827
2239
  *
1828
2240
  * Will take priority over all calculated endpoints if provided.
1829
- *
1830
- * @schema
1831
2241
  */
1832
2242
  l4Endpoints: {
1833
- ...{
1834
- entity: l4EndpointEntity,
1835
- required: false,
1836
- multiple: true
1837
- },
1838
- description: `The L4 endpoints of the identity.
1839
-
1840
- Will take priority over all calculated endpoints if provided.`
2243
+ entity: l4EndpointEntity,
2244
+ required: false,
2245
+ multiple: true
1841
2246
  },
1842
2247
  /**
1843
2248
  * The L3 endpoints to add to the allowed IPs of the identity.
@@ -1846,40 +2251,22 @@ var sharedPeerInputs = {
1846
2251
  *
1847
2252
  * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1848
2253
  * the corresponding network policy will be created.
1849
- *
1850
- * @schema
1851
2254
  */
1852
2255
  allowedL3Endpoints: {
1853
- ...{
1854
- entity: l3EndpointEntity,
1855
- multiple: true,
1856
- required: false
1857
- },
1858
- description: `The L3 endpoints to add to the allowed IPs of the identity.
1859
-
1860
- \`hostname\` endpoints will be ignored.
1861
-
1862
- If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1863
- the corresponding network policy will be created.`
2256
+ entity: l3EndpointEntity,
2257
+ multiple: true,
2258
+ required: false
1864
2259
  },
1865
2260
  /**
1866
2261
  * The L4 endpoints to add to the allowed IPs of the identity.
1867
2262
  *
1868
2263
  * If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1869
2264
  * the corresponding network policy will be created.
1870
- *
1871
- * @schema
1872
2265
  */
1873
2266
  allowedL4Endpoints: {
1874
- ...{
1875
- entity: l4EndpointEntity,
1876
- multiple: true,
1877
- required: false
1878
- },
1879
- description: `The L4 endpoints to add to the allowed IPs of the identity.
1880
-
1881
- If the endpoint contains k8s service metadata of the cluster where the identity node is deployed,
1882
- the corresponding network policy will be created.`
2267
+ entity: l4EndpointEntity,
2268
+ multiple: true,
2269
+ required: false
1883
2270
  }
1884
2271
  };
1885
2272
  var sharedPeerOutputs = {
@@ -1890,37 +2277,37 @@ var sharedPeerOutputs = {
1890
2277
  multiple: true
1891
2278
  }
1892
2279
  };
1893
- var peer = defineUnit7({
2280
+ var peer = defineUnit({
1894
2281
  type: "wireguard.peer",
1895
2282
  args: {
1896
2283
  ...sharedPeerArgs,
1897
2284
  /**
1898
2285
  * The public key of the WireGuard peer.
1899
- *
1900
- * @schema
1901
2286
  */
1902
2287
  publicKey: {
1903
- ...Type9.String(),
1904
- description: `The public key of the WireGuard peer.`
2288
+ schema: z.string(),
2289
+ meta: {
2290
+ description: `The public key of the WireGuard peer.`
2291
+ }
1905
2292
  }
1906
2293
  },
1907
2294
  secrets: {
1908
2295
  /**
1909
2296
  * The pre-shared key which should be used for the peer.
1910
- *
1911
- * @schema
1912
2297
  */
1913
2298
  presharedKey: {
1914
- ...Type9.Optional(Type9.String()),
1915
- description: `The pre-shared key which should be used for the peer.`
2299
+ schema: z.string().optional(),
2300
+ meta: {
2301
+ description: `The pre-shared key which should be used for the peer.`
2302
+ }
1916
2303
  }
1917
2304
  },
1918
2305
  inputs: sharedPeerInputs,
1919
2306
  outputs: sharedPeerOutputs,
1920
2307
  meta: {
1921
2308
  description: "The WireGuard peer with the public key.",
1922
- primaryIcon: "simple-icons:wireguard",
1923
- primaryIconColor: "#88171a",
2309
+ icon: "simple-icons:wireguard",
2310
+ iconColor: "#88171a",
1924
2311
  secondaryIcon: "mdi:badge-account-horizontal",
1925
2312
  category: "VPN"
1926
2313
  },
@@ -1929,17 +2316,17 @@ var peer = defineUnit7({
1929
2316
  path: "peer"
1930
2317
  }
1931
2318
  });
1932
- var peerPatch = defineUnit7({
2319
+ var peerPatch = defineUnit({
1933
2320
  type: "wireguard.peer-patch",
1934
2321
  args: {
1935
2322
  /**
1936
2323
  * The endpoints of the WireGuard peer.
1937
- *
1938
- * @schema
1939
2324
  */
1940
2325
  endpoints: {
1941
- ...Type9.Default(Type9.Array(Type9.String()), []),
1942
- description: `The endpoints of the WireGuard peer.`
2326
+ schema: z.string().array().default([]),
2327
+ meta: {
2328
+ description: `The endpoints of the WireGuard peer.`
2329
+ }
1943
2330
  },
1944
2331
  /**
1945
2332
  * The mode to use for patching the endpoints.
@@ -1947,19 +2334,27 @@ var peerPatch = defineUnit7({
1947
2334
  * - `prepend`: prepend the new endpoints to the existing ones (default);
1948
2335
  * - `replace`: replace the existing endpoints with the new ones.
1949
2336
  */
1950
- endpointsPatchMode: Type9.Default(arrayPatchModeSchema, "prepend"),
2337
+ endpointsPatchMode: {
2338
+ schema: arrayPatchModeSchema.default("prepend"),
2339
+ meta: {
2340
+ description: `The mode to use for patching the endpoints.
2341
+
2342
+ - \`prepend\`: prepend the new endpoints to the existing ones (default);
2343
+ - \`replace\`: replace the existing endpoints with the new ones.`
2344
+ }
2345
+ },
1951
2346
  /**
1952
2347
  * The allowed endpoints of the WireGuard peer.
1953
2348
  *
1954
2349
  * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
1955
- *
1956
- * @schema
1957
2350
  */
1958
2351
  allowedEndpoints: {
1959
- ...Type9.Default(Type9.Array(Type9.String()), []),
1960
- description: `The allowed endpoints of the WireGuard peer.
2352
+ schema: z.string().array().default([]),
2353
+ meta: {
2354
+ description: `The allowed endpoints of the WireGuard peer.
1961
2355
 
1962
2356
  The non \`hostname\` endpoints will be added to the \`allowedIps\` of the peer.`
2357
+ }
1963
2358
  },
1964
2359
  /**
1965
2360
  * The mode to use for patching the allowed endpoints.
@@ -1967,7 +2362,15 @@ var peerPatch = defineUnit7({
1967
2362
  * - `prepend`: prepend the new endpoints to the existing ones (default);
1968
2363
  * - `replace`: replace the existing endpoints with the new ones.
1969
2364
  */
1970
- allowedEndpointsPatchMode: Type9.Default(arrayPatchModeSchema, "prepend"),
2365
+ allowedEndpointsPatchMode: {
2366
+ schema: arrayPatchModeSchema.default("prepend"),
2367
+ meta: {
2368
+ description: `The mode to use for patching the allowed endpoints.
2369
+
2370
+ - \`prepend\`: prepend the new endpoints to the existing ones (default);
2371
+ - \`replace\`: replace the existing endpoints with the new ones.`
2372
+ }
2373
+ },
1971
2374
  ...omit(sharedPeerArgs, ["endpoints", "allowedEndpoints"])
1972
2375
  },
1973
2376
  inputs: {
@@ -1983,10 +2386,10 @@ var peerPatch = defineUnit7({
1983
2386
  }
1984
2387
  },
1985
2388
  meta: {
1986
- displayName: "WireGuard Peer Patch",
2389
+ title: "WireGuard Peer Patch",
1987
2390
  description: "Patches some properties of the WireGuard peer.",
1988
- primaryIcon: "simple-icons:wireguard",
1989
- primaryIconColor: "#88171a",
2391
+ icon: "simple-icons:wireguard",
2392
+ iconColor: "#88171a",
1990
2393
  secondaryIcon: "mdi:badge-account-horizontal",
1991
2394
  category: "VPN"
1992
2395
  },
@@ -1995,7 +2398,7 @@ var peerPatch = defineUnit7({
1995
2398
  path: "peer-patch"
1996
2399
  }
1997
2400
  });
1998
- var identity = defineUnit7({
2401
+ var identity = defineUnit({
1999
2402
  type: "wireguard.identity",
2000
2403
  args: {
2001
2404
  ...sharedPeerArgs,
@@ -2003,14 +2406,14 @@ var identity = defineUnit7({
2003
2406
  * The port to listen on.
2004
2407
  *
2005
2408
  * Used by the implementation of the identity and to calculate the endpoint of the peer.
2006
- *
2007
- * @schema
2008
2409
  */
2009
2410
  listenPort: {
2010
- ...Type9.Optional(Type9.Number()),
2011
- description: `The port to listen on.
2411
+ schema: z.number().optional(),
2412
+ meta: {
2413
+ description: `The port to listen on.
2012
2414
 
2013
2415
  Used by the implementation of the identity and to calculate the endpoint of the peer.`
2416
+ }
2014
2417
  },
2015
2418
  /**
2016
2419
  * The endpoint of the WireGuard peer.
@@ -2018,16 +2421,16 @@ var identity = defineUnit7({
2018
2421
  * If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
2019
2422
  *
2020
2423
  * Will take priority over all calculated endpoints and `l4Endpoint` input.
2021
- *
2022
- * @schema
2023
2424
  */
2024
2425
  endpoints: {
2025
- ...Type9.Default(Type9.Array(Type9.String()), []),
2026
- description: `The endpoint of the WireGuard peer.
2426
+ schema: z.string().array().default([]),
2427
+ meta: {
2428
+ description: `The endpoint of the WireGuard peer.
2027
2429
 
2028
2430
  If overridden, does not affect node which implements the identity, but is used in the peer configuration of other nodes.
2029
2431
 
2030
2432
  Will take priority over all calculated endpoints and \`l4Endpoint\` input.`
2433
+ }
2031
2434
  }
2032
2435
  },
2033
2436
  secrets: {
@@ -2035,27 +2438,27 @@ var identity = defineUnit7({
2035
2438
  * The private key of the WireGuard identity.
2036
2439
  *
2037
2440
  * If not provided, the key will be generated automatically.
2038
- *
2039
- * @schema
2040
2441
  */
2041
2442
  privateKey: {
2042
- ...Type9.Optional(Type9.String()),
2043
- description: `The private key of the WireGuard identity.
2443
+ schema: z.string().optional(),
2444
+ meta: {
2445
+ description: `The private key of the WireGuard identity.
2044
2446
 
2045
2447
  If not provided, the key will be generated automatically.`
2448
+ }
2046
2449
  },
2047
2450
  /**
2048
2451
  * The part of the pre-shared of the WireGuard identity.
2049
2452
  *
2050
2453
  * Will be generated automatically if not provided.
2051
- *
2052
- * @schema
2053
2454
  */
2054
2455
  presharedKeyPart: {
2055
- ...Type9.Optional(Type9.String()),
2056
- description: `The part of the pre-shared of the WireGuard identity.
2456
+ schema: z.string().optional(),
2457
+ meta: {
2458
+ description: `The part of the pre-shared of the WireGuard identity.
2057
2459
 
2058
2460
  Will be generated automatically if not provided.`
2461
+ }
2059
2462
  }
2060
2463
  },
2061
2464
  inputs: sharedPeerInputs,
@@ -2065,8 +2468,8 @@ var identity = defineUnit7({
2065
2468
  },
2066
2469
  meta: {
2067
2470
  description: "The WireGuard identity with the public key.",
2068
- primaryIcon: "simple-icons:wireguard",
2069
- primaryIconColor: "#88171a",
2471
+ icon: "simple-icons:wireguard",
2472
+ iconColor: "#88171a",
2070
2473
  secondaryIcon: "mdi:account",
2071
2474
  category: "VPN"
2072
2475
  },
@@ -2075,30 +2478,30 @@ var identity = defineUnit7({
2075
2478
  path: "identity"
2076
2479
  }
2077
2480
  });
2078
- var node = defineUnit7({
2481
+ var node = defineUnit({
2079
2482
  type: "wireguard.node",
2080
2483
  args: {
2081
2484
  /**
2082
2485
  * The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
2083
2486
  *
2084
2487
  * By default, the name is `wg-${identity.name}`.
2085
- *
2086
- * @schema
2087
2488
  */
2088
2489
  appName: {
2089
- ...Type9.Optional(Type9.String()),
2090
- description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
2490
+ schema: z.string().optional(),
2491
+ meta: {
2492
+ description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
2091
2493
 
2092
2494
  By default, the name is \`wg-\${identity.name}\`.`
2495
+ }
2093
2496
  },
2094
2497
  /**
2095
2498
  * Whether to expose the WireGuard node to the outside world.
2096
- *
2097
- * @schema
2098
2499
  */
2099
2500
  external: {
2100
- ...Type9.Default(Type9.Boolean(), false),
2101
- description: `Whether to expose the WireGuard node to the outside world.`
2501
+ schema: z.boolean().default(false),
2502
+ meta: {
2503
+ description: `Whether to expose the WireGuard node to the outside world.`
2504
+ }
2102
2505
  },
2103
2506
  /**
2104
2507
  * The policy to use for exposing the WireGuard node.
@@ -2109,19 +2512,49 @@ var node = defineUnit7({
2109
2512
  *
2110
2513
  * * By default, the `when-has-endpoint` policy is used.
2111
2514
  */
2112
- exposePolicy: Type9.Default(nodeExposePolicySchema, "when-has-endpoint"),
2515
+ exposePolicy: {
2516
+ schema: nodeExposePolicySchema.default("when-has-endpoint"),
2517
+ meta: {
2518
+ description: `The policy to use for exposing the WireGuard node.
2519
+
2520
+ - \`always\` - The node will be exposed and the service will be created.
2521
+ - \`when-has-endpoint\` - The node will be exposed only if the provided idenity has at least one endpoint.
2522
+ - \`never\` - The node will not be exposed and the service will not be created.
2523
+
2524
+ * By default, the \`when-has-endpoint\` policy is used.`
2525
+ }
2526
+ },
2113
2527
  /**
2114
2528
  * The extra specification of the container which runs the WireGuard node.
2115
2529
  *
2116
2530
  * Will override any overlapping fields.
2117
- *
2118
- * @schema
2119
2531
  */
2120
2532
  containerSpec: {
2121
- ...Type9.Optional(Type9.Record(Type9.String(), Type9.Any())),
2122
- description: `The extra specification of the container which runs the WireGuard node.
2533
+ schema: z.record(z.string(), z.unknown()).optional(),
2534
+ meta: {
2535
+ description: `The extra specification of the container which runs the WireGuard node.
2123
2536
 
2124
2537
  Will override any overlapping fields.`
2538
+ }
2539
+ },
2540
+ /**
2541
+ * List of CIDR blocks that should be blocked from forwarding through this WireGuard node.
2542
+ *
2543
+ * This prevents other peers from reaching these destination CIDRs while still allowing
2544
+ * the peers in those CIDRs to access the internet and other allowed endpoints.
2545
+ *
2546
+ * Useful for peer isolation where you want to prevent cross-peer communication.
2547
+ */
2548
+ forwardRestrictedIps: {
2549
+ schema: z.string().array().default([]),
2550
+ meta: {
2551
+ description: `List of CIDR blocks that should be blocked from forwarding through this WireGuard node.
2552
+
2553
+ This prevents other peers from reaching these destination CIDRs while still allowing
2554
+ the peers in those CIDRs to access the internet and other allowed endpoints.
2555
+
2556
+ Useful for peer isolation where you want to prevent cross-peer communication.`
2557
+ }
2125
2558
  }
2126
2559
  },
2127
2560
  inputs: {
@@ -2158,8 +2591,8 @@ var node = defineUnit7({
2158
2591
  },
2159
2592
  meta: {
2160
2593
  description: "The WireGuard node running on the Kubernetes.",
2161
- primaryIcon: "simple-icons:wireguard",
2162
- primaryIconColor: "#88171a",
2594
+ icon: "simple-icons:wireguard",
2595
+ iconColor: "#88171a",
2163
2596
  secondaryIcon: "mdi:server",
2164
2597
  category: "VPN"
2165
2598
  },
@@ -2168,21 +2601,21 @@ var node = defineUnit7({
2168
2601
  path: "node"
2169
2602
  }
2170
2603
  });
2171
- var config = defineUnit7({
2604
+ var config = defineUnit({
2172
2605
  type: "wireguard.config",
2173
2606
  args: {
2174
2607
  /**
2175
2608
  * The name of the "default" interface where non-tunneled traffic should go.
2176
2609
  *
2177
2610
  * If not provided, the config will not respect `excludedIps`.
2178
- *
2179
- * @schema
2180
2611
  */
2181
2612
  defaultInterface: {
2182
- ...Type9.Optional(Type9.String()),
2183
- description: `The name of the "default" interface where non-tunneled traffic should go.
2613
+ schema: z.string().optional(),
2614
+ meta: {
2615
+ description: `The name of the "default" interface where non-tunneled traffic should go.
2184
2616
 
2185
2617
  If not provided, the config will not respect \`excludedIps\`.`
2618
+ }
2186
2619
  }
2187
2620
  },
2188
2621
  inputs: {
@@ -2194,10 +2627,10 @@ var config = defineUnit7({
2194
2627
  }
2195
2628
  },
2196
2629
  meta: {
2197
- displayName: "WireGuard Config",
2630
+ title: "WireGuard Config",
2198
2631
  description: "Just the WireGuard configuration for the identity and peers.",
2199
- primaryIcon: "simple-icons:wireguard",
2200
- primaryIconColor: "#88171a",
2632
+ icon: "simple-icons:wireguard",
2633
+ iconColor: "#88171a",
2201
2634
  secondaryIcon: "mdi:settings",
2202
2635
  category: "VPN"
2203
2636
  },
@@ -2206,7 +2639,7 @@ var config = defineUnit7({
2206
2639
  path: "config"
2207
2640
  }
2208
2641
  });
2209
- var configBundle = defineUnit7({
2642
+ var configBundle = defineUnit({
2210
2643
  type: "wireguard.config-bundle",
2211
2644
  inputs: {
2212
2645
  identity: identityEntity,
@@ -2221,10 +2654,10 @@ var configBundle = defineUnit7({
2221
2654
  }
2222
2655
  },
2223
2656
  meta: {
2224
- displayName: "WireGuard Config Bundle",
2657
+ title: "WireGuard Config Bundle",
2225
2658
  description: "The WireGuard configuration bundle for the identity and peers.",
2226
- primaryIcon: "simple-icons:wireguard",
2227
- primaryIconColor: "#88171a",
2659
+ icon: "simple-icons:wireguard",
2660
+ iconColor: "#88171a",
2228
2661
  secondaryIcon: "mdi:folder-settings-variant",
2229
2662
  category: "VPN"
2230
2663
  },
@@ -2264,36 +2697,29 @@ __export(apps_exports, {
2264
2697
  vaultwarden: () => vaultwarden
2265
2698
  });
2266
2699
 
2267
- // src/apps/mariadb.ts
2268
- import { defineEntity as defineEntity10, defineUnit as defineUnit9, Type as Type12 } from "@highstate/contract";
2269
-
2270
- // src/apps/shared.ts
2271
- import { Type as Type11 } from "@highstate/contract";
2272
-
2273
2700
  // src/restic.ts
2274
2701
  var restic_exports = {};
2275
2702
  __export(restic_exports, {
2276
2703
  repo: () => repo,
2277
- repoEntity: () => repoEntity
2704
+ repositoryEntity: () => repositoryEntity
2278
2705
  });
2279
- import { defineEntity as defineEntity9, defineUnit as defineUnit8, Type as Type10 } from "@highstate/contract";
2280
- var repoEntity = defineEntity9({
2281
- type: "restic.repo",
2282
- schema: Type10.Object({
2283
- remoteEndpoints: Type10.Array(Type10.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),
2284
- type: Type10.Literal("rclone"),
2285
- rcloneConfig: Type10.String(),
2286
- remoteName: Type10.String(),
2287
- pathPattern: Type10.String()
2706
+ var repositoryEntity = defineEntity({
2707
+ type: "restic.repository",
2708
+ schema: z.object({
2709
+ remoteEndpoints: z.union([l3EndpointEntity.schema, l4EndpointEntity.schema]).array(),
2710
+ type: z.literal("rclone"),
2711
+ rcloneConfig: z.string(),
2712
+ remoteName: z.string(),
2713
+ pathPattern: z.string()
2288
2714
  }),
2289
2715
  meta: {
2290
2716
  color: "#e56901"
2291
2717
  }
2292
2718
  });
2293
- var repo = defineUnit8({
2719
+ var repo = defineUnit({
2294
2720
  type: "restic.repo",
2295
2721
  args: {
2296
- remoteEndpoints: Type10.Default(Type10.Array(Type10.String()), []),
2722
+ remoteEndpoints: z.string().array().default([]),
2297
2723
  /**
2298
2724
  * The pattern for the path where backups will be stored for the specific application.
2299
2725
  *
@@ -2304,12 +2730,11 @@ var repo = defineUnit8({
2304
2730
  * - `$unitName`: The name of the unit, which deploys the application, provided by the user.
2305
2731
  *
2306
2732
  * By default, the path pattern is `backups/$clusterName/$appName`.
2307
- *
2308
- * @schema
2309
2733
  */
2310
2734
  pathPattern: {
2311
- ...Type10.Default(Type10.String(), "backups/$clusterName/$appName"),
2312
- description: `The pattern for the path where backups will be stored for the specific application.
2735
+ schema: z.string().default("backups/$clusterName/$appName"),
2736
+ meta: {
2737
+ description: `The pattern for the path where backups will be stored for the specific application.
2313
2738
 
2314
2739
  Available variables:
2315
2740
 
@@ -2318,10 +2743,11 @@ var repo = defineUnit8({
2318
2743
  - \`$unitName\`: The name of the unit, which deploys the application, provided by the user.
2319
2744
 
2320
2745
  By default, the path pattern is \`backups/$clusterName/$appName\`.`
2746
+ }
2321
2747
  }
2322
2748
  },
2323
2749
  secrets: {
2324
- rcloneConfig: Type10.String({ language: "ini" })
2750
+ rcloneConfig: z.string()
2325
2751
  },
2326
2752
  inputs: {
2327
2753
  remoteL3Endpoints: {
@@ -2336,13 +2762,13 @@ var repo = defineUnit8({
2336
2762
  }
2337
2763
  },
2338
2764
  outputs: {
2339
- repo: repoEntity
2765
+ repo: repositoryEntity
2340
2766
  },
2341
2767
  meta: {
2342
- displayName: "Restic Repo",
2768
+ title: "Restic Repo",
2343
2769
  description: "Holds the configuration for a Restic repository and its remote storage.",
2344
- primaryIconColor: "#e56901",
2345
- primaryIcon: "material-symbols:backup",
2770
+ iconColor: "#e56901",
2771
+ icon: "material-symbols:backup",
2346
2772
  category: "Infrastructure"
2347
2773
  },
2348
2774
  source: {
@@ -2354,24 +2780,24 @@ var repo = defineUnit8({
2354
2780
  // src/apps/shared.ts
2355
2781
  var extraArgsDefinitions = {
2356
2782
  fqdn: {
2357
- schema: Type11.String()
2783
+ schema: z.string()
2358
2784
  },
2359
2785
  endpoints: {
2360
- schema: Type11.Array(Type11.String()),
2786
+ schema: z.string().array(),
2361
2787
  required: false
2362
2788
  },
2363
2789
  external: {
2364
- schema: Type11.Boolean(),
2790
+ schema: z.boolean(),
2365
2791
  required: false
2366
2792
  }
2367
2793
  };
2368
2794
  var extraSecretsDefinitions = {
2369
2795
  rootPassword: {
2370
- schema: Type11.String(),
2796
+ schema: z.string(),
2371
2797
  required: false
2372
2798
  },
2373
2799
  backupPassword: {
2374
- schema: Type11.String(),
2800
+ schema: z.string(),
2375
2801
  required: false
2376
2802
  }
2377
2803
  };
@@ -2380,7 +2806,7 @@ var eagerExtraInputDefinitions = {
2380
2806
  entity: accessPointEntity
2381
2807
  },
2382
2808
  resticRepo: {
2383
- entity: repoEntity,
2809
+ entity: repositoryEntity,
2384
2810
  required: false
2385
2811
  },
2386
2812
  dnsProviders: {
@@ -2398,7 +2824,7 @@ var extraInputDefinitions = {
2398
2824
  };
2399
2825
  function createArgs2(defaultAppName, extraArgs) {
2400
2826
  const base = {
2401
- appName: Type11.Default(Type11.String(), defaultAppName)
2827
+ appName: z.string().default(defaultAppName)
2402
2828
  };
2403
2829
  const dynamicArgs = {};
2404
2830
  if (Array.isArray(extraArgs)) {
@@ -2483,21 +2909,21 @@ function createSource(path) {
2483
2909
  path
2484
2910
  };
2485
2911
  }
2486
- var databaseSchema = Type11.Object({
2487
- endpoints: Type11.Array(l4EndpointEntity.schema),
2488
- service: Type11.Optional(serviceEntity.schema),
2489
- rootPassword: Type11.String()
2912
+ var databaseSchema = z.object({
2913
+ endpoints: l4EndpointEntity.schema.array(),
2914
+ service: serviceEntity.schema.optional(),
2915
+ rootPassword: z.string()
2490
2916
  });
2491
2917
 
2492
2918
  // src/apps/mariadb.ts
2493
- var mariadbEntity = defineEntity10({
2919
+ var mariadbEntity = defineEntity({
2494
2920
  type: "apps.mariadb",
2495
2921
  schema: databaseSchema,
2496
2922
  meta: {
2497
2923
  color: "#f06292"
2498
2924
  }
2499
2925
  });
2500
- var mariadb = defineUnit9({
2926
+ var mariadb = defineUnit({
2501
2927
  type: "apps.mariadb",
2502
2928
  args: createArgs2("mariadb", ["external"]),
2503
2929
  secrets: createSecrets(["rootPassword", "backupPassword"]),
@@ -2511,9 +2937,9 @@ var mariadb = defineUnit9({
2511
2937
  }
2512
2938
  },
2513
2939
  meta: {
2514
- displayName: "MariaDB",
2940
+ title: "MariaDB",
2515
2941
  description: "The MariaDB database deployed on Kubernetes.",
2516
- primaryIcon: "simple-icons:mariadb",
2942
+ icon: "simple-icons:mariadb",
2517
2943
  secondaryIcon: "mdi:database",
2518
2944
  category: "Databases"
2519
2945
  },
@@ -2521,38 +2947,35 @@ var mariadb = defineUnit9({
2521
2947
  });
2522
2948
  extraInputDefinitions.mariadb = {
2523
2949
  entity: mariadbEntity,
2524
- displayName: "MariaDB"
2950
+ title: "MariaDB"
2525
2951
  };
2526
- var mariadbDatabase = defineUnit9({
2952
+ var mariadbDatabase = defineUnit({
2527
2953
  type: "apps.mariadb.database",
2528
2954
  args: {
2529
- database: Type12.Optional(Type12.String()),
2530
- username: Type12.Optional(Type12.String())
2955
+ database: z.string().optional(),
2956
+ username: z.string().optional()
2531
2957
  },
2532
2958
  inputs: createInputs(["mariadb"]),
2533
2959
  secrets: {
2534
- password: Type12.Optional(Type12.String())
2960
+ password: z.string().optional()
2535
2961
  },
2536
2962
  meta: {
2537
- displayName: "MariaDB Database",
2963
+ title: "MariaDB Database",
2538
2964
  description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
2539
- primaryIcon: "simple-icons:mariadb",
2965
+ icon: "simple-icons:mariadb",
2540
2966
  secondaryIcon: "mdi:database-plus",
2541
2967
  category: "Databases"
2542
2968
  },
2543
2969
  source: createSource("mariadb/database")
2544
2970
  });
2545
-
2546
- // src/apps/postgresql.ts
2547
- import { defineEntity as defineEntity11, defineUnit as defineUnit10, Type as Type13 } from "@highstate/contract";
2548
- var postgresqlEntity = defineEntity11({
2971
+ var postgresqlEntity = defineEntity({
2549
2972
  type: "apps.postgresql",
2550
2973
  schema: databaseSchema,
2551
2974
  meta: {
2552
2975
  color: "#336791"
2553
2976
  }
2554
2977
  });
2555
- var postgresql = defineUnit10({
2978
+ var postgresql = defineUnit({
2556
2979
  type: "apps.postgresql",
2557
2980
  args: createArgs2("postgresql", ["external"]),
2558
2981
  secrets: createSecrets(["rootPassword", "backupPassword"]),
@@ -2566,9 +2989,9 @@ var postgresql = defineUnit10({
2566
2989
  }
2567
2990
  },
2568
2991
  meta: {
2569
- displayName: "PostgreSQL",
2992
+ title: "PostgreSQL",
2570
2993
  description: "The PostgreSQL database deployed on Kubernetes.",
2571
- primaryIcon: "simple-icons:postgresql",
2994
+ icon: "simple-icons:postgresql",
2572
2995
  secondaryIcon: "mdi:database",
2573
2996
  category: "Databases"
2574
2997
  },
@@ -2576,56 +2999,50 @@ var postgresql = defineUnit10({
2576
2999
  });
2577
3000
  extraInputDefinitions.postgresql = {
2578
3001
  entity: postgresqlEntity,
2579
- displayName: "PostgreSQL"
3002
+ title: "PostgreSQL"
2580
3003
  };
2581
- var postgresqlDatabase = defineUnit10({
3004
+ var postgresqlDatabase = defineUnit({
2582
3005
  type: "apps.postgresql.database",
2583
3006
  args: {
2584
- database: Type13.Optional(Type13.String()),
2585
- username: Type13.Optional(Type13.String())
3007
+ database: z.string().optional(),
3008
+ username: z.string().optional()
2586
3009
  },
2587
3010
  secrets: {
2588
- password: Type13.Optional(Type13.String())
3011
+ password: z.string().optional()
2589
3012
  },
2590
3013
  inputs: createInputs(["postgresql"]),
2591
3014
  meta: {
2592
- displayName: "PostgreSQL Database",
3015
+ title: "PostgreSQL Database",
2593
3016
  description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
2594
- primaryIcon: "simple-icons:postgresql",
3017
+ icon: "simple-icons:postgresql",
2595
3018
  secondaryIcon: "mdi:database-plus",
2596
3019
  category: "Databases"
2597
3020
  },
2598
3021
  source: createSource("postgresql/database")
2599
3022
  });
2600
-
2601
- // src/apps/vaultwarden.ts
2602
- import { defineUnit as defineUnit11, Type as Type14 } from "@highstate/contract";
2603
- var vaultwarden = defineUnit11({
3023
+ var vaultwarden = defineUnit({
2604
3024
  type: "apps.vaultwarden",
2605
3025
  args: createArgs2("vaultwarden", ["fqdn"]),
2606
3026
  secrets: {
2607
- mariadbPassword: Type14.Optional(Type14.String())
3027
+ mariadbPassword: z.string().optional()
2608
3028
  },
2609
3029
  inputs: createInputs(["accessPoint", "mariadb"]),
2610
3030
  meta: {
2611
- displayName: "Vaultwarden",
3031
+ title: "Vaultwarden",
2612
3032
  description: "The Vaultwarden password manager deployed on Kubernetes.",
2613
- primaryIcon: "simple-icons:vaultwarden",
3033
+ icon: "simple-icons:vaultwarden",
2614
3034
  category: "Security"
2615
3035
  },
2616
3036
  source: createSource("vaultwarden")
2617
3037
  });
2618
-
2619
- // src/apps/mongodb.ts
2620
- import { defineEntity as defineEntity12, defineUnit as defineUnit12, Type as Type15 } from "@highstate/contract";
2621
- var mongodbEntity = defineEntity12({
3038
+ var mongodbEntity = defineEntity({
2622
3039
  type: "apps.mongodb",
2623
3040
  schema: databaseSchema,
2624
3041
  meta: {
2625
3042
  color: "#13aa52"
2626
3043
  }
2627
3044
  });
2628
- var mongodb = defineUnit12({
3045
+ var mongodb = defineUnit({
2629
3046
  type: "apps.mongodb",
2630
3047
  args: createArgs2("mongodb", ["external"]),
2631
3048
  secrets: createSecrets(["rootPassword", "backupPassword"]),
@@ -2639,9 +3056,9 @@ var mongodb = defineUnit12({
2639
3056
  }
2640
3057
  },
2641
3058
  meta: {
2642
- displayName: "MongoDB",
3059
+ title: "MongoDB",
2643
3060
  description: "The MongoDB instance deployed on Kubernetes.",
2644
- primaryIcon: "simple-icons:mongodb",
3061
+ icon: "simple-icons:mongodb",
2645
3062
  secondaryIcon: "mdi:database",
2646
3063
  category: "Databases"
2647
3064
  },
@@ -2649,32 +3066,29 @@ var mongodb = defineUnit12({
2649
3066
  });
2650
3067
  extraInputDefinitions.mongodb = {
2651
3068
  entity: mongodbEntity,
2652
- displayName: "MongoDB"
3069
+ title: "MongoDB"
2653
3070
  };
2654
- var mongodbDatabase = defineUnit12({
3071
+ var mongodbDatabase = defineUnit({
2655
3072
  type: "apps.mongodb.database",
2656
3073
  args: {
2657
- database: Type15.Optional(Type15.String()),
2658
- username: Type15.Optional(Type15.String())
3074
+ database: z.string().optional(),
3075
+ username: z.string().optional()
2659
3076
  },
2660
3077
  secrets: {
2661
- password: Type15.Optional(Type15.String())
3078
+ password: z.string().optional()
2662
3079
  },
2663
3080
  inputs: createInputs(["mongodb"]),
2664
3081
  meta: {
2665
- displayName: "MongoDB Database",
3082
+ title: "MongoDB Database",
2666
3083
  description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
2667
- primaryIcon: "simple-icons:mongodb",
3084
+ icon: "simple-icons:mongodb",
2668
3085
  secondaryIcon: "mdi:database-plus",
2669
3086
  category: "Databases"
2670
3087
  },
2671
3088
  source: createSource("mongodb/database")
2672
3089
  });
2673
-
2674
- // src/apps/network.ts
2675
- import { defineUnit as defineUnit13, Type as Type16 } from "@highstate/contract";
2676
- var explicitEndpointFilterSchema = Type16.StringEnum(["public", "external", "internal"]);
2677
- var endpointFilter = defineUnit13({
3090
+ var explicitEndpointFilterSchema = z.enum(["public", "external", "internal"]);
3091
+ var endpointFilter = defineUnit({
2678
3092
  type: "apps.endpoint-filter",
2679
3093
  args: {
2680
3094
  /**
@@ -2684,7 +3098,16 @@ var endpointFilter = defineUnit13({
2684
3098
  * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
2685
3099
  * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
2686
3100
  */
2687
- filter: Type16.Default(explicitEndpointFilterSchema, "public")
3101
+ filter: {
3102
+ schema: explicitEndpointFilterSchema.default("public"),
3103
+ meta: {
3104
+ description: `The filter to apply to the endpoints.
3105
+
3106
+ - \`public\`: Only public endpoints accessible from the internet.
3107
+ - \`external\`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
3108
+ - \`internal\`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.`
3109
+ }
3110
+ }
2688
3111
  },
2689
3112
  inputs: {
2690
3113
  l3Endpoints: {
@@ -2709,20 +3132,17 @@ var endpointFilter = defineUnit13({
2709
3132
  }
2710
3133
  },
2711
3134
  meta: {
2712
- displayName: "Endpoint Filter",
3135
+ title: "Endpoint Filter",
2713
3136
  description: "Explicitly filter endpoints by their accessibility.",
2714
- primaryIcon: "mdi:network-outline",
2715
- primaryIconColor: "#FF9800",
3137
+ icon: "mdi:network-outline",
3138
+ iconColor: "#FF9800",
2716
3139
  secondaryIcon: "mdi:filter-outline",
2717
3140
  category: "Network"
2718
3141
  },
2719
3142
  source: createSource("endpoint-filter")
2720
3143
  });
2721
-
2722
- // src/apps/dns.ts
2723
- import { defineUnit as defineUnit14, Type as Type17 } from "@highstate/contract";
2724
- var endpointFilterSchema2 = Type17.StringEnum(["all", "public", "external", "internal"]);
2725
- var recordSet = defineUnit14({
3144
+ var endpointFilterSchema2 = z.enum(["all", "public", "external", "internal"]);
3145
+ var recordSet = defineUnit({
2726
3146
  type: "apps.dns-record-set",
2727
3147
  args: {
2728
3148
  /**
@@ -2730,31 +3150,67 @@ var recordSet = defineUnit14({
2730
3150
  *
2731
3151
  * If not provided, will use the name of the unit.
2732
3152
  */
2733
- recordName: Type17.Optional(Type17.String()),
3153
+ recordName: {
3154
+ schema: z.string().optional(),
3155
+ meta: {
3156
+ description: `The name of the DNS record.
3157
+
3158
+ If not provided, will use the name of the unit.`
3159
+ }
3160
+ },
2734
3161
  /**
2735
3162
  * The type of the DNS record.
2736
3163
  *
2737
3164
  * If not specified, will use the default type for the provider.
2738
3165
  */
2739
- type: Type17.Optional(Type17.String()),
3166
+ type: {
3167
+ schema: z.string().optional(),
3168
+ meta: {
3169
+ description: `The type of the DNS record.
3170
+
3171
+ If not specified, will use the default type for the provider.`
3172
+ }
3173
+ },
2740
3174
  /**
2741
3175
  * The values of the DNS record.
2742
3176
  */
2743
- values: Type17.Array(Type17.String()),
3177
+ values: {
3178
+ schema: z.string().array(),
3179
+ meta: {
3180
+ description: `The values of the DNS record.`
3181
+ }
3182
+ },
2744
3183
  /**
2745
3184
  * The TTL of the DNS record.
2746
3185
  */
2747
- ttl: Type17.Optional(Type17.Number()),
3186
+ ttl: {
3187
+ schema: z.number().optional(),
3188
+ meta: {
3189
+ description: `The TTL of the DNS record.`
3190
+ }
3191
+ },
2748
3192
  /**
2749
3193
  * The priority of the DNS record.
2750
3194
  */
2751
- priority: Type17.Optional(Type17.Number()),
3195
+ priority: {
3196
+ schema: z.number().optional(),
3197
+ meta: {
3198
+ description: `The priority of the DNS record.`
3199
+ }
3200
+ },
2752
3201
  /**
2753
3202
  * Whether the DNS record is proxied.
2754
3203
  *
2755
3204
  * Available only for public IPs and some DNS providers like Cloudflare.
2756
3205
  */
2757
- proxied: Type17.Optional(Type17.Boolean()),
3206
+ proxied: {
3207
+ schema: z.boolean().optional(),
3208
+ meta: {
3209
+ description: `Whether the DNS record is proxied.
3210
+
3211
+ Available only for public IPs and some DNS providers like Cloudflare.`
3212
+ }
3213
+ },
2758
3214
  /**
2759
3215
  * The filter to apply to the endpoints.
2760
3216
  *
@@ -2763,7 +3219,17 @@ var recordSet = defineUnit14({
2763
3219
  * - `external`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
2764
3220
  * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
2765
3221
  */
2766
- endpointFilter: Type17.Default(endpointFilterSchema2, "public")
3222
+ endpointFilter: {
3223
+ schema: endpointFilterSchema2.default("public"),
3224
+ meta: {
3225
+ description: `The filter to apply to the endpoints.
3226
+
3227
+ - \`all\`: All endpoints.
3228
+ - \`public\`: Only public endpoints accessible from the internet (default).
3229
+ - \`external\`: Only external endpoints (e.g. NodePort, LoadBalancer) accessible from outside the cluster, but not from the internet.
3230
+ - \`internal\`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.`
3231
+ }
3232
+ }
2767
3233
  },
2768
3234
  inputs: {
2769
3235
  dnsProviders: {
@@ -2785,19 +3251,27 @@ var recordSet = defineUnit14({
2785
3251
  /**
2786
3252
  * The single L3 endpoint representing created DNS records.
2787
3253
  */
2788
- l3Endpoint: l3EndpointEntity,
3254
+ l3Endpoint: {
3255
+ entity: l3EndpointEntity,
3256
+ meta: {
3257
+ description: `The single L3 endpoint representing created DNS records.`
3258
+ }
3259
+ },
2789
3260
  /**
2790
3261
  * Multiple L4 endpoints representing created DNS records for each unique port/protocol combination from the input L4 endpoints.
2791
3262
  */
2792
3263
  l4Endpoints: {
2793
3264
  entity: l4EndpointEntity,
2794
- multiple: true
3265
+ multiple: true,
3266
+ meta: {
3267
+ description: `Multiple L4 endpoints representing created DNS records for each unique port/protocol combination from the input L4 endpoints.`
3268
+ }
2795
3269
  }
2796
3270
  },
2797
3271
  meta: {
2798
- displayName: "DNS Record Set",
3272
+ title: "DNS Record Set",
2799
3273
  description: "A set of DNS records to be created.",
2800
- primaryIcon: "mdi:server",
3274
+ icon: "mdi:server",
2801
3275
  defaultNamePrefix: "record",
2802
3276
  category: "Network"
2803
3277
  },
@@ -2806,22 +3280,14 @@ var recordSet = defineUnit14({
2806
3280
  var sharedArgs = {
2807
3281
  /**
2808
3282
  * The FQDN to register the cluster nodes with.
2809
- *
2810
- * @schema
2811
3283
  */
2812
- fqdn: {
2813
- ...Type17.Optional(Type17.String()),
2814
- description: `The FQDN to register the cluster nodes with.`
2815
- }
3284
+ fqdn: z.string().optional()
2816
3285
  };
2817
-
2818
- // src/apps/traefik.ts
2819
- import { defineUnit as defineUnit15, Type as Type18 } from "@highstate/contract";
2820
- var traefikGateway = defineUnit15({
3286
+ var traefikGateway = defineUnit({
2821
3287
  type: "apps.traefik-gateway",
2822
3288
  args: {
2823
3289
  ...createArgs2("traefik", ["external"]),
2824
- className: Type18.Optional(Type18.String())
3290
+ className: z.string().optional()
2825
3291
  },
2826
3292
  inputs: createInputs(),
2827
3293
  outputs: {
@@ -2833,9 +3299,9 @@ var traefikGateway = defineUnit15({
2833
3299
  }
2834
3300
  },
2835
3301
  meta: {
2836
- displayName: "Traefik Gateway",
3302
+ title: "Traefik Gateway",
2837
3303
  description: "A Traefik gateway for routing traffic to services.",
2838
- primaryIcon: "simple-icons:traefikproxy",
3304
+ icon: "simple-icons:traefikproxy",
2839
3305
  category: "Network"
2840
3306
  },
2841
3307
  source: {
@@ -2843,83 +3309,71 @@ var traefikGateway = defineUnit15({
2843
3309
  path: "traefik"
2844
3310
  }
2845
3311
  });
2846
-
2847
- // src/apps/kubernetes-dashboard.ts
2848
- import { defineUnit as defineUnit16 } from "@highstate/contract";
2849
- var kubernetesDashboard = defineUnit16({
3312
+ var kubernetesDashboard = defineUnit({
2850
3313
  type: "apps.kubernetes-dashboard",
2851
3314
  args: createArgs2("kubernetes-dashboard", ["fqdn"]),
2852
3315
  inputs: createInputs(["accessPoint"]),
2853
3316
  meta: {
2854
- displayName: "Kubernetes Dashboard",
3317
+ title: "Kubernetes Dashboard",
2855
3318
  description: "The Kubernetes Dashboard deployed on Kubernetes.",
2856
- primaryIcon: "devicon:kubernetes",
3319
+ icon: "devicon:kubernetes",
2857
3320
  secondaryIcon: "material-symbols:dashboard",
2858
3321
  category: "Kubernetes"
2859
3322
  },
2860
3323
  source: createSource("kubernetes-dashboard")
2861
3324
  });
2862
-
2863
- // src/apps/grocy.ts
2864
- import { defineUnit as defineUnit17 } from "@highstate/contract";
2865
- var grocy = defineUnit17({
3325
+ var grocy = defineUnit({
2866
3326
  type: "apps.grocy",
2867
3327
  args: createArgs2("grocy", ["fqdn"]),
2868
3328
  secrets: createSecrets(["backupPassword"]),
2869
3329
  inputs: createInputs(["accessPoint", "resticRepo"]),
2870
3330
  meta: {
2871
- displayName: "Grocy",
3331
+ title: "Grocy",
2872
3332
  description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
2873
- primaryIcon: "simple-icons:grocy",
3333
+ icon: "simple-icons:grocy",
2874
3334
  category: "Productivity"
2875
3335
  },
2876
3336
  source: createSource("grocy")
2877
3337
  });
2878
-
2879
- // src/apps/maybe.ts
2880
- import { defineUnit as defineUnit18, Type as Type19 } from "@highstate/contract";
2881
- var maybe = defineUnit18({
3338
+ var maybe = defineUnit({
2882
3339
  type: "apps.maybe",
2883
3340
  args: createArgs2("maybe", ["fqdn"]),
2884
3341
  secrets: {
2885
3342
  ...createSecrets(["backupPassword"]),
2886
- postgresqlPassword: Type19.Optional(Type19.String()),
2887
- secretKey: Type19.Optional(Type19.String())
3343
+ postgresqlPassword: z.string().optional(),
3344
+ secretKey: z.string().optional()
2888
3345
  },
2889
3346
  inputs: createInputs(["accessPoint", "resticRepo", "postgresql"]),
2890
3347
  meta: {
2891
- displayName: "Maybe",
3348
+ title: "Maybe",
2892
3349
  description: "The OS for your personal finances.",
2893
- primaryIcon: "arcticons:finance-manager",
3350
+ icon: "arcticons:finance-manager",
2894
3351
  category: "Finance"
2895
3352
  },
2896
3353
  source: createSource("maybe")
2897
3354
  });
2898
-
2899
- // src/apps/deployment.ts
2900
- import { defineUnit as defineUnit19, Type as Type20 } from "@highstate/contract";
2901
- var deployment = defineUnit19({
3355
+ var deployment = defineUnit({
2902
3356
  type: "apps.deployment",
2903
3357
  args: {
2904
- appName: Type20.Optional(Type20.String()),
2905
- fqdn: Type20.Optional(Type20.String()),
2906
- serviceType: Type20.Optional(serviceTypeSchema),
2907
- image: Type20.Optional(Type20.String()),
2908
- port: Type20.Optional(Type20.Number()),
2909
- replicas: Type20.Optional(Type20.Number()),
2910
- dataPath: Type20.Optional(Type20.String()),
2911
- env: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2912
- mariadbEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2913
- postgresqlEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2914
- mongodbEnvMapping: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2915
- manifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2916
- serviceManifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any())),
2917
- httpRouteManifest: Type20.Optional(Type20.Record(Type20.String(), Type20.Any()))
3358
+ appName: z.string().optional(),
3359
+ fqdn: z.string().optional(),
3360
+ serviceType: serviceTypeSchema.optional(),
3361
+ image: z.string().optional(),
3362
+ port: z.number().optional(),
3363
+ replicas: z.number().optional(),
3364
+ dataPath: z.string().optional(),
3365
+ env: z.record(z.string(), z.any()).optional(),
3366
+ mariadbEnvMapping: z.record(z.string(), z.any()).optional(),
3367
+ postgresqlEnvMapping: z.record(z.string(), z.any()).optional(),
3368
+ mongodbEnvMapping: z.record(z.string(), z.any()).optional(),
3369
+ manifest: z.record(z.string(), z.any()).optional(),
3370
+ serviceManifest: z.record(z.string(), z.any()).optional(),
3371
+ httpRouteManifest: z.record(z.string(), z.any()).optional()
2918
3372
  },
2919
3373
  secrets: {
2920
- mariadbPassword: Type20.Optional(Type20.String()),
2921
- postgresqlPassword: Type20.Optional(Type20.String()),
2922
- mongodbPassword: Type20.Optional(Type20.String())
3374
+ mariadbPassword: z.string().optional(),
3375
+ postgresqlPassword: z.string().optional(),
3376
+ mongodbPassword: z.string().optional()
2923
3377
  },
2924
3378
  inputs: createInputs([
2925
3379
  "accessPoint",
@@ -2934,19 +3388,16 @@ var deployment = defineUnit19({
2934
3388
  service: serviceEntity
2935
3389
  },
2936
3390
  meta: {
2937
- displayName: "Kubernetes Deployment",
3391
+ title: "Kubernetes Deployment",
2938
3392
  description: "A generic Kubernetes deployment with optional service and gateway routes.",
2939
- primaryIcon: "devicon:kubernetes",
3393
+ icon: "devicon:kubernetes",
2940
3394
  secondaryIcon: "mdi:cube-outline",
2941
3395
  category: "Kubernetes"
2942
3396
  },
2943
3397
  source: createSource("deployment")
2944
3398
  });
2945
-
2946
- // src/apps/syncthing.ts
2947
- import { defineUnit as defineUnit20, Type as Type21 } from "@highstate/contract";
2948
- var backupModeSchema = Type21.StringEnum(["state", "full"]);
2949
- var syncthing = defineUnit20({
3399
+ var backupModeSchema = z.enum(["state", "full"]);
3400
+ var syncthing = defineUnit({
2950
3401
  type: "apps.syncthing",
2951
3402
  args: {
2952
3403
  ...createArgs2("syncthing", ["fqdn", "external"]),
@@ -2956,7 +3407,15 @@ var syncthing = defineUnit20({
2956
3407
  * The `fqdn` argument unlike this one points to the gateway and used to
2957
3408
  * access the Syncthing Web UI.
2958
3409
  */
2959
- deviceFqdn: Type21.Optional(Type21.String()),
3410
+ deviceFqdn: {
3411
+ schema: z.string().optional(),
3412
+ meta: {
3413
+ description: `The FQDN of the Syncthing instance used to sync with other devices.
3414
+
3415
+ The \`fqdn\` argument unlike this one points to the gateway and used to
3416
+ access the Syncthing Web UI.`
3417
+ }
3418
+ },
2960
3419
  /**
2961
3420
  * The backup mode to use for the Syncthing instance.
2962
3421
  *
@@ -2966,7 +3425,18 @@ var syncthing = defineUnit20({
2966
3425
  *
2967
3426
  * The default is `state`.
2968
3427
  */
2969
- backupMode: Type21.Default(backupModeSchema, "state")
3428
+ backupMode: {
3429
+ schema: backupModeSchema.default("state"),
3430
+ meta: {
3431
+ description: `The backup mode to use for the Syncthing instance.
3432
+
3433
+ - \`state\`: Only the state is backed up. When the instance is restored, it will
3434
+ sync files from the other devices automatically.
3435
+ - \`full\`: A full backup is created including all files.
3436
+
3437
+ The default is \`state\`.`
3438
+ }
3439
+ }
2970
3440
  },
2971
3441
  secrets: createSecrets(["backupPassword"]),
2972
3442
  inputs: createInputs(["accessPoint", "resticRepo", "volume"]),
@@ -2979,23 +3449,20 @@ var syncthing = defineUnit20({
2979
3449
  }
2980
3450
  },
2981
3451
  meta: {
2982
- displayName: "Syncthing",
3452
+ title: "Syncthing",
2983
3453
  description: "The Syncthing instance deployed on Kubernetes.",
2984
- primaryIcon: "simple-icons:syncthing",
3454
+ icon: "simple-icons:syncthing",
2985
3455
  category: "File Sync"
2986
3456
  },
2987
3457
  source: createSource("syncthing")
2988
3458
  });
2989
-
2990
- // src/apps/code-server.ts
2991
- import { defineUnit as defineUnit21, Type as Type22 } from "@highstate/contract";
2992
- var codeServer = defineUnit21({
3459
+ var codeServer = defineUnit({
2993
3460
  type: "apps.code-server",
2994
3461
  args: createArgs2("code-server", ["fqdn"]),
2995
3462
  secrets: {
2996
3463
  ...createSecrets(["backupPassword"]),
2997
- password: Type22.Optional(Type22.String()),
2998
- sudoPassword: Type22.Optional(Type22.String())
3464
+ password: z.string().optional(),
3465
+ sudoPassword: z.string().optional()
2999
3466
  },
3000
3467
  inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
3001
3468
  outputs: {
@@ -3003,9 +3470,9 @@ var codeServer = defineUnit21({
3003
3470
  volume: persistentVolumeClaimEntity
3004
3471
  },
3005
3472
  meta: {
3006
- displayName: "Code Server",
3473
+ title: "Code Server",
3007
3474
  description: "The Code Server instance deployed on Kubernetes.",
3008
- primaryIcon: "material-icon-theme:vscode",
3475
+ icon: "material-icon-theme:vscode",
3009
3476
  category: "Development"
3010
3477
  },
3011
3478
  source: {
@@ -3013,17 +3480,14 @@ var codeServer = defineUnit21({
3013
3480
  path: "code-server"
3014
3481
  }
3015
3482
  });
3016
-
3017
- // src/apps/hubble.ts
3018
- import { defineUnit as defineUnit22 } from "@highstate/contract";
3019
- var hubble = defineUnit22({
3483
+ var hubble = defineUnit({
3020
3484
  type: "apps.hubble",
3021
3485
  args: createArgs2("hubble", ["fqdn"]),
3022
3486
  inputs: createInputs(["accessPoint"]),
3023
3487
  meta: {
3024
- displayName: "Hubble",
3488
+ title: "Hubble",
3025
3489
  description: "Exposes Hubble UI to the user. It must be already installed in the cluster as part of the Cilium.",
3026
- primaryIcon: "mdi:eye",
3490
+ icon: "mdi:eye",
3027
3491
  secondaryIcon: "simple-icons:cilium",
3028
3492
  category: "Observability"
3029
3493
  },
@@ -3035,19 +3499,18 @@ var cloudflare_exports = {};
3035
3499
  __export(cloudflare_exports, {
3036
3500
  connection: () => connection2
3037
3501
  });
3038
- import { defineUnit as defineUnit23, Type as Type23 } from "@highstate/contract";
3039
- var connection2 = defineUnit23({
3502
+ var connection2 = defineUnit({
3040
3503
  type: "cloudflare.connection",
3041
3504
  secrets: {
3042
- apiToken: Type23.String()
3505
+ apiToken: z.string()
3043
3506
  },
3044
3507
  outputs: {
3045
3508
  dnsProvider: providerEntity
3046
3509
  },
3047
3510
  meta: {
3048
- displayName: "Cloudflare Connection",
3511
+ title: "Cloudflare Connection",
3049
3512
  description: "Creates a new Cloudflare connection for one zone.",
3050
- primaryIcon: "simple-icons:cloudflare",
3513
+ icon: "simple-icons:cloudflare",
3051
3514
  category: "Cloudflare"
3052
3515
  },
3053
3516
  source: {
@@ -3065,7 +3528,6 @@ __export(k3s_exports, {
3065
3528
  internalComponents: () => internalComponents,
3066
3529
  packagedComponents: () => packagedComponents
3067
3530
  });
3068
- import { defineUnit as defineUnit24, Type as Type24 } from "@highstate/contract";
3069
3531
  var packagedComponents = [
3070
3532
  "coredns",
3071
3533
  "servicelb",
@@ -3081,69 +3543,69 @@ var internalComponents = [
3081
3543
  "network-policy",
3082
3544
  "helm-controller"
3083
3545
  ];
3084
- var componentSchema = Type24.StringEnum([...packagedComponents, ...internalComponents]);
3085
- var cniSchema3 = Type24.StringEnum(["none", "flannel"]);
3086
- var cluster2 = defineUnit24({
3546
+ var componentSchema = z.enum([...packagedComponents, ...internalComponents]);
3547
+ var cniSchema3 = z.enum(["none", "flannel"]);
3548
+ var cluster2 = defineUnit({
3087
3549
  type: "k3s.cluster",
3088
3550
  args: {
3089
3551
  /**
3090
3552
  * The components to disable in the K3S cluster.
3091
- *
3092
- * @schema
3093
3553
  */
3094
3554
  disabledComponents: {
3095
- ...Type24.Default(Type24.Array(componentSchema), []),
3096
- description: `The components to disable in the K3S cluster.`
3555
+ schema: componentSchema.array().default([]),
3556
+ meta: {
3557
+ description: `The components to disable in the K3S cluster.`
3558
+ }
3097
3559
  },
3098
3560
  /**
3099
3561
  * The CNI to use in the K3S cluster.
3100
3562
  *
3101
3563
  * Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
3102
3564
  * If needed, you can disable them using `disabledComponents` argument.
3103
- *
3104
- * @schema
3105
3565
  */
3106
3566
  cni: {
3107
- ...Type24.Default(cniSchema3, "flannel"),
3108
- description: `The CNI to use in the K3S cluster.
3567
+ schema: cniSchema3.default("flannel"),
3568
+ meta: {
3569
+ description: `The CNI to use in the K3S cluster.
3109
3570
 
3110
3571
  Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
3111
3572
  If needed, you can disable them using \`disabledComponents\` argument.`
3573
+ }
3112
3574
  },
3113
3575
  /**
3114
3576
  * The K3S configuration to pass to each server or agent in the cluster.
3115
3577
  *
3116
3578
  * See: https://docs.k3s.io/installation/configuration
3117
- *
3118
- * @schema
3119
3579
  */
3120
3580
  config: {
3121
- ...Type24.Optional(Type24.Record(Type24.String(), Type24.Any())),
3122
- description: `The K3S configuration to pass to each server or agent in the cluster.
3581
+ schema: z.record(z.string(), z.any()).optional(),
3582
+ meta: {
3583
+ description: `The K3S configuration to pass to each server or agent in the cluster.
3123
3584
 
3124
3585
  See: https://docs.k3s.io/installation/configuration`
3586
+ }
3125
3587
  },
3126
3588
  /**
3127
3589
  * The configuration of the registries to use for the K3S cluster.
3128
3590
  *
3129
3591
  * See: https://docs.k3s.io/installation/private-registry
3130
- *
3131
- * @schema
3132
3592
  */
3133
3593
  registries: {
3134
- ...Type24.Optional(Type24.Record(Type24.String(), Type24.Any())),
3135
- description: `The configuration of the registries to use for the K3S cluster.
3594
+ schema: z.record(z.string(), z.any()).optional(),
3595
+ meta: {
3596
+ description: `The configuration of the registries to use for the K3S cluster.
3136
3597
 
3137
3598
  See: https://docs.k3s.io/installation/private-registry`
3599
+ }
3138
3600
  }
3139
3601
  },
3140
3602
  inputs: clusterInputs,
3141
3603
  outputs: clusterOutputs,
3142
3604
  meta: {
3143
- displayName: "K3s Cluster",
3605
+ title: "K3s Cluster",
3144
3606
  description: "The K3s cluster created on top of the server.",
3145
3607
  category: "k3s",
3146
- primaryIcon: "devicon:k3s",
3608
+ icon: "devicon:k3s",
3147
3609
  secondaryIcon: "devicon:kubernetes"
3148
3610
  },
3149
3611
  source: {
@@ -3157,19 +3619,18 @@ var mullvad_exports = {};
3157
3619
  __export(mullvad_exports, {
3158
3620
  peer: () => peer2
3159
3621
  });
3160
- import { defineUnit as defineUnit25, Type as Type25 } from "@highstate/contract";
3161
- var peer2 = defineUnit25({
3622
+ var peer2 = defineUnit({
3162
3623
  type: "mullvad.peer",
3163
3624
  args: {
3164
- hostname: Type25.Optional(Type25.String()),
3625
+ hostname: z.string().optional(),
3165
3626
  /**
3166
3627
  * Whether to include Mullvad DNS servers in the peer configuration.
3167
- *
3168
- * @schema
3169
3628
  */
3170
3629
  includeDns: {
3171
- ...Type25.Default(Type25.Boolean(), true),
3172
- description: `Whether to include Mullvad DNS servers in the peer configuration.`
3630
+ schema: z.boolean().default(true),
3631
+ meta: {
3632
+ description: `Whether to include Mullvad DNS servers in the peer configuration.`
3633
+ }
3173
3634
  }
3174
3635
  },
3175
3636
  inputs: {
@@ -3177,17 +3638,15 @@ var peer2 = defineUnit25({
3177
3638
  * The network to use for the WireGuard peer.
3178
3639
  *
3179
3640
  * If not provided, the peer will use default network configuration.
3180
- *
3181
- * @schema
3182
3641
  */
3183
3642
  network: {
3184
- ...{
3185
- entity: networkEntity,
3186
- required: false
3187
- },
3188
- description: `The network to use for the WireGuard peer.
3643
+ entity: networkEntity,
3644
+ required: false,
3645
+ meta: {
3646
+ description: `The network to use for the WireGuard peer.
3189
3647
 
3190
3648
  If not provided, the peer will use default network configuration.`
3649
+ }
3191
3650
  }
3192
3651
  },
3193
3652
  outputs: {
@@ -3198,9 +3657,9 @@ var peer2 = defineUnit25({
3198
3657
  }
3199
3658
  },
3200
3659
  meta: {
3201
- displayName: "Mullvad Peer",
3660
+ title: "Mullvad Peer",
3202
3661
  description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
3203
- primaryIcon: "simple-icons:mullvad",
3662
+ icon: "simple-icons:mullvad",
3204
3663
  secondaryIcon: "cib:wireguard",
3205
3664
  secondaryIconColor: "#88171a",
3206
3665
  category: "VPN"
@@ -3218,26 +3677,25 @@ __export(timeweb_exports, {
3218
3677
  connectionEntity: () => connectionEntity,
3219
3678
  virtualMachine: () => virtualMachine2
3220
3679
  });
3221
- import { defineEntity as defineEntity13, defineUnit as defineUnit26, Type as Type26 } from "@highstate/contract";
3222
- var connectionEntity = defineEntity13({
3680
+ var connectionEntity = defineEntity({
3223
3681
  type: "timeweb.connection",
3224
- schema: Type26.Object({
3225
- name: Type26.String(),
3226
- apiToken: Type26.String()
3682
+ schema: z.object({
3683
+ name: z.string(),
3684
+ apiToken: z.string()
3227
3685
  })
3228
3686
  });
3229
- var connection3 = defineUnit26({
3687
+ var connection3 = defineUnit({
3230
3688
  type: "timeweb.connection",
3231
3689
  secrets: {
3232
- apiToken: Type26.String()
3690
+ apiToken: z.string()
3233
3691
  },
3234
3692
  outputs: {
3235
3693
  connection: connectionEntity
3236
3694
  },
3237
3695
  meta: {
3238
- displayName: "Timeweb Connection",
3696
+ title: "Timeweb Connection",
3239
3697
  description: "Creates a new Timeweb connection.",
3240
- primaryIcon: "material-symbols:cloud",
3698
+ icon: "material-symbols:cloud",
3241
3699
  category: "Timeweb"
3242
3700
  },
3243
3701
  source: {
@@ -3245,12 +3703,12 @@ var connection3 = defineUnit26({
3245
3703
  path: "connection"
3246
3704
  }
3247
3705
  });
3248
- var virtualMachine2 = defineUnit26({
3706
+ var virtualMachine2 = defineUnit({
3249
3707
  type: "timeweb.virtual-machine",
3250
3708
  args: {
3251
- presetId: Type26.Optional(Type26.Number()),
3252
- osId: Type26.Optional(Type26.Number()),
3253
- availabilityZone: Type26.String()
3709
+ presetId: z.number().optional(),
3710
+ osId: z.number().optional(),
3711
+ availabilityZone: z.string()
3254
3712
  },
3255
3713
  inputs: {
3256
3714
  connection: connectionEntity,
@@ -3260,15 +3718,15 @@ var virtualMachine2 = defineUnit26({
3260
3718
  }
3261
3719
  },
3262
3720
  secrets: {
3263
- sshPrivateKey: Type26.Optional(Type26.String())
3721
+ sshPrivateKey: z.string().optional()
3264
3722
  },
3265
3723
  outputs: {
3266
3724
  server: serverEntity
3267
3725
  },
3268
3726
  meta: {
3269
- displayName: "Timeweb Virtual Machine",
3727
+ title: "Timeweb Virtual Machine",
3270
3728
  description: "Creates a new Timeweb virtual machine.",
3271
- primaryIcon: "material-symbols:cloud",
3729
+ icon: "material-symbols:cloud",
3272
3730
  secondaryIcon: "codicon:vm",
3273
3731
  category: "Timeweb"
3274
3732
  },
@@ -3281,45 +3739,60 @@ var virtualMachine2 = defineUnit26({
3281
3739
  // src/nixos.ts
3282
3740
  var nixos_exports = {};
3283
3741
  __export(nixos_exports, {
3284
- flakeEntity: () => flakeEntity,
3285
3742
  inlineFlake: () => inlineFlake,
3286
3743
  inlineModule: () => inlineModule,
3287
- inlineModuleEntity: () => inlineModuleEntity,
3288
- remoteFlake: () => remoteFlake,
3289
3744
  system: () => system
3290
3745
  });
3291
- import { defineEntity as defineEntity14, defineUnit as defineUnit27, Type as Type27 } from "@highstate/contract";
3292
- var inlineModuleEntity = defineEntity14({
3293
- type: "nixos.inline-module",
3294
- schema: Type27.Object({
3295
- code: Type27.String()
3296
- }),
3297
- meta: {
3298
- displayName: "NixOS Inline Module",
3299
- description: "The NixOS module reference.",
3300
- color: "#5277c3"
3301
- }
3302
- });
3303
- var inlineModule = defineUnit27({
3746
+ var inlineModule = defineUnit({
3304
3747
  type: "nixos.inline-module",
3305
3748
  args: {
3306
- code: Type27.String({ language: "nix" })
3749
+ /**
3750
+ * The name of the module file.
3751
+ *
3752
+ * If not provided, the name will be the name of the unit.
3753
+ */
3754
+ moduleName: {
3755
+ schema: z.string().optional(),
3756
+ meta: {
3757
+ description: `The name of the module file.
3758
+
3759
+ If not provided, the name will be the name of the unit.`
3760
+ }
3761
+ },
3762
+ /**
3763
+ * The code of the NixOS module.
3764
+ *
3765
+ * In this code you can reference other modules and files by their names.
3766
+ */
3767
+ code: {
3768
+ schema: z.string().meta({ language: "nix" }),
3769
+ meta: {
3770
+ description: `The code of the NixOS module.
3771
+
3772
+ In this code you can reference other modules and files by their names.`
3773
+ }
3774
+ }
3307
3775
  },
3308
3776
  inputs: {
3309
3777
  files: {
3310
3778
  entity: fileEntity,
3311
3779
  required: false,
3312
3780
  multiple: true
3781
+ },
3782
+ folders: {
3783
+ entity: folderEntity,
3784
+ required: false,
3785
+ multiple: true
3313
3786
  }
3314
3787
  },
3315
3788
  outputs: {
3316
- module: inlineModuleEntity
3789
+ folder: folderEntity
3317
3790
  },
3318
3791
  meta: {
3319
- displayName: "NixOS Inline Module",
3792
+ title: "NixOS Inline Module",
3320
3793
  description: "Creates a NixOS module from inline code.",
3321
- primaryIcon: "simple-icons:nixos",
3322
- primaryIconColor: "#7ebae4",
3794
+ icon: "simple-icons:nixos",
3795
+ iconColor: "#7ebae4",
3323
3796
  secondaryIcon: "mdi:file-code",
3324
3797
  category: "NixOS"
3325
3798
  },
@@ -3328,69 +3801,56 @@ var inlineModule = defineUnit27({
3328
3801
  path: "inline-module"
3329
3802
  }
3330
3803
  });
3331
- var flakeEntity = defineEntity14({
3332
- type: "nixos.flake",
3333
- schema: Type27.Object({
3334
- url: Type27.String()
3335
- }),
3336
- meta: {
3337
- displayName: "NixOS Flake",
3338
- description: "The NixOS flake reference.",
3339
- color: "#5277c3"
3340
- }
3341
- });
3342
- var remoteFlake = defineUnit27({
3343
- type: "nixos.remote-flake",
3344
- args: {
3345
- url: Type27.String()
3346
- },
3347
- outputs: {
3348
- flake: flakeEntity
3349
- },
3350
- meta: {
3351
- displayName: "NixOS Remote Flake",
3352
- description: "References a remote NixOS flake.",
3353
- primaryIcon: "simple-icons:nixos",
3354
- primaryIconColor: "#7ebae4",
3355
- secondaryIcon: "simple-icons:git",
3356
- secondaryIconColor: "#f1502f",
3357
- category: "NixOS"
3358
- },
3359
- source: {
3360
- package: "@highstate/nixos",
3361
- path: "flake"
3362
- }
3363
- });
3364
- var inlineFlake = defineUnit27({
3804
+ var inlineFlake = defineUnit({
3365
3805
  type: "nixos.inline-flake",
3366
3806
  args: {
3367
- code: Type27.String({ language: "nix" })
3807
+ /**
3808
+ * The name of the flake folder.
3809
+ *
3810
+ * If not provided, the name will be the name of the unit.
3811
+ */
3812
+ flakeName: {
3813
+ schema: z.string().optional(),
3814
+ meta: {
3815
+ description: `The name of the flake folder.
3816
+
3817
+ If not provided, the name will be the name of the unit.`
3818
+ }
3819
+ },
3820
+ /**
3821
+ * The code of the `flake.nix` file.
3822
+ *
3823
+ * In this code you can reference other flakes, modules, files, and folders by their names.
3824
+ */
3825
+ code: {
3826
+ schema: z.string().meta({ language: "nix" }),
3827
+ meta: {
3828
+ description: `The code of the \`flake.nix\` file.
3829
+
3830
+ In this code you can reference other flakes, modules, files, and folders by their names.`
3831
+ }
3832
+ }
3368
3833
  },
3369
3834
  inputs: {
3370
- flakes: {
3371
- entity: flakeEntity,
3372
- required: false,
3373
- multiple: true
3374
- },
3375
- modules: {
3376
- entity: inlineModuleEntity,
3835
+ files: {
3836
+ entity: fileEntity,
3377
3837
  required: false,
3378
3838
  multiple: true
3379
3839
  },
3380
- files: {
3381
- entity: fileEntity,
3840
+ folders: {
3841
+ entity: folderEntity,
3382
3842
  required: false,
3383
3843
  multiple: true
3384
3844
  }
3385
3845
  },
3386
3846
  outputs: {
3387
- flake: flakeEntity
3847
+ folder: folderEntity
3388
3848
  },
3389
3849
  meta: {
3390
- displayName: "NixOS Inline Flake",
3850
+ title: "NixOS Inline Flake",
3391
3851
  description: "Creates a NixOS flake from inline code.",
3392
- primaryIcon: "simple-icons:nixos",
3393
- primaryIconColor: "#7ebae4",
3852
+ icon: "simple-icons:nixos",
3853
+ iconColor: "#7ebae4",
3394
3854
  secondaryIcon: "mdi:file-code",
3395
3855
  category: "NixOS"
3396
3856
  },
@@ -3399,28 +3859,23 @@ var inlineFlake = defineUnit27({
3399
3859
  path: "inline-flake"
3400
3860
  }
3401
3861
  });
3402
- var system = defineUnit27({
3862
+ var system = defineUnit({
3403
3863
  type: "nixos.system",
3404
3864
  args: {
3405
- system: Type27.Optional(Type27.String())
3865
+ system: z.string().optional()
3406
3866
  },
3407
3867
  inputs: {
3408
- flake: flakeEntity,
3409
3868
  server: serverEntity,
3410
- modules: {
3411
- entity: inlineModuleEntity,
3412
- required: false,
3413
- multiple: true
3414
- }
3869
+ flake: folderEntity
3415
3870
  },
3416
3871
  outputs: {
3417
3872
  server: serverEntity
3418
3873
  },
3419
3874
  meta: {
3420
- displayName: "NixOS System",
3875
+ title: "NixOS System",
3421
3876
  description: "Creates a NixOS system on top of any server.",
3422
- primaryIcon: "simple-icons:nixos",
3423
- primaryIconColor: "#7ebae4",
3877
+ icon: "simple-icons:nixos",
3878
+ iconColor: "#7ebae4",
3424
3879
  secondaryIcon: "codicon:vm",
3425
3880
  category: "NixOS"
3426
3881
  },
@@ -3435,11 +3890,10 @@ var sops_exports = {};
3435
3890
  __export(sops_exports, {
3436
3891
  secrets: () => secrets
3437
3892
  });
3438
- import { defineUnit as defineUnit28, Type as Type28 } from "@highstate/contract";
3439
- var secrets = defineUnit28({
3893
+ var secrets = defineUnit({
3440
3894
  type: "sops.secrets",
3441
- args: {
3442
- secrets: Type28.Record(Type28.String(), Type28.Any())
3895
+ secrets: {
3896
+ data: z.record(z.string(), z.any())
3443
3897
  },
3444
3898
  inputs: {
3445
3899
  servers: {
@@ -3452,9 +3906,9 @@ var secrets = defineUnit28({
3452
3906
  file: fileEntity
3453
3907
  },
3454
3908
  meta: {
3455
- displayName: "SOPS Secrets",
3909
+ title: "SOPS Secrets",
3456
3910
  description: "Encrypts secrets using SOPS for the specified servers.",
3457
- primaryIcon: "mdi:file-lock",
3911
+ icon: "mdi:file-lock",
3458
3912
  category: "Secrets"
3459
3913
  },
3460
3914
  source: {
@@ -3470,165 +3924,168 @@ __export(obfuscators_exports, {
3470
3924
  obfuscatorSpec: () => obfuscatorSpec,
3471
3925
  phantun: () => phantun_exports
3472
3926
  });
3473
-
3474
- // src/obfuscators/shared.ts
3475
- import { Type as Type29 } from "@highstate/contract";
3476
3927
  var deobfuscatorSpec = {
3477
- args: {
3928
+ args: $args({
3478
3929
  /**
3479
3930
  * The name of the namespace and deployment to deploy the deobfuscator on.
3480
3931
  *
3481
3932
  * By default, calculated as `deobfs-{type}-{name}`.
3482
3933
  */
3483
- appName: Type29.Optional(Type29.String()),
3934
+ appName: {
3935
+ schema: z.string().optional(),
3936
+ meta: {
3937
+ description: `The name of the namespace and deployment to deploy the deobfuscator on.
3938
+
3939
+ By default, calculated as \`deobfs-{type}-{name}\`.`
3940
+ }
3941
+ },
3484
3942
  /**
3485
3943
  * The L4 endpoint to forward deobfuscated traffic to.
3486
3944
  *
3487
3945
  * Will take precedence over the `targetEndpoint` input.
3488
- *
3489
- * @schema
3490
3946
  */
3491
3947
  targetEndpoints: {
3492
- ...Type29.Default(Type29.Array(Type29.String()), []),
3493
- description: `The L4 endpoint to forward deobfuscated traffic to.
3948
+ schema: z.string().array().default([]),
3949
+ meta: {
3950
+ description: `The L4 endpoint to forward deobfuscated traffic to.
3494
3951
 
3495
3952
  Will take precedence over the \`targetEndpoint\` input.`
3953
+ }
3496
3954
  },
3497
3955
  /**
3498
3956
  * Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3499
3957
  *
3500
3958
  * By default, the service is not exposed and only accessible from within the cluster.
3501
- *
3502
- * @schema
3503
3959
  */
3504
3960
  external: {
3505
- ...Type29.Default(Type29.Boolean(), false),
3506
- description: `Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3961
+ schema: z.boolean().default(false),
3962
+ meta: {
3963
+ description: `Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3507
3964
 
3508
3965
  By default, the service is not exposed and only accessible from within the cluster.`
3966
+ }
3509
3967
  }
3510
- },
3511
- inputs: {
3968
+ }),
3969
+ inputs: $inputs({
3512
3970
  /**
3513
3971
  * The Kubernetes cluster to deploy the deobfuscator on.
3514
- *
3515
- * @schema
3516
3972
  */
3517
3973
  k8sCluster: {
3518
- ...clusterEntity2,
3519
- description: `The Kubernetes cluster to deploy the deobfuscator on.`
3974
+ entity: clusterEntity2,
3975
+ meta: {
3976
+ description: `The Kubernetes cluster to deploy the deobfuscator on.`
3977
+ }
3520
3978
  },
3521
3979
  /**
3522
3980
  * The L4 endpoints to forward deobfuscated traffic to.
3523
3981
  *
3524
3982
  * Will select the most appropriate endpoint based on the environment.
3525
- *
3526
- * @schema
3527
3983
  */
3528
3984
  targetEndpoints: {
3529
- ...{
3530
- entity: l4EndpointEntity,
3531
- required: false,
3532
- multiple: true
3533
- },
3534
- description: `The L4 endpoints to forward deobfuscated traffic to.
3985
+ entity: l4EndpointEntity,
3986
+ required: false,
3987
+ multiple: true,
3988
+ meta: {
3989
+ description: `The L4 endpoints to forward deobfuscated traffic to.
3535
3990
 
3536
3991
  Will select the most appropriate endpoint based on the environment.`
3992
+ }
3537
3993
  }
3538
- },
3539
- outputs: {
3994
+ }),
3995
+ outputs: $outputs({
3540
3996
  /**
3541
3997
  * The L4 endpoints of the deobfuscator accepting obfuscated traffic.
3542
- *
3543
- * @schema
3544
3998
  */
3545
3999
  endpoints: {
3546
- ...{
3547
- entity: l4EndpointEntity,
3548
- required: false,
3549
- multiple: true
3550
- },
3551
- description: `The L4 endpoints of the deobfuscator accepting obfuscated traffic.`
4000
+ entity: l4EndpointEntity,
4001
+ required: false,
4002
+ multiple: true,
4003
+ meta: {
4004
+ description: `The L4 endpoints of the deobfuscator accepting obfuscated traffic.`
4005
+ }
3552
4006
  }
3553
- }
4007
+ })
3554
4008
  };
3555
4009
  var obfuscatorSpec = {
3556
- args: {
4010
+ args: $args({
3557
4011
  /**
3558
4012
  * The name of the namespace and deployment to deploy the obfuscator on.
3559
4013
  *
3560
4014
  * By default, calculated as `obfs-{type}-{name}`.
3561
4015
  */
3562
- appName: Type29.Optional(Type29.String()),
4016
+ appName: {
4017
+ schema: z.string().optional(),
4018
+ meta: {
4019
+ description: `The name of the namespace and deployment to deploy the obfuscator on.
4020
+
4021
+ By default, calculated as \`obfs-{type}-{name}\`.`
4022
+ }
4023
+ },
3563
4024
  /**
3564
4025
  * The endpoint of the deobfuscator to pass obfuscated traffic to.
3565
4026
  *
3566
4027
  * Will take precedence over the `endpoint` input.
3567
- *
3568
- * @schema
3569
4028
  */
3570
4029
  endpoints: {
3571
- ...Type29.Default(Type29.Array(Type29.String()), []),
3572
- description: `The endpoint of the deobfuscator to pass obfuscated traffic to.
4030
+ schema: z.string().array().default([]),
4031
+ meta: {
4032
+ description: `The endpoint of the deobfuscator to pass obfuscated traffic to.
3573
4033
 
3574
4034
  Will take precedence over the \`endpoint\` input.`
4035
+ }
3575
4036
  },
3576
4037
  /**
3577
4038
  * Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
3578
4039
  *
3579
4040
  * By default, the service is not exposed and only accessible from within the cluster.
3580
- *
3581
- * @schema
3582
4041
  */
3583
4042
  external: {
3584
- ...Type29.Default(Type29.Boolean(), false),
3585
- description: `Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
4043
+ schema: z.boolean().default(false),
4044
+ meta: {
4045
+ description: `Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
3586
4046
 
3587
4047
  By default, the service is not exposed and only accessible from within the cluster.`
4048
+ }
3588
4049
  }
3589
- },
3590
- inputs: {
4050
+ }),
4051
+ inputs: $inputs({
3591
4052
  /**
3592
4053
  * The Kubernetes cluster to deploy the obfuscator on.
3593
- *
3594
- * @schema
3595
4054
  */
3596
4055
  k8sCluster: {
3597
- ...clusterEntity2,
3598
- description: `The Kubernetes cluster to deploy the obfuscator on.`
4056
+ entity: clusterEntity2,
4057
+ meta: {
4058
+ description: `The Kubernetes cluster to deploy the obfuscator on.`
4059
+ }
3599
4060
  },
3600
4061
  /**
3601
4062
  * The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
3602
4063
  *
3603
4064
  * Will select the most appropriate endpoint based on the environment.
3604
- *
3605
- * @schema
3606
4065
  */
3607
4066
  endpoints: {
3608
- ...{
3609
- entity: l4EndpointEntity,
3610
- required: false,
3611
- multiple: true
3612
- },
3613
- description: `The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
4067
+ entity: l4EndpointEntity,
4068
+ required: false,
4069
+ multiple: true,
4070
+ meta: {
4071
+ description: `The L4 endpoints of the deobfuscator to pass obfuscated traffic to.
3614
4072
 
3615
4073
  Will select the most appropriate endpoint based on the environment.`
4074
+ }
3616
4075
  }
3617
- },
3618
- outputs: {
4076
+ }),
4077
+ outputs: $outputs({
3619
4078
  /**
3620
4079
  * The L4 endpoints accepting unobfuscated traffic.
3621
- *
3622
- * @schema
3623
4080
  */
3624
4081
  entryEndpoints: {
3625
- ...{
3626
- entity: l4EndpointEntity,
3627
- multiple: true
3628
- },
3629
- description: `The L4 endpoints accepting unobfuscated traffic.`
4082
+ entity: l4EndpointEntity,
4083
+ multiple: true,
4084
+ meta: {
4085
+ description: `The L4 endpoints accepting unobfuscated traffic.`
4086
+ }
3630
4087
  }
3631
- }
4088
+ })
3632
4089
  };
3633
4090
 
3634
4091
  // src/obfuscators/phantun.ts
@@ -3637,14 +4094,13 @@ __export(phantun_exports, {
3637
4094
  deobfuscator: () => deobfuscator,
3638
4095
  obfuscator: () => obfuscator
3639
4096
  });
3640
- import { defineUnit as defineUnit29 } from "@highstate/contract";
3641
- var deobfuscator = defineUnit29({
4097
+ var deobfuscator = defineUnit({
3642
4098
  type: "obfuscators.phantun.deobfuscator",
3643
4099
  ...deobfuscatorSpec,
3644
4100
  meta: {
3645
- displayName: "Phantun Deobfuscator",
4101
+ title: "Phantun Deobfuscator",
3646
4102
  description: "The Phantun Deobfuscator deployed on Kubernetes.",
3647
- primaryIcon: "mdi:network-outline",
4103
+ icon: "mdi:network-outline",
3648
4104
  secondaryIcon: "mdi:hide",
3649
4105
  category: "Obfuscators"
3650
4106
  },
@@ -3653,13 +4109,13 @@ var deobfuscator = defineUnit29({
3653
4109
  path: "phantun/deobfuscator"
3654
4110
  }
3655
4111
  });
3656
- var obfuscator = defineUnit29({
4112
+ var obfuscator = defineUnit({
3657
4113
  type: "obfuscators.phantun.obfuscator",
3658
4114
  ...obfuscatorSpec,
3659
4115
  meta: {
3660
- displayName: "Phantun Obfuscator",
4116
+ title: "Phantun Obfuscator",
3661
4117
  description: "The Phantun Obfuscator deployed on Kubernetes.",
3662
- primaryIcon: "mdi:network-outline",
4118
+ icon: "mdi:network-outline",
3663
4119
  secondaryIcon: "mdi:hide",
3664
4120
  category: "Obfuscators"
3665
4121
  },
@@ -3668,25 +4124,119 @@ var obfuscator = defineUnit29({
3668
4124
  path: "phantun/obfuscator"
3669
4125
  }
3670
4126
  });
3671
- export {
3672
- apps_exports as apps,
3673
- arrayPatchModeSchema,
3674
- cloudflare_exports as cloudflare,
3675
- common_exports as common,
3676
- dns_exports as dns,
3677
- k3s_exports as k3s,
3678
- k8s_exports as k8s,
3679
- mullvad_exports as mullvad,
3680
- network_exports as network,
3681
- nixos_exports as nixos,
3682
- obfuscators_exports as obfuscators,
3683
- prefixKeysWith,
3684
- proxmox_exports as proxmox,
3685
- restic_exports as restic,
3686
- sops_exports as sops,
3687
- ssh_exports as ssh,
3688
- talos_exports as talos,
3689
- timeweb_exports as timeweb,
3690
- wireguard_exports as wireguard
3691
- };
4127
+
4128
+ // src/distributions/index.ts
4129
+ var distributions_exports = {};
4130
+ __export(distributions_exports, {
4131
+ ubuntu: () => ubuntu,
4132
+ ubuntuArchitectureSchema: () => ubuntuArchitectureSchema,
4133
+ ubuntuVersionSchema: () => ubuntuVersionSchema
4134
+ });
4135
+ var ubuntuVersionSchema = z.enum(["22.04", "24.04", "24.10", "25.04", "25.10"]);
4136
+ var ubuntuArchitectureSchema = z.enum(["amd64", "arm64"]);
4137
+ var ubuntu = defineUnit({
4138
+ type: "distributions.ubuntu",
4139
+ args: {
4140
+ version: ubuntuVersionSchema.default("24.04"),
4141
+ architecture: ubuntuArchitectureSchema.default("amd64")
4142
+ },
4143
+ outputs: {
4144
+ image: fileEntity,
4145
+ cloudConfig: fileEntity
4146
+ },
4147
+ meta: {
4148
+ title: "Ubuntu",
4149
+ description: "Ubuntu distribution with image and cloud-config.",
4150
+ icon: "mdi:ubuntu",
4151
+ iconColor: "#E95420",
4152
+ category: "Distributions"
4153
+ },
4154
+ source: {
4155
+ package: "@highstate/distributions",
4156
+ path: "ubuntu"
4157
+ }
4158
+ });
4159
+
4160
+ // src/git.ts
4161
+ var git_exports = {};
4162
+ __export(git_exports, {
4163
+ remoteRepository: () => remoteRepository
4164
+ });
4165
+ var remoteRepository = defineUnit({
4166
+ type: "git.remote-repository",
4167
+ args: {
4168
+ /**
4169
+ * The URL of the remote repository.
4170
+ */
4171
+ url: {
4172
+ schema: z.string().optional(),
4173
+ meta: {
4174
+ description: `The URL of the remote repository.`
4175
+ }
4176
+ },
4177
+ /**
4178
+ * The ref of the remote repository to checkout.
4179
+ *
4180
+ * If not specified, the default branch will be used.
4181
+ */
4182
+ ref: {
4183
+ schema: z.string().optional(),
4184
+ meta: {
4185
+ description: `The ref of the remote repository to checkout.
4186
+
4187
+ If not specified, the default branch will be used.`
4188
+ }
4189
+ },
4190
+ /**
4191
+ * Whether to include the .git directory in the packed artifact.
4192
+ *
4193
+ * Do not enable this unless you need the full git history.
4194
+ */
4195
+ includeGit: {
4196
+ schema: z.boolean().default(false),
4197
+ meta: {
4198
+ description: `Whether to include the .git directory in the packed artifact.
4199
+
4200
+ Do not enable this unless you need the full git history.`
4201
+ }
4202
+ }
4203
+ },
4204
+ inputs: {
4205
+ /**
4206
+ * The L7 endpoint of the remote repository.
4207
+ */
4208
+ endpoint: {
4209
+ entity: l7EndpointEntity,
4210
+ required: false,
4211
+ meta: {
4212
+ description: `The L7 endpoint of the remote repository.`
4213
+ }
4214
+ }
4215
+ },
4216
+ outputs: {
4217
+ /**
4218
+ * The folder containing the repository content.
4219
+ */
4220
+ folder: {
4221
+ entity: folderEntity,
4222
+ meta: {
4223
+ description: `The folder containing the repository content.`
4224
+ }
4225
+ }
4226
+ },
4227
+ meta: {
4228
+ title: "Git Remote Repository",
4229
+ description: "References a remote Git repository.",
4230
+ icon: "simple-icons:git",
4231
+ iconColor: "#f1502f",
4232
+ category: "Git"
4233
+ },
4234
+ source: {
4235
+ package: "@highstate/git",
4236
+ path: "remote-repository"
4237
+ }
4238
+ });
4239
+
4240
+ export { apps_exports as apps, arrayPatchModeSchema, cloudflare_exports as cloudflare, common_exports as common, distributions_exports as distributions, dns_exports as dns, git_exports as git, k3s_exports as k3s, k8s_exports as k8s, mullvad_exports as mullvad, network_exports as network, nixos_exports as nixos, obfuscators_exports as obfuscators, prefixKeysWith, proxmox_exports as proxmox, restic_exports as restic, sops_exports as sops, ssh_exports as ssh, talos_exports as talos, timeweb_exports as timeweb, wireguard_exports as wireguard };
4241
+ //# sourceMappingURL=index.js.map
3692
4242
  //# sourceMappingURL=index.js.map