@highstate/library 0.9.16 → 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.
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import { registerKnownAbbreviations, Type, defineEntity, defineUnit, fileContentSchema as fileContentSchema$1, fileMetaSchema, unitArtifactSchema, HighstateSignature, $outputs, $inputs, $args } from '@highstate/contract';
2
- import { Literal } from '@sinclair/typebox';
1
+ import { registerKnownAbbreviations, z, defineEntity, camelCaseToHumanReadable, defineUnit, fileContentSchema as fileContentSchema$1, fileMetaSchema, unitArtifactSchema, $args, $outputs, $inputs } from '@highstate/contract';
3
2
  import { omit } from 'remeda';
4
3
 
5
4
  var __defProp = Object.defineProperty;
@@ -81,7 +80,7 @@ __export(network_exports, {
81
80
  l7AppInfoSchema: () => l7AppInfoSchema,
82
81
  l7EndpointEntity: () => l7EndpointEntity
83
82
  });
84
- var endpointVisibilitySchema = Type.StringEnum([
83
+ var endpointVisibilitySchema = z.enum([
85
84
  "public",
86
85
  // Reachable from the public internet
87
86
  "external",
@@ -89,72 +88,75 @@ var endpointVisibilitySchema = Type.StringEnum([
89
88
  "internal"
90
89
  // Reachable only from within the system or cluster
91
90
  ]);
92
- var endpointFilterSchema = Type.Array(endpointVisibilitySchema);
91
+ var endpointFilterSchema = endpointVisibilitySchema.array();
93
92
  var l3EndpointEntity = defineEntity({
94
93
  type: "network.l3-endpoint",
95
- schema: Type.Intersect([
96
- Type.Object({
94
+ schema: z.intersection(
95
+ z.object({
97
96
  visibility: endpointVisibilitySchema,
98
- metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown()))
97
+ metadata: z.record(z.string(), z.unknown()).optional()
99
98
  }),
100
- Type.Union([
101
- Type.Object({
102
- type: Type.Literal("hostname"),
99
+ z.union([
100
+ z.object({
101
+ type: z.literal("hostname"),
103
102
  /**
104
103
  * The hostname of the endpoint in the format of a domain name.
105
104
  */
106
- hostname: Type.String()
105
+ hostname: z.string().meta({ title: camelCaseToHumanReadable("hostname"), description: `The hostname of the endpoint in the format of a domain name.` })
107
106
  }),
108
- Type.Object({
109
- type: Type.Literal("ipv4"),
107
+ z.object({
108
+ type: z.literal("ipv4"),
110
109
  /**
111
110
  * The IPv4 address of the endpoint.
112
111
  */
113
- address: Type.String()
112
+ address: z.string().meta({ title: camelCaseToHumanReadable("address"), description: `The IPv4 address of the endpoint.` })
114
113
  }),
115
- Type.Object({
116
- type: Type.Literal("ipv6"),
114
+ z.object({
115
+ type: z.literal("ipv6"),
117
116
  /**
118
117
  * The IPv6 address of the endpoint.
119
118
  */
120
- address: Type.String()
119
+ address: z.string().meta({ title: camelCaseToHumanReadable("address"), description: `The IPv6 address of the endpoint.` })
121
120
  })
122
121
  ])
123
- ]),
122
+ ),
124
123
  meta: {
125
124
  color: "#4CAF50",
126
125
  description: "The L3 endpoint for some service. May be a domain name or an IP address."
127
126
  }
128
127
  });
129
- var l4ProtocolSchema = Type.StringEnum(["tcp", "udp"]);
130
- var l4PortInfoSchema = Type.Object({
131
- port: Type.Number(),
128
+ var l4ProtocolSchema = z.enum(["tcp", "udp"]);
129
+ var l4PortInfoSchema = z.object({
130
+ port: z.number(),
132
131
  protocol: l4ProtocolSchema
133
132
  });
134
133
  var l4EndpointEntity = defineEntity({
135
134
  type: "network.l4-endpoint",
136
- schema: Type.Intersect([l3EndpointEntity.schema, l4PortInfoSchema]),
135
+ schema: z.intersection(l3EndpointEntity.schema, l4PortInfoSchema),
137
136
  meta: {
138
137
  color: "#2196F3",
139
138
  description: "The L4 endpoint for some service. Extends an L3 endpoint with a port."
140
139
  }
141
140
  });
142
- var l7AppInfoSchema = Type.Object({
141
+ var l7AppInfoSchema = z.object({
143
142
  /**
144
143
  * The name of the application protocol used by the endpoint.
145
144
  */
146
- appProtocol: Type.String(),
145
+ appProtocol: z.string().meta({ title: camelCaseToHumanReadable("appProtocol"), description: `The name of the application protocol used by the endpoint.` }),
147
146
  /**
148
147
  * The resource path of the application endpoint, including query parameters.
149
148
  * Must not start with a slash (`/`).
150
149
  *
151
150
  * Example: `api/v1/resource?query=value`, `database?param=value`, `user/repo.git`.
152
151
  */
153
- resource: Type.Optional(Type.String())
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\`.` })
154
156
  });
155
157
  var l7EndpointEntity = defineEntity({
156
158
  type: "network.l7-endpoint",
157
- schema: Type.Intersect([l4EndpointEntity.schema, l7AppInfoSchema]),
159
+ schema: z.intersection(l4EndpointEntity.schema, l7AppInfoSchema),
158
160
  meta: {
159
161
  color: "#FF9800",
160
162
  description: "The L7 endpoint for some service. Extends an L4 endpoint with application protocol information."
@@ -169,7 +171,7 @@ var l3Endpoint = defineUnit({
169
171
  * May be a domain name or an IP address.
170
172
  */
171
173
  endpoint: {
172
- schema: Type.String(),
174
+ schema: z.string(),
173
175
  meta: {
174
176
  description: `The string representation of the endpoint.
175
177
 
@@ -180,7 +182,7 @@ var l3Endpoint = defineUnit({
180
182
  * The visibility of the endpoint.
181
183
  */
182
184
  visibility: {
183
- schema: Type.Default(endpointVisibilitySchema, "public"),
185
+ schema: endpointVisibilitySchema.default("public"),
184
186
  meta: {
185
187
  description: `The visibility of the endpoint.`
186
188
  }
@@ -190,10 +192,10 @@ var l3Endpoint = defineUnit({
190
192
  endpoint: l3EndpointEntity
191
193
  },
192
194
  meta: {
193
- displayName: "L3 Endpoint",
195
+ title: "L3 Endpoint",
194
196
  description: "An L3 endpoint for some service. May be a domain name or an IP address.",
195
- primaryIcon: "mdi:network-outline",
196
- primaryIconColor: "#4CAF50",
197
+ icon: "mdi:network-outline",
198
+ iconColor: "#4CAF50",
197
199
  defaultNamePrefix: "endpoint",
198
200
  category: "Network"
199
201
  },
@@ -217,7 +219,7 @@ var l4Endpoint = defineUnit({
217
219
  * - `udp://endpoint:port`
218
220
  */
219
221
  endpoint: {
220
- schema: Type.String(),
222
+ schema: z.string(),
221
223
  meta: {
222
224
  description: `The string representation of the endpoint.
223
225
 
@@ -234,7 +236,7 @@ var l4Endpoint = defineUnit({
234
236
  * The visibility of the endpoint.
235
237
  */
236
238
  visibility: {
237
- schema: Type.Default(endpointVisibilitySchema, "public"),
239
+ schema: endpointVisibilitySchema.default("public"),
238
240
  meta: {
239
241
  description: `The visibility of the endpoint.`
240
242
  }
@@ -244,10 +246,10 @@ var l4Endpoint = defineUnit({
244
246
  endpoint: l4EndpointEntity
245
247
  },
246
248
  meta: {
247
- displayName: "L4 Endpoint",
249
+ title: "L4 Endpoint",
248
250
  description: "An L4 endpoint for some service. Extends an L3 endpoint with a port.",
249
- primaryIcon: "mdi:network-outline",
250
- primaryIconColor: "#2196F3",
251
+ icon: "mdi:network-outline",
252
+ iconColor: "#2196F3",
251
253
  defaultNamePrefix: "endpoint",
252
254
  category: "Network"
253
255
  },
@@ -256,32 +258,26 @@ var l4Endpoint = defineUnit({
256
258
  path: "units/network/l4-endpoint"
257
259
  }
258
260
  });
259
- var checksumAlgorithmSchema = Type.StringEnum([
260
- "md5",
261
- "sha1",
262
- "sha256",
263
- "sha384",
264
- "sha512"
265
- ]);
266
- var checksumSchema = Type.Object({
261
+ var checksumAlgorithmSchema = z.enum(["md5", "sha1", "sha256", "sha384", "sha512"]);
262
+ var checksumSchema = z.object({
267
263
  algorithm: checksumAlgorithmSchema,
268
- value: Type.String()
264
+ value: z.string()
269
265
  });
270
- var fileContentSchema = Type.Union([
266
+ var fileContentSchema = z.union([
271
267
  fileContentSchema$1,
272
- Type.Object({
273
- type: Type.Literal("local"),
274
- path: Type.String()
268
+ z.object({
269
+ type: z.literal("local"),
270
+ path: z.string()
275
271
  }),
276
- Type.Object({
277
- type: Type.Literal("remote"),
272
+ z.object({
273
+ type: z.literal("remote"),
278
274
  endpoint: l7EndpointEntity.schema,
279
- checksum: Type.Optional(checksumSchema)
275
+ checksum: checksumSchema.optional()
280
276
  })
281
277
  ]);
282
278
  var fileEntity = defineEntity({
283
279
  type: "common.file",
284
- schema: Type.Object({
280
+ schema: z.object({
285
281
  meta: fileMetaSchema,
286
282
  content: fileContentSchema
287
283
  }),
@@ -289,42 +285,37 @@ var fileEntity = defineEntity({
289
285
  color: "#FF5722"
290
286
  }
291
287
  });
292
- var folderMetaSchema = Type.Object({
293
- name: Type.String(),
294
- mode: Type.Optional(Type.Number())
295
- });
296
- var folderContentSchema = Type.Recursive(
297
- (TSelf) => {
298
- return Type.Union([
299
- Type.Object({
300
- type: Type.Literal("embedded"),
301
- files: Type.Array(fileEntity.schema),
302
- folders: Type.Array(
303
- Type.Object({
304
- meta: folderMetaSchema,
305
- content: TSelf
306
- })
307
- )
308
- }),
309
- Type.Object({
310
- type: Type.Literal("artifact"),
311
- [HighstateSignature.Artifact]: unitArtifactSchema
312
- }),
313
- Type.Object({
314
- type: Type.Literal("local"),
315
- path: Type.String()
316
- }),
317
- Type.Object({
318
- type: Type.Literal("remote"),
319
- endpoint: l7EndpointEntity.schema
320
- })
321
- ]);
322
- },
323
- { $id: "common.folder.content" }
324
- );
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
+ ]);
325
316
  var folderEntity = defineEntity({
326
317
  type: "common.folder",
327
- schema: Type.Object({
318
+ schema: z.object({
328
319
  meta: folderMetaSchema,
329
320
  content: folderContentSchema
330
321
  }),
@@ -339,7 +330,7 @@ var remoteFile = defineUnit({
339
330
  * The URL of the remote file.
340
331
  */
341
332
  url: {
342
- schema: Type.Optional(Type.String()),
333
+ schema: z.string().optional(),
343
334
  meta: {
344
335
  description: `The URL of the remote file.`
345
336
  }
@@ -361,9 +352,9 @@ var remoteFile = defineUnit({
361
352
  file: fileEntity
362
353
  },
363
354
  meta: {
364
- displayName: "Remote File",
355
+ title: "Remote File",
365
356
  description: "References a file from a remote URL.",
366
- primaryIcon: "mdi:file-download",
357
+ icon: "mdi:file-download",
367
358
  category: "Files"
368
359
  },
369
360
  source: {
@@ -373,41 +364,41 @@ var remoteFile = defineUnit({
373
364
  });
374
365
 
375
366
  // src/ssh.ts
376
- var keyTypeSchema = Type.StringEnum(["ed25519"]);
367
+ var keyTypeSchema = z.enum(["ed25519"]);
377
368
  var keyPairEntity = defineEntity({
378
369
  type: "ssh.key-pair",
379
- schema: Type.Object({
370
+ schema: z.object({
380
371
  type: keyTypeSchema,
381
- fingerprint: Type.String(),
382
- publicKey: Type.String(),
383
- privateKey: Type.String()
372
+ fingerprint: z.string(),
373
+ publicKey: z.string(),
374
+ privateKey: z.string()
384
375
  }),
385
376
  meta: {
386
377
  color: "#2b5797"
387
378
  }
388
379
  });
389
- var credentialsSchema = Type.Object({
390
- endpoints: Type.Array(l4EndpointEntity.schema),
391
- hostKey: Type.String(),
392
- user: Type.String(),
393
- password: Type.Optional(Type.String()),
394
- keyPair: Type.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()
395
386
  });
396
387
  var keyPair = defineUnit({
397
388
  type: "ssh.key-pair",
398
389
  secrets: {
399
- privateKey: Type.Optional(Type.String())
390
+ privateKey: z.string().optional()
400
391
  },
401
392
  outputs: {
402
393
  keyPair: keyPairEntity,
403
394
  publicKeyFile: fileEntity
404
395
  },
405
396
  meta: {
406
- displayName: "SSH Key Pair",
397
+ title: "SSH Key Pair",
407
398
  description: "Holds the ED25519 SSH key pair and generates the private key if not provided.",
408
399
  category: "ssh",
409
- primaryIcon: "charm:key",
410
- primaryIconColor: "#ffffff",
400
+ icon: "charm:key",
401
+ iconColor: "#ffffff",
411
402
  secondaryIcon: "mdi:lock",
412
403
  secondaryIconColor: "#ffffff"
413
404
  },
@@ -432,16 +423,16 @@ function prefixKeysWith(prefix, obj) {
432
423
  Object.entries(obj).map(([key, value]) => [prefixWith(key, prefix), value])
433
424
  );
434
425
  }
435
- var arrayPatchModeSchema = Type.StringEnum(["prepend", "replace"]);
426
+ var arrayPatchModeSchema = z.enum(["prepend", "replace"]);
436
427
 
437
428
  // src/dns.ts
438
429
  var providerEntity = defineEntity({
439
430
  type: "dns.provider",
440
- schema: Type.Object({
441
- name: Type.String(),
442
- type: Type.String(),
443
- data: Type.Record(Type.String(), Type.Unknown()),
444
- domain: Type.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()
445
436
  }),
446
437
  meta: {
447
438
  color: "#FF5722"
@@ -456,7 +447,7 @@ function createArgs(prefix) {
456
447
  *
457
448
  * Will throw an error if no matching provider is found.
458
449
  */
459
- fqdn: Type.Optional(Type.String()),
450
+ fqdn: z.string().optional(),
460
451
  /**
461
452
  * The endpoint filter to filter the endpoints before creating the DNS records.
462
453
  *
@@ -474,7 +465,7 @@ function createArgs(prefix) {
474
465
  * - Otherwise, if any external endpoints exist, all external endpoints are selected;
475
466
  * - If neither exist, all internal endpoints are selected.
476
467
  */
477
- endpointFilter: Type.Default(endpointFilterSchema, []),
468
+ endpointFilter: endpointFilterSchema.default([]),
478
469
  /**
479
470
  * The mode to use for patching the existing endpoints.
480
471
  *
@@ -483,7 +474,7 @@ function createArgs(prefix) {
483
474
  *
484
475
  * The default is `prepend`.
485
476
  */
486
- patchMode: Type.Default(arrayPatchModeSchema, "prepend")
477
+ patchMode: arrayPatchModeSchema.default("prepend")
487
478
  });
488
479
  }
489
480
  var inputs = {
@@ -501,10 +492,10 @@ var inputs = {
501
492
  // src/common.ts
502
493
  var serverEntity = defineEntity({
503
494
  type: "common.server",
504
- schema: Type.Object({
505
- hostname: Type.String(),
506
- endpoints: Type.Array(l3EndpointEntity.schema),
507
- ssh: Type.Optional(credentialsSchema)
495
+ schema: z.object({
496
+ hostname: z.string(),
497
+ endpoints: l3EndpointEntity.schema.array(),
498
+ ssh: credentialsSchema.optional()
508
499
  }),
509
500
  meta: {
510
501
  color: "#009688"
@@ -526,7 +517,7 @@ var existingServer = defineUnit({
526
517
  * Takes precedence over the `endpoint` input.
527
518
  */
528
519
  endpoint: {
529
- schema: Type.Optional(Type.String()),
520
+ schema: z.string().optional(),
530
521
  meta: {
531
522
  description: `The endpoint of the server.
532
523
 
@@ -537,7 +528,7 @@ var existingServer = defineUnit({
537
528
  * The SSH user to use for connecting to the server.
538
529
  */
539
530
  sshUser: {
540
- schema: Type.Default(Type.String(), "root"),
531
+ schema: z.string().default("root"),
541
532
  meta: {
542
533
  description: `The SSH user to use for connecting to the server.`
543
534
  }
@@ -546,15 +537,15 @@ var existingServer = defineUnit({
546
537
  * The SSH port to use for connecting to the server.
547
538
  */
548
539
  sshPort: {
549
- schema: Type.Default(Type.Number(), 22),
540
+ schema: z.number().default(22),
550
541
  meta: {
551
542
  description: `The SSH port to use for connecting to the server.`
552
543
  }
553
544
  }
554
545
  },
555
546
  secrets: {
556
- sshPassword: Type.Optional(Type.String()),
557
- sshPrivateKey: Type.Optional(Type.String())
547
+ sshPassword: z.string().optional(),
548
+ sshPrivateKey: z.string().optional()
558
549
  },
559
550
  inputs: {
560
551
  sshKeyPair: {
@@ -568,9 +559,9 @@ var existingServer = defineUnit({
568
559
  },
569
560
  outputs: serverOutputs,
570
561
  meta: {
571
- displayName: "Existing Server",
562
+ title: "Existing Server",
572
563
  description: "An existing server that can be used in the configuration.",
573
- primaryIcon: "mdi:server",
564
+ icon: "mdi:server",
574
565
  defaultNamePrefix: "server",
575
566
  category: "Infrastructure"
576
567
  },
@@ -590,7 +581,7 @@ var serverPatch = defineUnit({
590
581
  * The same server may also be represented by multiple entries (e.g. a node with private and public IP).
591
582
  */
592
583
  endpoints: {
593
- schema: Type.Default(Type.Array(Type.String()), []),
584
+ schema: z.string().array().default([]),
594
585
  meta: {
595
586
  description: `The endpoints of the server.
596
587
 
@@ -606,7 +597,7 @@ var serverPatch = defineUnit({
606
597
  * - `replace`: replace the existing endpoints with the new ones.
607
598
  */
608
599
  endpointsPatchMode: {
609
- schema: Type.Default(arrayPatchModeSchema, "prepend"),
600
+ schema: arrayPatchModeSchema.default("prepend"),
610
601
  meta: {
611
602
  description: `The mode to use for patching the endpoints.
612
603
 
@@ -631,9 +622,9 @@ var serverPatch = defineUnit({
631
622
  }
632
623
  },
633
624
  meta: {
634
- displayName: "Server Patch",
625
+ title: "Server Patch",
635
626
  description: "Patches some properties of the server.",
636
- primaryIcon: "mdi:server",
627
+ icon: "mdi:server",
637
628
  secondaryIcon: "fluent:patch-20-filled",
638
629
  category: "Infrastructure"
639
630
  },
@@ -657,9 +648,9 @@ var serverDns = defineUnit({
657
648
  }
658
649
  },
659
650
  meta: {
660
- displayName: "Server DNS",
651
+ title: "Server DNS",
661
652
  description: "Creates DNS records for the server and updates endpoints.",
662
- primaryIcon: "mdi:server",
653
+ icon: "mdi:server",
663
654
  secondaryIcon: "mdi:dns",
664
655
  category: "Infrastructure"
665
656
  },
@@ -671,9 +662,9 @@ var serverDns = defineUnit({
671
662
  var script = defineUnit({
672
663
  type: "common.script",
673
664
  args: {
674
- script: Type.String({ language: "shell" }),
675
- updateScript: Type.Optional(Type.String({ language: "shell" })),
676
- deleteScript: Type.Optional(Type.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" })
677
668
  },
678
669
  inputs: {
679
670
  server: serverEntity
@@ -682,9 +673,9 @@ var script = defineUnit({
682
673
  server: serverEntity
683
674
  },
684
675
  meta: {
685
- displayName: "Shell Script",
676
+ title: "Shell Script",
686
677
  description: "Run a shell script on the server.",
687
- primaryIcon: "mdi:bash",
678
+ icon: "mdi:bash",
688
679
  category: "Infrastructure"
689
680
  },
690
681
  source: {
@@ -705,15 +696,15 @@ __export(proxmox_exports, {
705
696
  });
706
697
  var clusterEntity = defineEntity({
707
698
  type: "proxmox.cluster",
708
- schema: Type.Object({
699
+ schema: z.object({
709
700
  endpoint: l7EndpointEntity.schema,
710
- insecure: Type.Optional(Type.Boolean()),
711
- username: Type.Optional(Type.String()),
712
- defaultNodeName: Type.String(),
713
- defaultDatastoreId: Type.String(),
714
- password: Type.Optional(Type.String()),
715
- apiToken: Type.Optional(Type.String()),
716
- ssh: Type.Optional(credentialsSchema)
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()
717
708
  }),
718
709
  meta: {
719
710
  color: "#e56901"
@@ -721,8 +712,8 @@ var clusterEntity = defineEntity({
721
712
  });
722
713
  var imageEntity = defineEntity({
723
714
  type: "proxmox.image",
724
- schema: Type.Object({
725
- id: Type.String()
715
+ schema: z.object({
716
+ id: z.string()
726
717
  }),
727
718
  meta: {
728
719
  color: "#e56901"
@@ -735,7 +726,7 @@ var connection = defineUnit({
735
726
  * The endpoint of the Proxmox API.
736
727
  */
737
728
  endpoint: {
738
- schema: Type.String(),
729
+ schema: z.string(),
739
730
  meta: {
740
731
  description: `The endpoint of the Proxmox API.`
741
732
  }
@@ -744,7 +735,7 @@ var connection = defineUnit({
744
735
  * Whether to allow insecure connections to the Proxmox API.
745
736
  */
746
737
  insecure: {
747
- schema: Type.Optional(Type.Boolean()),
738
+ schema: z.boolean().optional(),
748
739
  meta: {
749
740
  description: `Whether to allow insecure connections to the Proxmox API.`
750
741
  }
@@ -755,7 +746,7 @@ var connection = defineUnit({
755
746
  * Only required for password token authentication.
756
747
  */
757
748
  username: {
758
- schema: Type.Optional(Type.String()),
749
+ schema: z.string().optional(),
759
750
  meta: {
760
751
  description: `The username to use for the Proxmox API.
761
752
 
@@ -768,7 +759,7 @@ var connection = defineUnit({
768
759
  * If not specified, the first node in the cluster will be used.
769
760
  */
770
761
  defaultNodeName: {
771
- schema: Type.Optional(Type.String()),
762
+ schema: z.string().optional(),
772
763
  meta: {
773
764
  description: `The name of the default Proxmox node to use for operations.
774
765
 
@@ -781,7 +772,7 @@ var connection = defineUnit({
781
772
  * If not specified, the first datastore in the cluster will be used.
782
773
  */
783
774
  defaultDatastoreId: {
784
- schema: Type.Optional(Type.String()),
775
+ schema: z.string().optional(),
785
776
  meta: {
786
777
  description: `The ID of the default Proxmox datastore to use for operations.
787
778
 
@@ -794,7 +785,7 @@ var connection = defineUnit({
794
785
  * By default, this is set to "root".
795
786
  */
796
787
  sshUser: {
797
- schema: Type.Default(Type.String(), "root"),
788
+ schema: z.string().default("root"),
798
789
  meta: {
799
790
  description: `The username to use for SSH connections to the Proxmox nodes.
800
791
 
@@ -807,7 +798,7 @@ var connection = defineUnit({
807
798
  * By default, this is set to 22.
808
799
  */
809
800
  sshPort: {
810
- schema: Type.Default(Type.Number(), 22),
801
+ schema: z.number().default(22),
811
802
  meta: {
812
803
  description: `The port to use for SSH connections to the Proxmox nodes.
813
804
 
@@ -822,29 +813,29 @@ var connection = defineUnit({
822
813
  * Requires `username` to be set.
823
814
  */
824
815
  password: {
825
- schema: Type.Optional(Type.String()),
816
+ schema: z.string().optional(),
826
817
  meta: {
827
818
  description: `The password to use for the Proxmox API.
828
819
 
829
820
  Requires \`username\` to be set.`,
830
- displayName: "Proxmox Password"
821
+ title: "Proxmox Password"
831
822
  }
832
823
  },
833
824
  /**
834
825
  * The Proxmox API token to use for authentication.
835
826
  */
836
827
  apiToken: {
837
- schema: Type.Optional(Type.String()),
828
+ schema: z.string().optional(),
838
829
  meta: {
839
830
  description: `The Proxmox API token to use for authentication.`,
840
- displayName: "Proxmox API Token"
831
+ title: "Proxmox API Token"
841
832
  }
842
833
  },
843
834
  /**
844
835
  * The SSH password to use for connecting to the Proxmox nodes.
845
836
  */
846
837
  sshPassword: {
847
- schema: Type.Optional(Type.String()),
838
+ schema: z.string().optional(),
848
839
  meta: {
849
840
  description: `The SSH password to use for connecting to the Proxmox nodes.`
850
841
  }
@@ -866,11 +857,11 @@ var connection = defineUnit({
866
857
  proxmoxCluster: clusterEntity
867
858
  },
868
859
  meta: {
869
- displayName: "Proxmox Connection",
860
+ title: "Proxmox Connection",
870
861
  description: "The connection to an existing Proxmox cluster.",
871
862
  category: "Proxmox",
872
- primaryIcon: "simple-icons:proxmox",
873
- primaryIconColor: "#e56901"
863
+ icon: "simple-icons:proxmox",
864
+ iconColor: "#e56901"
874
865
  },
875
866
  source: {
876
867
  package: "@highstate/proxmox",
@@ -887,7 +878,7 @@ var image = defineUnit({
887
878
  * or `<unitName>.<extension>` if `sha256` is not provided.
888
879
  */
889
880
  fileName: {
890
- schema: Type.Optional(Type.String()),
881
+ schema: z.string().optional(),
891
882
  meta: {
892
883
  description: `The name of the image to upload.
893
884
 
@@ -899,7 +890,7 @@ var image = defineUnit({
899
890
  * The URL of the image to upload.
900
891
  */
901
892
  url: {
902
- schema: Type.Optional(Type.String()),
893
+ schema: z.string().optional(),
903
894
  meta: {
904
895
  description: `The URL of the image to upload.`
905
896
  }
@@ -908,7 +899,7 @@ var image = defineUnit({
908
899
  * The checksum of the image file to verify.
909
900
  */
910
901
  checksum: {
911
- schema: Type.Optional(checksumSchema),
902
+ schema: checksumSchema.optional(),
912
903
  meta: {
913
904
  description: `The checksum of the image file to verify.`
914
905
  }
@@ -919,7 +910,7 @@ var image = defineUnit({
919
910
  * If not specified, the default node name from the cluster will be used.
920
911
  */
921
912
  nodeName: {
922
- schema: Type.Optional(Type.String()),
913
+ schema: z.string().optional(),
923
914
  meta: {
924
915
  description: `The name of the Proxmox node to upload the image to.
925
916
 
@@ -932,7 +923,7 @@ var image = defineUnit({
932
923
  * If not specified, the default datastore ID from the cluster will be used.
933
924
  */
934
925
  datastoreId: {
935
- schema: Type.Optional(Type.String()),
926
+ schema: z.string().optional(),
936
927
  meta: {
937
928
  description: `The ID of the Proxmox datastore to upload the image to.
938
929
 
@@ -969,11 +960,11 @@ var image = defineUnit({
969
960
  image: imageEntity
970
961
  },
971
962
  meta: {
972
- displayName: "Proxmox Image",
963
+ title: "Proxmox Image",
973
964
  description: "The image to upload to a Proxmox cluster.",
974
965
  category: "Proxmox",
975
- primaryIcon: "simple-icons:proxmox",
976
- primaryIconColor: "#e56901",
966
+ icon: "simple-icons:proxmox",
967
+ iconColor: "#e56901",
977
968
  secondaryIcon: "mage:compact-disk-fill"
978
969
  },
979
970
  source: {
@@ -984,7 +975,7 @@ var image = defineUnit({
984
975
  var existingImage = defineUnit({
985
976
  type: "proxmox.existing-image",
986
977
  args: {
987
- id: Type.String()
978
+ id: z.string()
988
979
  },
989
980
  inputs: {
990
981
  proxmoxCluster: clusterEntity
@@ -993,11 +984,11 @@ var existingImage = defineUnit({
993
984
  image: imageEntity
994
985
  },
995
986
  meta: {
996
- displayName: "Proxmox Existing Image",
987
+ title: "Proxmox Existing Image",
997
988
  description: "The existing image on a Proxmox cluster.",
998
989
  category: "Proxmox",
999
- primaryIcon: "simple-icons:proxmox",
1000
- primaryIconColor: "#e56901",
990
+ icon: "simple-icons:proxmox",
991
+ iconColor: "#e56901",
1001
992
  secondaryIcon: "mage:compact-disk-fill"
1002
993
  },
1003
994
  source: {
@@ -1008,36 +999,201 @@ var existingImage = defineUnit({
1008
999
  var virtualMachine = defineUnit({
1009
1000
  type: "proxmox.virtual-machine",
1010
1001
  args: {
1011
- nodeName: Type.Optional(Type.String()),
1012
- cpuType: Type.Default(Type.String(), "host"),
1013
- cores: Type.Default(Type.Number(), 1),
1014
- sockets: Type.Default(Type.Number(), 1),
1015
- memory: Type.Default(Type.Number(), 512),
1016
1002
  /**
1017
- * The IPv4 address to assign to the virtual machine.
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.
1018
1017
  *
1019
- * If not specified, the virtual machine will not have an IPv4 address.
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.
1020
1090
  */
1021
1091
  ipv4: {
1022
- schema: Type.Optional(Type.String()),
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" }),
1023
1142
  meta: {
1024
- description: `The IPv4 address to assign to the virtual machine.
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.
1025
1157
 
1026
- If not specified, the virtual machine will not have an IPv4 address.`
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.`
1027
1170
  }
1028
1171
  },
1029
- ipv4Gateway: Type.Optional(Type.String()),
1030
- dns: Type.Optional(Type.Array(Type.String())),
1031
- datastoreId: Type.Optional(Type.String()),
1032
- diskSize: Type.Default(Type.Number(), 8),
1033
- bridge: Type.Default(Type.String(), "vmbr0"),
1034
- sshPort: Type.Default(Type.Number(), 22),
1035
- sshUser: Type.Default(Type.String(), "root"),
1036
- waitForAgent: Type.Default(Type.Boolean(), true),
1037
- vendorData: Type.Optional(Type.String({ language: "yaml" }))
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
+ }
1038
1194
  },
1039
1195
  secrets: {
1040
- sshPassword: Type.Optional(Type.String())
1196
+ sshPassword: z.string().optional()
1041
1197
  },
1042
1198
  inputs: {
1043
1199
  proxmoxCluster: clusterEntity,
@@ -1063,11 +1219,11 @@ var virtualMachine = defineUnit({
1063
1219
  },
1064
1220
  outputs: serverOutputs,
1065
1221
  meta: {
1066
- displayName: "Proxmox Virtual Machine",
1222
+ title: "Proxmox Virtual Machine",
1067
1223
  description: "The virtual machine on a Proxmox cluster.",
1068
1224
  category: "Proxmox",
1069
- primaryIcon: "simple-icons:proxmox",
1070
- primaryIconColor: "#e56901",
1225
+ icon: "simple-icons:proxmox",
1226
+ iconColor: "#e56901",
1071
1227
  secondaryIcon: "codicon:vm"
1072
1228
  },
1073
1229
  source: {
@@ -1114,30 +1270,32 @@ __export(k8s_exports, {
1114
1270
  tlsIssuerEntity: () => tlsIssuerEntity,
1115
1271
  tunDevicePolicySchema: () => tunDevicePolicySchema
1116
1272
  });
1117
- var fallbackKubeApiAccessSchema = Type.Object({
1118
- serverIp: Type.String(),
1119
- serverPort: Type.Number()
1273
+ var fallbackKubeApiAccessSchema = z.object({
1274
+ serverIp: z.string(),
1275
+ serverPort: z.number()
1120
1276
  });
1121
- var tunDevicePolicySchema = Type.Union([
1122
- Type.Object({
1123
- type: Literal("host")
1277
+ var tunDevicePolicySchema = z.union([
1278
+ z.object({
1279
+ type: z.literal("host")
1124
1280
  }),
1125
- Type.Object({
1126
- type: Literal("plugin"),
1127
- resourceName: Type.String(),
1128
- resourceValue: Type.String()
1281
+ z.object({
1282
+ type: z.literal("plugin"),
1283
+ resourceName: z.string(),
1284
+ resourceValue: z.string()
1129
1285
  })
1130
1286
  ]);
1131
- var externalServiceTypeSchema = Type.StringEnum(["NodePort", "LoadBalancer"]);
1132
- var scheduleOnMastersPolicySchema = Type.StringEnum(["always", "when-no-workers", "never"]);
1133
- var cniSchema = Type.StringEnum(["cilium", "other"]);
1134
- var clusterQuirksSchema = Type.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({
1135
1291
  /**
1136
1292
  * The IP and port of the kube-apiserver available from the cluster.
1137
1293
  *
1138
1294
  * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
1139
1295
  */
1140
- fallbackKubeApiAccess: Type.Optional(fallbackKubeApiAccessSchema),
1296
+ fallbackKubeApiAccess: fallbackKubeApiAccessSchema.optional().meta({ title: camelCaseToHumanReadable("fallbackKubeApiAccess"), description: `The IP and port of the kube-apiserver available from the cluster.
1297
+
1298
+ Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.` }),
1141
1299
  /**
1142
1300
  * Specifies the policy for using the tun device inside containers.
1143
1301
  *
@@ -1145,13 +1303,19 @@ var clusterQuirksSchema = Type.Object({
1145
1303
  *
1146
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.
1147
1305
  */
1148
- tunDevicePolicy: Type.Optional(tunDevicePolicySchema),
1306
+ tunDevicePolicy: tunDevicePolicySchema.optional().meta({ title: camelCaseToHumanReadable("tunDevicePolicy"), description: `Specifies the policy for using the tun device inside containers.
1307
+
1308
+ If not provided, the default policy is \`host\` which assumes just mounting /dev/net/tun from the host.
1309
+
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.` }),
1149
1311
  /**
1150
1312
  * The service type to use for external services.
1151
1313
  *
1152
1314
  * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
1153
1315
  */
1154
- externalServiceType: Type.Optional(externalServiceTypeSchema)
1316
+ externalServiceType: externalServiceTypeSchema.optional().meta({ title: camelCaseToHumanReadable("externalServiceType"), description: `The service type to use for external services.
1317
+
1318
+ If not provided, the default service type is \`NodePort\` since \`LoadBalancer\` may not be available.` })
1155
1319
  });
1156
1320
  var clusterInfoProperties = {
1157
1321
  /**
@@ -1159,11 +1323,11 @@ var clusterInfoProperties = {
1159
1323
  *
1160
1324
  * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.
1161
1325
  */
1162
- id: Type.String(),
1326
+ id: z.string(),
1163
1327
  /**
1164
1328
  * The name of the cluster.
1165
1329
  */
1166
- name: Type.String(),
1330
+ name: z.string(),
1167
1331
  /**
1168
1332
  * The name of the CNI plugin used by the cluster.
1169
1333
  *
@@ -1179,7 +1343,7 @@ var clusterInfoProperties = {
1179
1343
  *
1180
1344
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1181
1345
  */
1182
- endpoints: Type.Array(l3EndpointEntity.schema),
1346
+ endpoints: l3EndpointEntity.schema.array(),
1183
1347
  /**
1184
1348
  * The endpoints of the API server.
1185
1349
  *
@@ -1187,37 +1351,37 @@ var clusterInfoProperties = {
1187
1351
  *
1188
1352
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1189
1353
  */
1190
- apiEndpoints: Type.Array(l4EndpointEntity.schema),
1354
+ apiEndpoints: l4EndpointEntity.schema.array(),
1191
1355
  /**
1192
1356
  * The external IPs of the cluster nodes allowed to be used for external access.
1193
1357
  */
1194
- externalIps: Type.Array(Type.String()),
1358
+ externalIps: z.string().array(),
1195
1359
  /**
1196
1360
  * The extra quirks of the cluster to improve compatibility.
1197
1361
  */
1198
- quirks: Type.Optional(clusterQuirksSchema),
1362
+ quirks: clusterQuirksSchema.optional(),
1199
1363
  /**
1200
1364
  * The extra metadata to attach to the cluster.
1201
1365
  */
1202
- metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown()))
1366
+ metadata: z.record(z.string(), z.unknown()).optional()
1203
1367
  };
1204
- var serviceTypeSchema = Type.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
1205
- var metadataSchema = Type.Object({
1206
- name: Type.String(),
1207
- namespace: Type.String(),
1208
- labels: Type.Optional(Type.Record(Type.String(), Type.String())),
1209
- annotations: Type.Optional(Type.Record(Type.String(), Type.String()))
1210
- });
1211
- var resourceSchema = Type.Object({
1212
- clusterId: Type.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(),
1213
1377
  metadata: metadataSchema
1214
1378
  });
1215
1379
  var serviceEntity = defineEntity({
1216
1380
  type: "k8s.service",
1217
- schema: Type.Object({
1218
- type: Type.Literal("k8s.service"),
1219
- ...resourceSchema.properties,
1220
- endpoints: Type.Array(l4EndpointEntity.schema)
1381
+ schema: z.object({
1382
+ type: z.literal("k8s.service"),
1383
+ ...resourceSchema.shape,
1384
+ endpoints: l4EndpointEntity.schema.array()
1221
1385
  }),
1222
1386
  meta: {
1223
1387
  color: "#2196F3"
@@ -1225,16 +1389,16 @@ var serviceEntity = defineEntity({
1225
1389
  });
1226
1390
  var clusterEntity2 = defineEntity({
1227
1391
  type: "k8s.cluster",
1228
- schema: Type.Object({
1392
+ schema: z.object({
1229
1393
  ...clusterInfoProperties,
1230
- kubeconfig: Type.String()
1394
+ kubeconfig: z.string()
1231
1395
  }),
1232
1396
  meta: {
1233
1397
  color: "#2196F3"
1234
1398
  }
1235
1399
  });
1236
- var internalIpsPolicySchema = Type.StringEnum(["always", "public", "never"]);
1237
- var scheduleOnMastersPolicyArgs = {
1400
+ var internalIpsPolicySchema = z.enum(["always", "public", "never"]);
1401
+ var scheduleOnMastersPolicyArgs = $args({
1238
1402
  /**
1239
1403
  * The policy for scheduling workloads on master nodes.
1240
1404
  *
@@ -1242,8 +1406,17 @@ var scheduleOnMastersPolicyArgs = {
1242
1406
  * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
1243
1407
  * - `never`: never schedule workloads on master nodes.
1244
1408
  */
1245
- scheduleOnMastersPolicy: Type.Default(scheduleOnMastersPolicySchema, "when-no-workers")
1246
- };
1409
+ scheduleOnMastersPolicy: {
1410
+ schema: scheduleOnMastersPolicySchema.default("when-no-workers"),
1411
+ meta: {
1412
+ description: `The policy for scheduling workloads on master nodes.
1413
+
1414
+ - \`always\`: always schedule workloads on master nodes regardless of the number of workers;
1415
+ - \`when-no-workers\`: schedule workloads on master nodes only if there are no workers (default);
1416
+ - \`never\`: never schedule workloads on master nodes.`
1417
+ }
1418
+ }
1419
+ });
1247
1420
  var clusterInputs = {
1248
1421
  masters: {
1249
1422
  entity: serverEntity,
@@ -1275,7 +1448,7 @@ var existingCluster = defineUnit({
1275
1448
  * If not provided, will be automatically detected by querying the cluster nodes.
1276
1449
  */
1277
1450
  externalIps: {
1278
- schema: Type.Optional(Type.Array(Type.String())),
1451
+ schema: z.string().array().optional(),
1279
1452
  meta: {
1280
1453
  description: `The list of external IPs of the cluster nodes allowed to be used for external access.
1281
1454
 
@@ -1290,7 +1463,7 @@ var existingCluster = defineUnit({
1290
1463
  * - `never`: never use internal IPs as external IPs.
1291
1464
  */
1292
1465
  internalIpsPolicy: {
1293
- schema: Type.Default(internalIpsPolicySchema, "public"),
1466
+ schema: internalIpsPolicySchema.default("public"),
1294
1467
  meta: {
1295
1468
  description: `The policy for using internal IPs of the nodes as external IPs.
1296
1469
 
@@ -1303,7 +1476,7 @@ var existingCluster = defineUnit({
1303
1476
  * The extra quirks of the cluster to improve compatibility.
1304
1477
  */
1305
1478
  quirks: {
1306
- schema: Type.Optional(clusterQuirksSchema),
1479
+ schema: clusterQuirksSchema.optional(),
1307
1480
  meta: {
1308
1481
  description: `The extra quirks of the cluster to improve compatibility.`
1309
1482
  }
@@ -1316,7 +1489,7 @@ var existingCluster = defineUnit({
1316
1489
  * Will be available for all components using `cluster` output of this unit.
1317
1490
  */
1318
1491
  kubeconfig: {
1319
- schema: Type.Record(Type.String(), Type.Any()),
1492
+ schema: z.record(z.string(), z.unknown()),
1320
1493
  meta: {
1321
1494
  description: `The kubeconfig of the cluster to use for connecting to the cluster.
1322
1495
 
@@ -1326,9 +1499,9 @@ var existingCluster = defineUnit({
1326
1499
  },
1327
1500
  outputs: clusterOutputs,
1328
1501
  meta: {
1329
- displayName: "Existing Cluster",
1502
+ title: "Existing Cluster",
1330
1503
  description: "An existing Kubernetes cluster.",
1331
- primaryIcon: "devicon:kubernetes",
1504
+ icon: "devicon:kubernetes",
1332
1505
  category: "Kubernetes"
1333
1506
  },
1334
1507
  source: {
@@ -1347,7 +1520,7 @@ var clusterPatch = defineUnit({
1347
1520
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1348
1521
  */
1349
1522
  apiEndpoints: {
1350
- schema: Type.Default(Type.Array(Type.String()), []),
1523
+ schema: z.string().array().default([]),
1351
1524
  meta: {
1352
1525
  description: `The endpoints of the API server.
1353
1526
 
@@ -1363,7 +1536,7 @@ var clusterPatch = defineUnit({
1363
1536
  * - `replace`: replace the existing endpoints with the new ones.
1364
1537
  */
1365
1538
  apiEndpointsPatchMode: {
1366
- schema: Type.Default(arrayPatchModeSchema, "prepend"),
1539
+ schema: arrayPatchModeSchema.default("prepend"),
1367
1540
  meta: {
1368
1541
  description: `The mode to use for patching the API endpoints.
1369
1542
 
@@ -1379,7 +1552,7 @@ var clusterPatch = defineUnit({
1379
1552
  * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
1380
1553
  */
1381
1554
  endpoints: {
1382
- schema: Type.Default(Type.Array(Type.String()), []),
1555
+ schema: z.string().array().default([]),
1383
1556
  meta: {
1384
1557
  description: `The endpoints of the cluster nodes.
1385
1558
 
@@ -1395,7 +1568,7 @@ var clusterPatch = defineUnit({
1395
1568
  * - `replace`: replace the existing endpoints with the new ones.
1396
1569
  */
1397
1570
  endpointsPatchMode: {
1398
- schema: Type.Default(arrayPatchModeSchema, "prepend"),
1571
+ schema: arrayPatchModeSchema.default("prepend"),
1399
1572
  meta: {
1400
1573
  description: `The mode to use for patching the endpoints.
1401
1574
 
@@ -1419,9 +1592,9 @@ var clusterPatch = defineUnit({
1419
1592
  },
1420
1593
  outputs: clusterOutputs,
1421
1594
  meta: {
1422
- displayName: "Cluster Patch",
1595
+ title: "Cluster Patch",
1423
1596
  description: "Patches some properties of the cluster.",
1424
- primaryIcon: "devicon:kubernetes",
1597
+ icon: "devicon:kubernetes",
1425
1598
  secondaryIcon: "fluent:patch-20-filled",
1426
1599
  category: "Kubernetes"
1427
1600
  },
@@ -1442,9 +1615,9 @@ var clusterDns = defineUnit({
1442
1615
  },
1443
1616
  outputs: clusterOutputs,
1444
1617
  meta: {
1445
- displayName: "Cluster DNS",
1618
+ title: "Cluster DNS",
1446
1619
  description: "Creates DNS records for the cluster and updates endpoints.",
1447
- primaryIcon: "devicon:kubernetes",
1620
+ icon: "devicon:kubernetes",
1448
1621
  secondaryIcon: "mdi:dns",
1449
1622
  category: "Kubernetes"
1450
1623
  },
@@ -1455,12 +1628,12 @@ var clusterDns = defineUnit({
1455
1628
  });
1456
1629
  var gatewayEntity = defineEntity({
1457
1630
  type: "k8s.gateway",
1458
- schema: Type.Object({
1459
- clusterId: Type.String(),
1460
- gatewayClassName: Type.String(),
1461
- httpListenerPort: Type.Number(),
1462
- httpsListenerPort: Type.Number(),
1463
- endpoints: Type.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()
1464
1637
  }),
1465
1638
  meta: {
1466
1639
  color: "#4CAF50"
@@ -1468,9 +1641,9 @@ var gatewayEntity = defineEntity({
1468
1641
  });
1469
1642
  var tlsIssuerEntity = defineEntity({
1470
1643
  type: "k8s.tls-issuer",
1471
- schema: Type.Object({
1472
- clusterId: Type.String(),
1473
- clusterIssuerName: Type.String()
1644
+ schema: z.object({
1645
+ clusterId: z.string(),
1646
+ clusterIssuerName: z.string()
1474
1647
  }),
1475
1648
  meta: {
1476
1649
  color: "#f06292"
@@ -1478,11 +1651,11 @@ var tlsIssuerEntity = defineEntity({
1478
1651
  });
1479
1652
  var accessPointEntity = defineEntity({
1480
1653
  type: "k8s.access-point",
1481
- schema: Type.Object({
1482
- clusterId: Type.String(),
1654
+ schema: z.object({
1655
+ clusterId: z.string(),
1483
1656
  gateway: gatewayEntity.schema,
1484
1657
  tlsIssuer: tlsIssuerEntity.schema,
1485
- dnsProviders: Type.Array(providerEntity.schema)
1658
+ dnsProviders: providerEntity.schema.array()
1486
1659
  }),
1487
1660
  meta: {
1488
1661
  color: "#F57F17"
@@ -1502,9 +1675,9 @@ var accessPoint = defineUnit({
1502
1675
  accessPoint: accessPointEntity
1503
1676
  },
1504
1677
  meta: {
1505
- displayName: "Access Point",
1678
+ title: "Access Point",
1506
1679
  description: "An access point which can be used to connect to services.",
1507
- primaryIcon: "mdi:access-point",
1680
+ icon: "mdi:access-point",
1508
1681
  category: "Kubernetes"
1509
1682
  },
1510
1683
  source: {
@@ -1521,9 +1694,9 @@ var certManager = defineUnit({
1521
1694
  k8sCluster: clusterEntity2
1522
1695
  },
1523
1696
  meta: {
1524
- displayName: "Cert Manager",
1697
+ title: "Cert Manager",
1525
1698
  description: "A certificate manager for managing TLS certificates.",
1526
- primaryIcon: "simple-icons:letsencrypt",
1699
+ icon: "simple-icons:letsencrypt",
1527
1700
  category: "Kubernetes"
1528
1701
  },
1529
1702
  source: {
@@ -1540,7 +1713,7 @@ var dns01TlsIssuer = defineUnit({
1540
1713
  * If not provided, will use all domains passed to the DNS providers.
1541
1714
  */
1542
1715
  domains: {
1543
- schema: Type.Optional(Type.Array(Type.String())),
1716
+ schema: z.string().array().optional(),
1544
1717
  meta: {
1545
1718
  description: `The top-level domains to filter the DNS01 challenge for.
1546
1719
 
@@ -1559,9 +1732,9 @@ var dns01TlsIssuer = defineUnit({
1559
1732
  tlsIssuer: tlsIssuerEntity
1560
1733
  },
1561
1734
  meta: {
1562
- displayName: "DNS01 Issuer",
1735
+ title: "DNS01 Issuer",
1563
1736
  description: "A TLS issuer for issuing certificate using DNS01 challenge.",
1564
- primaryIcon: "mdi:certificate",
1737
+ icon: "mdi:certificate",
1565
1738
  category: "Kubernetes"
1566
1739
  },
1567
1740
  source: {
@@ -1571,10 +1744,10 @@ var dns01TlsIssuer = defineUnit({
1571
1744
  });
1572
1745
  var deploymentEntity = defineEntity({
1573
1746
  type: "k8s.deployment",
1574
- schema: Type.Object({
1575
- type: Type.Literal("k8s.deployment"),
1576
- ...resourceSchema.properties,
1577
- service: Type.Optional(serviceEntity.schema)
1747
+ schema: z.object({
1748
+ type: z.literal("k8s.deployment"),
1749
+ ...resourceSchema.shape,
1750
+ service: serviceEntity.schema.optional()
1578
1751
  }),
1579
1752
  meta: {
1580
1753
  color: "#4CAF50"
@@ -1582,9 +1755,9 @@ var deploymentEntity = defineEntity({
1582
1755
  });
1583
1756
  var statefulSetEntity = defineEntity({
1584
1757
  type: "k8s.stateful-set",
1585
- schema: Type.Object({
1586
- type: Type.Literal("k8s.stateful-set"),
1587
- ...resourceSchema.properties,
1758
+ schema: z.object({
1759
+ type: z.literal("k8s.stateful-set"),
1760
+ ...resourceSchema.shape,
1588
1761
  service: serviceEntity.schema
1589
1762
  }),
1590
1763
  meta: {
@@ -1593,16 +1766,16 @@ var statefulSetEntity = defineEntity({
1593
1766
  });
1594
1767
  var exposableWorkloadEntity = defineEntity({
1595
1768
  type: "k8s.exposable-workload",
1596
- schema: Type.Union([deploymentEntity.schema, statefulSetEntity.schema]),
1769
+ schema: z.union([deploymentEntity.schema, statefulSetEntity.schema]),
1597
1770
  meta: {
1598
1771
  color: "#4CAF50"
1599
1772
  }
1600
1773
  });
1601
1774
  var persistentVolumeClaimEntity = defineEntity({
1602
1775
  type: "k8s.persistent-volume-claim",
1603
- schema: Type.Object({
1604
- type: Type.Literal("k8s.persistent-volume-claim"),
1605
- ...resourceSchema.properties
1776
+ schema: z.object({
1777
+ type: z.literal("k8s.persistent-volume-claim"),
1778
+ ...resourceSchema.shape
1606
1779
  }),
1607
1780
  meta: {
1608
1781
  color: "#FFC107"
@@ -1610,8 +1783,8 @@ var persistentVolumeClaimEntity = defineEntity({
1610
1783
  });
1611
1784
  var interfaceEntity = defineEntity({
1612
1785
  type: "k8s.interface",
1613
- schema: Type.Object({
1614
- name: Type.String(),
1786
+ schema: z.object({
1787
+ name: z.string(),
1615
1788
  workload: exposableWorkloadEntity.schema
1616
1789
  }),
1617
1790
  meta: {
@@ -1628,9 +1801,9 @@ var gatewayApi = defineUnit({
1628
1801
  k8sCluster: clusterEntity2
1629
1802
  },
1630
1803
  meta: {
1631
- displayName: "Gateway API",
1804
+ title: "Gateway API",
1632
1805
  description: "Installs the Gateway API CRDs to the cluster.",
1633
- primaryIcon: "devicon:kubernetes",
1806
+ icon: "devicon:kubernetes",
1634
1807
  secondaryIcon: "mdi:api",
1635
1808
  secondaryIconColor: "#4CAF50",
1636
1809
  category: "Kubernetes"
@@ -1651,7 +1824,7 @@ var cilium = defineUnit({
1651
1824
  * By default, is `false`.
1652
1825
  */
1653
1826
  allowForbiddenFqdnResolution: {
1654
- schema: Type.Default(Type.Boolean(), false),
1827
+ schema: z.boolean().default(false),
1655
1828
  meta: {
1656
1829
  description: `If set to \`true\`, the generated network policy will allow
1657
1830
  all DNS queries to be resolved, even if they are
@@ -1668,9 +1841,9 @@ var cilium = defineUnit({
1668
1841
  k8sCluster: clusterEntity2
1669
1842
  },
1670
1843
  meta: {
1671
- displayName: "Cilium",
1844
+ title: "Cilium",
1672
1845
  description: "The Cilium CNI deployed on Kubernetes.",
1673
- primaryIcon: "simple-icons:cilium",
1846
+ icon: "simple-icons:cilium",
1674
1847
  secondaryIcon: "devicon:kubernetes",
1675
1848
  category: "Kubernetes"
1676
1849
  },
@@ -1679,20 +1852,20 @@ var cilium = defineUnit({
1679
1852
  path: "unit"
1680
1853
  }
1681
1854
  });
1682
- var monitorWorkerResourceGroupSchema = Type.Object({
1683
- type: Type.StringEnum(["deployment", "statefulset", "pod", "service"]),
1684
- namespace: Type.String(),
1685
- names: Type.Optional(Type.Array(Type.String()))
1855
+ var monitorWorkerResourceGroupSchema = z.object({
1856
+ type: z.enum(["deployment", "statefulset", "pod", "service"]),
1857
+ namespace: z.string(),
1858
+ names: z.string().array().optional()
1686
1859
  });
1687
- var monitorWorkerParamsSchema = Type.Object({
1860
+ var monitorWorkerParamsSchema = z.object({
1688
1861
  /**
1689
1862
  * The ID of the secret containing the kubeconfig of the cluster.
1690
1863
  */
1691
- kubeconfigSecretId: Type.String(),
1864
+ kubeconfigSecretId: z.string().meta({ title: camelCaseToHumanReadable("kubeconfigSecretId"), description: `The ID of the secret containing the kubeconfig of the cluster.` }),
1692
1865
  /**
1693
1866
  * The resources to monitor in the cluster.
1694
1867
  */
1695
- resourceGroups: Type.Array(monitorWorkerResourceGroupSchema)
1868
+ resourceGroups: monitorWorkerResourceGroupSchema.array().meta({ title: camelCaseToHumanReadable("resourceGroups"), description: `The resources to monitor in the cluster.` })
1696
1869
  });
1697
1870
 
1698
1871
  // src/talos.ts
@@ -1705,16 +1878,16 @@ __export(talos_exports, {
1705
1878
  });
1706
1879
  var clusterEntity3 = defineEntity({
1707
1880
  type: "talos.cluster",
1708
- schema: Type.Object({
1709
- clientConfiguration: Type.String(),
1710
- machineSecrets: Type.String()
1881
+ schema: z.object({
1882
+ clientConfiguration: z.string(),
1883
+ machineSecrets: z.string()
1711
1884
  }),
1712
1885
  meta: {
1713
1886
  color: "#2d2d2d"
1714
1887
  }
1715
1888
  });
1716
- var cniSchema2 = Type.StringEnum(["none", "cilium", "flannel"]);
1717
- var csiSchema = Type.StringEnum(["none", "local-path-provisioner"]);
1889
+ var cniSchema2 = z.enum(["none", "cilium", "flannel"]);
1890
+ var csiSchema = z.enum(["none", "local-path-provisioner"]);
1718
1891
  var cluster = defineUnit({
1719
1892
  type: "talos.cluster",
1720
1893
  args: {
@@ -1725,7 +1898,7 @@ var cluster = defineUnit({
1725
1898
  * By default, the name of the instance is used.
1726
1899
  */
1727
1900
  clusterName: {
1728
- schema: Type.Optional(Type.String()),
1901
+ schema: z.string().optional(),
1729
1902
  meta: {
1730
1903
  description: `The name of the cluster.
1731
1904
 
@@ -1743,7 +1916,7 @@ var cluster = defineUnit({
1743
1916
  * The "cilium" CNI plugin is recommended to cover advanced network policies like FQDNs.
1744
1917
  */
1745
1918
  cni: {
1746
- schema: Type.Default(cniSchema2, "cilium"),
1919
+ schema: cniSchema2.default("cilium"),
1747
1920
  meta: {
1748
1921
  description: `The CNI plugin to use.
1749
1922
 
@@ -1763,7 +1936,7 @@ var cluster = defineUnit({
1763
1936
  * - "none" (disable CSI, must be installed manually if needed)
1764
1937
  */
1765
1938
  csi: {
1766
- schema: Type.Default(csiSchema, "local-path-provisioner"),
1939
+ schema: csiSchema.default("local-path-provisioner"),
1767
1940
  meta: {
1768
1941
  description: `The CSI plugin to use.
1769
1942
 
@@ -1777,7 +1950,7 @@ var cluster = defineUnit({
1777
1950
  * It will be applied to all nodes.
1778
1951
  */
1779
1952
  sharedConfigPatch: {
1780
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
1953
+ schema: z.record(z.string(), z.any()).optional(),
1781
1954
  meta: {
1782
1955
  description: `The shared configuration patch.
1783
1956
  It will be applied to all nodes.`
@@ -1788,7 +1961,7 @@ var cluster = defineUnit({
1788
1961
  * It will be applied to all master nodes.
1789
1962
  */
1790
1963
  masterConfigPatch: {
1791
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
1964
+ schema: z.record(z.string(), z.any()).optional(),
1792
1965
  meta: {
1793
1966
  description: `The master configuration patch.
1794
1967
  It will be applied to all master nodes.`
@@ -1799,7 +1972,7 @@ var cluster = defineUnit({
1799
1972
  * It will be applied to all worker nodes.
1800
1973
  */
1801
1974
  workerConfigPatch: {
1802
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
1975
+ schema: z.record(z.string(), z.any()).optional(),
1803
1976
  meta: {
1804
1977
  description: `The worker configuration patch.
1805
1978
  It will be applied to all worker nodes.`
@@ -1813,7 +1986,7 @@ var cluster = defineUnit({
1813
1986
  * By default, this option is set to true.
1814
1987
  */
1815
1988
  enableTunDevicePlugin: {
1816
- schema: Type.Default(Type.Boolean(), true),
1989
+ schema: z.boolean().default(true),
1817
1990
  meta: {
1818
1991
  description: `Whether to enable the Tun device plugin.
1819
1992
 
@@ -1829,11 +2002,11 @@ var cluster = defineUnit({
1829
2002
  talosCluster: clusterEntity3
1830
2003
  },
1831
2004
  meta: {
1832
- displayName: "Talos Cluster",
2005
+ title: "Talos Cluster",
1833
2006
  description: "A Kubernetes cluster managed by Talos.",
1834
2007
  category: "Talos",
1835
2008
  color: "#2d2d2d",
1836
- primaryIcon: "simple-icons:talos",
2009
+ icon: "simple-icons:talos",
1837
2010
  secondaryIcon: "devicon:kubernetes"
1838
2011
  },
1839
2012
  source: {
@@ -1858,25 +2031,25 @@ __export(wireguard_exports, {
1858
2031
  peerEntity: () => peerEntity,
1859
2032
  peerPatch: () => peerPatch
1860
2033
  });
1861
- var backendSchema = Type.StringEnum(["wireguard", "amneziawg"]);
2034
+ var backendSchema = z.enum(["wireguard", "amneziawg"]);
1862
2035
  var networkEntity = defineEntity({
1863
2036
  type: "wireguard.network",
1864
- schema: Type.Object({
2037
+ schema: z.object({
1865
2038
  backend: backendSchema,
1866
- ipv6: Type.Boolean()
2039
+ ipv6: z.boolean()
1867
2040
  })
1868
2041
  });
1869
- var nodeExposePolicySchema = Type.StringEnum(["always", "when-has-endpoint", "never"]);
2042
+ var nodeExposePolicySchema = z.enum(["always", "when-has-endpoint", "never"]);
1870
2043
  var peerEntity = defineEntity({
1871
2044
  type: "wireguard.peer",
1872
- schema: Type.Object({
1873
- name: Type.String(),
1874
- network: Type.Optional(networkEntity.schema),
1875
- publicKey: Type.String(),
1876
- address: Type.Optional(Type.String()),
1877
- allowedIps: Type.Array(Type.String()),
1878
- endpoints: Type.Array(l4EndpointEntity.schema),
1879
- allowedEndpoints: Type.Array(Type.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(),
1880
2053
  /**
1881
2054
  * The pre-shared key of the WireGuard peer.
1882
2055
  *
@@ -1884,16 +2057,22 @@ var peerEntity = defineEntity({
1884
2057
  *
1885
2058
  * Will be ignored if both peers have `presharedKeyPart` set.
1886
2059
  */
1887
- presharedKey: Type.Optional(Type.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.` }),
1888
2065
  /**
1889
2066
  * The pre-shared key part of the WireGuard peer.
1890
2067
  *
1891
2068
  * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as XOR of the two parts.
1892
2069
  */
1893
- presharedKeyPart: Type.Optional(Type.String()),
1894
- excludedIps: Type.Array(Type.String()),
1895
- dns: Type.Array(Type.String()),
1896
- listenPort: Type.Optional(Type.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()
1897
2076
  }),
1898
2077
  meta: {
1899
2078
  color: "#673AB7"
@@ -1901,9 +2080,9 @@ var peerEntity = defineEntity({
1901
2080
  });
1902
2081
  var identityEntity = defineEntity({
1903
2082
  type: "wireguard.identity",
1904
- schema: Type.Object({
2083
+ schema: z.object({
1905
2084
  peer: peerEntity.schema,
1906
- privateKey: Type.String()
2085
+ privateKey: z.string()
1907
2086
  }),
1908
2087
  meta: {
1909
2088
  color: "#F44336"
@@ -1922,7 +2101,7 @@ var network = defineUnit({
1922
2101
  * By default, the `wireguard` backend is used.
1923
2102
  */
1924
2103
  backend: {
1925
- schema: Type.Default(backendSchema, "wireguard"),
2104
+ schema: backendSchema.default("wireguard"),
1926
2105
  meta: {
1927
2106
  description: `The backend to use for the WireGuard network.
1928
2107
 
@@ -1939,7 +2118,7 @@ var network = defineUnit({
1939
2118
  * By default, IPv6 support is disabled.
1940
2119
  */
1941
2120
  ipv6: {
1942
- schema: Type.Default(Type.Boolean(), false),
2121
+ schema: z.boolean().default(false),
1943
2122
  meta: {
1944
2123
  description: `The option to enable IPv6 support in the network.
1945
2124
 
@@ -1952,8 +2131,8 @@ var network = defineUnit({
1952
2131
  },
1953
2132
  meta: {
1954
2133
  description: "The WireGuard network with some shared configuration.",
1955
- primaryIcon: "simple-icons:wireguard",
1956
- primaryIconColor: "#88171a",
2134
+ icon: "simple-icons:wireguard",
2135
+ iconColor: "#88171a",
1957
2136
  secondaryIcon: "mdi:local-area-network-connect",
1958
2137
  category: "VPN"
1959
2138
  },
@@ -1968,19 +2147,19 @@ var sharedPeerArgs = {
1968
2147
  *
1969
2148
  * If not provided, the peer will be named after the unit.
1970
2149
  */
1971
- peerName: Type.Optional(Type.String()),
2150
+ peerName: z.string().optional(),
1972
2151
  /**
1973
2152
  * The address of the WireGuard interface.
1974
2153
  *
1975
2154
  * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
1976
2155
  */
1977
- address: Type.Optional(Type.String()),
2156
+ address: z.string().optional(),
1978
2157
  /**
1979
2158
  * The convenience option to set `allowedIps` to `0.0.0.0/0, ::/0`.
1980
2159
  *
1981
2160
  * Will be merged with the `allowedIps` if provided.
1982
2161
  */
1983
- exitNode: Type.Default(Type.Boolean(), false),
2162
+ exitNode: z.boolean().default(false),
1984
2163
  /**
1985
2164
  * The list of IP ranges to exclude from the tunnel.
1986
2165
  *
@@ -1990,7 +2169,7 @@ var sharedPeerArgs = {
1990
2169
  * - Instead, the node will setup extra direct routes to these IPs via default gateway.
1991
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.
1992
2171
  */
1993
- excludedIps: Type.Default(Type.Array(Type.String()), []),
2172
+ excludedIps: z.string().array().default([]),
1994
2173
  /**
1995
2174
  * The convenience option to exclude private IPs from the tunnel.
1996
2175
  *
@@ -2007,33 +2186,33 @@ var sharedPeerArgs = {
2007
2186
  *
2008
2187
  * Will be merged with `excludedIps` if provided.
2009
2188
  */
2010
- excludePrivateIps: Type.Default(Type.Boolean(), false),
2189
+ excludePrivateIps: z.boolean().default(false),
2011
2190
  /**
2012
2191
  * The endpoints of the WireGuard peer.
2013
2192
  */
2014
- endpoints: Type.Default(Type.Array(Type.String()), []),
2193
+ endpoints: z.string().array().default([]),
2015
2194
  /**
2016
2195
  * The allowed endpoints of the WireGuard peer.
2017
2196
  *
2018
2197
  * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
2019
2198
  */
2020
- allowedEndpoints: Type.Default(Type.Array(Type.String()), []),
2199
+ allowedEndpoints: z.string().array().default([]),
2021
2200
  /**
2022
2201
  * The DNS servers that should be used by the interface connected to the WireGuard peer.
2023
2202
  *
2024
2203
  * If multiple peers define DNS servers, the node will merge them into a single list (but this is discouraged).
2025
2204
  */
2026
- dns: Type.Default(Type.Array(Type.String()), []),
2205
+ dns: z.string().array().default([]),
2027
2206
  /**
2028
2207
  * The convenience option to include the DNS servers to the allowed IPs.
2029
2208
  *
2030
2209
  * By default, is `true`.
2031
2210
  */
2032
- includeDns: Type.Default(Type.Boolean(), true),
2211
+ includeDns: z.boolean().default(true),
2033
2212
  /**
2034
2213
  * The port to listen on.
2035
2214
  */
2036
- listenPort: Type.Optional(Type.Number())
2215
+ listenPort: z.number().optional()
2037
2216
  };
2038
2217
  var sharedPeerInputs = {
2039
2218
  /**
@@ -2106,7 +2285,7 @@ var peer = defineUnit({
2106
2285
  * The public key of the WireGuard peer.
2107
2286
  */
2108
2287
  publicKey: {
2109
- schema: Type.String(),
2288
+ schema: z.string(),
2110
2289
  meta: {
2111
2290
  description: `The public key of the WireGuard peer.`
2112
2291
  }
@@ -2117,7 +2296,7 @@ var peer = defineUnit({
2117
2296
  * The pre-shared key which should be used for the peer.
2118
2297
  */
2119
2298
  presharedKey: {
2120
- schema: Type.Optional(Type.String()),
2299
+ schema: z.string().optional(),
2121
2300
  meta: {
2122
2301
  description: `The pre-shared key which should be used for the peer.`
2123
2302
  }
@@ -2127,8 +2306,8 @@ var peer = defineUnit({
2127
2306
  outputs: sharedPeerOutputs,
2128
2307
  meta: {
2129
2308
  description: "The WireGuard peer with the public key.",
2130
- primaryIcon: "simple-icons:wireguard",
2131
- primaryIconColor: "#88171a",
2309
+ icon: "simple-icons:wireguard",
2310
+ iconColor: "#88171a",
2132
2311
  secondaryIcon: "mdi:badge-account-horizontal",
2133
2312
  category: "VPN"
2134
2313
  },
@@ -2144,7 +2323,7 @@ var peerPatch = defineUnit({
2144
2323
  * The endpoints of the WireGuard peer.
2145
2324
  */
2146
2325
  endpoints: {
2147
- schema: Type.Default(Type.Array(Type.String()), []),
2326
+ schema: z.string().array().default([]),
2148
2327
  meta: {
2149
2328
  description: `The endpoints of the WireGuard peer.`
2150
2329
  }
@@ -2156,7 +2335,7 @@ var peerPatch = defineUnit({
2156
2335
  * - `replace`: replace the existing endpoints with the new ones.
2157
2336
  */
2158
2337
  endpointsPatchMode: {
2159
- schema: Type.Default(arrayPatchModeSchema, "prepend"),
2338
+ schema: arrayPatchModeSchema.default("prepend"),
2160
2339
  meta: {
2161
2340
  description: `The mode to use for patching the endpoints.
2162
2341
 
@@ -2170,7 +2349,7 @@ var peerPatch = defineUnit({
2170
2349
  * The non `hostname` endpoints will be added to the `allowedIps` of the peer.
2171
2350
  */
2172
2351
  allowedEndpoints: {
2173
- schema: Type.Default(Type.Array(Type.String()), []),
2352
+ schema: z.string().array().default([]),
2174
2353
  meta: {
2175
2354
  description: `The allowed endpoints of the WireGuard peer.
2176
2355
 
@@ -2184,7 +2363,7 @@ var peerPatch = defineUnit({
2184
2363
  * - `replace`: replace the existing endpoints with the new ones.
2185
2364
  */
2186
2365
  allowedEndpointsPatchMode: {
2187
- schema: Type.Default(arrayPatchModeSchema, "prepend"),
2366
+ schema: arrayPatchModeSchema.default("prepend"),
2188
2367
  meta: {
2189
2368
  description: `The mode to use for patching the allowed endpoints.
2190
2369
 
@@ -2207,10 +2386,10 @@ var peerPatch = defineUnit({
2207
2386
  }
2208
2387
  },
2209
2388
  meta: {
2210
- displayName: "WireGuard Peer Patch",
2389
+ title: "WireGuard Peer Patch",
2211
2390
  description: "Patches some properties of the WireGuard peer.",
2212
- primaryIcon: "simple-icons:wireguard",
2213
- primaryIconColor: "#88171a",
2391
+ icon: "simple-icons:wireguard",
2392
+ iconColor: "#88171a",
2214
2393
  secondaryIcon: "mdi:badge-account-horizontal",
2215
2394
  category: "VPN"
2216
2395
  },
@@ -2229,7 +2408,7 @@ var identity = defineUnit({
2229
2408
  * Used by the implementation of the identity and to calculate the endpoint of the peer.
2230
2409
  */
2231
2410
  listenPort: {
2232
- schema: Type.Optional(Type.Number()),
2411
+ schema: z.number().optional(),
2233
2412
  meta: {
2234
2413
  description: `The port to listen on.
2235
2414
 
@@ -2244,7 +2423,7 @@ var identity = defineUnit({
2244
2423
  * Will take priority over all calculated endpoints and `l4Endpoint` input.
2245
2424
  */
2246
2425
  endpoints: {
2247
- schema: Type.Default(Type.Array(Type.String()), []),
2426
+ schema: z.string().array().default([]),
2248
2427
  meta: {
2249
2428
  description: `The endpoint of the WireGuard peer.
2250
2429
 
@@ -2261,7 +2440,7 @@ var identity = defineUnit({
2261
2440
  * If not provided, the key will be generated automatically.
2262
2441
  */
2263
2442
  privateKey: {
2264
- schema: Type.Optional(Type.String()),
2443
+ schema: z.string().optional(),
2265
2444
  meta: {
2266
2445
  description: `The private key of the WireGuard identity.
2267
2446
 
@@ -2274,7 +2453,7 @@ var identity = defineUnit({
2274
2453
  * Will be generated automatically if not provided.
2275
2454
  */
2276
2455
  presharedKeyPart: {
2277
- schema: Type.Optional(Type.String()),
2456
+ schema: z.string().optional(),
2278
2457
  meta: {
2279
2458
  description: `The part of the pre-shared of the WireGuard identity.
2280
2459
 
@@ -2289,8 +2468,8 @@ var identity = defineUnit({
2289
2468
  },
2290
2469
  meta: {
2291
2470
  description: "The WireGuard identity with the public key.",
2292
- primaryIcon: "simple-icons:wireguard",
2293
- primaryIconColor: "#88171a",
2471
+ icon: "simple-icons:wireguard",
2472
+ iconColor: "#88171a",
2294
2473
  secondaryIcon: "mdi:account",
2295
2474
  category: "VPN"
2296
2475
  },
@@ -2308,7 +2487,7 @@ var node = defineUnit({
2308
2487
  * By default, the name is `wg-${identity.name}`.
2309
2488
  */
2310
2489
  appName: {
2311
- schema: Type.Optional(Type.String()),
2490
+ schema: z.string().optional(),
2312
2491
  meta: {
2313
2492
  description: `The name of the namespace/deployment/statefulset where the WireGuard node will be deployed.
2314
2493
 
@@ -2319,7 +2498,7 @@ var node = defineUnit({
2319
2498
  * Whether to expose the WireGuard node to the outside world.
2320
2499
  */
2321
2500
  external: {
2322
- schema: Type.Default(Type.Boolean(), false),
2501
+ schema: z.boolean().default(false),
2323
2502
  meta: {
2324
2503
  description: `Whether to expose the WireGuard node to the outside world.`
2325
2504
  }
@@ -2334,7 +2513,7 @@ var node = defineUnit({
2334
2513
  * * By default, the `when-has-endpoint` policy is used.
2335
2514
  */
2336
2515
  exposePolicy: {
2337
- schema: Type.Default(nodeExposePolicySchema, "when-has-endpoint"),
2516
+ schema: nodeExposePolicySchema.default("when-has-endpoint"),
2338
2517
  meta: {
2339
2518
  description: `The policy to use for exposing the WireGuard node.
2340
2519
 
@@ -2351,7 +2530,7 @@ var node = defineUnit({
2351
2530
  * Will override any overlapping fields.
2352
2531
  */
2353
2532
  containerSpec: {
2354
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
2533
+ schema: z.record(z.string(), z.unknown()).optional(),
2355
2534
  meta: {
2356
2535
  description: `The extra specification of the container which runs the WireGuard node.
2357
2536
 
@@ -2367,7 +2546,7 @@ var node = defineUnit({
2367
2546
  * Useful for peer isolation where you want to prevent cross-peer communication.
2368
2547
  */
2369
2548
  forwardRestrictedIps: {
2370
- schema: Type.Default(Type.Array(Type.String()), []),
2549
+ schema: z.string().array().default([]),
2371
2550
  meta: {
2372
2551
  description: `List of CIDR blocks that should be blocked from forwarding through this WireGuard node.
2373
2552
 
@@ -2412,8 +2591,8 @@ var node = defineUnit({
2412
2591
  },
2413
2592
  meta: {
2414
2593
  description: "The WireGuard node running on the Kubernetes.",
2415
- primaryIcon: "simple-icons:wireguard",
2416
- primaryIconColor: "#88171a",
2594
+ icon: "simple-icons:wireguard",
2595
+ iconColor: "#88171a",
2417
2596
  secondaryIcon: "mdi:server",
2418
2597
  category: "VPN"
2419
2598
  },
@@ -2431,7 +2610,7 @@ var config = defineUnit({
2431
2610
  * If not provided, the config will not respect `excludedIps`.
2432
2611
  */
2433
2612
  defaultInterface: {
2434
- schema: Type.Optional(Type.String()),
2613
+ schema: z.string().optional(),
2435
2614
  meta: {
2436
2615
  description: `The name of the "default" interface where non-tunneled traffic should go.
2437
2616
 
@@ -2448,10 +2627,10 @@ var config = defineUnit({
2448
2627
  }
2449
2628
  },
2450
2629
  meta: {
2451
- displayName: "WireGuard Config",
2630
+ title: "WireGuard Config",
2452
2631
  description: "Just the WireGuard configuration for the identity and peers.",
2453
- primaryIcon: "simple-icons:wireguard",
2454
- primaryIconColor: "#88171a",
2632
+ icon: "simple-icons:wireguard",
2633
+ iconColor: "#88171a",
2455
2634
  secondaryIcon: "mdi:settings",
2456
2635
  category: "VPN"
2457
2636
  },
@@ -2475,10 +2654,10 @@ var configBundle = defineUnit({
2475
2654
  }
2476
2655
  },
2477
2656
  meta: {
2478
- displayName: "WireGuard Config Bundle",
2657
+ title: "WireGuard Config Bundle",
2479
2658
  description: "The WireGuard configuration bundle for the identity and peers.",
2480
- primaryIcon: "simple-icons:wireguard",
2481
- primaryIconColor: "#88171a",
2659
+ icon: "simple-icons:wireguard",
2660
+ iconColor: "#88171a",
2482
2661
  secondaryIcon: "mdi:folder-settings-variant",
2483
2662
  category: "VPN"
2484
2663
  },
@@ -2526,12 +2705,12 @@ __export(restic_exports, {
2526
2705
  });
2527
2706
  var repositoryEntity = defineEntity({
2528
2707
  type: "restic.repository",
2529
- schema: Type.Object({
2530
- remoteEndpoints: Type.Array(Type.Union([l3EndpointEntity.schema, l4EndpointEntity.schema])),
2531
- type: Type.Literal("rclone"),
2532
- rcloneConfig: Type.String(),
2533
- remoteName: Type.String(),
2534
- pathPattern: Type.String()
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()
2535
2714
  }),
2536
2715
  meta: {
2537
2716
  color: "#e56901"
@@ -2540,7 +2719,7 @@ var repositoryEntity = defineEntity({
2540
2719
  var repo = defineUnit({
2541
2720
  type: "restic.repo",
2542
2721
  args: {
2543
- remoteEndpoints: Type.Default(Type.Array(Type.String()), []),
2722
+ remoteEndpoints: z.string().array().default([]),
2544
2723
  /**
2545
2724
  * The pattern for the path where backups will be stored for the specific application.
2546
2725
  *
@@ -2553,7 +2732,7 @@ var repo = defineUnit({
2553
2732
  * By default, the path pattern is `backups/$clusterName/$appName`.
2554
2733
  */
2555
2734
  pathPattern: {
2556
- schema: Type.Default(Type.String(), "backups/$clusterName/$appName"),
2735
+ schema: z.string().default("backups/$clusterName/$appName"),
2557
2736
  meta: {
2558
2737
  description: `The pattern for the path where backups will be stored for the specific application.
2559
2738
 
@@ -2568,7 +2747,7 @@ var repo = defineUnit({
2568
2747
  }
2569
2748
  },
2570
2749
  secrets: {
2571
- rcloneConfig: Type.String({ language: "ini" })
2750
+ rcloneConfig: z.string()
2572
2751
  },
2573
2752
  inputs: {
2574
2753
  remoteL3Endpoints: {
@@ -2586,10 +2765,10 @@ var repo = defineUnit({
2586
2765
  repo: repositoryEntity
2587
2766
  },
2588
2767
  meta: {
2589
- displayName: "Restic Repo",
2768
+ title: "Restic Repo",
2590
2769
  description: "Holds the configuration for a Restic repository and its remote storage.",
2591
- primaryIconColor: "#e56901",
2592
- primaryIcon: "material-symbols:backup",
2770
+ iconColor: "#e56901",
2771
+ icon: "material-symbols:backup",
2593
2772
  category: "Infrastructure"
2594
2773
  },
2595
2774
  source: {
@@ -2601,24 +2780,24 @@ var repo = defineUnit({
2601
2780
  // src/apps/shared.ts
2602
2781
  var extraArgsDefinitions = {
2603
2782
  fqdn: {
2604
- schema: Type.String()
2783
+ schema: z.string()
2605
2784
  },
2606
2785
  endpoints: {
2607
- schema: Type.Array(Type.String()),
2786
+ schema: z.string().array(),
2608
2787
  required: false
2609
2788
  },
2610
2789
  external: {
2611
- schema: Type.Boolean(),
2790
+ schema: z.boolean(),
2612
2791
  required: false
2613
2792
  }
2614
2793
  };
2615
2794
  var extraSecretsDefinitions = {
2616
2795
  rootPassword: {
2617
- schema: Type.String(),
2796
+ schema: z.string(),
2618
2797
  required: false
2619
2798
  },
2620
2799
  backupPassword: {
2621
- schema: Type.String(),
2800
+ schema: z.string(),
2622
2801
  required: false
2623
2802
  }
2624
2803
  };
@@ -2645,7 +2824,7 @@ var extraInputDefinitions = {
2645
2824
  };
2646
2825
  function createArgs2(defaultAppName, extraArgs) {
2647
2826
  const base = {
2648
- appName: Type.Default(Type.String(), defaultAppName)
2827
+ appName: z.string().default(defaultAppName)
2649
2828
  };
2650
2829
  const dynamicArgs = {};
2651
2830
  if (Array.isArray(extraArgs)) {
@@ -2730,10 +2909,10 @@ function createSource(path) {
2730
2909
  path
2731
2910
  };
2732
2911
  }
2733
- var databaseSchema = Type.Object({
2734
- endpoints: Type.Array(l4EndpointEntity.schema),
2735
- service: Type.Optional(serviceEntity.schema),
2736
- rootPassword: Type.String()
2912
+ var databaseSchema = z.object({
2913
+ endpoints: l4EndpointEntity.schema.array(),
2914
+ service: serviceEntity.schema.optional(),
2915
+ rootPassword: z.string()
2737
2916
  });
2738
2917
 
2739
2918
  // src/apps/mariadb.ts
@@ -2758,9 +2937,9 @@ var mariadb = defineUnit({
2758
2937
  }
2759
2938
  },
2760
2939
  meta: {
2761
- displayName: "MariaDB",
2940
+ title: "MariaDB",
2762
2941
  description: "The MariaDB database deployed on Kubernetes.",
2763
- primaryIcon: "simple-icons:mariadb",
2942
+ icon: "simple-icons:mariadb",
2764
2943
  secondaryIcon: "mdi:database",
2765
2944
  category: "Databases"
2766
2945
  },
@@ -2768,22 +2947,22 @@ var mariadb = defineUnit({
2768
2947
  });
2769
2948
  extraInputDefinitions.mariadb = {
2770
2949
  entity: mariadbEntity,
2771
- displayName: "MariaDB"
2950
+ title: "MariaDB"
2772
2951
  };
2773
2952
  var mariadbDatabase = defineUnit({
2774
2953
  type: "apps.mariadb.database",
2775
2954
  args: {
2776
- database: Type.Optional(Type.String()),
2777
- username: Type.Optional(Type.String())
2955
+ database: z.string().optional(),
2956
+ username: z.string().optional()
2778
2957
  },
2779
2958
  inputs: createInputs(["mariadb"]),
2780
2959
  secrets: {
2781
- password: Type.Optional(Type.String())
2960
+ password: z.string().optional()
2782
2961
  },
2783
2962
  meta: {
2784
- displayName: "MariaDB Database",
2963
+ title: "MariaDB Database",
2785
2964
  description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
2786
- primaryIcon: "simple-icons:mariadb",
2965
+ icon: "simple-icons:mariadb",
2787
2966
  secondaryIcon: "mdi:database-plus",
2788
2967
  category: "Databases"
2789
2968
  },
@@ -2810,9 +2989,9 @@ var postgresql = defineUnit({
2810
2989
  }
2811
2990
  },
2812
2991
  meta: {
2813
- displayName: "PostgreSQL",
2992
+ title: "PostgreSQL",
2814
2993
  description: "The PostgreSQL database deployed on Kubernetes.",
2815
- primaryIcon: "simple-icons:postgresql",
2994
+ icon: "simple-icons:postgresql",
2816
2995
  secondaryIcon: "mdi:database",
2817
2996
  category: "Databases"
2818
2997
  },
@@ -2820,22 +2999,22 @@ var postgresql = defineUnit({
2820
2999
  });
2821
3000
  extraInputDefinitions.postgresql = {
2822
3001
  entity: postgresqlEntity,
2823
- displayName: "PostgreSQL"
3002
+ title: "PostgreSQL"
2824
3003
  };
2825
3004
  var postgresqlDatabase = defineUnit({
2826
3005
  type: "apps.postgresql.database",
2827
3006
  args: {
2828
- database: Type.Optional(Type.String()),
2829
- username: Type.Optional(Type.String())
3007
+ database: z.string().optional(),
3008
+ username: z.string().optional()
2830
3009
  },
2831
3010
  secrets: {
2832
- password: Type.Optional(Type.String())
3011
+ password: z.string().optional()
2833
3012
  },
2834
3013
  inputs: createInputs(["postgresql"]),
2835
3014
  meta: {
2836
- displayName: "PostgreSQL Database",
3015
+ title: "PostgreSQL Database",
2837
3016
  description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
2838
- primaryIcon: "simple-icons:postgresql",
3017
+ icon: "simple-icons:postgresql",
2839
3018
  secondaryIcon: "mdi:database-plus",
2840
3019
  category: "Databases"
2841
3020
  },
@@ -2845,13 +3024,13 @@ var vaultwarden = defineUnit({
2845
3024
  type: "apps.vaultwarden",
2846
3025
  args: createArgs2("vaultwarden", ["fqdn"]),
2847
3026
  secrets: {
2848
- mariadbPassword: Type.Optional(Type.String())
3027
+ mariadbPassword: z.string().optional()
2849
3028
  },
2850
3029
  inputs: createInputs(["accessPoint", "mariadb"]),
2851
3030
  meta: {
2852
- displayName: "Vaultwarden",
3031
+ title: "Vaultwarden",
2853
3032
  description: "The Vaultwarden password manager deployed on Kubernetes.",
2854
- primaryIcon: "simple-icons:vaultwarden",
3033
+ icon: "simple-icons:vaultwarden",
2855
3034
  category: "Security"
2856
3035
  },
2857
3036
  source: createSource("vaultwarden")
@@ -2877,9 +3056,9 @@ var mongodb = defineUnit({
2877
3056
  }
2878
3057
  },
2879
3058
  meta: {
2880
- displayName: "MongoDB",
3059
+ title: "MongoDB",
2881
3060
  description: "The MongoDB instance deployed on Kubernetes.",
2882
- primaryIcon: "simple-icons:mongodb",
3061
+ icon: "simple-icons:mongodb",
2883
3062
  secondaryIcon: "mdi:database",
2884
3063
  category: "Databases"
2885
3064
  },
@@ -2887,28 +3066,28 @@ var mongodb = defineUnit({
2887
3066
  });
2888
3067
  extraInputDefinitions.mongodb = {
2889
3068
  entity: mongodbEntity,
2890
- displayName: "MongoDB"
3069
+ title: "MongoDB"
2891
3070
  };
2892
3071
  var mongodbDatabase = defineUnit({
2893
3072
  type: "apps.mongodb.database",
2894
3073
  args: {
2895
- database: Type.Optional(Type.String()),
2896
- username: Type.Optional(Type.String())
3074
+ database: z.string().optional(),
3075
+ username: z.string().optional()
2897
3076
  },
2898
3077
  secrets: {
2899
- password: Type.Optional(Type.String())
3078
+ password: z.string().optional()
2900
3079
  },
2901
3080
  inputs: createInputs(["mongodb"]),
2902
3081
  meta: {
2903
- displayName: "MongoDB Database",
3082
+ title: "MongoDB Database",
2904
3083
  description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
2905
- primaryIcon: "simple-icons:mongodb",
3084
+ icon: "simple-icons:mongodb",
2906
3085
  secondaryIcon: "mdi:database-plus",
2907
3086
  category: "Databases"
2908
3087
  },
2909
3088
  source: createSource("mongodb/database")
2910
3089
  });
2911
- var explicitEndpointFilterSchema = Type.StringEnum(["public", "external", "internal"]);
3090
+ var explicitEndpointFilterSchema = z.enum(["public", "external", "internal"]);
2912
3091
  var endpointFilter = defineUnit({
2913
3092
  type: "apps.endpoint-filter",
2914
3093
  args: {
@@ -2920,7 +3099,7 @@ var endpointFilter = defineUnit({
2920
3099
  * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
2921
3100
  */
2922
3101
  filter: {
2923
- schema: Type.Default(explicitEndpointFilterSchema, "public"),
3102
+ schema: explicitEndpointFilterSchema.default("public"),
2924
3103
  meta: {
2925
3104
  description: `The filter to apply to the endpoints.
2926
3105
 
@@ -2953,16 +3132,16 @@ var endpointFilter = defineUnit({
2953
3132
  }
2954
3133
  },
2955
3134
  meta: {
2956
- displayName: "Endpoint Filter",
3135
+ title: "Endpoint Filter",
2957
3136
  description: "Explicitly filter endpoints by their accessibility.",
2958
- primaryIcon: "mdi:network-outline",
2959
- primaryIconColor: "#FF9800",
3137
+ icon: "mdi:network-outline",
3138
+ iconColor: "#FF9800",
2960
3139
  secondaryIcon: "mdi:filter-outline",
2961
3140
  category: "Network"
2962
3141
  },
2963
3142
  source: createSource("endpoint-filter")
2964
3143
  });
2965
- var endpointFilterSchema2 = Type.StringEnum(["all", "public", "external", "internal"]);
3144
+ var endpointFilterSchema2 = z.enum(["all", "public", "external", "internal"]);
2966
3145
  var recordSet = defineUnit({
2967
3146
  type: "apps.dns-record-set",
2968
3147
  args: {
@@ -2972,7 +3151,7 @@ var recordSet = defineUnit({
2972
3151
  * If not provided, will use the name of the unit.
2973
3152
  */
2974
3153
  recordName: {
2975
- schema: Type.Optional(Type.String()),
3154
+ schema: z.string().optional(),
2976
3155
  meta: {
2977
3156
  description: `The name of the DNS record.
2978
3157
 
@@ -2985,7 +3164,7 @@ var recordSet = defineUnit({
2985
3164
  * If not specified, will use the default type for the provider.
2986
3165
  */
2987
3166
  type: {
2988
- schema: Type.Optional(Type.String()),
3167
+ schema: z.string().optional(),
2989
3168
  meta: {
2990
3169
  description: `The type of the DNS record.
2991
3170
 
@@ -2996,7 +3175,7 @@ var recordSet = defineUnit({
2996
3175
  * The values of the DNS record.
2997
3176
  */
2998
3177
  values: {
2999
- schema: Type.Array(Type.String()),
3178
+ schema: z.string().array(),
3000
3179
  meta: {
3001
3180
  description: `The values of the DNS record.`
3002
3181
  }
@@ -3005,7 +3184,7 @@ var recordSet = defineUnit({
3005
3184
  * The TTL of the DNS record.
3006
3185
  */
3007
3186
  ttl: {
3008
- schema: Type.Optional(Type.Number()),
3187
+ schema: z.number().optional(),
3009
3188
  meta: {
3010
3189
  description: `The TTL of the DNS record.`
3011
3190
  }
@@ -3014,7 +3193,7 @@ var recordSet = defineUnit({
3014
3193
  * The priority of the DNS record.
3015
3194
  */
3016
3195
  priority: {
3017
- schema: Type.Optional(Type.Number()),
3196
+ schema: z.number().optional(),
3018
3197
  meta: {
3019
3198
  description: `The priority of the DNS record.`
3020
3199
  }
@@ -3025,7 +3204,7 @@ var recordSet = defineUnit({
3025
3204
  * Available only for public IPs and some DNS providers like Cloudflare.
3026
3205
  */
3027
3206
  proxied: {
3028
- schema: Type.Optional(Type.Boolean()),
3207
+ schema: z.boolean().optional(),
3029
3208
  meta: {
3030
3209
  description: `Whether the DNS record is proxied.
3031
3210
 
@@ -3041,7 +3220,7 @@ var recordSet = defineUnit({
3041
3220
  * - `internal`: Only internal endpoints (e.g. ClusterIP) accessible from within the cluster.
3042
3221
  */
3043
3222
  endpointFilter: {
3044
- schema: Type.Default(endpointFilterSchema2, "public"),
3223
+ schema: endpointFilterSchema2.default("public"),
3045
3224
  meta: {
3046
3225
  description: `The filter to apply to the endpoints.
3047
3226
 
@@ -3090,9 +3269,9 @@ var recordSet = defineUnit({
3090
3269
  }
3091
3270
  },
3092
3271
  meta: {
3093
- displayName: "DNS Record Set",
3272
+ title: "DNS Record Set",
3094
3273
  description: "A set of DNS records to be created.",
3095
- primaryIcon: "mdi:server",
3274
+ icon: "mdi:server",
3096
3275
  defaultNamePrefix: "record",
3097
3276
  category: "Network"
3098
3277
  },
@@ -3102,13 +3281,13 @@ var sharedArgs = {
3102
3281
  /**
3103
3282
  * The FQDN to register the cluster nodes with.
3104
3283
  */
3105
- fqdn: Type.Optional(Type.String())
3284
+ fqdn: z.string().optional()
3106
3285
  };
3107
3286
  var traefikGateway = defineUnit({
3108
3287
  type: "apps.traefik-gateway",
3109
3288
  args: {
3110
3289
  ...createArgs2("traefik", ["external"]),
3111
- className: Type.Optional(Type.String())
3290
+ className: z.string().optional()
3112
3291
  },
3113
3292
  inputs: createInputs(),
3114
3293
  outputs: {
@@ -3120,9 +3299,9 @@ var traefikGateway = defineUnit({
3120
3299
  }
3121
3300
  },
3122
3301
  meta: {
3123
- displayName: "Traefik Gateway",
3302
+ title: "Traefik Gateway",
3124
3303
  description: "A Traefik gateway for routing traffic to services.",
3125
- primaryIcon: "simple-icons:traefikproxy",
3304
+ icon: "simple-icons:traefikproxy",
3126
3305
  category: "Network"
3127
3306
  },
3128
3307
  source: {
@@ -3135,9 +3314,9 @@ var kubernetesDashboard = defineUnit({
3135
3314
  args: createArgs2("kubernetes-dashboard", ["fqdn"]),
3136
3315
  inputs: createInputs(["accessPoint"]),
3137
3316
  meta: {
3138
- displayName: "Kubernetes Dashboard",
3317
+ title: "Kubernetes Dashboard",
3139
3318
  description: "The Kubernetes Dashboard deployed on Kubernetes.",
3140
- primaryIcon: "devicon:kubernetes",
3319
+ icon: "devicon:kubernetes",
3141
3320
  secondaryIcon: "material-symbols:dashboard",
3142
3321
  category: "Kubernetes"
3143
3322
  },
@@ -3149,9 +3328,9 @@ var grocy = defineUnit({
3149
3328
  secrets: createSecrets(["backupPassword"]),
3150
3329
  inputs: createInputs(["accessPoint", "resticRepo"]),
3151
3330
  meta: {
3152
- displayName: "Grocy",
3331
+ title: "Grocy",
3153
3332
  description: "Grocy is a web-based self-hosted groceries & household management solution for your home.",
3154
- primaryIcon: "simple-icons:grocy",
3333
+ icon: "simple-icons:grocy",
3155
3334
  category: "Productivity"
3156
3335
  },
3157
3336
  source: createSource("grocy")
@@ -3161,14 +3340,14 @@ var maybe = defineUnit({
3161
3340
  args: createArgs2("maybe", ["fqdn"]),
3162
3341
  secrets: {
3163
3342
  ...createSecrets(["backupPassword"]),
3164
- postgresqlPassword: Type.Optional(Type.String()),
3165
- secretKey: Type.Optional(Type.String())
3343
+ postgresqlPassword: z.string().optional(),
3344
+ secretKey: z.string().optional()
3166
3345
  },
3167
3346
  inputs: createInputs(["accessPoint", "resticRepo", "postgresql"]),
3168
3347
  meta: {
3169
- displayName: "Maybe",
3348
+ title: "Maybe",
3170
3349
  description: "The OS for your personal finances.",
3171
- primaryIcon: "arcticons:finance-manager",
3350
+ icon: "arcticons:finance-manager",
3172
3351
  category: "Finance"
3173
3352
  },
3174
3353
  source: createSource("maybe")
@@ -3176,25 +3355,25 @@ var maybe = defineUnit({
3176
3355
  var deployment = defineUnit({
3177
3356
  type: "apps.deployment",
3178
3357
  args: {
3179
- appName: Type.Optional(Type.String()),
3180
- fqdn: Type.Optional(Type.String()),
3181
- serviceType: Type.Optional(serviceTypeSchema),
3182
- image: Type.Optional(Type.String()),
3183
- port: Type.Optional(Type.Number()),
3184
- replicas: Type.Optional(Type.Number()),
3185
- dataPath: Type.Optional(Type.String()),
3186
- env: Type.Optional(Type.Record(Type.String(), Type.Any())),
3187
- mariadbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
3188
- postgresqlEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
3189
- mongodbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
3190
- manifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
3191
- serviceManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
3192
- httpRouteManifest: Type.Optional(Type.Record(Type.String(), Type.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()
3193
3372
  },
3194
3373
  secrets: {
3195
- mariadbPassword: Type.Optional(Type.String()),
3196
- postgresqlPassword: Type.Optional(Type.String()),
3197
- mongodbPassword: Type.Optional(Type.String())
3374
+ mariadbPassword: z.string().optional(),
3375
+ postgresqlPassword: z.string().optional(),
3376
+ mongodbPassword: z.string().optional()
3198
3377
  },
3199
3378
  inputs: createInputs([
3200
3379
  "accessPoint",
@@ -3209,15 +3388,15 @@ var deployment = defineUnit({
3209
3388
  service: serviceEntity
3210
3389
  },
3211
3390
  meta: {
3212
- displayName: "Kubernetes Deployment",
3391
+ title: "Kubernetes Deployment",
3213
3392
  description: "A generic Kubernetes deployment with optional service and gateway routes.",
3214
- primaryIcon: "devicon:kubernetes",
3393
+ icon: "devicon:kubernetes",
3215
3394
  secondaryIcon: "mdi:cube-outline",
3216
3395
  category: "Kubernetes"
3217
3396
  },
3218
3397
  source: createSource("deployment")
3219
3398
  });
3220
- var backupModeSchema = Type.StringEnum(["state", "full"]);
3399
+ var backupModeSchema = z.enum(["state", "full"]);
3221
3400
  var syncthing = defineUnit({
3222
3401
  type: "apps.syncthing",
3223
3402
  args: {
@@ -3229,7 +3408,7 @@ var syncthing = defineUnit({
3229
3408
  * access the Syncthing Web UI.
3230
3409
  */
3231
3410
  deviceFqdn: {
3232
- schema: Type.Optional(Type.String()),
3411
+ schema: z.string().optional(),
3233
3412
  meta: {
3234
3413
  description: `The FQDN of the Syncthing instance used to sync with other devices.
3235
3414
 
@@ -3247,7 +3426,7 @@ var syncthing = defineUnit({
3247
3426
  * The default is `state`.
3248
3427
  */
3249
3428
  backupMode: {
3250
- schema: Type.Default(backupModeSchema, "state"),
3429
+ schema: backupModeSchema.default("state"),
3251
3430
  meta: {
3252
3431
  description: `The backup mode to use for the Syncthing instance.
3253
3432
 
@@ -3270,9 +3449,9 @@ var syncthing = defineUnit({
3270
3449
  }
3271
3450
  },
3272
3451
  meta: {
3273
- displayName: "Syncthing",
3452
+ title: "Syncthing",
3274
3453
  description: "The Syncthing instance deployed on Kubernetes.",
3275
- primaryIcon: "simple-icons:syncthing",
3454
+ icon: "simple-icons:syncthing",
3276
3455
  category: "File Sync"
3277
3456
  },
3278
3457
  source: createSource("syncthing")
@@ -3282,8 +3461,8 @@ var codeServer = defineUnit({
3282
3461
  args: createArgs2("code-server", ["fqdn"]),
3283
3462
  secrets: {
3284
3463
  ...createSecrets(["backupPassword"]),
3285
- password: Type.Optional(Type.String()),
3286
- sudoPassword: Type.Optional(Type.String())
3464
+ password: z.string().optional(),
3465
+ sudoPassword: z.string().optional()
3287
3466
  },
3288
3467
  inputs: createInputs(["accessPoint", "resticRepo", "dnsProviders", "volume"]),
3289
3468
  outputs: {
@@ -3291,9 +3470,9 @@ var codeServer = defineUnit({
3291
3470
  volume: persistentVolumeClaimEntity
3292
3471
  },
3293
3472
  meta: {
3294
- displayName: "Code Server",
3473
+ title: "Code Server",
3295
3474
  description: "The Code Server instance deployed on Kubernetes.",
3296
- primaryIcon: "material-icon-theme:vscode",
3475
+ icon: "material-icon-theme:vscode",
3297
3476
  category: "Development"
3298
3477
  },
3299
3478
  source: {
@@ -3306,9 +3485,9 @@ var hubble = defineUnit({
3306
3485
  args: createArgs2("hubble", ["fqdn"]),
3307
3486
  inputs: createInputs(["accessPoint"]),
3308
3487
  meta: {
3309
- displayName: "Hubble",
3488
+ title: "Hubble",
3310
3489
  description: "Exposes Hubble UI to the user. It must be already installed in the cluster as part of the Cilium.",
3311
- primaryIcon: "mdi:eye",
3490
+ icon: "mdi:eye",
3312
3491
  secondaryIcon: "simple-icons:cilium",
3313
3492
  category: "Observability"
3314
3493
  },
@@ -3323,15 +3502,15 @@ __export(cloudflare_exports, {
3323
3502
  var connection2 = defineUnit({
3324
3503
  type: "cloudflare.connection",
3325
3504
  secrets: {
3326
- apiToken: Type.String()
3505
+ apiToken: z.string()
3327
3506
  },
3328
3507
  outputs: {
3329
3508
  dnsProvider: providerEntity
3330
3509
  },
3331
3510
  meta: {
3332
- displayName: "Cloudflare Connection",
3511
+ title: "Cloudflare Connection",
3333
3512
  description: "Creates a new Cloudflare connection for one zone.",
3334
- primaryIcon: "simple-icons:cloudflare",
3513
+ icon: "simple-icons:cloudflare",
3335
3514
  category: "Cloudflare"
3336
3515
  },
3337
3516
  source: {
@@ -3364,8 +3543,8 @@ var internalComponents = [
3364
3543
  "network-policy",
3365
3544
  "helm-controller"
3366
3545
  ];
3367
- var componentSchema = Type.StringEnum([...packagedComponents, ...internalComponents]);
3368
- var cniSchema3 = Type.StringEnum(["none", "flannel"]);
3546
+ var componentSchema = z.enum([...packagedComponents, ...internalComponents]);
3547
+ var cniSchema3 = z.enum(["none", "flannel"]);
3369
3548
  var cluster2 = defineUnit({
3370
3549
  type: "k3s.cluster",
3371
3550
  args: {
@@ -3373,7 +3552,7 @@ var cluster2 = defineUnit({
3373
3552
  * The components to disable in the K3S cluster.
3374
3553
  */
3375
3554
  disabledComponents: {
3376
- schema: Type.Default(Type.Array(componentSchema), []),
3555
+ schema: componentSchema.array().default([]),
3377
3556
  meta: {
3378
3557
  description: `The components to disable in the K3S cluster.`
3379
3558
  }
@@ -3385,7 +3564,7 @@ var cluster2 = defineUnit({
3385
3564
  * If needed, you can disable them using `disabledComponents` argument.
3386
3565
  */
3387
3566
  cni: {
3388
- schema: Type.Default(cniSchema3, "flannel"),
3567
+ schema: cniSchema3.default("flannel"),
3389
3568
  meta: {
3390
3569
  description: `The CNI to use in the K3S cluster.
3391
3570
 
@@ -3399,7 +3578,7 @@ var cluster2 = defineUnit({
3399
3578
  * See: https://docs.k3s.io/installation/configuration
3400
3579
  */
3401
3580
  config: {
3402
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
3581
+ schema: z.record(z.string(), z.any()).optional(),
3403
3582
  meta: {
3404
3583
  description: `The K3S configuration to pass to each server or agent in the cluster.
3405
3584
 
@@ -3412,7 +3591,7 @@ var cluster2 = defineUnit({
3412
3591
  * See: https://docs.k3s.io/installation/private-registry
3413
3592
  */
3414
3593
  registries: {
3415
- schema: Type.Optional(Type.Record(Type.String(), Type.Any())),
3594
+ schema: z.record(z.string(), z.any()).optional(),
3416
3595
  meta: {
3417
3596
  description: `The configuration of the registries to use for the K3S cluster.
3418
3597
 
@@ -3423,10 +3602,10 @@ var cluster2 = defineUnit({
3423
3602
  inputs: clusterInputs,
3424
3603
  outputs: clusterOutputs,
3425
3604
  meta: {
3426
- displayName: "K3s Cluster",
3605
+ title: "K3s Cluster",
3427
3606
  description: "The K3s cluster created on top of the server.",
3428
3607
  category: "k3s",
3429
- primaryIcon: "devicon:k3s",
3608
+ icon: "devicon:k3s",
3430
3609
  secondaryIcon: "devicon:kubernetes"
3431
3610
  },
3432
3611
  source: {
@@ -3443,12 +3622,12 @@ __export(mullvad_exports, {
3443
3622
  var peer2 = defineUnit({
3444
3623
  type: "mullvad.peer",
3445
3624
  args: {
3446
- hostname: Type.Optional(Type.String()),
3625
+ hostname: z.string().optional(),
3447
3626
  /**
3448
3627
  * Whether to include Mullvad DNS servers in the peer configuration.
3449
3628
  */
3450
3629
  includeDns: {
3451
- schema: Type.Default(Type.Boolean(), true),
3630
+ schema: z.boolean().default(true),
3452
3631
  meta: {
3453
3632
  description: `Whether to include Mullvad DNS servers in the peer configuration.`
3454
3633
  }
@@ -3478,9 +3657,9 @@ var peer2 = defineUnit({
3478
3657
  }
3479
3658
  },
3480
3659
  meta: {
3481
- displayName: "Mullvad Peer",
3660
+ title: "Mullvad Peer",
3482
3661
  description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
3483
- primaryIcon: "simple-icons:mullvad",
3662
+ icon: "simple-icons:mullvad",
3484
3663
  secondaryIcon: "cib:wireguard",
3485
3664
  secondaryIconColor: "#88171a",
3486
3665
  category: "VPN"
@@ -3500,23 +3679,23 @@ __export(timeweb_exports, {
3500
3679
  });
3501
3680
  var connectionEntity = defineEntity({
3502
3681
  type: "timeweb.connection",
3503
- schema: Type.Object({
3504
- name: Type.String(),
3505
- apiToken: Type.String()
3682
+ schema: z.object({
3683
+ name: z.string(),
3684
+ apiToken: z.string()
3506
3685
  })
3507
3686
  });
3508
3687
  var connection3 = defineUnit({
3509
3688
  type: "timeweb.connection",
3510
3689
  secrets: {
3511
- apiToken: Type.String()
3690
+ apiToken: z.string()
3512
3691
  },
3513
3692
  outputs: {
3514
3693
  connection: connectionEntity
3515
3694
  },
3516
3695
  meta: {
3517
- displayName: "Timeweb Connection",
3696
+ title: "Timeweb Connection",
3518
3697
  description: "Creates a new Timeweb connection.",
3519
- primaryIcon: "material-symbols:cloud",
3698
+ icon: "material-symbols:cloud",
3520
3699
  category: "Timeweb"
3521
3700
  },
3522
3701
  source: {
@@ -3527,9 +3706,9 @@ var connection3 = defineUnit({
3527
3706
  var virtualMachine2 = defineUnit({
3528
3707
  type: "timeweb.virtual-machine",
3529
3708
  args: {
3530
- presetId: Type.Optional(Type.Number()),
3531
- osId: Type.Optional(Type.Number()),
3532
- availabilityZone: Type.String()
3709
+ presetId: z.number().optional(),
3710
+ osId: z.number().optional(),
3711
+ availabilityZone: z.string()
3533
3712
  },
3534
3713
  inputs: {
3535
3714
  connection: connectionEntity,
@@ -3539,15 +3718,15 @@ var virtualMachine2 = defineUnit({
3539
3718
  }
3540
3719
  },
3541
3720
  secrets: {
3542
- sshPrivateKey: Type.Optional(Type.String())
3721
+ sshPrivateKey: z.string().optional()
3543
3722
  },
3544
3723
  outputs: {
3545
3724
  server: serverEntity
3546
3725
  },
3547
3726
  meta: {
3548
- displayName: "Timeweb Virtual Machine",
3727
+ title: "Timeweb Virtual Machine",
3549
3728
  description: "Creates a new Timeweb virtual machine.",
3550
- primaryIcon: "material-symbols:cloud",
3729
+ icon: "material-symbols:cloud",
3551
3730
  secondaryIcon: "codicon:vm",
3552
3731
  category: "Timeweb"
3553
3732
  },
@@ -3573,7 +3752,7 @@ var inlineModule = defineUnit({
3573
3752
  * If not provided, the name will be the name of the unit.
3574
3753
  */
3575
3754
  moduleName: {
3576
- schema: Type.Optional(Type.String()),
3755
+ schema: z.string().optional(),
3577
3756
  meta: {
3578
3757
  description: `The name of the module file.
3579
3758
 
@@ -3586,7 +3765,7 @@ var inlineModule = defineUnit({
3586
3765
  * In this code you can reference other modules and files by their names.
3587
3766
  */
3588
3767
  code: {
3589
- schema: Type.String({ language: "nix" }),
3768
+ schema: z.string().meta({ language: "nix" }),
3590
3769
  meta: {
3591
3770
  description: `The code of the NixOS module.
3592
3771
 
@@ -3610,10 +3789,10 @@ var inlineModule = defineUnit({
3610
3789
  folder: folderEntity
3611
3790
  },
3612
3791
  meta: {
3613
- displayName: "NixOS Inline Module",
3792
+ title: "NixOS Inline Module",
3614
3793
  description: "Creates a NixOS module from inline code.",
3615
- primaryIcon: "simple-icons:nixos",
3616
- primaryIconColor: "#7ebae4",
3794
+ icon: "simple-icons:nixos",
3795
+ iconColor: "#7ebae4",
3617
3796
  secondaryIcon: "mdi:file-code",
3618
3797
  category: "NixOS"
3619
3798
  },
@@ -3631,7 +3810,7 @@ var inlineFlake = defineUnit({
3631
3810
  * If not provided, the name will be the name of the unit.
3632
3811
  */
3633
3812
  flakeName: {
3634
- schema: Type.Optional(Type.String()),
3813
+ schema: z.string().optional(),
3635
3814
  meta: {
3636
3815
  description: `The name of the flake folder.
3637
3816
 
@@ -3644,7 +3823,7 @@ var inlineFlake = defineUnit({
3644
3823
  * In this code you can reference other flakes, modules, files, and folders by their names.
3645
3824
  */
3646
3825
  code: {
3647
- schema: Type.String({ language: "nix" }),
3826
+ schema: z.string().meta({ language: "nix" }),
3648
3827
  meta: {
3649
3828
  description: `The code of the \`flake.nix\` file.
3650
3829
 
@@ -3668,10 +3847,10 @@ var inlineFlake = defineUnit({
3668
3847
  folder: folderEntity
3669
3848
  },
3670
3849
  meta: {
3671
- displayName: "NixOS Inline Flake",
3850
+ title: "NixOS Inline Flake",
3672
3851
  description: "Creates a NixOS flake from inline code.",
3673
- primaryIcon: "simple-icons:nixos",
3674
- primaryIconColor: "#7ebae4",
3852
+ icon: "simple-icons:nixos",
3853
+ iconColor: "#7ebae4",
3675
3854
  secondaryIcon: "mdi:file-code",
3676
3855
  category: "NixOS"
3677
3856
  },
@@ -3683,7 +3862,7 @@ var inlineFlake = defineUnit({
3683
3862
  var system = defineUnit({
3684
3863
  type: "nixos.system",
3685
3864
  args: {
3686
- system: Type.Optional(Type.String())
3865
+ system: z.string().optional()
3687
3866
  },
3688
3867
  inputs: {
3689
3868
  server: serverEntity,
@@ -3693,10 +3872,10 @@ var system = defineUnit({
3693
3872
  server: serverEntity
3694
3873
  },
3695
3874
  meta: {
3696
- displayName: "NixOS System",
3875
+ title: "NixOS System",
3697
3876
  description: "Creates a NixOS system on top of any server.",
3698
- primaryIcon: "simple-icons:nixos",
3699
- primaryIconColor: "#7ebae4",
3877
+ icon: "simple-icons:nixos",
3878
+ iconColor: "#7ebae4",
3700
3879
  secondaryIcon: "codicon:vm",
3701
3880
  category: "NixOS"
3702
3881
  },
@@ -3714,7 +3893,7 @@ __export(sops_exports, {
3714
3893
  var secrets = defineUnit({
3715
3894
  type: "sops.secrets",
3716
3895
  secrets: {
3717
- data: Type.Record(Type.String(), Type.Any())
3896
+ data: z.record(z.string(), z.any())
3718
3897
  },
3719
3898
  inputs: {
3720
3899
  servers: {
@@ -3727,9 +3906,9 @@ var secrets = defineUnit({
3727
3906
  file: fileEntity
3728
3907
  },
3729
3908
  meta: {
3730
- displayName: "SOPS Secrets",
3909
+ title: "SOPS Secrets",
3731
3910
  description: "Encrypts secrets using SOPS for the specified servers.",
3732
- primaryIcon: "mdi:file-lock",
3911
+ icon: "mdi:file-lock",
3733
3912
  category: "Secrets"
3734
3913
  },
3735
3914
  source: {
@@ -3753,7 +3932,7 @@ var deobfuscatorSpec = {
3753
3932
  * By default, calculated as `deobfs-{type}-{name}`.
3754
3933
  */
3755
3934
  appName: {
3756
- schema: Type.Optional(Type.String()),
3935
+ schema: z.string().optional(),
3757
3936
  meta: {
3758
3937
  description: `The name of the namespace and deployment to deploy the deobfuscator on.
3759
3938
 
@@ -3766,7 +3945,7 @@ var deobfuscatorSpec = {
3766
3945
  * Will take precedence over the `targetEndpoint` input.
3767
3946
  */
3768
3947
  targetEndpoints: {
3769
- schema: Type.Default(Type.Array(Type.String()), []),
3948
+ schema: z.string().array().default([]),
3770
3949
  meta: {
3771
3950
  description: `The L4 endpoint to forward deobfuscated traffic to.
3772
3951
 
@@ -3779,7 +3958,7 @@ var deobfuscatorSpec = {
3779
3958
  * By default, the service is not exposed and only accessible from within the cluster.
3780
3959
  */
3781
3960
  external: {
3782
- schema: Type.Default(Type.Boolean(), false),
3961
+ schema: z.boolean().default(false),
3783
3962
  meta: {
3784
3963
  description: `Whether to expose the deobfuscator service by "NodePort" or "LoadBalancer".
3785
3964
 
@@ -3835,7 +4014,7 @@ var obfuscatorSpec = {
3835
4014
  * By default, calculated as `obfs-{type}-{name}`.
3836
4015
  */
3837
4016
  appName: {
3838
- schema: Type.Optional(Type.String()),
4017
+ schema: z.string().optional(),
3839
4018
  meta: {
3840
4019
  description: `The name of the namespace and deployment to deploy the obfuscator on.
3841
4020
 
@@ -3848,7 +4027,7 @@ var obfuscatorSpec = {
3848
4027
  * Will take precedence over the `endpoint` input.
3849
4028
  */
3850
4029
  endpoints: {
3851
- schema: Type.Default(Type.Array(Type.String()), []),
4030
+ schema: z.string().array().default([]),
3852
4031
  meta: {
3853
4032
  description: `The endpoint of the deobfuscator to pass obfuscated traffic to.
3854
4033
 
@@ -3861,7 +4040,7 @@ var obfuscatorSpec = {
3861
4040
  * By default, the service is not exposed and only accessible from within the cluster.
3862
4041
  */
3863
4042
  external: {
3864
- schema: Type.Default(Type.Boolean(), false),
4043
+ schema: z.boolean().default(false),
3865
4044
  meta: {
3866
4045
  description: `Whether to expose the obfuscator service by "NodePort" or "LoadBalancer".
3867
4046
 
@@ -3919,9 +4098,9 @@ var deobfuscator = defineUnit({
3919
4098
  type: "obfuscators.phantun.deobfuscator",
3920
4099
  ...deobfuscatorSpec,
3921
4100
  meta: {
3922
- displayName: "Phantun Deobfuscator",
4101
+ title: "Phantun Deobfuscator",
3923
4102
  description: "The Phantun Deobfuscator deployed on Kubernetes.",
3924
- primaryIcon: "mdi:network-outline",
4103
+ icon: "mdi:network-outline",
3925
4104
  secondaryIcon: "mdi:hide",
3926
4105
  category: "Obfuscators"
3927
4106
  },
@@ -3934,9 +4113,9 @@ var obfuscator = defineUnit({
3934
4113
  type: "obfuscators.phantun.obfuscator",
3935
4114
  ...obfuscatorSpec,
3936
4115
  meta: {
3937
- displayName: "Phantun Obfuscator",
4116
+ title: "Phantun Obfuscator",
3938
4117
  description: "The Phantun Obfuscator deployed on Kubernetes.",
3939
- primaryIcon: "mdi:network-outline",
4118
+ icon: "mdi:network-outline",
3940
4119
  secondaryIcon: "mdi:hide",
3941
4120
  category: "Obfuscators"
3942
4121
  },
@@ -3953,23 +4132,23 @@ __export(distributions_exports, {
3953
4132
  ubuntuArchitectureSchema: () => ubuntuArchitectureSchema,
3954
4133
  ubuntuVersionSchema: () => ubuntuVersionSchema
3955
4134
  });
3956
- var ubuntuVersionSchema = Type.StringEnum(["22.04", "24.04", "24.10", "25.04", "25.10"]);
3957
- var ubuntuArchitectureSchema = Type.StringEnum(["amd64", "arm64"]);
4135
+ var ubuntuVersionSchema = z.enum(["22.04", "24.04", "24.10", "25.04", "25.10"]);
4136
+ var ubuntuArchitectureSchema = z.enum(["amd64", "arm64"]);
3958
4137
  var ubuntu = defineUnit({
3959
4138
  type: "distributions.ubuntu",
3960
4139
  args: {
3961
- version: Type.Default(ubuntuVersionSchema, "24.04"),
3962
- architecture: Type.Default(ubuntuArchitectureSchema, "amd64")
4140
+ version: ubuntuVersionSchema.default("24.04"),
4141
+ architecture: ubuntuArchitectureSchema.default("amd64")
3963
4142
  },
3964
4143
  outputs: {
3965
4144
  image: fileEntity,
3966
4145
  cloudConfig: fileEntity
3967
4146
  },
3968
4147
  meta: {
3969
- displayName: "Ubuntu",
4148
+ title: "Ubuntu",
3970
4149
  description: "Ubuntu distribution with image and cloud-config.",
3971
- primaryIcon: "mdi:ubuntu",
3972
- primaryIconColor: "#E95420",
4150
+ icon: "mdi:ubuntu",
4151
+ iconColor: "#E95420",
3973
4152
  category: "Distributions"
3974
4153
  },
3975
4154
  source: {
@@ -3990,7 +4169,7 @@ var remoteRepository = defineUnit({
3990
4169
  * The URL of the remote repository.
3991
4170
  */
3992
4171
  url: {
3993
- schema: Type.Optional(Type.String()),
4172
+ schema: z.string().optional(),
3994
4173
  meta: {
3995
4174
  description: `The URL of the remote repository.`
3996
4175
  }
@@ -4001,7 +4180,7 @@ var remoteRepository = defineUnit({
4001
4180
  * If not specified, the default branch will be used.
4002
4181
  */
4003
4182
  ref: {
4004
- schema: Type.Optional(Type.String()),
4183
+ schema: z.string().optional(),
4005
4184
  meta: {
4006
4185
  description: `The ref of the remote repository to checkout.
4007
4186
 
@@ -4014,7 +4193,7 @@ var remoteRepository = defineUnit({
4014
4193
  * Do not enable this unless you need the full git history.
4015
4194
  */
4016
4195
  includeGit: {
4017
- schema: Type.Default(Type.Boolean(), false),
4196
+ schema: z.boolean().default(false),
4018
4197
  meta: {
4019
4198
  description: `Whether to include the .git directory in the packed artifact.
4020
4199
 
@@ -4046,10 +4225,10 @@ var remoteRepository = defineUnit({
4046
4225
  }
4047
4226
  },
4048
4227
  meta: {
4049
- displayName: "Git Remote Repository",
4228
+ title: "Git Remote Repository",
4050
4229
  description: "References a remote Git repository.",
4051
- primaryIcon: "simple-icons:git",
4052
- primaryIconColor: "#f1502f",
4230
+ icon: "simple-icons:git",
4231
+ iconColor: "#f1502f",
4053
4232
  category: "Git"
4054
4233
  },
4055
4234
  source: {