@highstate/library 0.9.14 → 0.9.16

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