@highstate/library 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/highstate.library.msgpack +0 -0
  2. package/dist/index.js +2314 -1141
  3. package/dist/index.js.map +1 -1
  4. package/package.json +3 -3
  5. package/src/abbreviations.ts +3 -0
  6. package/src/common/access-point.ts +23 -4
  7. package/src/common/files.ts +27 -17
  8. package/src/common/server.ts +28 -7
  9. package/src/databases/etcd.ts +142 -37
  10. package/src/databases/index.ts +8 -7
  11. package/src/databases/influxdb3.ts +103 -0
  12. package/src/databases/minio.ts +157 -0
  13. package/src/databases/mongodb.ts +122 -40
  14. package/src/databases/mysql.ts +172 -0
  15. package/src/databases/postgresql.ts +133 -39
  16. package/src/databases/redis.ts +118 -43
  17. package/src/databases/s3.ts +49 -126
  18. package/src/dns.ts +12 -7
  19. package/src/index.ts +1 -1
  20. package/src/k3s.ts +7 -0
  21. package/src/k8s/apps/etcd.ts +3 -3
  22. package/src/k8s/apps/gitea.ts +1 -1
  23. package/src/k8s/apps/grafana.ts +48 -0
  24. package/src/k8s/apps/index.ts +4 -2
  25. package/src/k8s/apps/mariadb.ts +7 -38
  26. package/src/k8s/apps/matrix-stack.ts +62 -0
  27. package/src/k8s/apps/minio.ts +38 -45
  28. package/src/k8s/apps/mongodb.ts +6 -38
  29. package/src/k8s/apps/portal.ts +27 -0
  30. package/src/k8s/apps/postgresql.ts +7 -41
  31. package/src/k8s/apps/refluxdb.ts +49 -0
  32. package/src/k8s/apps/remnawave.ts +17 -1
  33. package/src/k8s/apps/shared.ts +16 -15
  34. package/src/k8s/apps/traefik.ts +5 -0
  35. package/src/k8s/apps/valkey.ts +5 -5
  36. package/src/k8s/apps/vaultwarden.ts +2 -6
  37. package/src/k8s/apps/workload.ts +14 -11
  38. package/src/k8s/cert-manager.ts +22 -0
  39. package/src/k8s/cilium.ts +17 -2
  40. package/src/k8s/resources.ts +50 -9
  41. package/src/k8s/service.ts +7 -2
  42. package/src/k8s/shared.ts +50 -18
  43. package/src/k8s/workload.ts +65 -42
  44. package/src/network/address-space.ts +17 -7
  45. package/src/network/address.ts +14 -2
  46. package/src/network/endpoint-container.ts +235 -0
  47. package/src/network/endpoint-schema.ts +8 -0
  48. package/src/network/endpoint.ts +23 -39
  49. package/src/network/index.ts +1 -1
  50. package/src/network/subnet.ts +5 -2
  51. package/src/proxmox.ts +27 -7
  52. package/src/restic.ts +9 -2
  53. package/src/ssh.ts +63 -31
  54. package/src/talos.ts +10 -1
  55. package/src/third-party/cloudflare.ts +4 -4
  56. package/src/third-party/timeweb.ts +18 -3
  57. package/src/third-party/yandex.ts +203 -86
  58. package/src/tls.ts +22 -0
  59. package/src/utils.ts +16 -1
  60. package/src/wireguard.ts +352 -120
  61. package/src/databases/mariadb.ts +0 -90
  62. package/src/databases/shared.ts +0 -67
  63. package/src/k8s/apps/kubernetes-dashboard.ts +0 -28
  64. package/src/k8s/apps/maybe.ts +0 -39
  65. package/src/network/dynamic-endpoint.ts +0 -39
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { registerKnownAbbreviations, z, defineEntity, camelCaseToHumanReadable, genericNameSchema, $args, $addArgumentDescription, defineUnit, $addInputDescription, fileContentSchema as fileContentSchema$1, fileMetaSchema, unitArtifactSchema, $secrets, $inputs, $outputs, text } from '@highstate/contract';
1
+ import { registerKnownAbbreviations, z, defineEntity, camelCaseToHumanReadable, defineUnit, $addInputDescription, $addArgumentDescription, genericNameSchema, $args, secretSchema, $secrets, $inputs, $outputs, fileContentSchema as fileContentSchema$1, fileMetaSchema, unitArtifactSchema, text } from '@highstate/contract';
2
2
  import { mapValues, pick } from 'remeda';
3
3
 
4
4
  var __defProp = Object.defineProperty;
@@ -34,9 +34,14 @@ registerKnownAbbreviations([
34
34
  "CNI",
35
35
  "CSI",
36
36
  "MariaDB",
37
+ "MySQL",
37
38
  "PostgreSQL",
38
39
  "MongoDB",
39
- "etcd"
40
+ "etcd",
41
+ "MAS",
42
+ // Matrix Authentication Service
43
+ "LC"
44
+ // Locale
40
45
  ]);
41
46
 
42
47
  // src/common/index.ts
@@ -78,24 +83,27 @@ __export(network_exports, {
78
83
  addressSpace: () => addressSpace,
79
84
  addressSpaceEntity: () => addressSpaceEntity,
80
85
  addressTypeSchema: () => addressTypeSchema,
81
- dynamicL3EndpointEntity: () => dynamicL3EndpointEntity,
82
- dynamicL4EndpointEntity: () => dynamicL4EndpointEntity,
83
- dynamicL7EndpointEntity: () => dynamicL7EndpointEntity,
84
86
  endpointArgs: () => endpointArgs,
85
87
  endpointFilter: () => endpointFilter,
86
88
  ipv46Schema: () => ipv46Schema,
87
89
  ipv4PrefixSchema: () => ipv4PrefixSchema,
88
90
  l3Endpoint: () => l3Endpoint,
91
+ l3EndpointContainer: () => l3EndpointContainer,
89
92
  l3EndpointEntity: () => l3EndpointEntity,
93
+ l3EndpointReplacer: () => l3EndpointReplacer,
90
94
  l3EndpointSchema: () => l3EndpointSchema,
91
95
  l4Endpoint: () => l4Endpoint,
96
+ l4EndpointContainer: () => l4EndpointContainer,
92
97
  l4EndpointEntity: () => l4EndpointEntity,
98
+ l4EndpointReplacer: () => l4EndpointReplacer,
93
99
  l4EndpointSchema: () => l4EndpointSchema,
94
100
  l4PortInfoSchema: () => l4PortInfoSchema,
95
101
  l4ProtocolSchema: () => l4ProtocolSchema,
96
102
  l7AppInfoSchema: () => l7AppInfoSchema,
97
103
  l7Endpoint: () => l7Endpoint,
104
+ l7EndpointContainer: () => l7EndpointContainer,
98
105
  l7EndpointEntity: () => l7EndpointEntity,
106
+ l7EndpointReplacer: () => l7EndpointReplacer,
99
107
  l7EndpointSchema: () => l7EndpointSchema,
100
108
  networkArgs: () => networkArgs,
101
109
  optionalNetworkArgs: () => optionalNetworkArgs,
@@ -120,6 +128,8 @@ var subnetEntity = defineEntity({
120
128
  prefixLength: z.number().int().nonnegative().meta({ title: camelCaseToHumanReadable("prefixLength"), description: `The prefix length of the subnet.` })
121
129
  }),
122
130
  meta: {
131
+ title: "Subnet",
132
+ icon: "ri:network-line",
123
133
  color: "#3F51B5"
124
134
  }
125
135
  });
@@ -131,7 +141,12 @@ var addressEntity = defineEntity({
131
141
  /**
132
142
  * The subnet to which the address belongs.
133
143
  */
134
- subnet: subnetEntity
144
+ subnet: subnetEntity,
145
+ /**
146
+ * The subnet containing the single address.
147
+ * Can be used to provide address entity where subnet entity is expected.
148
+ */
149
+ asSubnet: subnetEntity
135
150
  },
136
151
  schema: z.object({
137
152
  /**
@@ -154,7 +169,97 @@ var addressEntity = defineEntity({
154
169
  For example:
155
170
  - IPv4: \`192.168.1.1\`
156
171
  - IPv6: \`2001:db8:85a3::8a2e:370:7334\`` })
157
- })
172
+ }),
173
+ meta: {
174
+ title: "Address",
175
+ icon: "mdi:ip"
176
+ }
177
+ });
178
+ var addressSpaceEntity = defineEntity({
179
+ type: "network.address-space.v1",
180
+ includes: {
181
+ /**
182
+ * The minimal set of subnets that fully cover the address space.
183
+ */
184
+ subnets: {
185
+ entity: subnetEntity,
186
+ multiple: true,
187
+ required: false
188
+ }
189
+ },
190
+ schema: z.unknown(),
191
+ meta: {
192
+ description: `The entity representing a network address space.`,
193
+ color: "#3F51B5",
194
+ title: "Address Space",
195
+ icon: "mdi:network",
196
+ iconColor: "#3F51B5"
197
+ }
198
+ });
199
+ var addressSpace = defineUnit({
200
+ type: "network.address-space.v1",
201
+ args: {
202
+ /**
203
+ * The list of addresses to include in the address space.
204
+ *
205
+ * The supported formats are:
206
+ * - Single IP address (e.g., `192.168.1.1`);
207
+ * - CIDR notation (e.g., `192.168.1.1/24`);
208
+ * - Dash notation (e.g., `192.168.1.1-192.168.1.254`).
209
+ *
210
+ * The addresses can be a mix of IPv4 and IPv6.
211
+ */
212
+ included: $addArgumentDescription(z.string().array().default([]), `The list of addresses to include in the address space.
213
+
214
+ The supported formats are:
215
+ - Single IP address (e.g., \`192.168.1.1\`);
216
+ - CIDR notation (e.g., \`192.168.1.1/24\`);
217
+ - Dash notation (e.g., \`192.168.1.1-192.168.1.254\`).
218
+
219
+ The addresses can be a mix of IPv4 and IPv6.`),
220
+ /**
221
+ * The list of addresses to exclude from the `addresses` list.
222
+ *
223
+ * The supported formats are the same as in `addresses`.
224
+ */
225
+ excluded: $addArgumentDescription(z.string().array().default([]), `The list of addresses to exclude from the \`addresses\` list.
226
+
227
+ The supported formats are the same as in \`addresses\`.`)
228
+ },
229
+ inputs: {
230
+ /**
231
+ * The subnets to include in the address space.
232
+ */
233
+ included: $addInputDescription({
234
+ entity: subnetEntity,
235
+ multiple: true,
236
+ required: false
237
+ }, `The subnets to include in the address space.`),
238
+ /**
239
+ * The subnets to exclude from the `included` list.
240
+ */
241
+ excluded: $addInputDescription({
242
+ entity: subnetEntity,
243
+ multiple: true,
244
+ required: false
245
+ }, `The subnets to exclude from the \`included\` list.`)
246
+ },
247
+ outputs: {
248
+ /**
249
+ * The address space entity representing the created address space.
250
+ */
251
+ addressSpace: $addInputDescription(addressSpaceEntity, `The address space entity representing the created address space.`)
252
+ },
253
+ meta: {
254
+ description: `Defines an address space from a list of addresses/subnets/ranges.`,
255
+ title: "Address Space",
256
+ icon: "mdi:network",
257
+ category: "Network"
258
+ },
259
+ source: {
260
+ package: "@highstate/common",
261
+ path: "units/network/address-space"
262
+ }
158
263
  });
159
264
  function prefixWith(string, prefix) {
160
265
  return prefix ? `${prefix}${string.charAt(0).toUpperCase()}${string.slice(1)}` : string;
@@ -189,6 +294,8 @@ var implementationReferenceSchema = z.object({
189
294
  */
190
295
  data: z.record(z.string(), z.unknown()).meta({ title: camelCaseToHumanReadable("data"), description: `The implementation specific data.` })
191
296
  });
297
+
298
+ // src/network/endpoint-schema.ts
192
299
  function createEndpointSchema(level, shape) {
193
300
  return z.intersection(
194
301
  z.object({
@@ -217,6 +324,14 @@ function createEndpointSchema(level, shape) {
217
324
  ).meta({ title: camelCaseToHumanReadable("metadata"), description: `The extra metadata for the endpoint.
218
325
 
219
326
  In most cases, this is provided by the endpoint origin (e.g., a Kubernetes service).` }),
327
+ /**
328
+ * The implementation reference that will be used to resolve the endpoint at runtime.
329
+ *
330
+ * Used primarily to expose endpoints from private networks to the Pulumi program.
331
+ */
332
+ implRef: implementationReferenceSchema.optional().meta({ title: camelCaseToHumanReadable("implRef"), description: `The implementation reference that will be used to resolve the endpoint at runtime.
333
+
334
+ Used primarily to expose endpoints from private networks to the Pulumi program.` }),
220
335
  ...shape
221
336
  }),
222
337
  z.union([
@@ -284,32 +399,6 @@ var l3EndpointSchema = z.union([
284
399
  var l4EndpointSchema = z.union([onlyl4EndpointSchema, onlyl7EndpointSchema]);
285
400
  var l7EndpointSchema = onlyl7EndpointSchema;
286
401
 
287
- // src/network/dynamic-endpoint.ts
288
- function defineDynamicEndpointEntity(level, endpointSchema) {
289
- return defineEntity({
290
- type: `network.dynamic-l${level}-endpoint.v1`,
291
- schema: z.union([
292
- z.object({
293
- type: z.literal("static"),
294
- /**
295
- * The static endpoint.
296
- */
297
- endpoint: endpointSchema.meta({ title: camelCaseToHumanReadable("endpoint"), description: `The static endpoint.` })
298
- }),
299
- z.object({
300
- type: z.literal("dynamic"),
301
- /**
302
- * The implementation reference to resolve the dynamic endpoint.
303
- */
304
- implRef: implementationReferenceSchema.meta({ title: camelCaseToHumanReadable("implRef"), description: `The implementation reference to resolve the dynamic endpoint.` })
305
- })
306
- ])
307
- });
308
- }
309
- var dynamicL3EndpointEntity = defineDynamicEndpointEntity(3, l3EndpointSchema);
310
- var dynamicL4EndpointEntity = defineDynamicEndpointEntity(4, l3EndpointSchema);
311
- var dynamicL7EndpointEntity = defineDynamicEndpointEntity(7, l3EndpointSchema);
312
-
313
402
  // src/network/endpoint.ts
314
403
  var l3EndpointEntity = defineEntity({
315
404
  type: "network.l3-endpoint.v1",
@@ -331,15 +420,6 @@ var l3EndpointEntity = defineEntity({
331
420
  address: {
332
421
  entity: addressEntity,
333
422
  required: false
334
- },
335
- /**
336
- * The dynamic endpoint which statically resolves to this endpoint.
337
- *
338
- * Allows to use any static endpoint as a dynamic without extra units.
339
- */
340
- dynamic: {
341
- entity: dynamicL3EndpointEntity,
342
- required: false
343
423
  }
344
424
  },
345
425
  schema: l3EndpointSchema,
@@ -347,7 +427,10 @@ var l3EndpointEntity = defineEntity({
347
427
  description: `The L3 endpoint for some service.
348
428
 
349
429
  May be a domain name or an IP address.`,
350
- color: "#4CAF50"
430
+ color: "#4CAF50",
431
+ title: "L3 Endpoint",
432
+ icon: "mdi:network-outline",
433
+ iconColor: "#4CAF50"
351
434
  }
352
435
  });
353
436
  var ipv4PrefixSchema = z.number().int().min(0).max(32);
@@ -355,39 +438,29 @@ var ipv46Schema = z.union([z.ipv4(), z.ipv6()]);
355
438
  var l4EndpointEntity = defineEntity({
356
439
  type: "network.l4-endpoint.v1",
357
440
  extends: { l3EndpointEntity },
358
- includes: {
359
- /**
360
- * The dynamic endpoint which statically resolves to this endpoint.
361
- *
362
- * Allows to use any static endpoint as a dynamic without extra units.
363
- */
364
- dynamic: dynamicL4EndpointEntity
365
- },
366
441
  schema: l4EndpointSchema,
367
442
  meta: {
368
443
  description: `The L4 endpoint for some service.
369
444
 
370
445
  Extends an L3 endpoint with a port and protocol.`,
371
- color: "#2196F3"
446
+ color: "#2196F3",
447
+ title: "L4 Endpoint",
448
+ icon: "mdi:network-outline",
449
+ iconColor: "#2196F3"
372
450
  }
373
451
  });
374
452
  var l7EndpointEntity = defineEntity({
375
453
  type: "network.l7-endpoint.v1",
376
454
  extends: { l4EndpointEntity },
377
- includes: {
378
- /**
379
- * The dynamic endpoint which statically resolves to this endpoint.
380
- *
381
- * Allows to use any static endpoint as a dynamic without extra units.
382
- */
383
- dynamic: dynamicL7EndpointEntity
384
- },
385
455
  schema: l7EndpointSchema,
386
456
  meta: {
387
457
  description: `The L7 endpoint for some service.
388
458
 
389
459
  Extends an L4 endpoint with application protocol information.`,
390
- color: "#FF9800"
460
+ color: "#FF9800",
461
+ title: "L7 Endpoint",
462
+ icon: "mdi:network-outline",
463
+ iconColor: "#FF9800"
391
464
  }
392
465
  });
393
466
  var endpointArgs = $args({
@@ -585,88 +658,174 @@ var endpointFilter = defineUnit({
585
658
  path: "units/network/endpoint-filter"
586
659
  }
587
660
  });
588
-
589
- // src/network/address-space.ts
590
- var addressSpaceEntity = defineEntity({
591
- type: "network.address-space.v1",
661
+ var l3EndpointContainer = defineEntity({
662
+ type: "network.l3-endpoint-container.v1",
592
663
  includes: {
593
- /**
594
- * The minimal set of subnets that fully cover the address space.
595
- */
596
- subnets: {
597
- entity: subnetEntity,
664
+ endpoints: {
665
+ entity: l3EndpointEntity,
598
666
  multiple: true
599
667
  }
600
668
  },
601
669
  schema: z.unknown(),
602
670
  meta: {
603
- description: `The entity representing a network address space.`,
604
- color: "#3F51B5"
671
+ color: "#4CAF50",
672
+ title: "L3 Endpoint Container",
673
+ icon: "mdi:network-outline",
674
+ iconColor: "#4CAF50"
605
675
  }
606
676
  });
607
- var addressSpace = defineUnit({
608
- type: "network.address-space.v1",
609
- args: {
610
- /**
611
- * The list of addresses to include in the address space.
612
- *
613
- * The supported formats are:
614
- * - Single IP address (e.g., `192.168.1.1`);
615
- * - CIDR notation (e.g., `192.168.1.1/24`);
616
- * - Dash notation (e.g., `192.168.1.1-192.168.1.254`).
617
- *
618
- * The addresses can be a mix of IPv4 and IPv6.
619
- */
620
- included: $addArgumentDescription(z.string().array().default([]), `The list of addresses to include in the address space.
621
-
622
- The supported formats are:
623
- - Single IP address (e.g., \`192.168.1.1\`);
624
- - CIDR notation (e.g., \`192.168.1.1/24\`);
625
- - Dash notation (e.g., \`192.168.1.1-192.168.1.254\`).
677
+ var l4EndpointContainer = defineEntity({
678
+ type: "network.l4-endpoint-container.v1",
679
+ includes: {
680
+ endpoints: {
681
+ entity: l4EndpointEntity,
682
+ multiple: true
683
+ }
684
+ },
685
+ schema: z.unknown(),
686
+ meta: {
687
+ color: "#2196F3",
688
+ title: "L4 Endpoint Container",
689
+ icon: "mdi:network-outline",
690
+ iconColor: "#2196F3"
691
+ }
692
+ });
693
+ var l7EndpointContainer = defineEntity({
694
+ type: "network.l7-endpoint-container.v1",
695
+ includes: {
696
+ endpoints: {
697
+ entity: l7EndpointEntity,
698
+ multiple: true
699
+ }
700
+ },
701
+ schema: z.unknown(),
702
+ meta: {
703
+ color: "#FF9800",
704
+ title: "L7 Endpoint Container",
705
+ icon: "mdi:network-outline",
706
+ iconColor: "#FF9800"
707
+ }
708
+ });
709
+ var endpointReplacerArgs = $args({
710
+ /**
711
+ * The strings to parse as endpoints and add to the replacement list.
712
+ */
713
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The strings to parse as endpoints and add to the replacement list.`),
714
+ /**
715
+ * Whether to add current endpoints of the entity to the replacement list.
716
+ *
717
+ * Defaults to `true`.
718
+ */
719
+ includeCurrent: $addArgumentDescription(z.boolean().default(true), `Whether to add current endpoints of the entity to the replacement list.
626
720
 
627
- The addresses can be a mix of IPv4 and IPv6.`),
721
+ Defaults to \`true\`.`),
722
+ ...pick(optionalNetworkArgs, ["endpointFilter"])
723
+ });
724
+ var l3EndpointReplacer = defineUnit({
725
+ type: "network.l3-endpoint-replacer.v1",
726
+ args: endpointReplacerArgs,
727
+ inputs: {
628
728
  /**
629
- * The list of addresses to exclude from the `addresses` list.
630
- *
631
- * The supported formats are the same as in `addresses`.
729
+ * The entity containing the "endpoints" inclusion to replace.
632
730
  */
633
- excluded: $addArgumentDescription(z.string().array().default([]), `The list of addresses to exclude from the \`addresses\` list.
634
-
635
- The supported formats are the same as in \`addresses\`.`)
636
- },
637
- inputs: {
731
+ entity: $addInputDescription(l3EndpointContainer, `The entity containing the "endpoints" inclusion to replace.`),
638
732
  /**
639
- * The endpoints to include in the address space.
733
+ * The endpoints to add to the replacement list.
640
734
  */
641
- included: $addInputDescription({
735
+ endpoints: $addInputDescription({
642
736
  entity: l3EndpointEntity,
643
737
  multiple: true,
644
738
  required: false
645
- }, `The endpoints to include in the address space.`),
739
+ }, `The endpoints to add to the replacement list.`),
646
740
  /**
647
- * The endpoints to exclude from the `included` list.
741
+ * The IP addresses to parse as endpoints and add to the replacement list.
648
742
  */
649
- excluded: $addInputDescription({
650
- entity: l3EndpointEntity,
743
+ addresses: $addInputDescription({
744
+ entity: addressEntity,
651
745
  multiple: true,
652
746
  required: false
653
- }, `The endpoints to exclude from the \`included\` list.`)
747
+ }, `The IP addresses to parse as endpoints and add to the replacement list.`)
654
748
  },
655
749
  outputs: {
750
+ entity: { fromInput: "entity" }
751
+ },
752
+ meta: {
753
+ description: `Replaces the L3 endpoints in the entity.`,
754
+ title: "L3 Endpoint Replacer",
755
+ icon: "mdi:network-outline",
756
+ iconColor: "#FF9800",
757
+ secondaryIcon: "mdi:swap-horizontal-bold",
758
+ category: "Network"
759
+ },
760
+ source: {
761
+ package: "@highstate/common",
762
+ path: "units/network/l3-endpoint-replacer"
763
+ }
764
+ });
765
+ var l4EndpointReplacer = defineUnit({
766
+ type: "network.l4-endpoint-replacer.v1",
767
+ args: endpointReplacerArgs,
768
+ inputs: {
656
769
  /**
657
- * The address space entity representing the created address space.
770
+ * The entity containing the "endpoints" inclusion to replace.
658
771
  */
659
- addressSpace: $addInputDescription(addressSpaceEntity, `The address space entity representing the created address space.`)
772
+ entity: $addInputDescription(l4EndpointContainer, `The entity containing the "endpoints" inclusion to replace.`),
773
+ /**
774
+ * The endpoints to add to the replacement list.
775
+ */
776
+ endpoints: $addInputDescription({
777
+ entity: l4EndpointEntity,
778
+ multiple: true,
779
+ required: false
780
+ }, `The endpoints to add to the replacement list.`)
781
+ },
782
+ outputs: {
783
+ entity: { fromInput: "entity" }
660
784
  },
661
785
  meta: {
662
- description: `Defines an address space from a list of addresses/subnets/ranges.`,
663
- title: "Address Space",
664
- icon: "mdi:network",
786
+ description: `Replaces the L4 endpoints in the entity.`,
787
+ title: "L4 Endpoint Replacer",
788
+ icon: "mdi:network-outline",
789
+ iconColor: "#FF9800",
790
+ secondaryIcon: "mdi:swap-horizontal-bold",
665
791
  category: "Network"
666
792
  },
667
793
  source: {
668
794
  package: "@highstate/common",
669
- path: "units/network/address-space"
795
+ path: "units/network/l4-endpoint-replacer"
796
+ }
797
+ });
798
+ var l7EndpointReplacer = defineUnit({
799
+ type: "network.l7-endpoint-replacer.v1",
800
+ args: endpointReplacerArgs,
801
+ inputs: {
802
+ /**
803
+ * The entity containing the "endpoints" inclusion to replace.
804
+ */
805
+ entity: $addInputDescription(l7EndpointContainer, `The entity containing the "endpoints" inclusion to replace.`),
806
+ /**
807
+ * The endpoints to add to the replacement list.
808
+ */
809
+ endpoints: $addInputDescription({
810
+ entity: l7EndpointEntity,
811
+ multiple: true,
812
+ required: false
813
+ }, `The endpoints to add to the replacement list.`)
814
+ },
815
+ outputs: {
816
+ entity: { fromInput: "entity" }
817
+ },
818
+ meta: {
819
+ description: `Replaces the L7 endpoints in the entity.`,
820
+ title: "L7 Endpoint Replacer",
821
+ icon: "mdi:network-outline",
822
+ iconColor: "#FF9800",
823
+ secondaryIcon: "mdi:swap-horizontal-bold",
824
+ category: "Network"
825
+ },
826
+ source: {
827
+ package: "@highstate/common",
828
+ path: "units/network/l7-endpoint-replacer"
670
829
  }
671
830
  });
672
831
 
@@ -674,7 +833,7 @@ var addressSpace = defineUnit({
674
833
  var ssh_exports = {};
675
834
  __export(ssh_exports, {
676
835
  argsSchema: () => argsSchema,
677
- connectionSchema: () => connectionSchema,
836
+ connectionEntity: () => connectionEntity,
678
837
  inputs: () => inputs,
679
838
  keyPair: () => keyPair,
680
839
  keyPairEntity: () => keyPairEntity,
@@ -683,118 +842,6 @@ __export(ssh_exports, {
683
842
  publicKeyEntity: () => publicKeyEntity,
684
843
  secrets: () => secrets
685
844
  });
686
- var checksumAlgorithmSchema = z.enum(["md5", "sha1", "sha256", "sha384", "sha512"]);
687
- var checksumSchema = z.object({
688
- algorithm: checksumAlgorithmSchema,
689
- value: z.string()
690
- });
691
- var fileContentSchema = z.union([
692
- fileContentSchema$1,
693
- z.object({
694
- type: z.literal("local"),
695
- path: z.string()
696
- }),
697
- z.object({
698
- type: z.literal("remote"),
699
- endpoint: l7EndpointEntity.schema,
700
- checksum: checksumSchema.optional()
701
- })
702
- ]);
703
- var fileEntity = defineEntity({
704
- type: "common.file.v1",
705
- schema: z.object({
706
- meta: fileMetaSchema,
707
- content: fileContentSchema
708
- }),
709
- meta: {
710
- color: "#FF5722"
711
- }
712
- });
713
- var folderMetaSchema = z.object({
714
- name: z.string(),
715
- mode: z.number().optional()
716
- });
717
- var folderContentSchema = z.union([
718
- z.object({
719
- type: z.literal("embedded"),
720
- files: fileEntity.schema.array(),
721
- folders: z.object({
722
- meta: folderMetaSchema,
723
- get content() {
724
- return folderContentSchema;
725
- }
726
- }).array()
727
- }),
728
- z.object({
729
- type: z.literal("artifact"),
730
- ...unitArtifactSchema.shape
731
- }),
732
- z.object({
733
- type: z.literal("local"),
734
- path: z.string()
735
- }),
736
- z.object({
737
- type: z.literal("remote"),
738
- endpoint: l7EndpointEntity.schema
739
- })
740
- ]);
741
- var folderEntity = defineEntity({
742
- type: "common.folder.v1",
743
- schema: z.object({
744
- meta: folderMetaSchema,
745
- content: folderContentSchema
746
- }),
747
- meta: {
748
- color: "#FF9800"
749
- }
750
- });
751
- var remoteFile = defineUnit({
752
- type: "common.remote-file.v1",
753
- args: {
754
- /**
755
- * The URL of the remote file.
756
- *
757
- * Either this or the 'endpoint' input must be provided.
758
- */
759
- url: $addArgumentDescription(z.string().optional(), `The URL of the remote file.
760
-
761
- Either this or the 'endpoint' input must be provided.`),
762
- /**
763
- * The name of the file.
764
- *
765
- * If not provided, the name will be derived from the URL or endpoint path.
766
- * If not possible, the name of the unit will be used.
767
- */
768
- fileName: $addArgumentDescription(z.string().optional(), `The name of the file.
769
-
770
- If not provided, the name will be derived from the URL or endpoint path.
771
- If not possible, the name of the unit will be used.`)
772
- },
773
- inputs: {
774
- /**
775
- * The L7 endpoint of the remote file.
776
- */
777
- endpoint: $addInputDescription({
778
- entity: l7EndpointEntity,
779
- required: false
780
- }, `The L7 endpoint of the remote file.`)
781
- },
782
- outputs: {
783
- file: fileEntity
784
- },
785
- meta: {
786
- description: `References a file from a remote URL.`,
787
- title: "Remote File",
788
- icon: "mdi:file-download",
789
- category: "Files"
790
- },
791
- source: {
792
- package: "@highstate/common",
793
- path: "units/remote-file"
794
- }
795
- });
796
-
797
- // src/ssh.ts
798
845
  var keyTypeSchema = z.enum(["ed25519"]);
799
846
  var publicKeyEntity = defineEntity({
800
847
  type: "ssh.public-key.v1",
@@ -827,34 +874,57 @@ var keyPairEntity = defineEntity({
827
874
  /**
828
875
  * The private key in PEM format.
829
876
  */
830
- privateKey: z.string().meta({ title: camelCaseToHumanReadable("privateKey"), description: `The private key in PEM format.` })
877
+ privateKey: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("privateKey"), description: `The private key in PEM format.` })
831
878
  }),
832
879
  meta: {
833
880
  description: `The entity representing an SSH key pair.`,
834
- color: "#2b5797"
881
+ color: "#2b5797",
882
+ title: "SSH Key Pair",
883
+ icon: "charm:key",
884
+ iconColor: "#ffffff",
885
+ secondaryIcon: "mdi:lock",
886
+ secondaryIconColor: "#ffffff"
835
887
  }
836
888
  });
837
- var connectionSchema = z.object({
838
- /**
839
- * The list of L4 endpoints which can be used to connect to the SSH server.
840
- */
841
- endpoints: l4EndpointEntity.schema.array().meta({ title: camelCaseToHumanReadable("endpoints"), description: `The list of L4 endpoints which can be used to connect to the SSH server.` }),
842
- /**
843
- * The host key of the SSH server which will be used to verify the server's identity.
844
- */
845
- hostKey: z.string().meta({ title: camelCaseToHumanReadable("hostKey"), description: `The host key of the SSH server which will be used to verify the server's identity.` }),
846
- /**
847
- * The user to connect as.
848
- */
849
- user: z.string().meta({ title: camelCaseToHumanReadable("user"), description: `The user to connect as.` }),
850
- /**
851
- * The password to use for authentication.
852
- */
853
- password: z.string().optional().meta({ title: camelCaseToHumanReadable("password"), description: `The password to use for authentication.` }),
854
- /**
855
- * The SSH key pair to use for authentication.
856
- */
857
- keyPair: keyPairEntity.schema.optional().meta({ title: camelCaseToHumanReadable("keyPair"), description: `The SSH key pair to use for authentication.` })
889
+ var connectionEntity = defineEntity({
890
+ type: "ssh.connection.v1",
891
+ includes: {
892
+ /**
893
+ * The endpoints to connect to.
894
+ */
895
+ endpoints: {
896
+ entity: l4EndpointEntity,
897
+ multiple: true
898
+ },
899
+ /**
900
+ * The SSH key pair to use for authentication.
901
+ */
902
+ keyPair: {
903
+ entity: keyPairEntity,
904
+ required: false
905
+ }
906
+ },
907
+ schema: z.object({
908
+ /**
909
+ * The host key of the SSH server which will be used to verify the server's identity.
910
+ */
911
+ hostKey: z.string().meta({ title: camelCaseToHumanReadable("hostKey"), description: `The host key of the SSH server which will be used to verify the server's identity.` }),
912
+ /**
913
+ * The user to connect as.
914
+ */
915
+ user: z.string().meta({ title: camelCaseToHumanReadable("user"), description: `The user to connect as.` }),
916
+ /**
917
+ * The password to use for authentication.
918
+ */
919
+ password: secretSchema(z.string()).optional().meta({ title: camelCaseToHumanReadable("password"), description: `The password to use for authentication.` })
920
+ }),
921
+ meta: {
922
+ description: `The schema for the SSH connection credentials.`,
923
+ color: "#2b5797",
924
+ title: "SSH Connection",
925
+ icon: "mdi:terminal",
926
+ iconColor: "#2b5797"
927
+ }
858
928
  });
859
929
  var argsSchema = z.object({
860
930
  /**
@@ -947,8 +1017,7 @@ var keyPair = defineUnit({
947
1017
  If not provided, a new key pair will be generated and stored.`)
948
1018
  },
949
1019
  outputs: {
950
- keyPair: keyPairEntity,
951
- publicKeyFile: fileEntity
1020
+ keyPair: keyPairEntity
952
1021
  },
953
1022
  meta: {
954
1023
  description: `Holds the ED25519 SSH key pair and generates the private key if not provided.`,
@@ -968,15 +1037,23 @@ var keyPair = defineUnit({
968
1037
  // src/common/server.ts
969
1038
  var serverEntity = defineEntity({
970
1039
  type: "common.server.v1",
1040
+ extends: { l3EndpointContainer },
971
1041
  includes: {
972
- endpoints: {
973
- entity: l3EndpointEntity,
974
- multiple: true
1042
+ /**
1043
+ * The SSH configuration for the server.
1044
+ *
1045
+ * If not specified, it will be assumed that the server is not accessible via SSH.
1046
+ */
1047
+ ssh: {
1048
+ entity: connectionEntity,
1049
+ required: false
975
1050
  }
976
1051
  },
977
1052
  schema: z.object({
978
- hostname: z.string(),
979
- ssh: connectionSchema.optional()
1053
+ /**
1054
+ * The hostname of the server.
1055
+ */
1056
+ hostname: z.string().meta({ title: camelCaseToHumanReadable("hostname"), description: `The hostname of the server.` })
980
1057
  }),
981
1058
  meta: {
982
1059
  description: `The server entity represents a server with its hostname, endpoints, and optional SSH configuration.
@@ -984,7 +1061,10 @@ var serverEntity = defineEntity({
984
1061
  The OS of the server is not specified (but in most cases it will one of the Linux distributions).
985
1062
 
986
1063
  In fact, anything that have hostname (which can be any string) and L3 endpoints can be represented by this entity.`,
987
- color: "#009688"
1064
+ color: "#009688",
1065
+ title: "Server",
1066
+ icon: "mdi:server",
1067
+ iconColor: "#009688"
988
1068
  }
989
1069
  });
990
1070
  var serverOutputs = $outputs({
@@ -1124,10 +1204,6 @@ var script = defineUnit({
1124
1204
  var providerEntity = defineEntity({
1125
1205
  type: "dns.provider.v1",
1126
1206
  schema: z.object({
1127
- /**
1128
- * The ID of the DNS provider unique within the system.
1129
- */
1130
- id: z.string().meta({ title: camelCaseToHumanReadable("id"), description: `The ID of the DNS provider unique within the system.` }),
1131
1207
  /**
1132
1208
  * The zones managed by the DNS provider.
1133
1209
  */
@@ -1138,7 +1214,10 @@ var providerEntity = defineEntity({
1138
1214
  implRef: implementationReferenceSchema.meta({ title: camelCaseToHumanReadable("implRef"), description: `The reference to the implementation of the DNS provider.` })
1139
1215
  }),
1140
1216
  meta: {
1141
- color: "#FF5722"
1217
+ color: "#FF5722",
1218
+ title: "DNS Provider",
1219
+ icon: "mdi:dns",
1220
+ iconColor: "#FF5722"
1142
1221
  }
1143
1222
  });
1144
1223
  var recordSet = defineUnit({
@@ -1302,6 +1381,9 @@ var gatewayEntity = defineEntity({
1302
1381
  If not provided, should be automatically detected by the implementation.` })
1303
1382
  }),
1304
1383
  meta: {
1384
+ title: "Gateway",
1385
+ icon: "mdi:router-network",
1386
+ iconColor: "#F57F17",
1305
1387
  color: "#F57F17"
1306
1388
  }
1307
1389
  });
@@ -1318,6 +1400,9 @@ var tlsIssuerEntity = defineEntity({
1318
1400
  implRef: implementationReferenceSchema.meta({ title: camelCaseToHumanReadable("implRef"), description: `The reference to the implementation of the TLS issuer.` })
1319
1401
  }),
1320
1402
  meta: {
1403
+ title: "TLS Issuer",
1404
+ icon: "mdi:certificate-outline",
1405
+ iconColor: "#F57F17",
1321
1406
  color: "#F57F17"
1322
1407
  }
1323
1408
  });
@@ -1342,6 +1427,9 @@ var accessPointEntity = defineEntity({
1342
1427
  proxied: z.boolean().default(false).meta({ title: camelCaseToHumanReadable("proxied"), description: `Whether the DNS records created for the access point should be proxied.` })
1343
1428
  }),
1344
1429
  meta: {
1430
+ title: "Access Point",
1431
+ icon: "mdi:access-point",
1432
+ iconColor: "#F57F17",
1345
1433
  color: "#F57F17"
1346
1434
  }
1347
1435
  });
@@ -1392,544 +1480,1171 @@ var accessPoint = defineUnit({
1392
1480
  path: "units/access-point"
1393
1481
  }
1394
1482
  });
1395
-
1396
- // src/databases/index.ts
1397
- var databases_exports = {};
1398
- __export(databases_exports, {
1399
- etcdEntity: () => etcdEntity,
1400
- etcdPatch: () => etcdPatch,
1401
- existingEtcd: () => existingEtcd,
1402
- existingMariadb: () => existingMariadb,
1403
- existingMongodb: () => existingMongodb,
1404
- existingPostgresql: () => existingPostgresql,
1405
- existingRedis: () => existingRedis,
1406
- existingS3: () => existingS3,
1407
- mariadbEntity: () => mariadbEntity,
1408
- mariadbPatch: () => mariadbPatch,
1409
- mongodbEntity: () => mongodbEntity,
1410
- mongodbPatch: () => mongodbPatch,
1411
- optionalSharedArgs: () => optionalSharedArgs,
1412
- postgresqlEntity: () => postgresqlEntity,
1413
- postgresqlPatch: () => postgresqlPatch,
1414
- redisEntity: () => redisEntity,
1415
- redisPatch: () => redisPatch,
1416
- s3BucketPolicySchema: () => s3BucketPolicySchema,
1417
- s3BucketSchema: () => s3BucketSchema,
1418
- s3Entity: () => s3Entity,
1419
- s3Patch: () => s3Patch,
1420
- sharedArgs: () => sharedArgs,
1421
- sharedInputs: () => sharedInputs,
1422
- sharedSchema: () => sharedSchema,
1423
- sharedSecrets: () => sharedSecrets
1483
+ var checksumAlgorithmSchema = z.enum(["md5", "sha1", "sha256", "sha384", "sha512"]);
1484
+ var checksumSchema = z.object({
1485
+ algorithm: checksumAlgorithmSchema,
1486
+ value: z.string()
1424
1487
  });
1425
- var etcdArgs = {
1426
- endpoints: {
1427
- schema: z.string().array().default([])
1488
+ var fileContentSchema = z.union([
1489
+ fileContentSchema$1,
1490
+ z.object({
1491
+ type: z.literal("remote"),
1492
+ endpoint: l7EndpointEntity.schema,
1493
+ checksum: checksumSchema.optional()
1494
+ })
1495
+ ]);
1496
+ var fileEntity = defineEntity({
1497
+ type: "common.file.v1",
1498
+ schema: z.object({
1499
+ meta: fileMetaSchema,
1500
+ content: fileContentSchema
1501
+ }),
1502
+ meta: {
1503
+ title: "File",
1504
+ icon: "mdi:file",
1505
+ iconColor: "#2196F3",
1506
+ color: "#2196F3"
1428
1507
  }
1429
- };
1430
- var etcdEntity = defineEntity({
1431
- type: "databases.etcd.v1",
1508
+ });
1509
+ var folderMetaSchema = z.object({
1510
+ name: z.string(),
1511
+ mode: z.number().optional()
1512
+ });
1513
+ var folderContentSchema = z.union([
1514
+ z.object({
1515
+ type: z.literal("embedded")
1516
+ }),
1517
+ z.object({
1518
+ type: z.literal("artifact"),
1519
+ ...unitArtifactSchema.shape
1520
+ }),
1521
+ z.object({
1522
+ type: z.literal("local"),
1523
+ path: z.string()
1524
+ }),
1525
+ z.object({
1526
+ type: z.literal("remote"),
1527
+ endpoint: l7EndpointEntity.schema
1528
+ })
1529
+ ]);
1530
+ var folderEntity = defineEntity({
1531
+ type: "common.folder.v1",
1432
1532
  includes: {
1433
- endpoints: {
1434
- entity: l4EndpointEntity,
1435
- multiple: true
1533
+ files: {
1534
+ entity: fileEntity,
1535
+ multiple: true,
1536
+ required: false
1537
+ },
1538
+ folders: {
1539
+ entity: () => folderEntity,
1540
+ multiple: true,
1541
+ required: false
1436
1542
  }
1437
1543
  },
1438
- schema: z.unknown(),
1544
+ schema: z.object({
1545
+ meta: folderMetaSchema,
1546
+ content: folderContentSchema
1547
+ }),
1439
1548
  meta: {
1440
- description: `Represents the etcd database instance.`,
1441
- color: "#0064bf"
1549
+ title: "Folder",
1550
+ icon: "mdi:folder",
1551
+ iconColor: "#4CAF50",
1552
+ color: "#4CAF50"
1442
1553
  }
1443
1554
  });
1444
- var existingEtcd = defineUnit({
1445
- type: "databases.etcd.existing.v1",
1446
- args: etcdArgs,
1555
+ var remoteFile = defineUnit({
1556
+ type: "common.remote-file.v1",
1557
+ args: {
1558
+ /**
1559
+ * The URL of the remote file.
1560
+ *
1561
+ * Either this or the 'endpoint' input must be provided.
1562
+ */
1563
+ url: $addArgumentDescription(z.string().optional(), `The URL of the remote file.
1564
+
1565
+ Either this or the 'endpoint' input must be provided.`),
1566
+ /**
1567
+ * The name of the file.
1568
+ *
1569
+ * If not provided, the name will be derived from the URL or endpoint path.
1570
+ * If not possible, the name of the unit will be used.
1571
+ */
1572
+ fileName: $addArgumentDescription(z.string().optional(), `The name of the file.
1573
+
1574
+ If not provided, the name will be derived from the URL or endpoint path.
1575
+ If not possible, the name of the unit will be used.`)
1576
+ },
1447
1577
  inputs: {
1448
- endpoints: {
1449
- entity: l4EndpointEntity,
1450
- multiple: true,
1578
+ /**
1579
+ * The L7 endpoint of the remote file.
1580
+ */
1581
+ endpoint: $addInputDescription({
1582
+ entity: l7EndpointEntity,
1451
1583
  required: false
1452
- }
1584
+ }, `The L7 endpoint of the remote file.`)
1453
1585
  },
1454
1586
  outputs: {
1455
- etcd: etcdEntity
1456
- },
1457
- source: {
1458
- package: "@highstate/common",
1459
- path: "units/databases/existing-etcd"
1587
+ file: fileEntity
1460
1588
  },
1461
1589
  meta: {
1462
- description: `The existing etcd database instance.`,
1463
- title: "Existing etcd Database",
1464
- icon: "simple-icons:etcd",
1465
- secondaryIcon: "mdi:database",
1466
- category: "Databases"
1590
+ description: `References a file from a remote URL.`,
1591
+ title: "Remote File",
1592
+ icon: "mdi:file-download",
1593
+ category: "Files"
1594
+ },
1595
+ source: {
1596
+ package: "@highstate/common",
1597
+ path: "units/remote-file"
1598
+ }
1599
+ });
1600
+
1601
+ // src/databases/etcd.ts
1602
+ var etcd_exports = {};
1603
+ __export(etcd_exports, {
1604
+ connection: () => connection,
1605
+ connectionEntity: () => connectionEntity2,
1606
+ credentialsSchema: () => credentialsSchema,
1607
+ namespace: () => namespace,
1608
+ namespacePermissionSchema: () => namespacePermissionSchema
1609
+ });
1610
+ var certificateEntity = defineEntity({
1611
+ type: "tls.certificate.v1",
1612
+ includes: {
1613
+ /**
1614
+ * The file containing the certificate in PEM format.
1615
+ */
1616
+ file: fileEntity
1617
+ },
1618
+ schema: z.unknown(),
1619
+ meta: {
1620
+ title: "TLS Certificate",
1621
+ color: "#4caf50",
1622
+ icon: "mdi:certificate",
1623
+ iconColor: "#4caf50"
1467
1624
  }
1468
1625
  });
1469
- var etcdPatch = defineUnit({
1470
- type: "databases.etcd-patch.v1",
1471
- args: toPatchArgs(etcdArgs),
1626
+
1627
+ // src/databases/etcd.ts
1628
+ var credentialsSchema = z.discriminatedUnion("type", [
1629
+ z.object({
1630
+ type: z.literal("password"),
1631
+ /**
1632
+ * The username used to authenticate against the database.
1633
+ */
1634
+ username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the database.` }),
1635
+ /**
1636
+ * The password used to authenticate against the database.
1637
+ */
1638
+ password: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the database.` })
1639
+ })
1640
+ ]);
1641
+ var connectionEntity2 = defineEntity({
1642
+ type: "etcd.connection.v1",
1643
+ extends: { l4EndpointContainer },
1644
+ includes: {
1645
+ /**
1646
+ * The TLS certificate of the server if any.
1647
+ */
1648
+ certificate: {
1649
+ entity: certificateEntity,
1650
+ required: false
1651
+ }
1652
+ },
1653
+ schema: z.object({
1654
+ /**
1655
+ * The credentials for authenticating to the etcd cluster.
1656
+ */
1657
+ credentials: credentialsSchema.optional().meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the etcd cluster.` })
1658
+ }),
1659
+ meta: {
1660
+ description: `Represents a connection to the etcd cluster.`,
1661
+ color: "#0064bf"
1662
+ }
1663
+ });
1664
+ var connection = defineUnit({
1665
+ type: "etcd.connection.v1",
1666
+ args: {
1667
+ /**
1668
+ * The endpoints to connect to the etcd cluster.
1669
+ */
1670
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the etcd cluster.`),
1671
+ /**
1672
+ * The username to authenticate with.
1673
+ */
1674
+ username: $addArgumentDescription(z.string().optional(), `The username to authenticate with.`)
1675
+ },
1676
+ secrets: {
1677
+ /**
1678
+ * The password to authenticate with.
1679
+ */
1680
+ password: $addArgumentDescription(z.string().optional(), `The password to authenticate with.`)
1681
+ },
1472
1682
  inputs: {
1473
- etcd: etcdEntity,
1474
- endpoints: {
1683
+ /**
1684
+ * The endpoints to connect to the etcd cluster.
1685
+ */
1686
+ endpoints: $addInputDescription({
1475
1687
  entity: l4EndpointEntity,
1476
1688
  multiple: true,
1477
1689
  required: false
1478
- }
1690
+ }, `The endpoints to connect to the etcd cluster.`)
1479
1691
  },
1480
1692
  outputs: {
1481
- etcd: etcdEntity
1693
+ connection: connectionEntity2
1482
1694
  },
1483
1695
  source: {
1484
- package: "@highstate/common",
1485
- path: "units/databases/etcd-patch"
1696
+ package: "@highstate/etcd",
1697
+ path: "units/connection"
1486
1698
  },
1487
1699
  meta: {
1488
- description: `Patches some properties of the etcd database and outputs the updated database.`,
1489
- title: "etcd Patch",
1700
+ description: `The connection to an existing etcd cluster hosted on a server or a managed service.`,
1701
+ title: "Existing etcd Database",
1490
1702
  icon: "simple-icons:etcd",
1491
- secondaryIcon: "fluent:patch-20-filled",
1703
+ secondaryIcon: "mdi:database",
1492
1704
  category: "Databases"
1493
1705
  }
1494
1706
  });
1495
- var sharedSchema = z.object({
1707
+ var namespacePermissionSchema = z.object({
1496
1708
  /**
1497
- * The username to connect to the database with.
1709
+ * The prefix of the namespace to grant access to.
1498
1710
  */
1499
- username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username to connect to the database with.` }),
1711
+ prefix: z.string().meta({ title: camelCaseToHumanReadable("prefix"), description: `The prefix of the namespace to grant access to.` }),
1500
1712
  /**
1501
- * The password to connect to the database with.
1713
+ * The range end of the namespace to grant access to.
1714
+ *
1715
+ * If not specified, all keys with the given prefix will be included in the namespace.
1502
1716
  */
1503
- password: z.string().optional().meta({ title: camelCaseToHumanReadable("password"), description: `The password to connect to the database with.` }),
1717
+ rangeEnd: z.string().optional().meta({ title: camelCaseToHumanReadable("rangeEnd"), description: `The range end of the namespace to grant access to.
1718
+
1719
+ If not specified, all keys with the given prefix will be included in the namespace.` }),
1504
1720
  /**
1505
- * The name of the database to connect to.
1721
+ * The access level to grant to the namespace.
1722
+ *
1723
+ * If not specified, defaults to `readwrite`.
1506
1724
  */
1507
- database: z.string().optional().meta({ title: camelCaseToHumanReadable("database"), description: `The name of the database to connect to.` })
1725
+ permission: z.enum(["read", "write", "readwrite"]).default("readwrite").meta({ title: camelCaseToHumanReadable("permission"), description: `The access level to grant to the namespace.
1726
+
1727
+ If not specified, defaults to \`readwrite\`.` })
1508
1728
  });
1509
- var sharedArgs = $args({
1729
+ var namespace = defineUnit({
1730
+ type: "etcd.namespace.v1",
1731
+ args: {
1732
+ /**
1733
+ * The name of the role to define for the namespace.
1734
+ *
1735
+ * If not provided, the name of the unit will be used.
1736
+ */
1737
+ roleName: $addArgumentDescription(z.string().optional(), `The name of the role to define for the namespace.
1738
+
1739
+ If not provided, the name of the unit will be used.`),
1740
+ /**
1741
+ * The username of the user to create for the namespace.
1742
+ *
1743
+ * If not provided, the name of the role will be used.
1744
+ */
1745
+ username: $addArgumentDescription(z.string().optional(), `The username of the user to create for the namespace.
1746
+
1747
+ If not provided, the name of the role will be used.`),
1748
+ /**
1749
+ * The permissions to grant to the namespace.
1750
+ */
1751
+ permissions: $addArgumentDescription(namespacePermissionSchema.array(), `The permissions to grant to the namespace.`)
1752
+ },
1753
+ secrets: {
1754
+ /**
1755
+ * The password of the user to create for the namespace.
1756
+ *
1757
+ * If not provided, a random password will be generated.
1758
+ */
1759
+ password: $addArgumentDescription(z.string().optional(), `The password of the user to create for the namespace.
1760
+
1761
+ If not provided, a random password will be generated.`)
1762
+ },
1763
+ inputs: {
1764
+ /**
1765
+ * The connection to the etcd cluster.
1766
+ */
1767
+ connection: $addInputDescription({
1768
+ entity: connectionEntity2,
1769
+ required: true
1770
+ }, `The connection to the etcd cluster.`)
1771
+ },
1772
+ outputs: {
1773
+ connection: connectionEntity2
1774
+ },
1775
+ source: {
1776
+ package: "@highstate/etcd",
1777
+ path: "units/namespace"
1778
+ },
1779
+ meta: {
1780
+ description: `The namespace within an existing etcd cluster.`,
1781
+ title: "etcd Namespace",
1782
+ icon: "simple-icons:etcd",
1783
+ iconColor: "#0069ab",
1784
+ secondaryIcon: "mdi:database",
1785
+ category: "Databases"
1786
+ }
1787
+ });
1788
+
1789
+ // src/databases/influxdb3.ts
1790
+ var influxdb3_exports = {};
1791
+ __export(influxdb3_exports, {
1792
+ connectionEntity: () => connectionEntity3,
1793
+ credentialsSchema: () => credentialsSchema2,
1794
+ database: () => database,
1795
+ databaseEntity: () => databaseEntity
1796
+ });
1797
+ var credentialsSchema2 = z.object({
1510
1798
  /**
1511
- * The endpoints to connect to the database in form of `host:port`.
1799
+ * The token for authenticating to the InfluxDB 3 instance.
1512
1800
  */
1513
- endpoints: $addArgumentDescription(z.string().array().min(1), `The endpoints to connect to the database in form of \`host:port\`.`),
1801
+ token: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("token"), description: `The token for authenticating to the InfluxDB 3 instance.` })
1802
+ });
1803
+ var connectionEntity3 = defineEntity({
1804
+ type: "influxdb3.connection.v1",
1805
+ extends: { l7EndpointContainer },
1806
+ schema: z.object({
1807
+ /**
1808
+ * The credentials for authenticating to the InfluxDB 3 instance.
1809
+ */
1810
+ credentials: credentialsSchema2.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the InfluxDB 3 instance.` })
1811
+ }),
1812
+ meta: {
1813
+ description: `Represents a connection to a InfluxDB 3 instance, including the endpoints and credentials.`,
1814
+ color: "#22adf6"
1815
+ }
1816
+ });
1817
+ var databaseEntity = defineEntity({
1818
+ type: "influxdb3.database.v1",
1819
+ extends: { connectionEntity: connectionEntity3 },
1820
+ schema: z.object({
1821
+ /**
1822
+ * The name of the database.
1823
+ */
1824
+ name: z.string().meta({ title: camelCaseToHumanReadable("name"), description: `The name of the database.` })
1825
+ }),
1826
+ meta: {
1827
+ description: `Represents an InfluxDB 3 database with credentials and endpoints to access it.`,
1828
+ color: "#22adf6"
1829
+ }
1830
+ });
1831
+ var database = defineUnit({
1832
+ type: "influxdb3.database.v1",
1833
+ args: {
1834
+ /**
1835
+ * The name of the database.
1836
+ *
1837
+ * If not provided, it will be set to the unit name.
1838
+ */
1839
+ databaseName: $addArgumentDescription(z.string().optional(), `The name of the database.
1840
+
1841
+ If not provided, it will be set to the unit name.`),
1842
+ /**
1843
+ * The retention period for the database.
1844
+ *
1845
+ * The value is passed through to InfluxDB 3 as-is.
1846
+ */
1847
+ retention_period: $addArgumentDescription(z.string().optional(), `The retention period for the database.
1848
+
1849
+ The value is passed through to InfluxDB 3 as-is.`)
1850
+ },
1851
+ inputs: {
1852
+ connection: connectionEntity3
1853
+ },
1854
+ outputs: {
1855
+ database: databaseEntity
1856
+ },
1857
+ meta: {
1858
+ description: `Creates a database in an InfluxDB 3 instance.`,
1859
+ title: "InfluxDB 3 Database",
1860
+ icon: "simple-icons:influxdb",
1861
+ category: "Databases"
1862
+ },
1863
+ source: {
1864
+ package: "@highstate/influxdb3",
1865
+ path: "units/database"
1866
+ }
1867
+ });
1868
+
1869
+ // src/databases/minio.ts
1870
+ var minio_exports = {};
1871
+ __export(minio_exports, {
1872
+ bucket: () => bucket,
1873
+ connection: () => connection2,
1874
+ connectionEntity: () => connectionEntity4,
1875
+ credentialsSchema: () => credentialsSchema4
1876
+ });
1877
+
1878
+ // src/databases/s3.ts
1879
+ var s3_exports = {};
1880
+ __export(s3_exports, {
1881
+ bucketEntity: () => bucketEntity,
1882
+ credentialsSchema: () => credentialsSchema3,
1883
+ existingBucket: () => existingBucket
1884
+ });
1885
+ var credentialsSchema3 = z.object({
1514
1886
  /**
1515
- * The username to connect to the database with.
1516
- *
1517
- * If not provided, defaults to `root`.
1887
+ * The access key used to authenticate against the API.
1518
1888
  */
1519
- username: $addArgumentDescription(z.string().default("root"), `The username to connect to the database with.
1520
-
1521
- If not provided, defaults to \`root\`.`),
1889
+ accessKey: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("accessKey"), description: `The access key used to authenticate against the API.` }),
1522
1890
  /**
1523
- * The name of the database to connect to.
1891
+ * The secret key used to authenticate against the API.
1524
1892
  */
1525
- database: $addArgumentDescription(z.string().optional(), `The name of the database to connect to.`)
1893
+ secretKey: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("secretKey"), description: `The secret key used to authenticate against the API.` })
1526
1894
  });
1527
- var optionalSharedArgs = mapValues(sharedArgs, (arg) => ({
1528
- ...arg,
1529
- schema: arg.schema.optional()
1530
- }));
1531
- var sharedSecrets = $secrets({
1895
+ var bucketEntity = defineEntity({
1896
+ type: "s3.bucket.v1",
1897
+ extends: { l7EndpointContainer },
1898
+ schema: z.object({
1899
+ /**
1900
+ * The name of the S3 bucket.
1901
+ */
1902
+ name: z.string().meta({ title: camelCaseToHumanReadable("name"), description: `The name of the S3 bucket.` }),
1903
+ /**
1904
+ * The region where the S3 bucket is located.
1905
+ */
1906
+ region: z.string().meta({ title: camelCaseToHumanReadable("region"), description: `The region where the S3 bucket is located.` }),
1907
+ /**
1908
+ * The credentials that can be used to access the S3 bucket.
1909
+ */
1910
+ credentials: credentialsSchema3.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials that can be used to access the S3 bucket.` })
1911
+ }),
1912
+ meta: {
1913
+ description: `Represents an S3 bucket with credentials and endpoints to access it.`,
1914
+ color: "#ff9900"
1915
+ }
1916
+ });
1917
+ var existingBucket = defineUnit({
1918
+ type: "s3.existing-bucket.v1",
1919
+ args: {
1920
+ /**
1921
+ * The name of the existing S3 bucket.
1922
+ */
1923
+ bucketName: $addArgumentDescription(z.string(), `The name of the existing S3 bucket.`),
1924
+ /**
1925
+ * The region where the existing S3 bucket is located.
1926
+ */
1927
+ region: $addArgumentDescription(z.string(), `The region where the existing S3 bucket is located.`),
1928
+ /**
1929
+ * The endpoints to connect to the S3 bucket.
1930
+ */
1931
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the S3 bucket.`)
1932
+ },
1933
+ inputs: {
1934
+ /**
1935
+ * The endpoints to connect to the S3 bucket.
1936
+ */
1937
+ endpoints: $addInputDescription({
1938
+ entity: l4EndpointEntity,
1939
+ multiple: true,
1940
+ required: false
1941
+ }, `The endpoints to connect to the S3 bucket.`)
1942
+ },
1943
+ outputs: {
1944
+ bucket: bucketEntity
1945
+ },
1946
+ source: {
1947
+ package: "@highstate/common",
1948
+ path: "units/databases/existing-s3-bucket"
1949
+ },
1950
+ meta: {
1951
+ description: `The existing S3 bucket hosted on AWS or another S3-compatible service.`,
1952
+ title: "Existing S3 Bucket",
1953
+ icon: "simple-icons:amazonaws",
1954
+ secondaryIcon: "mdi:database",
1955
+ category: "Databases"
1956
+ }
1957
+ });
1958
+
1959
+ // src/databases/minio.ts
1960
+ var credentialsSchema4 = z.object({
1532
1961
  /**
1533
- * The password to connect to the database with.
1962
+ * The username used to authenticate against the API.
1534
1963
  */
1535
- password: $addArgumentDescription(z.string().optional(), `The password to connect to the database with.`)
1536
- });
1537
- var sharedInputs = $inputs({
1964
+ username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the API.` }),
1538
1965
  /**
1539
- * The endpoints to connect to the database.
1966
+ * The password used to authenticate against the API.
1540
1967
  */
1541
- endpoints: $addInputDescription({
1542
- entity: l4EndpointEntity,
1543
- multiple: true,
1544
- required: false
1545
- }, `The endpoints to connect to the database.`)
1968
+ password: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the API.` })
1546
1969
  });
1547
-
1548
- // src/databases/mariadb.ts
1549
- var mariadbEntity = defineEntity({
1550
- type: "databases.mariadb.v1",
1551
- includes: {
1552
- endpoints: {
1553
- entity: l4EndpointEntity,
1554
- multiple: true
1555
- }
1556
- },
1557
- schema: sharedSchema,
1970
+ var connectionEntity4 = defineEntity({
1971
+ type: "minio.connection.v1",
1972
+ extends: { l7EndpointContainer },
1973
+ schema: z.object({
1974
+ /**
1975
+ * The region of the MinIO instance.
1976
+ */
1977
+ region: z.string().meta({ title: camelCaseToHumanReadable("region"), description: `The region of the MinIO instance.` }),
1978
+ /**
1979
+ * The credentials for authenticating to the MinIO instance.
1980
+ */
1981
+ credentials: credentialsSchema4.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the MinIO instance.` })
1982
+ }),
1558
1983
  meta: {
1559
- description: `Represents the MariaDB database or virtual database behind it.`,
1560
- color: "#f06292"
1984
+ description: `Represents a connection to a MinIO instance, including the endpoints and credentials.`,
1985
+ color: "#C72E49"
1561
1986
  }
1562
1987
  });
1563
- var existingMariadb = defineUnit({
1564
- type: "databases.mariadb.existing.v1",
1565
- args: sharedArgs,
1566
- secrets: sharedSecrets,
1567
- inputs: sharedInputs,
1988
+ var connection2 = defineUnit({
1989
+ type: "minio.connection.v1",
1990
+ args: {
1991
+ /**
1992
+ * The username to authenticate with.
1993
+ */
1994
+ username: $addArgumentDescription(z.string(), `The username to authenticate with.`),
1995
+ /**
1996
+ * The region of the MinIO instance.
1997
+ *
1998
+ * If not provided, it will default to "us-east-1".
1999
+ */
2000
+ region: $addArgumentDescription(z.string().default("us-east-1"), `The region of the MinIO instance.
2001
+
2002
+ If not provided, it will default to "us-east-1".`),
2003
+ /**
2004
+ * The endpoints to connect to the MinIO instance.
2005
+ */
2006
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the MinIO instance.`)
2007
+ },
2008
+ inputs: {
2009
+ /**
2010
+ * The endpoints to connect to the MinIO instance.
2011
+ */
2012
+ endpoints: $addInputDescription({
2013
+ entity: l7EndpointEntity,
2014
+ multiple: true,
2015
+ required: false
2016
+ }, `The endpoints to connect to the MinIO instance.`)
2017
+ },
2018
+ secrets: {
2019
+ /**
2020
+ * The password to authenticate with.
2021
+ */
2022
+ password: $addArgumentDescription(z.string(), `The password to authenticate with.`)
2023
+ },
1568
2024
  outputs: {
1569
- mariadb: mariadbEntity
2025
+ connection: connectionEntity4
1570
2026
  },
1571
2027
  source: {
1572
- package: "@highstate/common",
1573
- path: "units/databases/existing-mariadb"
2028
+ package: "@highstate/minio",
2029
+ path: "connection"
1574
2030
  },
1575
2031
  meta: {
1576
- description: `The existing MariaDB database or virtual database behind it.`,
1577
- title: "Existing MariaDB Database",
1578
- icon: "simple-icons:mariadb",
2032
+ description: `The existing MinIO connection hosted on a server or a managed service.`,
2033
+ title: "MinIO Connection",
2034
+ icon: "simple-icons:minio",
1579
2035
  secondaryIcon: "mdi:database",
1580
2036
  category: "Databases"
1581
2037
  }
1582
2038
  });
1583
- var mariadbPatch = defineUnit({
1584
- type: "databases.mariadb-patch.v1",
2039
+ var bucket = defineUnit({
2040
+ type: "minio.bucket.v1",
1585
2041
  args: {
1586
- ...toPatchArgs(optionalSharedArgs),
1587
- endpoints: {
1588
- ...sharedArgs.endpoints,
1589
- schema: z.string().array().default([])
1590
- }
2042
+ /**
2043
+ * The name of the bucket to create.
2044
+ *
2045
+ * Defaults to the name of the unit if not provided.
2046
+ */
2047
+ bucketName: $addArgumentDescription(z.string().optional(), `The name of the bucket to create.
2048
+
2049
+ Defaults to the name of the unit if not provided.`),
2050
+ /**
2051
+ * The quota for the bucket as string with size suffix, e.g. "10GB". If not provided, the bucket will have no quota.
2052
+ */
2053
+ quota: $addArgumentDescription(z.string().optional(), `The quota for the bucket as string with size suffix, e.g. "10GB". If not provided, the bucket will have no quota.`)
1591
2054
  },
1592
2055
  inputs: {
1593
- mariadb: mariadbEntity,
1594
- ...sharedInputs
2056
+ /**
2057
+ * The connection to the MinIO instance where the bucket should be created.
2058
+ */
2059
+ connection: $addInputDescription(connectionEntity4, `The connection to the MinIO instance where the bucket should be created.`)
1595
2060
  },
1596
2061
  outputs: {
1597
- mariadb: mariadbEntity
2062
+ /**
2063
+ * The created bucket.
2064
+ */
2065
+ bucket: $addInputDescription(bucketEntity, `The created bucket.`)
1598
2066
  },
1599
2067
  source: {
1600
- package: "@highstate/common",
1601
- path: "units/databases/mariadb-patch"
2068
+ package: "@highstate/minio",
2069
+ path: "bucket"
1602
2070
  },
1603
2071
  meta: {
1604
- description: `Patches some properties of the MariaDB database and outputs the updated database.`,
1605
- title: "MariaDB Patch",
1606
- icon: "simple-icons:mariadb",
1607
- secondaryIcon: "fluent:patch-20-filled",
2072
+ description: `Creates a bucket on a MinIO instance.`,
2073
+ title: "MinIO Bucket",
2074
+ icon: "simple-icons:minio",
2075
+ secondaryIcon: "mdi:database",
1608
2076
  category: "Databases"
1609
2077
  }
1610
2078
  });
1611
- var mongodbEntity = defineEntity({
1612
- type: "databases.mongodb.v1",
2079
+
2080
+ // src/databases/mongodb.ts
2081
+ var mongodb_exports = {};
2082
+ __export(mongodb_exports, {
2083
+ connection: () => connection3,
2084
+ connectionEntity: () => connectionEntity5,
2085
+ credentialsSchema: () => credentialsSchema5,
2086
+ database: () => database2
2087
+ });
2088
+ var credentialsSchema5 = z.discriminatedUnion("type", [
2089
+ z.object({
2090
+ type: z.literal("password"),
2091
+ /**
2092
+ * The username used to authenticate against the database.
2093
+ */
2094
+ username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the database.` }),
2095
+ /**
2096
+ * The password used to authenticate against the database.
2097
+ */
2098
+ password: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the database.` })
2099
+ })
2100
+ ]);
2101
+ var connectionEntity5 = defineEntity({
2102
+ type: "mongodb.connection.v1",
2103
+ extends: { l4EndpointContainer },
1613
2104
  includes: {
1614
- endpoints: {
1615
- entity: l4EndpointEntity,
1616
- multiple: true
2105
+ /**
2106
+ * The TLS certificate of the server if any.
2107
+ */
2108
+ certificate: {
2109
+ entity: certificateEntity,
2110
+ required: false
1617
2111
  }
1618
2112
  },
1619
- schema: sharedSchema,
2113
+ schema: z.object({
2114
+ /**
2115
+ * The credentials for authenticating to the MongoDB instance.
2116
+ */
2117
+ credentials: credentialsSchema5.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the MongoDB instance.` }),
2118
+ /**
2119
+ * The name of the database to operate on.
2120
+ */
2121
+ database: z.string().optional().meta({ title: camelCaseToHumanReadable("database"), description: `The name of the database to operate on.` })
2122
+ }),
1620
2123
  meta: {
1621
- description: `Represents the MongoDB database or virtual database behind it.`,
2124
+ description: `Represents a connection to a MongoDB instance, including the endpoints and credentials.`,
1622
2125
  color: "#13aa52"
1623
2126
  }
1624
2127
  });
1625
- var existingMongodb = defineUnit({
1626
- type: "databases.mongodb.existing.v1",
1627
- args: sharedArgs,
1628
- secrets: sharedSecrets,
1629
- inputs: sharedInputs,
2128
+ var connection3 = defineUnit({
2129
+ type: "mongodb.connection.v1",
2130
+ args: {
2131
+ /**
2132
+ * The username to authenticate with.
2133
+ */
2134
+ username: $addArgumentDescription(z.string(), `The username to authenticate with.`),
2135
+ /**
2136
+ * The endpoints to connect to the MongoDB instance in form of `host:port`.
2137
+ */
2138
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the MongoDB instance in form of \`host:port\`.`)
2139
+ },
2140
+ inputs: {
2141
+ /**
2142
+ * The endpoints to connect to the MongoDB instance.
2143
+ */
2144
+ endpoints: $addInputDescription({
2145
+ entity: l4EndpointEntity,
2146
+ multiple: true,
2147
+ required: false
2148
+ }, `The endpoints to connect to the MongoDB instance.`)
2149
+ },
2150
+ secrets: {
2151
+ /**
2152
+ * The password to authenticate with.
2153
+ */
2154
+ password: $addArgumentDescription(z.string(), `The password to authenticate with.`)
2155
+ },
1630
2156
  outputs: {
1631
- mongodb: mongodbEntity
2157
+ connection: connectionEntity5
1632
2158
  },
1633
2159
  source: {
1634
- package: "@highstate/common",
1635
- path: "units/databases/existing-mongodb"
2160
+ package: "@highstate/mongodb",
2161
+ path: "units/connection"
1636
2162
  },
1637
2163
  meta: {
1638
- description: `The existing MongoDB database or virtual database behind it.`,
1639
- title: "Existing MongoDB Database",
2164
+ description: `The existing MongoDB connection hosted on a server or a managed service.`,
2165
+ title: "MongoDB Connection",
1640
2166
  icon: "simple-icons:mongodb",
1641
2167
  secondaryIcon: "mdi:database",
1642
2168
  category: "Databases"
1643
2169
  }
1644
2170
  });
1645
- var mongodbPatch = defineUnit({
1646
- type: "databases.mongodb-patch.v1",
2171
+ var database2 = defineUnit({
2172
+ type: "mongodb.database.v1",
1647
2173
  args: {
1648
- ...toPatchArgs(optionalSharedArgs),
1649
- endpoints: {
1650
- ...sharedArgs.endpoints,
1651
- schema: z.string().array().default([])
1652
- }
2174
+ /**
2175
+ * The name of the database.
2176
+ *
2177
+ * If not provided, it will be set to the unit name.
2178
+ */
2179
+ databaseName: $addArgumentDescription(z.string().optional(), `The name of the database.
2180
+
2181
+ If not provided, it will be set to the unit name.`),
2182
+ /**
2183
+ * The username to create.
2184
+ *
2185
+ * If not provided, it will be set to the database name.
2186
+ */
2187
+ username: $addArgumentDescription(z.string().optional(), `The username to create.
2188
+
2189
+ If not provided, it will be set to the database name.`)
1653
2190
  },
1654
2191
  inputs: {
1655
- mongodb: mongodbEntity,
1656
- ...sharedInputs
2192
+ /**
2193
+ * The connection to the MongoDB instance where the database should be created.
2194
+ */
2195
+ connection: $addInputDescription(connectionEntity5, `The connection to the MongoDB instance where the database should be created.`)
1657
2196
  },
1658
- outputs: {
1659
- mongodb: mongodbEntity
2197
+ secrets: {
2198
+ /**
2199
+ * The password of the created user.
2200
+ *
2201
+ * If not provided, a random password will be generated.
2202
+ */
2203
+ password: $addArgumentDescription(z.string().optional(), `The password of the created user.
2204
+
2205
+ If not provided, a random password will be generated.`)
1660
2206
  },
1661
- source: {
1662
- package: "@highstate/common",
1663
- path: "units/databases/mongodb-patch"
2207
+ outputs: {
2208
+ connection: connectionEntity5
1664
2209
  },
1665
2210
  meta: {
1666
- description: `Patches some properties of the MongoDB database and outputs the updated database.`,
1667
- title: "MongoDB Patch",
2211
+ description: `Creates a database in a MongoDB instance.`,
2212
+ title: "MongoDB Database",
1668
2213
  icon: "simple-icons:mongodb",
1669
- secondaryIcon: "fluent:patch-20-filled",
2214
+ secondaryIcon: "mdi:database-plus",
1670
2215
  category: "Databases"
2216
+ },
2217
+ source: {
2218
+ package: "@highstate/mongodb",
2219
+ path: "units/database"
1671
2220
  }
1672
2221
  });
1673
- var postgresqlEntity = defineEntity({
1674
- type: "databases.postgresql.v1",
2222
+
2223
+ // src/databases/mysql.ts
2224
+ var mysql_exports = {};
2225
+ __export(mysql_exports, {
2226
+ connection: () => connection4,
2227
+ connectionEntity: () => connectionEntity6,
2228
+ credentialsSchema: () => credentialsSchema6,
2229
+ database: () => database3
2230
+ });
2231
+ var credentialsSchema6 = z.discriminatedUnion("type", [
2232
+ z.object({
2233
+ type: z.literal("password"),
2234
+ /**
2235
+ * The username used to authenticate against the database.
2236
+ */
2237
+ username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the database.` }),
2238
+ /**
2239
+ * The password used to authenticate against the database.
2240
+ */
2241
+ password: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the database.` })
2242
+ })
2243
+ ]);
2244
+ var connectionEntity6 = defineEntity({
2245
+ type: "mysql.connection.v1",
2246
+ extends: { l4EndpointContainer },
1675
2247
  includes: {
1676
- endpoints: {
1677
- entity: l4EndpointEntity,
1678
- multiple: true
2248
+ /**
2249
+ * The TLS certificate of the server if any.
2250
+ */
2251
+ certificate: {
2252
+ entity: certificateEntity,
2253
+ required: false
1679
2254
  }
1680
2255
  },
1681
- schema: sharedSchema,
2256
+ schema: z.object({
2257
+ /**
2258
+ * The credentials for authenticating to the MySQL instance.
2259
+ */
2260
+ credentials: credentialsSchema6.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the MySQL instance.` }),
2261
+ /**
2262
+ * The optional name of the database to operate on.
2263
+ */
2264
+ database: z.string().optional().meta({ title: camelCaseToHumanReadable("database"), description: `The optional name of the database to operate on.` })
2265
+ }),
1682
2266
  meta: {
1683
- description: `Represents the PostgreSQL database or virtual database behind it.`,
1684
- color: "#336791"
2267
+ description: `Represents a connection to a MySQL instance, including the endpoints and credentials.`,
2268
+ color: "#f06292"
1685
2269
  }
1686
2270
  });
1687
- var existingPostgresql = defineUnit({
1688
- type: "databases.postgresql.existing.v1",
1689
- args: sharedArgs,
1690
- secrets: sharedSecrets,
1691
- inputs: sharedInputs,
2271
+ var connection4 = defineUnit({
2272
+ type: "mysql.connection.v1",
2273
+ args: {
2274
+ /**
2275
+ * The username to authenticate with.
2276
+ */
2277
+ username: $addArgumentDescription(z.string(), `The username to authenticate with.`),
2278
+ /**
2279
+ * The endpoints to connect to the MySQL instance in form of `host:port`.
2280
+ */
2281
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the MySQL instance in form of \`host:port\`.`)
2282
+ },
2283
+ inputs: {
2284
+ /**
2285
+ * The endpoints to connect to the MySQL instance.
2286
+ */
2287
+ endpoints: $addInputDescription({
2288
+ entity: l4EndpointEntity,
2289
+ multiple: true,
2290
+ required: false
2291
+ }, `The endpoints to connect to the MySQL instance.`)
2292
+ },
2293
+ secrets: {
2294
+ /**
2295
+ * The password to authenticate with.
2296
+ */
2297
+ password: $addArgumentDescription(z.string(), `The password to authenticate with.`)
2298
+ },
1692
2299
  outputs: {
1693
- postgresql: postgresqlEntity
2300
+ connection: connectionEntity6
1694
2301
  },
1695
2302
  source: {
1696
- package: "@highstate/common",
1697
- path: "units/databases/existing-postgresql"
2303
+ package: "@highstate/mysql",
2304
+ path: "units/connection"
1698
2305
  },
1699
2306
  meta: {
1700
- description: `The existing PostgreSQL database or virtual database behind it.`,
1701
- title: "Existing PostgreSQL Database",
1702
- icon: "simple-icons:postgresql",
2307
+ description: `The existing MySQL connection hosted on a server or a managed service.`,
2308
+ title: "MySQL Connection",
2309
+ icon: "simple-icons:mysql",
1703
2310
  secondaryIcon: "mdi:database",
1704
2311
  category: "Databases"
1705
2312
  }
1706
2313
  });
1707
- var postgresqlPatch = defineUnit({
1708
- type: "databases.postgresql-patch.v1",
2314
+ var database3 = defineUnit({
2315
+ type: "mysql.database.v1",
1709
2316
  args: {
1710
- ...toPatchArgs(optionalSharedArgs),
1711
2317
  /**
1712
- * The endpoints to connect to the database in form of `host:port`.
2318
+ * The name of the database.
2319
+ *
2320
+ * If not provided, it will be set to the unit name.
2321
+ */
2322
+ databaseName: $addArgumentDescription(z.string().optional(), `The name of the database.
2323
+
2324
+ If not provided, it will be set to the unit name.`),
2325
+ /**
2326
+ * The username of the database admin user to create.
1713
2327
  *
1714
- * If at least one endpoint is provided (either via args or inputs), the existing endpoints
1715
- * will be replaced completely.
2328
+ * If not provided, it will be set to the database name.
1716
2329
  */
1717
- endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the database in form of \`host:port\`.
2330
+ username: $addArgumentDescription(z.string().optional(), `The username of the database admin user to create.
1718
2331
 
1719
- If at least one endpoint is provided (either via args or inputs), the existing endpoints
1720
- will be replaced completely.`)
2332
+ If not provided, it will be set to the database name.`)
1721
2333
  },
1722
2334
  inputs: {
1723
- postgresql: postgresqlEntity,
1724
- ...sharedInputs
2335
+ /**
2336
+ * The connection to the MySQL instance where the database should be created.
2337
+ */
2338
+ connection: $addInputDescription(connectionEntity6, `The connection to the MySQL instance where the database should be created.`)
1725
2339
  },
1726
- outputs: {
1727
- postgresql: postgresqlEntity
2340
+ secrets: {
2341
+ /**
2342
+ * The password of the created user.
2343
+ *
2344
+ * If not provided, a random password will be generated.
2345
+ */
2346
+ password: $addArgumentDescription(z.string().optional(), `The password of the created user.
2347
+
2348
+ If not provided, a random password will be generated.`)
1728
2349
  },
1729
- source: {
1730
- package: "@highstate/common",
1731
- path: "units/databases/postgresql-patch"
2350
+ outputs: {
2351
+ connection: connectionEntity6
1732
2352
  },
1733
2353
  meta: {
1734
- description: `Patches some properties of the PostgreSQL database and outputs the updated database.`,
1735
- title: "PostgreSQL Patch",
1736
- icon: "simple-icons:postgresql",
1737
- secondaryIcon: "fluent:patch-20-filled",
2354
+ description: `Creates a database in a MySQL instance.`,
2355
+ title: "MySQL Database",
2356
+ icon: "simple-icons:mysql",
2357
+ secondaryIcon: "mdi:database-plus",
1738
2358
  category: "Databases"
2359
+ },
2360
+ source: {
2361
+ package: "@highstate/mysql",
2362
+ path: "units/database"
1739
2363
  }
1740
2364
  });
1741
- var redisEntity = defineEntity({
1742
- type: "databases.redis.v1",
2365
+
2366
+ // src/databases/postgresql.ts
2367
+ var postgresql_exports = {};
2368
+ __export(postgresql_exports, {
2369
+ connection: () => connection5,
2370
+ connectionEntity: () => connectionEntity7,
2371
+ credentialsSchema: () => credentialsSchema7,
2372
+ database: () => database4
2373
+ });
2374
+ var credentialsSchema7 = z.discriminatedUnion("type", [
2375
+ z.object({
2376
+ type: z.literal("password"),
2377
+ /**
2378
+ * The username used to authenticate against the database.
2379
+ */
2380
+ username: z.string().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the database.` }),
2381
+ /**
2382
+ * The password used to authenticate against the database.
2383
+ */
2384
+ password: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the database.` })
2385
+ })
2386
+ ]);
2387
+ var connectionEntity7 = defineEntity({
2388
+ type: "postgresql.connection.v1",
2389
+ extends: { l4EndpointContainer },
1743
2390
  includes: {
1744
- endpoints: {
1745
- entity: l4EndpointEntity,
1746
- multiple: true
2391
+ /**
2392
+ * The TLS certificate of the server if any.
2393
+ */
2394
+ certificate: {
2395
+ entity: certificateEntity,
2396
+ required: false
1747
2397
  }
1748
2398
  },
1749
2399
  schema: z.object({
1750
2400
  /**
1751
- * The number of the database to use.
2401
+ * Whether SSL is not required to connect to the database.
2402
+ */
2403
+ insecure: z.boolean().default(false).meta({ title: camelCaseToHumanReadable("insecure"), description: `Whether SSL is not required to connect to the database.` }),
2404
+ /**
2405
+ * The credentials for authenticating to the PostgreSQL instance.
1752
2406
  */
1753
- database: z.number().default(0).meta({ title: camelCaseToHumanReadable("database"), description: `The number of the database to use.` })
2407
+ credentials: credentialsSchema7.meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the PostgreSQL instance.` }),
2408
+ /**
2409
+ * The name of the database to operate on.
2410
+ */
2411
+ database: z.string().optional().meta({ title: camelCaseToHumanReadable("database"), description: `The name of the database to operate on.` })
1754
2412
  }),
1755
2413
  meta: {
1756
- description: `Represents the Redis database or virtual database behind it.`,
1757
- color: "#dc382d"
2414
+ description: `Represents a connection to a PostgreSQL instance, including the endpoints and credentials.`,
2415
+ color: "#336791"
1758
2416
  }
1759
2417
  });
1760
- var existingRedis = defineUnit({
1761
- type: "databases.redis.existing.v1",
1762
- args: sharedArgs,
1763
- inputs: sharedInputs,
2418
+ var connection5 = defineUnit({
2419
+ type: "postgresql.connection.v1",
2420
+ args: {
2421
+ /**
2422
+ * The username to authenticate with.
2423
+ */
2424
+ username: $addArgumentDescription(z.string(), `The username to authenticate with.`),
2425
+ /**
2426
+ * The endpoints to connect to the PostgreSQL instance in form of `host:port`.
2427
+ */
2428
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the PostgreSQL instance in form of \`host:port\`.`)
2429
+ },
2430
+ inputs: {
2431
+ /**
2432
+ * The endpoints to connect to the PostgreSQL instance.
2433
+ */
2434
+ endpoints: $addInputDescription({
2435
+ entity: l4EndpointEntity,
2436
+ multiple: true,
2437
+ required: false
2438
+ }, `The endpoints to connect to the PostgreSQL instance.`)
2439
+ },
2440
+ secrets: {
2441
+ /**
2442
+ * The password to authenticate with.
2443
+ */
2444
+ password: $addArgumentDescription(z.string(), `The password to authenticate with.`)
2445
+ },
1764
2446
  outputs: {
1765
- redis: redisEntity
2447
+ connection: connectionEntity7
1766
2448
  },
1767
2449
  source: {
1768
- package: "@highstate/common",
1769
- path: "units/databases/existing-redis"
2450
+ package: "@highstate/postgresql",
2451
+ path: "units/connection"
1770
2452
  },
1771
2453
  meta: {
1772
- description: `The existing Redis database or virtual database behind it.`,
1773
- title: "Existing Redis Database",
1774
- icon: "simple-icons:redis",
2454
+ description: `The existing PostgreSQL connection hosted on a server or a managed service.`,
2455
+ title: "PostgreSQL Connection",
2456
+ icon: "simple-icons:postgresql",
1775
2457
  secondaryIcon: "mdi:database",
1776
2458
  category: "Databases"
1777
2459
  }
1778
2460
  });
1779
- var redisPatch = defineUnit({
1780
- type: "databases.redis-patch.v1",
2461
+ var database4 = defineUnit({
2462
+ type: "postgresql.database.v1",
1781
2463
  args: {
1782
- ...toPatchArgs(optionalSharedArgs),
1783
- endpoints: {
1784
- ...sharedArgs.endpoints,
1785
- schema: z.string().array().default([])
1786
- }
2464
+ /**
2465
+ * The name of the database.
2466
+ *
2467
+ * If not provided, it will be set to the unit name.
2468
+ */
2469
+ databaseName: $addArgumentDescription(z.string().optional(), `The name of the database.
2470
+
2471
+ If not provided, it will be set to the unit name.`),
2472
+ /**
2473
+ * The username to create.
2474
+ *
2475
+ * If not provided, it will be set to the database name.
2476
+ */
2477
+ username: $addArgumentDescription(z.string().optional(), `The username to create.
2478
+
2479
+ If not provided, it will be set to the database name.`),
2480
+ /**
2481
+ * The LC_COLLATE setting for the database, which determines the collation order (i.e., how string comparison is performed).
2482
+ */
2483
+ lcCollate: $addArgumentDescription(z.string().optional(), `The LC_COLLATE setting for the database, which determines the collation order (i.e., how string comparison is performed).`),
2484
+ /**
2485
+ * The LC_CTYPE setting for the database, which determines the character classification (i.e., how characters are categorized and compared).
2486
+ */
2487
+ lcCtype: $addArgumentDescription(z.string().optional(), `The LC_CTYPE setting for the database, which determines the character classification (i.e., how characters are categorized and compared).`)
1787
2488
  },
1788
2489
  inputs: {
1789
- redis: redisEntity,
1790
- ...sharedInputs
2490
+ /**
2491
+ * The connection to the PostgreSQL instance where the database should be created.
2492
+ */
2493
+ connection: $addInputDescription(connectionEntity7, `The connection to the PostgreSQL instance where the database should be created.`)
1791
2494
  },
1792
- outputs: {
1793
- redis: redisEntity
2495
+ secrets: {
2496
+ /**
2497
+ * The password of the created user.
2498
+ *
2499
+ * If not provided, a random password will be generated.
2500
+ */
2501
+ password: $addArgumentDescription(z.string().optional(), `The password of the created user.
2502
+
2503
+ If not provided, a random password will be generated.`)
1794
2504
  },
1795
- source: {
1796
- package: "@highstate/common",
1797
- path: "units/databases/redis-patch"
2505
+ outputs: {
2506
+ connection: connectionEntity7
1798
2507
  },
1799
2508
  meta: {
1800
- description: `Patches some properties of the Redis database and outputs the updated database.`,
1801
- title: "Redis Patch",
1802
- icon: "simple-icons:redis",
1803
- secondaryIcon: "fluent:patch-20-filled",
2509
+ description: `Creates a database in a PostgreSQL instance.`,
2510
+ title: "PostgreSQL Database",
2511
+ icon: "simple-icons:postgresql",
2512
+ secondaryIcon: "mdi:database-plus",
1804
2513
  category: "Databases"
2514
+ },
2515
+ source: {
2516
+ package: "@highstate/postgresql",
2517
+ path: "units/database"
1805
2518
  }
1806
2519
  });
1807
- var s3BucketPolicySchema = z.enum(["none", "download", "upload", "public"]);
1808
- var s3BucketSchema = z.object({
1809
- /**
1810
- * The name of the bucket.
1811
- */
1812
- name: z.string().meta({ title: camelCaseToHumanReadable("name"), description: `The name of the bucket.` }),
1813
- /**
1814
- * The optional policy applied to the bucket.
1815
- */
1816
- policy: s3BucketPolicySchema.optional().meta({ title: camelCaseToHumanReadable("policy"), description: `The optional policy applied to the bucket.` })
1817
- });
1818
- var s3Args = $args({
1819
- /**
1820
- * The endpoints to connect to the S3-compatible API in form of `host:port`.
1821
- */
1822
- endpoints: $addArgumentDescription(z.string().array().min(1), `The endpoints to connect to the S3-compatible API in form of \`host:port\`.`),
1823
- /**
1824
- * The access key used to authenticate against the S3-compatible API.
1825
- */
1826
- accessKey: $addArgumentDescription(z.string(), `The access key used to authenticate against the S3-compatible API.`),
1827
- /**
1828
- * The region associated with the S3-compatible deployment.
1829
- */
1830
- region: $addArgumentDescription(z.string().optional(), `The region associated with the S3-compatible deployment.`),
1831
- /**
1832
- * The buckets that must exist on the instance.
1833
- */
1834
- buckets: $addArgumentDescription(s3BucketSchema.array().default([]), `The buckets that must exist on the instance.`)
1835
- });
1836
- var optionalS3Args = mapValues(s3Args, (arg) => ({
1837
- ...arg,
1838
- schema: arg.schema.optional()
1839
- }));
1840
- var s3Secrets = $secrets({
1841
- /**
1842
- * The secret key used to authenticate against the S3-compatible API.
1843
- */
1844
- secretKey: $addArgumentDescription(z.string(), `The secret key used to authenticate against the S3-compatible API.`)
2520
+
2521
+ // src/databases/redis.ts
2522
+ var redis_exports = {};
2523
+ __export(redis_exports, {
2524
+ connection: () => connection6,
2525
+ connectionEntity: () => connectionEntity8,
2526
+ credentialsSchema: () => credentialsSchema8,
2527
+ databaseNumberSchema: () => databaseNumberSchema,
2528
+ namespace: () => namespace2,
2529
+ namespaceEntity: () => namespaceEntity
1845
2530
  });
1846
- var s3Inputs = $inputs({
2531
+ var credentialsSchema8 = z.object({
1847
2532
  /**
1848
- * The endpoints to connect to the S3-compatible API.
2533
+ * The username used to authenticate against the database.
1849
2534
  */
1850
- endpoints: $addInputDescription({
1851
- entity: l4EndpointEntity,
1852
- multiple: true,
1853
- required: false
1854
- }, `The endpoints to connect to the S3-compatible API.`)
2535
+ username: z.string().optional().meta({ title: camelCaseToHumanReadable("username"), description: `The username used to authenticate against the database.` }),
2536
+ /**
2537
+ * The password used to authenticate against the database.
2538
+ */
2539
+ password: secretSchema(z.string()).optional().meta({ title: camelCaseToHumanReadable("password"), description: `The password used to authenticate against the database.` })
1855
2540
  });
1856
- var s3Entity = defineEntity({
1857
- type: "databases.s3.v1",
1858
- includes: {
1859
- endpoints: {
1860
- entity: l4EndpointEntity,
1861
- multiple: true
1862
- }
1863
- },
2541
+ var databaseNumberSchema = z.number().nonnegative().max(15);
2542
+ var connectionEntity8 = defineEntity({
2543
+ type: "redis.connection.v1",
2544
+ extends: { l4EndpointContainer },
1864
2545
  schema: z.object({
1865
2546
  /**
1866
- * The region associated with the object storage instance.
2547
+ * The credentials for authenticating to the Redis instance.
2548
+ */
2549
+ credentials: credentialsSchema8.optional().meta({ title: camelCaseToHumanReadable("credentials"), description: `The credentials for authenticating to the Redis instance.` })
2550
+ }),
2551
+ meta: {
2552
+ description: `Represents a connection to a Redis instance, including the endpoints and credentials.`,
2553
+ color: "#dc382d"
2554
+ }
2555
+ });
2556
+ var connection6 = defineUnit({
2557
+ type: "redis.connection.existing.v1",
2558
+ args: {
2559
+ /**
2560
+ * The username to authenticate with.
1867
2561
  */
1868
- region: z.string().optional().meta({ title: camelCaseToHumanReadable("region"), description: `The region associated with the object storage instance.` }),
2562
+ username: $addArgumentDescription(z.string().optional(), `The username to authenticate with.`),
1869
2563
  /**
1870
- * The access key used to authenticate against the API.
2564
+ * The endpoints to connect to the database in form of `host:port`.
1871
2565
  */
1872
- accessKey: z.string().meta({ title: camelCaseToHumanReadable("accessKey"), description: `The access key used to authenticate against the API.` }),
2566
+ endpoints: $addArgumentDescription(z.string().array().default([]), `The endpoints to connect to the database in form of \`host:port\`.`)
2567
+ },
2568
+ inputs: {
1873
2569
  /**
1874
- * The secret key used to authenticate against the API.
2570
+ * The endpoints to connect to the database.
1875
2571
  */
1876
- secretKey: z.string().meta({ title: camelCaseToHumanReadable("secretKey"), description: `The secret key used to authenticate against the API.` }),
2572
+ endpoints: $addInputDescription({
2573
+ entity: l4EndpointEntity,
2574
+ multiple: true,
2575
+ required: false
2576
+ }, `The endpoints to connect to the database.`)
2577
+ },
2578
+ secrets: {
1877
2579
  /**
1878
- * The buckets that must exist on the instance.
2580
+ * The password to authenticate with.
1879
2581
  */
1880
- buckets: s3BucketSchema.array().meta({ title: camelCaseToHumanReadable("buckets"), description: `The buckets that must exist on the instance.` })
1881
- }),
1882
- meta: {
1883
- description: `Represents an S3-compatible object storage endpoint.`,
1884
- color: "#ff9900"
1885
- }
1886
- });
1887
- var existingS3 = defineUnit({
1888
- type: "databases.s3.existing.v1",
1889
- args: s3Args,
1890
- secrets: s3Secrets,
1891
- inputs: s3Inputs,
2582
+ password: $addArgumentDescription(z.string().optional(), `The password to authenticate with.`)
2583
+ },
1892
2584
  outputs: {
1893
- s3: s3Entity
2585
+ connection: connectionEntity8
1894
2586
  },
1895
2587
  source: {
1896
- package: "@highstate/common",
1897
- path: "units/databases/existing-s3"
2588
+ package: "@highstate/redis",
2589
+ path: "units/connection"
1898
2590
  },
1899
2591
  meta: {
1900
- description: `The existing S3-compatible object storage instance.`,
1901
- title: "Existing S3-Compatible Storage",
1902
- icon: "simple-icons:amazons3",
1903
- secondaryIcon: "mdi:bucket",
2592
+ description: `The existing Redis connection hosted on a server or a managed service.`,
2593
+ title: "Redis Connection",
2594
+ icon: "simple-icons:redis",
2595
+ secondaryIcon: "mdi:database",
1904
2596
  category: "Databases"
1905
2597
  }
1906
2598
  });
1907
- var s3Patch = defineUnit({
1908
- type: "databases.s3-patch.v1",
2599
+ var namespaceEntity = defineEntity({
2600
+ type: "redis.namespace.v1",
2601
+ extends: { connectionEntity: connectionEntity8 },
2602
+ schema: z.object({
2603
+ /**
2604
+ * The number of the database to use.
2605
+ */
2606
+ database: databaseNumberSchema.default(0).meta({ title: camelCaseToHumanReadable("database"), description: `The number of the database to use.` }),
2607
+ /**
2608
+ * The prefix of the namespace in the Redis database.
2609
+ */
2610
+ prefix: z.string().optional().meta({ title: camelCaseToHumanReadable("prefix"), description: `The prefix of the namespace in the Redis database.` })
2611
+ }),
2612
+ meta: {
2613
+ description: `Represents a Redis namespace within a database.`,
2614
+ color: "#0064bf"
2615
+ }
2616
+ });
2617
+ var namespace2 = defineUnit({
2618
+ type: "redis.database.v1",
1909
2619
  args: {
1910
- ...toPatchArgs(optionalS3Args),
1911
- endpoints: {
1912
- ...s3Args.endpoints,
1913
- schema: z.string().array().default([])
1914
- }
2620
+ /**
2621
+ * The number of the database to use.
2622
+ */
2623
+ database: $addArgumentDescription(databaseNumberSchema.default(0), `The number of the database to use.`),
2624
+ /**
2625
+ * The prefix of the namespace in the Redis database.
2626
+ */
2627
+ prefix: $addArgumentDescription(z.string().optional(), `The prefix of the namespace in the Redis database.`)
1915
2628
  },
1916
2629
  inputs: {
1917
- s3: s3Entity,
1918
- ...s3Inputs
2630
+ /**
2631
+ * The connection to the Redis instance.
2632
+ */
2633
+ connection: $addInputDescription(connectionEntity8, `The connection to the Redis instance.`)
1919
2634
  },
1920
2635
  outputs: {
1921
- s3: s3Entity
1922
- },
1923
- source: {
1924
- package: "@highstate/common",
1925
- path: "units/databases/s3-patch"
2636
+ namespace: namespaceEntity
1926
2637
  },
1927
2638
  meta: {
1928
- description: `Patches some properties of the S3-compatible object storage and outputs the updated storage.`,
1929
- title: "S3 Patch",
1930
- icon: "simple-icons:amazons3",
1931
- secondaryIcon: "fluent:patch-20-filled",
2639
+ description: `Creates a Redis namespace within an existing Redis connection.`,
2640
+ title: "Redis Database",
2641
+ icon: "simple-icons:redis",
2642
+ secondaryIcon: "mdi:database",
1932
2643
  category: "Databases"
2644
+ },
2645
+ source: {
2646
+ package: "@highstate/redis",
2647
+ path: "units/database"
1933
2648
  }
1934
2649
  });
1935
2650
 
@@ -2065,7 +2780,11 @@ var resourceEntity = defineEntity({
2065
2780
  ])
2066
2781
  ),
2067
2782
  meta: {
2068
- description: `The entity which represents a Kubernetes resource.`
2783
+ description: `The entity which represents a Kubernetes resource.`,
2784
+ color: "#607D8B",
2785
+ title: "Resource",
2786
+ icon: "devicon:kubernetes",
2787
+ iconColor: "#607D8B"
2069
2788
  }
2070
2789
  });
2071
2790
  var namespacedResourceEntity = defineEntity({
@@ -2075,16 +2794,23 @@ var namespacedResourceEntity = defineEntity({
2075
2794
  isNamespaced: z.literal(true)
2076
2795
  }),
2077
2796
  meta: {
2078
- description: `The entity which represents a Kubernetes resource scoped to a namespace.`
2797
+ description: `The entity which represents a Kubernetes resource scoped to a namespace.`,
2798
+ color: "#78909C",
2799
+ title: "Namespaced Resource",
2800
+ icon: "devicon:kubernetes",
2801
+ iconColor: "#78909C"
2079
2802
  }
2080
2803
  });
2081
- var namespaceEntity = defineEntity({
2804
+ var namespaceEntity2 = defineEntity({
2082
2805
  type: "k8s.namespace.v1",
2083
2806
  extends: { resourceEntity },
2084
2807
  schema: z.unknown(),
2085
2808
  meta: {
2086
2809
  description: `The entity which represents a Kubernetes namespace managed by Highstate.`,
2087
- color: "#9E9E9E"
2810
+ color: "#9E9E9E",
2811
+ title: "Namespace",
2812
+ icon: "devicon:kubernetes",
2813
+ iconColor: "#9E9E9E"
2088
2814
  }
2089
2815
  });
2090
2816
  var persistentVolumeClaimEntity = defineEntity({
@@ -2093,7 +2819,10 @@ var persistentVolumeClaimEntity = defineEntity({
2093
2819
  schema: z.unknown(),
2094
2820
  meta: {
2095
2821
  description: `The entity which represents a Kubernetes persistent volume claim managed by Highstate.`,
2096
- color: "#FFC107"
2822
+ color: "#FFC107",
2823
+ title: "Persistent Volume Claim",
2824
+ icon: "devicon:kubernetes",
2825
+ iconColor: "#FFC107"
2097
2826
  }
2098
2827
  });
2099
2828
  var gatewayEntity2 = defineEntity({
@@ -2102,15 +2831,21 @@ var gatewayEntity2 = defineEntity({
2102
2831
  schema: z.unknown(),
2103
2832
  meta: {
2104
2833
  description: `The entity which represents a Gateway resource from the Gateway API.`,
2105
- color: "#4CAF50"
2834
+ color: "#4CAF50",
2835
+ title: "Gateway",
2836
+ icon: "devicon:kubernetes",
2837
+ iconColor: "#4CAF50"
2106
2838
  }
2107
2839
  });
2108
- var certificateEntity = defineEntity({
2840
+ var certificateEntity2 = defineEntity({
2109
2841
  type: "k8s.certificate.v1",
2110
2842
  extends: { namespacedResourceEntity },
2111
2843
  schema: z.unknown(),
2112
2844
  meta: {
2113
- color: "#3F51B5"
2845
+ color: "#3F51B5",
2846
+ title: "Certificate",
2847
+ icon: "devicon:kubernetes",
2848
+ iconColor: "#3F51B5"
2114
2849
  }
2115
2850
  });
2116
2851
  var configMapEntity = defineEntity({
@@ -2118,7 +2853,10 @@ var configMapEntity = defineEntity({
2118
2853
  extends: { namespacedResourceEntity },
2119
2854
  schema: z.unknown(),
2120
2855
  meta: {
2121
- color: "#FF9800"
2856
+ color: "#FF9800",
2857
+ title: "ConfigMap",
2858
+ icon: "devicon:kubernetes",
2859
+ iconColor: "#FF9800"
2122
2860
  }
2123
2861
  });
2124
2862
  var secretEntity = defineEntity({
@@ -2126,7 +2864,10 @@ var secretEntity = defineEntity({
2126
2864
  extends: { namespacedResourceEntity },
2127
2865
  schema: z.unknown(),
2128
2866
  meta: {
2129
- color: "#9C27B0"
2867
+ color: "#9C27B0",
2868
+ title: "Secret",
2869
+ icon: "devicon:kubernetes",
2870
+ iconColor: "#9C27B0"
2130
2871
  }
2131
2872
  });
2132
2873
 
@@ -2202,18 +2943,6 @@ var clusterInfoProperties = {
2202
2943
  * If not provided, the native Kubernetes NetworkPolicy implementation will be used.
2203
2944
  */
2204
2945
  networkPolicyImplRef: implementationReferenceSchema.optional(),
2205
- /**
2206
- * The endpoints of the API server.
2207
- *
2208
- * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
2209
- *
2210
- * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
2211
- */
2212
- apiEndpoints: l4EndpointEntity.schema.array(),
2213
- /**
2214
- * The external IPs of the cluster nodes allowed to be used for external access.
2215
- */
2216
- externalIps: addressEntity.schema.array(),
2217
2946
  /**
2218
2947
  * The extra quirks of the cluster to improve compatibility.
2219
2948
  */
@@ -2226,6 +2955,17 @@ var clusterInfoProperties = {
2226
2955
  var clusterEntity = defineEntity({
2227
2956
  type: "k8s.cluster.v1",
2228
2957
  includes: {
2958
+ /**
2959
+ * The endpoints of the API server.
2960
+ *
2961
+ * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
2962
+ *
2963
+ * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
2964
+ */
2965
+ apiEndpoints: {
2966
+ entity: l4EndpointEntity,
2967
+ multiple: true
2968
+ },
2229
2969
  /**
2230
2970
  * The endpoints of the cluster nodes.
2231
2971
  *
@@ -2235,15 +2975,30 @@ var clusterEntity = defineEntity({
2235
2975
  */
2236
2976
  endpoints: {
2237
2977
  entity: l3EndpointEntity,
2238
- multiple: true
2239
- }
2978
+ multiple: true,
2979
+ required: false
2980
+ },
2981
+ /**
2982
+ * The external IPs of the cluster nodes allowed to be used for external access.
2983
+ */
2984
+ externalIps: {
2985
+ entity: addressEntity,
2986
+ multiple: true,
2987
+ required: false
2988
+ },
2989
+ /**
2990
+ * The kubeconfig file to use for connecting to the cluster.
2991
+ */
2992
+ kubeconfig: fileEntity
2240
2993
  },
2241
2994
  schema: z.object({
2242
- ...clusterInfoProperties,
2243
- kubeconfig: z.string()
2995
+ ...clusterInfoProperties
2244
2996
  }),
2245
2997
  meta: {
2246
- color: "#2196F3"
2998
+ color: "#2196F3",
2999
+ title: "K8S Cluster",
3000
+ icon: "devicon:kubernetes",
3001
+ iconColor: "#2196F3"
2247
3002
  }
2248
3003
  });
2249
3004
  var internalIpsPolicySchema = z.enum(["always", "public", "never"]);
@@ -2406,6 +3161,12 @@ var monitorWorkerParamsSchema = z.object({
2406
3161
  */
2407
3162
  resources: namespacedResourceEntity.schema.array().meta({ title: camelCaseToHumanReadable("resources"), description: `The resources to monitor in the cluster.` })
2408
3163
  });
3164
+ var tolerationSchema = z.object({
3165
+ key: z.string().optional(),
3166
+ operator: z.enum(["Exists", "Equal"]),
3167
+ value: z.string().optional(),
3168
+ effect: z.enum(["NoSchedule", "PreferNoSchedule", "NoExecute"]).optional()
3169
+ });
2409
3170
 
2410
3171
  // src/k3s.ts
2411
3172
  var packagedComponents = [
@@ -2466,6 +3227,14 @@ var cluster = defineUnit({
2466
3227
  agentConfig: $addArgumentDescription(z.record(z.string(), z.unknown()).optional(), `The K3S configuration to pass to each agent in the cluster.
2467
3228
 
2468
3229
  See: https://docs.k3s.io/installation/configuration`),
3230
+ /**
3231
+ * The map of configuration per each node in the cluster, where the key is the hostname of the node.
3232
+ *
3233
+ * Note: if multiple nodes have the same hostname, the configuration will be applied to all of them.
3234
+ */
3235
+ nodeConfig: $addArgumentDescription(z.record(z.string(), z.record(z.string(), z.unknown())).optional(), `The map of configuration per each node in the cluster, where the key is the hostname of the node.
3236
+
3237
+ Note: if multiple nodes have the same hostname, the configuration will be applied to all of them.`),
2469
3238
  /**
2470
3239
  * The configuration of the registries to use for the K3S cluster.
2471
3240
  *
@@ -2497,7 +3266,7 @@ __export(k8s_exports, {
2497
3266
  acessRuleSchema: () => acessRuleSchema,
2498
3267
  apps: () => apps_exports,
2499
3268
  certManager: () => certManager,
2500
- certificateEntity: () => certificateEntity,
3269
+ certificateEntity: () => certificateEntity2,
2501
3270
  cilium: () => cilium,
2502
3271
  ciliumClusterMetadata: () => ciliumClusterMetadata,
2503
3272
  clusterEntity: () => clusterEntity,
@@ -2511,7 +3280,6 @@ __export(k8s_exports, {
2511
3280
  deploymentEntity: () => deploymentEntity,
2512
3281
  dns01TlsIssuer: () => dns01TlsIssuer,
2513
3282
  existingCluster: () => existingCluster,
2514
- exposableWorkloadEntity: () => exposableWorkloadEntity,
2515
3283
  externalServiceTypeSchema: () => externalServiceTypeSchema,
2516
3284
  fallbackKubeApiAccessSchema: () => fallbackKubeApiAccessSchema,
2517
3285
  gameServers: () => game_servers_exports,
@@ -2524,7 +3292,7 @@ __export(k8s_exports, {
2524
3292
  metadataSchema: () => metadataSchema2,
2525
3293
  monitorWorkerParamsSchema: () => monitorWorkerParamsSchema,
2526
3294
  monitorWorkerResourceGroupSchema: () => monitorWorkerResourceGroupSchema,
2527
- namespaceEntity: () => namespaceEntity,
3295
+ namespaceEntity: () => namespaceEntity2,
2528
3296
  namespacedMetadataSchema: () => namespacedMetadataSchema,
2529
3297
  namespacedResourceEntity: () => namespacedResourceEntity,
2530
3298
  networkInterfaceEntity: () => networkInterfaceEntity,
@@ -2541,6 +3309,7 @@ __export(k8s_exports, {
2541
3309
  serviceTypeSchema: () => serviceTypeSchema,
2542
3310
  statefulSetEntity: () => statefulSetEntity,
2543
3311
  tlsIssuerDataSchema: () => tlsIssuerDataSchema,
3312
+ tolerationSchema: () => tolerationSchema,
2544
3313
  tunDevicePolicySchema: () => tunDevicePolicySchema,
2545
3314
  workloadEntity: () => workloadEntity
2546
3315
  });
@@ -2554,25 +3323,24 @@ __export(apps_exports, {
2554
3323
  databaseConfigKeySchema: () => databaseConfigKeySchema,
2555
3324
  environmentVariableSchema: () => environmentVariableSchema,
2556
3325
  etcd: () => etcd,
3326
+ grafana: () => grafana,
2557
3327
  grocy: () => grocy,
2558
3328
  hubble: () => hubble,
2559
- kubernetesDashboard: () => kubernetesDashboard,
2560
3329
  mariadb: () => mariadb,
2561
- mariadbDatabase: () => mariadbDatabase,
2562
- maybe: () => maybe,
3330
+ matrixStack: () => matrixStack,
2563
3331
  minio: () => minio,
2564
3332
  mongodb: () => mongodb,
2565
- mongodbDatabase: () => mongodbDatabase,
2566
3333
  node: () => node,
2567
- optionalSharedArgs: () => optionalSharedArgs2,
3334
+ optionalSharedArgs: () => optionalSharedArgs,
2568
3335
  optionalSharedInputs: () => optionalSharedInputs,
3336
+ portal: () => portal,
2569
3337
  postgresql: () => postgresql,
2570
- postgresqlDatabase: () => postgresqlDatabase,
3338
+ refluxdb: () => refluxdb,
2571
3339
  remnawave: () => remnawave,
2572
3340
  remnawaveEntity: () => remnawaveEntity,
2573
- sharedArgs: () => sharedArgs2,
2574
- sharedInputs: () => sharedInputs2,
2575
- sharedSecrets: () => sharedSecrets2,
3341
+ sharedArgs: () => sharedArgs,
3342
+ sharedInputs: () => sharedInputs,
3343
+ sharedSecrets: () => sharedSecrets,
2576
3344
  syncthing: () => syncthing,
2577
3345
  traefik: () => traefik,
2578
3346
  valkey: () => valkey,
@@ -2624,12 +3392,16 @@ var serviceEntity = defineEntity({
2624
3392
  includes: {
2625
3393
  endpoints: {
2626
3394
  entity: l4EndpointEntity,
2627
- multiple: true
3395
+ multiple: true,
3396
+ required: false
2628
3397
  }
2629
3398
  },
2630
3399
  schema: z.unknown(),
2631
3400
  meta: {
2632
- color: "#2196F3"
3401
+ color: "#2196F3",
3402
+ title: "Service",
3403
+ icon: "devicon:kubernetes",
3404
+ iconColor: "#2196F3"
2633
3405
  }
2634
3406
  });
2635
3407
  var serviceTypeSchema = z.enum(["NodePort", "LoadBalancer", "ClusterIP"]);
@@ -2638,10 +3410,38 @@ var serviceTypeSchema = z.enum(["NodePort", "LoadBalancer", "ClusterIP"]);
2638
3410
  var workloadEntity = defineEntity({
2639
3411
  type: "k8s.workload.v1",
2640
3412
  extends: { namespacedResourceEntity },
2641
- schema: z.unknown(),
3413
+ includes: {
3414
+ service: {
3415
+ entity: serviceEntity,
3416
+ required: false
3417
+ }
3418
+ },
3419
+ schema: z.object({
3420
+ spec: z.object({
3421
+ template: z.object({
3422
+ spec: z.object({
3423
+ containers: z.array(
3424
+ z.object({
3425
+ name: z.string(),
3426
+ ports: z.array(
3427
+ z.object({
3428
+ containerPort: z.number()
3429
+ })
3430
+ )
3431
+ })
3432
+ )
3433
+ })
3434
+ })
3435
+ })
3436
+ }),
2642
3437
  meta: {
2643
- description: `The entity which represents a Kubernetes workload.`,
2644
- color: "#9C27B0"
3438
+ description: `The entity which represents a Kubernetes workload.
3439
+
3440
+ Can optionally include a service associated with the workload.`,
3441
+ color: "#9C27B0",
3442
+ title: "Workload",
3443
+ icon: "devicon:kubernetes",
3444
+ iconColor: "#9C27B0"
2645
3445
  }
2646
3446
  });
2647
3447
  var jobEntity = defineEntity({
@@ -2650,7 +3450,10 @@ var jobEntity = defineEntity({
2650
3450
  schema: z.unknown(),
2651
3451
  meta: {
2652
3452
  description: `The entity which represents a Kubernetes job managed by Highstate.`,
2653
- color: "#FF5722"
3453
+ color: "#FF5722",
3454
+ title: "Job",
3455
+ icon: "devicon:kubernetes",
3456
+ iconColor: "#FF5722"
2654
3457
  }
2655
3458
  });
2656
3459
  var cronJobEntity = defineEntity({
@@ -2659,44 +3462,29 @@ var cronJobEntity = defineEntity({
2659
3462
  schema: z.unknown(),
2660
3463
  meta: {
2661
3464
  description: `The entity which represents a Kubernetes cron job managed by Highstate.`,
2662
- color: "#FF9800"
2663
- }
2664
- });
2665
- var exposableWorkloadEntity = defineEntity({
2666
- type: "k8s.exposable-workload.v1",
2667
- extends: { workloadEntity },
2668
- includes: {
2669
- service: {
2670
- entity: serviceEntity,
2671
- required: false
2672
- },
2673
- endpoints: {
2674
- entity: l4EndpointEntity,
2675
- multiple: true
2676
- }
2677
- },
2678
- schema: z.unknown(),
2679
- meta: {
2680
- description: `The entity which represents a Kubernetes workload (optionally) exposed via a service.
2681
-
2682
- Includes both the workload and its associated service.`,
2683
- color: "#4CAF50"
3465
+ color: "#FF9800",
3466
+ title: "CronJob",
3467
+ icon: "devicon:kubernetes",
3468
+ iconColor: "#FF9800"
2684
3469
  }
2685
3470
  });
2686
3471
  var deploymentEntity = defineEntity({
2687
3472
  type: "k8s.deployment.v1",
2688
- extends: { exposableWorkloadEntity },
3473
+ extends: { workloadEntity },
2689
3474
  schema: z.unknown(),
2690
3475
  meta: {
2691
3476
  description: `The entity which represents a Kubernetes deployment managed by Highstate.
2692
3477
 
2693
3478
  Also includes a service associated with the deployment.`,
2694
- color: "#4CAF50"
3479
+ color: "#4CAF50",
3480
+ title: "Deployment",
3481
+ icon: "devicon:kubernetes",
3482
+ iconColor: "#4CAF50"
2695
3483
  }
2696
3484
  });
2697
3485
  var statefulSetEntity = defineEntity({
2698
3486
  type: "k8s.stateful-set.v1",
2699
- extends: { exposableWorkloadEntity },
3487
+ extends: { workloadEntity },
2700
3488
  includes: {
2701
3489
  service: serviceEntity
2702
3490
  },
@@ -2705,18 +3493,26 @@ var statefulSetEntity = defineEntity({
2705
3493
  description: `The entity which represents a Kubernetes stateful set managed by Highstate.
2706
3494
 
2707
3495
  Also includes a service associated with the stateful set.`,
2708
- color: "#FFC107"
3496
+ color: "#FFC107",
3497
+ title: "Stateful Set",
3498
+ icon: "devicon:kubernetes",
3499
+ iconColor: "#FFC107"
2709
3500
  }
2710
3501
  });
2711
3502
  var networkInterfaceEntity = defineEntity({
2712
3503
  type: "k8s.network-interface.v1",
3504
+ includes: {
3505
+ workload: workloadEntity
3506
+ },
2713
3507
  schema: z.object({
2714
- name: z.string(),
2715
- workload: workloadEntity.schema
3508
+ name: z.string()
2716
3509
  }),
2717
3510
  meta: {
2718
3511
  description: `The network interface in a network namespace of the pod which can accept and transmit network traffic.`,
2719
- color: "#2196F3"
3512
+ color: "#2196F3",
3513
+ title: "Network Interface",
3514
+ icon: "devicon:kubernetes",
3515
+ iconColor: "#2196F3"
2720
3516
  }
2721
3517
  });
2722
3518
 
@@ -2807,7 +3603,7 @@ var repository = defineUnit({
2807
3603
  });
2808
3604
 
2809
3605
  // src/k8s/apps/shared.ts
2810
- var sharedArgs2 = $args({
3606
+ var sharedArgs = $args({
2811
3607
  /**
2812
3608
  * The FQDN where the application will be accessible.
2813
3609
  */
@@ -2827,9 +3623,17 @@ var sharedArgs2 = $args({
2827
3623
  /**
2828
3624
  * The number of replicas for the application.
2829
3625
  */
2830
- replicas: $addArgumentDescription(z.number().default(1), `The number of replicas for the application.`)
3626
+ replicas: $addArgumentDescription(z.number().default(1), `The number of replicas for the application.`),
3627
+ /**
3628
+ * The name of namespace to create for the application.
3629
+ *
3630
+ * If not provided, defaults to the appName.
3631
+ */
3632
+ namespace: $addArgumentDescription(z.string().optional(), `The name of namespace to create for the application.
3633
+
3634
+ If not provided, defaults to the appName.`)
2831
3635
  });
2832
- var optionalSharedArgs2 = mapValues(sharedArgs2, (arg) => ({
3636
+ var optionalSharedArgs = mapValues(sharedArgs, (arg) => ({
2833
3637
  ...arg,
2834
3638
  schema: arg.schema.optional()
2835
3639
  }));
@@ -2848,17 +3652,17 @@ function appName(defaultAppName) {
2848
3652
  }
2849
3653
  };
2850
3654
  }
2851
- var sharedSecrets2 = $secrets({
3655
+ var sharedSecrets = $secrets({
2852
3656
  /**
2853
- * The root password for the database instance. If not provided, a random password will be generated.
3657
+ * The admin password for the application. If not provided, a random password will be generated.
2854
3658
  */
2855
- rootPassword: $addArgumentDescription(z.string().optional(), `The root password for the database instance. If not provided, a random password will be generated.`),
3659
+ adminPassword: $addArgumentDescription(z.string().optional(), `The admin password for the application. If not provided, a random password will be generated.`),
2856
3660
  /**
2857
3661
  * The key to use for backup encryption. If not provided, a random key will be generated.
2858
3662
  */
2859
3663
  backupKey: $addArgumentDescription(z.string().optional(), `The key to use for backup encryption. If not provided, a random key will be generated.`)
2860
3664
  });
2861
- var sharedDatabaseArgs = $args({
3665
+ $args({
2862
3666
  /**
2863
3667
  * The username for the database user.
2864
3668
  *
@@ -2876,7 +3680,7 @@ var sharedDatabaseArgs = $args({
2876
3680
 
2877
3681
  If not provided, defaults to the username.`)
2878
3682
  });
2879
- var sharedDatabaseSecrets = $secrets({
3683
+ $secrets({
2880
3684
  /**
2881
3685
  * The password for the database user.
2882
3686
  *
@@ -2886,12 +3690,12 @@ var sharedDatabaseSecrets = $secrets({
2886
3690
 
2887
3691
  If not provided, a random password will be generated.`)
2888
3692
  });
2889
- var sharedInputs2 = $inputs({
3693
+ var sharedInputs = $inputs({
2890
3694
  k8sCluster: {
2891
3695
  entity: clusterEntity
2892
3696
  },
2893
3697
  namespace: {
2894
- entity: namespaceEntity
3698
+ entity: namespaceEntity2
2895
3699
  },
2896
3700
  accessPoint: {
2897
3701
  entity: accessPointEntity
@@ -2906,23 +3710,23 @@ var sharedInputs2 = $inputs({
2906
3710
  volume: {
2907
3711
  entity: persistentVolumeClaimEntity
2908
3712
  },
2909
- mariadb: {
2910
- entity: mariadbEntity
3713
+ mysql: {
3714
+ entity: mysql_exports.connectionEntity
2911
3715
  },
2912
3716
  postgresql: {
2913
- entity: postgresqlEntity
3717
+ entity: postgresql_exports.connectionEntity
2914
3718
  },
2915
3719
  mongodb: {
2916
- entity: mongodbEntity
3720
+ entity: mongodb_exports.connectionEntity
2917
3721
  },
2918
3722
  redis: {
2919
- entity: redisEntity
3723
+ entity: redis_exports.connectionEntity
2920
3724
  },
2921
3725
  etcd: {
2922
- entity: etcdEntity
3726
+ entity: etcd_exports.connectionEntity
2923
3727
  }
2924
3728
  });
2925
- var optionalSharedInputs = mapValues(sharedInputs2, (input) => ({
3729
+ var optionalSharedInputs = mapValues(sharedInputs, (input) => ({
2926
3730
  ...input,
2927
3731
  required: false
2928
3732
  }));
@@ -2938,15 +3742,15 @@ var codeServer = defineUnit({
2938
3742
  type: "k8s.apps.code-server.v1",
2939
3743
  args: {
2940
3744
  ...appName("code-server"),
2941
- ...pick(sharedArgs2, ["fqdn"])
3745
+ ...pick(sharedArgs, ["fqdn"])
2942
3746
  },
2943
3747
  secrets: {
2944
- ...pick(sharedSecrets2, ["backupKey"]),
3748
+ ...pick(sharedSecrets, ["backupKey"]),
2945
3749
  password: z.string().optional(),
2946
3750
  sudoPassword: z.string().optional()
2947
3751
  },
2948
3752
  inputs: {
2949
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"]),
3753
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
2950
3754
  ...pick(optionalSharedInputs, ["resticRepo", "dnsProviders", "volume"])
2951
3755
  },
2952
3756
  outputs: {
@@ -2965,17 +3769,17 @@ var etcd = defineUnit({
2965
3769
  type: "k8s.apps.etcd.v1",
2966
3770
  args: {
2967
3771
  ...appName("etcd"),
2968
- ...pick(sharedArgs2, ["external"])
3772
+ ...pick(sharedArgs, ["external"])
2969
3773
  },
2970
3774
  secrets: {
2971
- ...pick(sharedSecrets2, ["backupKey"])
3775
+ ...pick(sharedSecrets, ["backupKey"])
2972
3776
  },
2973
3777
  inputs: {
2974
- ...pick(sharedInputs2, ["k8sCluster"]),
3778
+ ...pick(sharedInputs, ["k8sCluster"]),
2975
3779
  ...pick(optionalSharedInputs, ["resticRepo"])
2976
3780
  },
2977
3781
  outputs: {
2978
- etcd: etcdEntity
3782
+ connection: connectionEntity2
2979
3783
  },
2980
3784
  meta: {
2981
3785
  description: `The etcd instance deployed on Kubernetes.`,
@@ -2985,19 +3789,57 @@ var etcd = defineUnit({
2985
3789
  secondaryIcon: "mdi:database",
2986
3790
  category: "Databases"
2987
3791
  },
2988
- source: source("etcd/app")
3792
+ source: source("etcd")
3793
+ });
3794
+ var grafana = defineUnit({
3795
+ type: "k8s.apps.grafana.v1",
3796
+ args: {
3797
+ ...appName("grafana"),
3798
+ ...pick(sharedArgs, ["fqdn"]),
3799
+ /**
3800
+ * The list of plugins to install on Grafana.
3801
+ *
3802
+ * See https://grafana.com/grafana/plugins for available plugins and their names.
3803
+ */
3804
+ plugins: $addArgumentDescription(z.string().array().default([]), `The list of plugins to install on Grafana.
3805
+
3806
+ See https://grafana.com/grafana/plugins for available plugins and their names.`)
3807
+ },
3808
+ secrets: {
3809
+ /**
3810
+ * The admin password used for Grafana.
3811
+ *
3812
+ * If not provided, a random password will be generated.
3813
+ */
3814
+ adminPassword: $addArgumentDescription(z.string().optional(), `The admin password used for Grafana.
3815
+
3816
+ If not provided, a random password will be generated.`)
3817
+ },
3818
+ inputs: {
3819
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"])
3820
+ },
3821
+ outputs: {
3822
+ service: serviceEntity
3823
+ },
3824
+ meta: {
3825
+ description: `Grafana deployed on Kubernetes.`,
3826
+ title: "Grafana",
3827
+ icon: "simple-icons:grafana",
3828
+ category: "Observability"
3829
+ },
3830
+ source: source("grafana")
2989
3831
  });
2990
3832
  var grocy = defineUnit({
2991
3833
  type: "k8s.apps.grocy.v1",
2992
3834
  args: {
2993
3835
  ...appName("grocy"),
2994
- ...pick(sharedArgs2, ["fqdn"])
3836
+ ...pick(sharedArgs, ["fqdn"])
2995
3837
  },
2996
3838
  secrets: {
2997
- ...pick(sharedSecrets2, ["backupKey"])
3839
+ ...pick(sharedSecrets, ["backupKey"])
2998
3840
  },
2999
3841
  inputs: {
3000
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"]),
3842
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
3001
3843
  ...pick(optionalSharedInputs, ["resticRepo"])
3002
3844
  },
3003
3845
  meta: {
@@ -3014,10 +3856,10 @@ var hubble = defineUnit({
3014
3856
  type: "k8s.apps.hubble.v1",
3015
3857
  args: {
3016
3858
  ...appName("hubble"),
3017
- ...pick(sharedArgs2, ["fqdn"])
3859
+ ...pick(sharedArgs, ["fqdn"])
3018
3860
  },
3019
3861
  inputs: {
3020
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"])
3862
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"])
3021
3863
  },
3022
3864
  meta: {
3023
3865
  description: `Exposes Hubble UI to the user.
@@ -3030,40 +3872,22 @@ var hubble = defineUnit({
3030
3872
  },
3031
3873
  source: source("hubble")
3032
3874
  });
3033
- var kubernetesDashboard = defineUnit({
3034
- type: "k8s.apps.kubernetes-dashboard.v1",
3035
- args: {
3036
- ...appName("kubernetes-dashboard"),
3037
- ...pick(sharedArgs2, ["fqdn"])
3038
- },
3039
- inputs: {
3040
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"])
3041
- },
3042
- meta: {
3043
- description: `The Kubernetes Dashboard deployed on Kubernetes.`,
3044
- title: "Kubernetes Dashboard",
3045
- icon: "devicon:kubernetes",
3046
- secondaryIcon: "material-symbols:dashboard",
3047
- category: "Kubernetes"
3048
- },
3049
- source: source("kubernetes-dashboard")
3050
- });
3051
3875
  var mariadb = defineUnit({
3052
3876
  type: "k8s.apps.mariadb.v1",
3053
3877
  args: {
3054
3878
  ...appName("mariadb"),
3055
- ...pick(sharedArgs2, ["external"])
3879
+ ...pick(sharedArgs, ["external"])
3056
3880
  },
3057
3881
  secrets: {
3058
- ...pick(sharedSecrets2, ["rootPassword", "backupKey"])
3882
+ ...pick(sharedSecrets, ["adminPassword", "backupKey"])
3059
3883
  },
3060
3884
  inputs: {
3061
- ...pick(sharedInputs2, ["k8sCluster"]),
3885
+ ...pick(sharedInputs, ["k8sCluster"]),
3062
3886
  ...pick(optionalSharedInputs, ["resticRepo"])
3063
3887
  },
3064
3888
  outputs: {
3065
- mariadb: mariadbEntity,
3066
- service: serviceEntity
3889
+ connection: connectionEntity6,
3890
+ statefulSet: statefulSetEntity
3067
3891
  },
3068
3892
  meta: {
3069
3893
  description: `The MariaDB database deployed on Kubernetes.`,
@@ -3072,101 +3896,99 @@ var mariadb = defineUnit({
3072
3896
  secondaryIcon: "mdi:database",
3073
3897
  category: "Databases"
3074
3898
  },
3075
- source: source("mariadb/app")
3076
- });
3077
- var mariadbDatabase = defineUnit({
3078
- type: "k8s.apps.mariadb.database.v1",
3079
- args: sharedDatabaseArgs,
3080
- secrets: sharedDatabaseSecrets,
3081
- inputs: {
3082
- ...pick(sharedInputs2, ["k8sCluster", "mariadb"]),
3083
- ...pick(optionalSharedInputs, ["namespace"])
3084
- },
3085
- outputs: {
3086
- mariadb: mariadbEntity
3087
- },
3088
- meta: {
3089
- description: `The virtual MariaDB database created on the MariaDB instance.
3090
-
3091
- Requires a Kubernetes cluster to place init jobs and secrets.`,
3092
- title: "MariaDB Database",
3093
- icon: "simple-icons:mariadb",
3094
- secondaryIcon: "mdi:database-plus",
3095
- category: "Databases"
3096
- },
3097
- source: source("mariadb/database")
3899
+ source: source("mariadb")
3098
3900
  });
3099
- var maybe = defineUnit({
3100
- type: "k8s.apps.maybe.v1",
3901
+ var matrixStack = defineUnit({
3902
+ type: "k8s.apps.matrix-stack.v1",
3101
3903
  args: {
3102
- ...appName("maybe"),
3103
- ...pick(sharedArgs2, ["fqdn"])
3104
- },
3105
- secrets: {
3106
- ...pick(sharedSecrets2, ["backupKey"]),
3107
- postgresqlPassword: z.string().optional(),
3108
- secretKey: z.string().optional()
3904
+ ...appName("matrix-stack"),
3905
+ /**
3906
+ * The base domain for the Matrix stack services.
3907
+ *
3908
+ * Subdomains for Matrix services are generated automatically.
3909
+ * This value cannot be changed after the first deployment.
3910
+ */
3911
+ fqdn: $addArgumentDescription(z.string(), `The base domain for the Matrix stack services.
3912
+
3913
+ Subdomains for Matrix services are generated automatically.
3914
+ This value cannot be changed after the first deployment.`),
3915
+ /**
3916
+ * Whether to enable cinny web client deployment.
3917
+ *
3918
+ * The FQDN will be generated as `cinny.${fqdn}`.
3919
+ */
3920
+ enableCinny: $addArgumentDescription(z.boolean().default(false), `Whether to enable cinny web client deployment.
3921
+
3922
+ The FQDN will be generated as \`cinny.\${fqdn}\`.`),
3923
+ /**
3924
+ * The list of remote Matrix domains that are allowed for federation.
3925
+ *
3926
+ * Leave empty to allow federation with all domains.
3927
+ */
3928
+ federationDomainWhitelist: $addArgumentDescription(z.array(z.string()).default([]), `The list of remote Matrix domains that are allowed for federation.
3929
+
3930
+ Leave empty to allow federation with all domains.`)
3109
3931
  },
3110
3932
  inputs: {
3111
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint", "postgresql", "redis"]),
3112
- ...pick(optionalSharedInputs, ["resticRepo"])
3933
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
3934
+ /**
3935
+ * The PostgreSQL connection for the Synapse server.
3936
+ */
3937
+ synapsePostgresql: $addInputDescription(postgresql_exports.connectionEntity, `The PostgreSQL connection for the Synapse server.`),
3938
+ /**
3939
+ * The PostgreSQL connection for the Matrix Authentication Service.
3940
+ */
3941
+ masPostgresql: $addInputDescription(postgresql_exports.connectionEntity, `The PostgreSQL connection for the Matrix Authentication Service.`)
3113
3942
  },
3943
+ secrets: {},
3114
3944
  meta: {
3115
- title: "Maybe",
3116
- description: "The OS for your personal finances.",
3117
- icon: "arcticons:finance-manager",
3118
- category: "Finance"
3945
+ description: `The Matrix stack deployed on Kubernetes.`,
3946
+ title: "Matrix Stack",
3947
+ icon: "simple-icons:matrix",
3948
+ secondaryIcon: "simple-icons:element",
3949
+ category: "Communication"
3119
3950
  },
3120
- source: source("maybe")
3121
- });
3122
- var minioSecrets = $secrets({
3123
- /**
3124
- * The secret key used to authenticate with MinIO.
3125
- */
3126
- secretKey: $addArgumentDescription(z.string().optional(), `The secret key used to authenticate with MinIO.`),
3127
- /**
3128
- * The key that protects Restic backups.
3129
- */
3130
- backupKey: $addArgumentDescription(z.string().optional(), `The key that protects Restic backups.`)
3951
+ source: source("matrix-stack")
3131
3952
  });
3132
- var minio = defineUnit({
3133
- type: "k8s.apps.minio.v1",
3134
- args: {
3135
- ...appName("minio"),
3136
- ...pick(sharedArgs2, ["external"]),
3137
- accessKey: {
3138
- schema: z.string().default("admin"),
3139
- meta: {
3140
- description: text`
3141
- The access key used to authenticate with MinIO.
3142
- If not provided, defaults to "admin".
3143
- `
3144
- }
3145
- },
3146
- region: {
3147
- schema: z.string().optional(),
3148
- meta: {
3149
- description: text`The region associated with the MinIO deployment.`
3150
- }
3151
- },
3152
- buckets: {
3153
- schema: s3BucketSchema.array().default([]),
3154
- meta: {
3155
- description: text`
3156
- The buckets that must exist on the MinIO instance.
3157
- Each entry can optionally include a bucket policy: none, download, upload, or public.
3158
- `
3159
- }
3160
- }
3953
+ var minio = defineUnit({
3954
+ type: "k8s.apps.minio.v1",
3955
+ args: {
3956
+ ...appName("minio"),
3957
+ ...pick(optionalSharedArgs, ["fqdn"]),
3958
+ ...pick(sharedArgs, ["external"]),
3959
+ /**
3960
+ * The FQDN of the MinIO console.
3961
+ *
3962
+ * If not provided, the console will not be exposed and only the S3 API will be available.
3963
+ */
3964
+ consoleFqdn: $addArgumentDescription(z.string().optional(), `The FQDN of the MinIO console.
3965
+
3966
+ If not provided, the console will not be exposed and only the S3 API will be available.`),
3967
+ /**
3968
+ * The name of the region to associate with the MinIO deployment.
3969
+ *
3970
+ * Defaults to "us-east-1".
3971
+ */
3972
+ region: $addArgumentDescription(z.string().default("us-east-1"), `The name of the region to associate with the MinIO deployment.
3973
+
3974
+ Defaults to "us-east-1".`),
3975
+ /**
3976
+ * Whether to use the [fork](https://github.com/huncrys/minio-console) of MinIO Console instead of the built-in console.
3977
+ * The fork contains admin features that were removed from the original console.
3978
+ */
3979
+ useConsoleFork: $addArgumentDescription(z.boolean().default(false), `Whether to use the [fork](https://github.com/huncrys/minio-console) of MinIO Console instead of the built-in console.
3980
+ The fork contains admin features that were removed from the original console.`)
3981
+ },
3982
+ secrets: {
3983
+ ...pick(sharedSecrets, ["adminPassword", "backupKey"])
3161
3984
  },
3162
- secrets: minioSecrets,
3163
3985
  inputs: {
3164
- ...pick(sharedInputs2, ["k8sCluster"]),
3165
- ...pick(optionalSharedInputs, ["resticRepo"])
3986
+ ...pick(sharedInputs, ["k8sCluster"]),
3987
+ ...pick(optionalSharedInputs, ["accessPoint", "resticRepo"])
3166
3988
  },
3167
3989
  outputs: {
3168
- s3: s3Entity,
3169
- service: serviceEntity
3990
+ connection: connectionEntity4,
3991
+ deployment: deploymentEntity
3170
3992
  },
3171
3993
  meta: {
3172
3994
  description: `The MinIO object storage deployed on Kubernetes.`,
@@ -3175,24 +3997,24 @@ var minio = defineUnit({
3175
3997
  secondaryIcon: "mdi:bucket",
3176
3998
  category: "Databases"
3177
3999
  },
3178
- source: source("minio/app")
4000
+ source: source("minio")
3179
4001
  });
3180
4002
  var mongodb = defineUnit({
3181
4003
  type: "k8s.apps.mongodb.v1",
3182
4004
  args: {
3183
4005
  ...appName("mongodb"),
3184
- ...pick(sharedArgs2, ["external"])
4006
+ ...pick(sharedArgs, ["external"])
3185
4007
  },
3186
4008
  secrets: {
3187
- ...pick(sharedSecrets2, ["rootPassword", "backupKey"])
4009
+ ...pick(sharedSecrets, ["adminPassword", "backupKey"])
3188
4010
  },
3189
4011
  inputs: {
3190
- ...pick(sharedInputs2, ["k8sCluster"]),
4012
+ ...pick(sharedInputs, ["k8sCluster"]),
3191
4013
  ...pick(optionalSharedInputs, ["resticRepo"])
3192
4014
  },
3193
4015
  outputs: {
3194
- mongodb: mongodbEntity,
3195
- service: serviceEntity
4016
+ connection: connectionEntity5,
4017
+ statefulSet: statefulSetEntity
3196
4018
  },
3197
4019
  meta: {
3198
4020
  description: `The MongoDB instance deployed on Kubernetes.`,
@@ -3201,46 +4023,41 @@ var mongodb = defineUnit({
3201
4023
  secondaryIcon: "mdi:database",
3202
4024
  category: "Databases"
3203
4025
  },
3204
- source: source("mongodb/app")
4026
+ source: source("mongodb")
3205
4027
  });
3206
- var mongodbDatabase = defineUnit({
3207
- type: "k8s.apps.mongodb.database.v1",
3208
- args: sharedDatabaseArgs,
3209
- secrets: sharedDatabaseSecrets,
3210
- inputs: {
3211
- ...pick(sharedInputs2, ["k8sCluster", "mongodb"]),
3212
- ...pick(optionalSharedInputs, ["namespace"])
4028
+ var portal = defineUnit({
4029
+ type: "k8s.apps.portal.v1",
4030
+ args: {
4031
+ ...appName("portal"),
4032
+ ...pick(sharedArgs, ["fqdn"])
3213
4033
  },
3214
- outputs: {
3215
- mongodb: mongodbEntity
4034
+ inputs: {
4035
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"])
3216
4036
  },
3217
4037
  meta: {
3218
- description: `The virtual MongoDB database created on the MongoDB instance.
3219
-
3220
- Requires a Kubernetes cluster to place init jobs and secrets.`,
3221
- title: "MongoDB Database",
3222
- icon: "simple-icons:mongodb",
3223
- secondaryIcon: "mdi:database-plus",
3224
- category: "Databases"
4038
+ description: `The Portal application deployed on Kubernetes.`,
4039
+ title: "Portal",
4040
+ icon: "mdi:application-outline",
4041
+ category: "Services"
3225
4042
  },
3226
- source: source("mongodb/database")
4043
+ source: source("portal")
3227
4044
  });
3228
4045
  var postgresql = defineUnit({
3229
4046
  type: "k8s.apps.postgresql.v1",
3230
4047
  args: {
3231
4048
  ...appName("postgresql"),
3232
- ...pick(sharedArgs2, ["external"])
4049
+ ...pick(sharedArgs, ["namespace", "external"])
3233
4050
  },
3234
4051
  secrets: {
3235
- ...pick(sharedSecrets2, ["rootPassword", "backupKey"])
4052
+ ...pick(sharedSecrets, ["adminPassword", "backupKey"])
3236
4053
  },
3237
4054
  inputs: {
3238
- ...pick(sharedInputs2, ["k8sCluster"]),
4055
+ ...pick(sharedInputs, ["k8sCluster"]),
3239
4056
  ...pick(optionalSharedInputs, ["resticRepo"])
3240
4057
  },
3241
4058
  outputs: {
3242
- postgresql: postgresqlEntity,
3243
- service: serviceEntity
4059
+ connection: connectionEntity7,
4060
+ statefulSet: statefulSetEntity
3244
4061
  },
3245
4062
  meta: {
3246
4063
  description: `The PostgreSQL instance deployed on Kubernetes.`,
@@ -3249,31 +4066,43 @@ var postgresql = defineUnit({
3249
4066
  secondaryIcon: "mdi:database",
3250
4067
  category: "Databases"
3251
4068
  },
3252
- source: source("postgresql/app")
4069
+ source: source("postgresql")
3253
4070
  });
3254
- var postgresqlDatabase = defineUnit({
3255
- type: "k8s.apps.postgresql.database.v1",
3256
- args: sharedDatabaseArgs,
3257
- secrets: sharedDatabaseSecrets,
4071
+ var refluxdb = defineUnit({
4072
+ type: "k8s.apps.refluxdb.v1",
4073
+ args: {
4074
+ ...appName("refluxdb"),
4075
+ ...pick(sharedArgs, ["external"]),
4076
+ /**
4077
+ * The ID of the node.
4078
+ *
4079
+ * Defaults to "local1".
4080
+ */
4081
+ nodeId: $addArgumentDescription(z.string().default("local1"), `The ID of the node.
4082
+
4083
+ Defaults to "local1".`)
4084
+ },
4085
+ secrets: {
4086
+ /**
4087
+ * The operator token of the RefluxDB instance.
4088
+ */
4089
+ operatorToken: $addArgumentDescription(z.string().optional(), `The operator token of the RefluxDB instance.`)
4090
+ },
3258
4091
  inputs: {
3259
- ...pick(sharedInputs2, ["k8sCluster", "postgresql"]),
3260
- ...pick(optionalSharedInputs, ["namespace"])
4092
+ ...pick(sharedInputs, ["k8sCluster"]),
4093
+ s3Bucket: s3_exports.bucketEntity
3261
4094
  },
3262
4095
  outputs: {
3263
- postgresql: postgresqlEntity
4096
+ connection: influxdb3_exports.connectionEntity,
4097
+ deployment: deploymentEntity
3264
4098
  },
3265
4099
  meta: {
3266
- description: `The virtual PostgreSQL database created on the PostgreSQL instance.
3267
-
3268
- The provided database must be authorized to create databases and users.
3269
-
3270
- Requires a Kubernetes cluster to place init jobs and secrets.`,
3271
- title: "PostgreSQL Database",
3272
- icon: "simple-icons:postgresql",
3273
- secondaryIcon: "mdi:database-plus",
4100
+ description: `The RefluxDB instance deployed on Kubernetes.`,
4101
+ title: "RefluxDB (InfluxDB 3)",
4102
+ icon: "simple-icons:influxdb",
3274
4103
  category: "Databases"
3275
4104
  },
3276
- source: source("postgresql/database")
4105
+ source: source("refluxdb")
3277
4106
  });
3278
4107
  var remnawaveEntity = defineEntity({
3279
4108
  type: "k8s.apps.remnawave.v1",
@@ -3282,7 +4111,13 @@ var remnawaveEntity = defineEntity({
3282
4111
  * The ID of the Remnawave instance.
3283
4112
  */
3284
4113
  instanceId: z.string().meta({ title: camelCaseToHumanReadable("instanceId"), description: `The ID of the Remnawave instance.` })
3285
- })
4114
+ }),
4115
+ meta: {
4116
+ color: "#0066cc",
4117
+ title: "Remnawave",
4118
+ icon: "mdi:waveform",
4119
+ iconColor: "#0066cc"
4120
+ }
3286
4121
  });
3287
4122
  var remnawave = defineUnit({
3288
4123
  type: "k8s.apps.remnawave.backend.v1",
@@ -3291,7 +4126,7 @@ var remnawave = defineUnit({
3291
4126
  jwtApiTokensSecret: z.string()
3292
4127
  },
3293
4128
  inputs: {
3294
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint", "postgresql", "redis"]),
4129
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint", "postgresql", "redis"]),
3295
4130
  ...pick(optionalSharedInputs, ["resticRepo"])
3296
4131
  },
3297
4132
  outputs: {
@@ -3310,7 +4145,7 @@ var node = defineUnit({
3310
4145
  type: "k8s.apps.remnawave.node.v1",
3311
4146
  inputs: {
3312
4147
  remnawave: remnawaveEntity,
3313
- ...pick(sharedInputs2, ["k8sCluster"])
4148
+ ...pick(sharedInputs, ["k8sCluster"])
3314
4149
  },
3315
4150
  meta: {
3316
4151
  description: `The Remnawave node deployed on Kubernetes.`,
@@ -3327,7 +4162,7 @@ var syncthing = defineUnit({
3327
4162
  type: "k8s.apps.syncthing.v1",
3328
4163
  args: {
3329
4164
  ...appName("syncthing"),
3330
- ...pick(sharedArgs2, ["fqdn", "external"]),
4165
+ ...pick(sharedArgs, ["fqdn", "external"]),
3331
4166
  /**
3332
4167
  * The FQDN of the Syncthing instance used to sync with other devices.
3333
4168
  *
@@ -3356,10 +4191,10 @@ var syncthing = defineUnit({
3356
4191
  The default is \`state\`.`)
3357
4192
  },
3358
4193
  secrets: {
3359
- ...pick(sharedSecrets2, ["backupKey"])
4194
+ ...pick(sharedSecrets, ["backupKey"])
3360
4195
  },
3361
4196
  inputs: {
3362
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"]),
4197
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
3363
4198
  ...pick(optionalSharedInputs, ["resticRepo", "volume"])
3364
4199
  },
3365
4200
  outputs: {
@@ -3382,7 +4217,7 @@ var traefik = defineUnit({
3382
4217
  type: "k8s.apps.traefik.v1",
3383
4218
  args: {
3384
4219
  ...appName("traefik"),
3385
- ...pick(sharedArgs2, ["external", "replicas"]),
4220
+ ...pick(sharedArgs, ["external", "replicas"]),
3386
4221
  /**
3387
4222
  * The name of the class to configure for ingress and gateway resources.
3388
4223
  *
@@ -3391,6 +4226,10 @@ var traefik = defineUnit({
3391
4226
  className: $addArgumentDescription(z.string().default("traefik"), `The name of the class to configure for ingress and gateway resources.
3392
4227
 
3393
4228
  Defaults to "traefik".`),
4229
+ /**
4230
+ * The node selector to apply to all Traefik pods.
4231
+ */
4232
+ nodeSelector: $addArgumentDescription(z.record(z.string(), z.string()).default({}), `The node selector to apply to all Traefik pods.`),
3394
4233
  /**
3395
4234
  * Whether to create and enable reconciliation for Traefik CRDs.
3396
4235
  */
@@ -3405,7 +4244,7 @@ var traefik = defineUnit({
3405
4244
  enableGatewayApi: $addArgumentDescription(z.boolean().default(false), `Whether to enable reconciliation for Gateway API resources and create gateway class.`)
3406
4245
  },
3407
4246
  inputs: {
3408
- ...pick(sharedInputs2, ["k8sCluster"])
4247
+ ...pick(sharedInputs, ["k8sCluster"])
3409
4248
  },
3410
4249
  outputs: {
3411
4250
  gateway: gatewayEntity,
@@ -3427,18 +4266,18 @@ var valkey = defineUnit({
3427
4266
  type: "k8s.apps.valkey.v1",
3428
4267
  args: {
3429
4268
  ...appName("valkey"),
3430
- ...pick(sharedArgs2, ["external"])
4269
+ ...pick(sharedArgs, ["external"])
3431
4270
  },
3432
4271
  secrets: {
3433
- ...pick(sharedSecrets2, ["backupKey"])
4272
+ ...pick(sharedSecrets, ["backupKey"])
3434
4273
  },
3435
4274
  inputs: {
3436
- ...pick(sharedInputs2, ["k8sCluster"]),
4275
+ ...pick(sharedInputs, ["k8sCluster"]),
3437
4276
  ...pick(optionalSharedInputs, ["resticRepo"])
3438
4277
  },
3439
4278
  outputs: {
3440
- redis: databases_exports.redisEntity,
3441
- service: serviceEntity
4279
+ connection: redis_exports.connectionEntity,
4280
+ statefulSet: statefulSetEntity
3442
4281
  },
3443
4282
  meta: {
3444
4283
  description: `The Valkey instance deployed on Kubernetes.`,
@@ -3447,19 +4286,16 @@ var valkey = defineUnit({
3447
4286
  secondaryIcon: "mdi:database",
3448
4287
  category: "Databases"
3449
4288
  },
3450
- source: source("valkey/app")
4289
+ source: source("valkey")
3451
4290
  });
3452
4291
  var vaultwarden = defineUnit({
3453
4292
  type: "k8s.apps.vaultwarden.v1",
3454
4293
  args: {
3455
4294
  ...appName("vaultwarden"),
3456
- ...pick(sharedArgs2, ["fqdn"])
3457
- },
3458
- secrets: {
3459
- mariadbPassword: z.string().optional()
4295
+ ...pick(sharedArgs, ["fqdn"])
3460
4296
  },
3461
4297
  inputs: {
3462
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint", "mariadb"])
4298
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint", "mysql"])
3463
4299
  },
3464
4300
  meta: {
3465
4301
  description: `The Vaultwarden password manager deployed on Kubernetes.`,
@@ -3473,10 +4309,10 @@ var wgFeedServer = defineUnit({
3473
4309
  type: "k8s.apps.wg-feed-server.v1",
3474
4310
  args: {
3475
4311
  ...appName("wg-feed-server"),
3476
- ...pick(sharedArgs2, ["fqdn"])
4312
+ ...pick(sharedArgs, ["fqdn"])
3477
4313
  },
3478
4314
  inputs: {
3479
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint", "etcd"])
4315
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint", "etcd"])
3480
4316
  },
3481
4317
  outputs: {
3482
4318
  endpoint: l4EndpointEntity
@@ -3606,6 +4442,10 @@ var workload = defineUnit({
3606
4442
  2. a dependency key to service configuration (e.g., \`mariadb.username\`);
3607
4443
  3. a config key to reference a configuration value provided via \`config\` argument;
3608
4444
  4. a secret key to reference a secret value provided via \`secretData\` secret.`),
4445
+ /**
4446
+ * The files to mount in the workload from a config map.
4447
+ */
4448
+ files: $addArgumentDescription(z.record(z.string(), z.string()).default({}), `The files to mount in the workload from a config map.`),
3609
4449
  /**
3610
4450
  * The configuration for the workload.
3611
4451
  *
@@ -3690,19 +4530,16 @@ var workload = defineUnit({
3690
4530
  You can reference the secret values in the environment variables using \`secretKey\`.`)
3691
4531
  },
3692
4532
  inputs: {
3693
- ...pick(sharedInputs2, ["k8sCluster"]),
3694
- ...pick(optionalSharedInputs, [
3695
- "accessPoint",
3696
- "resticRepo",
3697
- "mariadb",
3698
- "postgresql",
3699
- "mongodb"
3700
- ])
4533
+ ...pick(sharedInputs, ["k8sCluster"]),
4534
+ ...pick(optionalSharedInputs, ["accessPoint", "resticRepo", "mysql", "postgresql", "mongodb"]),
4535
+ workload: {
4536
+ entity: workloadEntity,
4537
+ required: false
4538
+ }
3701
4539
  },
3702
4540
  outputs: {
3703
- namespace: namespaceEntity,
3704
- workload: exposableWorkloadEntity,
3705
- service: serviceEntity
4541
+ namespace: namespaceEntity2,
4542
+ workload: workloadEntity
3706
4543
  },
3707
4544
  meta: {
3708
4545
  description: `The generic Kubernetes workload with optional service and gateway routes.
@@ -3756,6 +4593,24 @@ var certManager = defineUnit({
3756
4593
  });
3757
4594
  var dns01TlsIssuer = defineUnit({
3758
4595
  type: "k8s.dns01-issuer.v1",
4596
+ args: {
4597
+ /**
4598
+ * The ACME server to use for issuing certificates.
4599
+ */
4600
+ acmeServer: $addArgumentDescription(z.union([
4601
+ z.object({
4602
+ type: z.enum(["letsencrypt", "zerossl"])
4603
+ }),
4604
+ z.object({
4605
+ type: z.literal("custom"),
4606
+ url: z.string()
4607
+ })
4608
+ ]).default({ type: "letsencrypt" }), `The ACME server to use for issuing certificates.`)
4609
+ },
4610
+ secrets: {
4611
+ eabKeyId: z.string().optional(),
4612
+ eabKeySecret: z.string().optional()
4613
+ },
3759
4614
  inputs: {
3760
4615
  k8sCluster: clusterEntity,
3761
4616
  dnsProvider: providerEntity
@@ -3800,7 +4655,19 @@ var cilium = defineUnit({
3800
4655
 
3801
4656
  By default, this is \`true\`.
3802
4657
 
3803
- To expose the Hubble UI, you can use \`k8s.apps.hubble-ui\` unit.`)
4658
+ To expose the Hubble UI, you can use \`k8s.apps.hubble-ui\` unit.`),
4659
+ /**
4660
+ * The tolerations of the cilium agent in the cluster.
4661
+ */
4662
+ agentTolerations: $addArgumentDescription(tolerationSchema.array().optional(), `The tolerations of the cilium agent in the cluster.`),
4663
+ /**
4664
+ * The tolerations of the cilium envoy in the cluster.
4665
+ */
4666
+ envoyTolerations: $addArgumentDescription(tolerationSchema.array().optional(), `The tolerations of the cilium envoy in the cluster.`),
4667
+ /**
4668
+ * The tolerations of the cilium operator in the cluster.
4669
+ */
4670
+ operatorTolerations: $addArgumentDescription(tolerationSchema.array().optional(), `The tolerations of the cilium operator in the cluster.`)
3804
4671
  },
3805
4672
  inputs: {
3806
4673
  k8sCluster: clusterEntity
@@ -3821,7 +4688,7 @@ var cilium = defineUnit({
3821
4688
  }
3822
4689
  });
3823
4690
  var ciliumClusterMetadata = z.object({
3824
- cilium: z.object({
4691
+ "cilium.cni": z.object({
3825
4692
  /**
3826
4693
  * If set to `true`, the generated network policy will allow
3827
4694
  * all DNS queries to be resolved, even if they are
@@ -3847,15 +4714,15 @@ var openttd = defineUnit({
3847
4714
  type: "k8s.game-servers.openttd.v1",
3848
4715
  args: {
3849
4716
  ...appName("openttd-server"),
3850
- ...pick(sharedArgs2, ["fqdn"]),
4717
+ ...pick(sharedArgs, ["fqdn"]),
3851
4718
  port: z.number().default(3979).describe("The port the game server will be exposed on.")
3852
4719
  },
3853
4720
  inputs: {
3854
- ...pick(sharedInputs2, ["k8sCluster", "dnsProviders"]),
4721
+ ...pick(sharedInputs, ["k8sCluster", "dnsProviders"]),
3855
4722
  ...pick(optionalSharedInputs, ["resticRepo"])
3856
4723
  },
3857
4724
  secrets: {
3858
- ...pick(sharedSecrets2, ["backupKey"])
4725
+ ...pick(sharedSecrets, ["backupKey"])
3859
4726
  },
3860
4727
  source: {
3861
4728
  package: "@highstate/k8s.game-servers",
@@ -3871,15 +4738,15 @@ var satisfactory = defineUnit({
3871
4738
  type: "k8s.game-servers.satisfactory.v1",
3872
4739
  args: {
3873
4740
  ...appName("satisfactory-server"),
3874
- ...pick(sharedArgs2, ["fqdn"]),
4741
+ ...pick(sharedArgs, ["fqdn"]),
3875
4742
  port: z.number().default(7777).describe("The port the game server will be exposed on.")
3876
4743
  },
3877
4744
  inputs: {
3878
- ...pick(sharedInputs2, ["k8sCluster", "accessPoint"]),
4745
+ ...pick(sharedInputs, ["k8sCluster", "accessPoint"]),
3879
4746
  ...pick(optionalSharedInputs, ["resticRepo"])
3880
4747
  },
3881
4748
  secrets: {
3882
- ...pick(sharedSecrets2, ["backupKey"])
4749
+ ...pick(sharedSecrets, ["backupKey"])
3883
4750
  },
3884
4751
  source: {
3885
4752
  package: "@highstate/k8s.game-servers",
@@ -3899,7 +4766,7 @@ var gatewayDataSchema = z.object({
3899
4766
  /**
3900
4767
  * The namespace where the gateway controller of the class is running.
3901
4768
  */
3902
- namespace: namespaceEntity.schema.meta({ title: camelCaseToHumanReadable("namespace"), description: `The namespace where the gateway controller of the class is running.` }),
4769
+ namespace: namespaceEntity2.schema.meta({ title: camelCaseToHumanReadable("namespace"), description: `The namespace where the gateway controller of the class is running.` }),
3903
4770
  /**
3904
4771
  * The name of the gateway class to use.
3905
4772
  */
@@ -4147,12 +5014,12 @@ var reducedAccessCluster = defineUnit({
4147
5014
  /**
4148
5015
  * The namespace where the ServiceAccount will be created.
4149
5016
  */
4150
- namespace: $addInputDescription(namespaceEntity, `The namespace where the ServiceAccount will be created.`),
5017
+ namespace: $addInputDescription(namespaceEntity2, `The namespace where the ServiceAccount will be created.`),
4151
5018
  /**
4152
5019
  * The extra namespaces to bind to the ClusterRole and allow ServiceAccount to access them with specified rules.
4153
5020
  */
4154
5021
  extraNamespaces: $addInputDescription({
4155
- entity: namespaceEntity,
5022
+ entity: namespaceEntity2,
4156
5023
  multiple: true,
4157
5024
  required: false
4158
5025
  }, `The extra namespaces to bind to the ClusterRole and allow ServiceAccount to access them with specified rules.`),
@@ -4329,7 +5196,7 @@ var system = defineUnit({
4329
5196
  var proxmox_exports = {};
4330
5197
  __export(proxmox_exports, {
4331
5198
  clusterEntity: () => clusterEntity2,
4332
- connection: () => connection,
5199
+ connection: () => connection7,
4333
5200
  existingImage: () => existingImage,
4334
5201
  image: () => image,
4335
5202
  imageEntity: () => imageEntity,
@@ -4337,15 +5204,25 @@ __export(proxmox_exports, {
4337
5204
  });
4338
5205
  var clusterEntity2 = defineEntity({
4339
5206
  type: "proxmox.cluster.v1",
5207
+ includes: {
5208
+ /**
5209
+ * The SSH configuration for the Proxmox nodes.
5210
+ *
5211
+ * If not specified, it will be assumed that the nodes are not accessible via SSH.
5212
+ */
5213
+ ssh: {
5214
+ entity: connectionEntity,
5215
+ required: false
5216
+ }
5217
+ },
4340
5218
  schema: z.object({
4341
5219
  endpoint: l7EndpointEntity.schema,
4342
5220
  insecure: z.boolean().optional(),
4343
5221
  username: z.string().optional(),
4344
5222
  defaultNodeName: z.string(),
4345
5223
  defaultDatastoreId: z.string(),
4346
- password: z.string().optional(),
4347
- apiToken: z.string().optional(),
4348
- ssh: connectionSchema.optional()
5224
+ password: secretSchema(z.string()).optional(),
5225
+ apiToken: secretSchema(z.string()).optional()
4349
5226
  }),
4350
5227
  meta: {
4351
5228
  color: "#e56901"
@@ -4360,7 +5237,7 @@ var imageEntity = defineEntity({
4360
5237
  color: "#e56901"
4361
5238
  }
4362
5239
  });
4363
- var connection = defineUnit({
5240
+ var connection7 = defineUnit({
4364
5241
  type: "proxmox.connection.v1",
4365
5242
  args: {
4366
5243
  /**
@@ -4877,14 +5754,14 @@ var cluster2 = defineUnit({
4877
5754
  // src/third-party/cloudflare.ts
4878
5755
  var cloudflare_exports = {};
4879
5756
  __export(cloudflare_exports, {
4880
- connection: () => connection2,
5757
+ connection: () => connection8,
4881
5758
  providerDataSchema: () => providerDataSchema
4882
5759
  });
4883
5760
  var providerDataSchema = z.object({
4884
5761
  /**
4885
- * The zone ID of the Cloudflare zone.
5762
+ * The mapping of zone names to their corresponding Cloudflare zone IDs.
4886
5763
  */
4887
- zoneId: z.string().meta({ title: camelCaseToHumanReadable("zoneId"), description: `The zone ID of the Cloudflare zone.` }),
5764
+ zoneIds: z.record(z.string(), z.string()).meta({ title: camelCaseToHumanReadable("zoneIds"), description: `The mapping of zone names to their corresponding Cloudflare zone IDs.` }),
4888
5765
  /**
4889
5766
  * The API token for the Cloudflare account.
4890
5767
  *
@@ -4895,7 +5772,7 @@ var providerDataSchema = z.object({
4895
5772
  * - `Zone:Read`
4896
5773
  * - `Zone:DNS:Edit`
4897
5774
  */
4898
- apiToken: z.string().meta({ title: camelCaseToHumanReadable("apiToken"), description: `The API token for the Cloudflare account.
5775
+ apiToken: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("apiToken"), description: `The API token for the Cloudflare account.
4899
5776
 
4900
5777
  The API key must have permissions to manage DNS records for exactly one zone.
4901
5778
  If multiple zones are specified, the unit will fail.
@@ -4904,7 +5781,7 @@ var providerDataSchema = z.object({
4904
5781
  - \`Zone:Read\`
4905
5782
  - \`Zone:DNS:Edit\`` })
4906
5783
  });
4907
- var connection2 = defineUnit({
5784
+ var connection8 = defineUnit({
4908
5785
  type: "cloudflare.connection.v1",
4909
5786
  secrets: {
4910
5787
  /**
@@ -4951,6 +5828,7 @@ __export(mullvad_exports, {
4951
5828
  // src/wireguard.ts
4952
5829
  var wireguard_exports = {};
4953
5830
  __export(wireguard_exports, {
5831
+ amneziaParametersSchema: () => amneziaParametersSchema,
4954
5832
  backendSchema: () => backendSchema,
4955
5833
  config: () => config,
4956
5834
  configBundle: () => configBundle,
@@ -4961,22 +5839,42 @@ __export(wireguard_exports, {
4961
5839
  identity: () => identity,
4962
5840
  identityEntity: () => identityEntity,
4963
5841
  network: () => network,
5842
+ networkArgs: () => networkArgs2,
4964
5843
  networkEntity: () => networkEntity,
4965
5844
  node: () => node2,
4966
5845
  nodeExposePolicySchema: () => nodeExposePolicySchema,
5846
+ nodeFeedK8s: () => nodeFeedK8s,
4967
5847
  nodeK8s: () => nodeK8s,
4968
5848
  peer: () => peer,
4969
5849
  peerEntity: () => peerEntity,
4970
5850
  peerPatch: () => peerPatch
4971
5851
  });
4972
5852
  var backendSchema = z.enum(["wireguard", "amneziawg"]);
5853
+ var amneziaParametersSchema = z.object({
5854
+ i1: z.string().optional(),
5855
+ i2: z.string().optional(),
5856
+ i3: z.string().optional(),
5857
+ i4: z.string().optional(),
5858
+ i5: z.string().optional(),
5859
+ s1: z.number().optional(),
5860
+ s2: z.number().optional(),
5861
+ s3: z.number().optional(),
5862
+ s4: z.number().optional(),
5863
+ jc: z.number().optional(),
5864
+ jmin: z.number().optional(),
5865
+ jmax: z.number().optional(),
5866
+ h1: z.string().optional(),
5867
+ h2: z.string().optional(),
5868
+ h3: z.string().optional(),
5869
+ h4: z.string().optional()
5870
+ });
4973
5871
  var networkArgs2 = {
4974
5872
  /**
4975
5873
  * The backend to use for the WireGuard network.
4976
5874
  *
4977
5875
  * Possible values are:
4978
5876
  * - `wireguard` - the default backend;
4979
- * - `amneziawg` - the censorship-resistant fork of WireGuard (NOT SUPPORTED YET).
5877
+ * - `amneziawg` - the censorship-resistant fork of WireGuard.
4980
5878
  */
4981
5879
  backend: backendSchema.default("wireguard"),
4982
5880
  /**
@@ -4992,54 +5890,156 @@ var networkArgs2 = {
4992
5890
  *
4993
5891
  * By default, IPv6 support is disabled.
4994
5892
  */
4995
- ipv6: z.boolean().default(false)
5893
+ ipv6: z.boolean().default(false),
5894
+ /**
5895
+ * The extra parameters for the amneziawg backend.
5896
+ */
5897
+ amnezia: amneziaParametersSchema.optional()
4996
5898
  };
5899
+ var configSharedArgs = $args({
5900
+ /**
5901
+ * The filter to use when selecting endpoints for each peer.
5902
+ *
5903
+ * The first matching endpoint will be used.
5904
+ *
5905
+ * If not provided, all endpoints will be considered.
5906
+ */
5907
+ peerEndpointFilter: $addArgumentDescription(z.string().optional().meta({ language: "javascript" }), `The filter to use when selecting endpoints for each peer.
5908
+
5909
+ The first matching endpoint will be used.
5910
+
5911
+ If not provided, all endpoints will be considered.`),
5912
+ /**
5913
+ * Whether to include the `ListenPort` in the generated config.
5914
+ *
5915
+ * By default, is `false` because in most cases the config is used for peers which don't listen for incoming connections.
5916
+ */
5917
+ listen: $addArgumentDescription(z.boolean().default(false), `Whether to include the \`ListenPort\` in the generated config.
5918
+
5919
+ By default, is \`false\` because in most cases the config is used for peers which don't listen for incoming connections.`)
5920
+ });
4997
5921
  var networkEntity = defineEntity({
4998
5922
  type: "wireguard.network.v1",
4999
5923
  schema: z.object(networkArgs2),
5000
5924
  meta: {
5001
5925
  description: `The entity representing the WireGuard network configuration.
5002
5926
 
5003
- It holds shared configuration for WireGuard identities, peers, and nodes.`
5927
+ It holds shared configuration for WireGuard identities, peers, and nodes.`,
5928
+ color: "#88171a",
5929
+ title: "WireGuard Network",
5930
+ icon: "simple-icons:wireguard",
5931
+ iconColor: "#88171a",
5932
+ secondaryIcon: "mdi:local-area-network-connect"
5004
5933
  }
5005
5934
  });
5006
5935
  var nodeExposePolicySchema = z.enum(["always", "when-has-endpoint", "never"]);
5936
+ var feedDisplayInfoSchema = z.object({
5937
+ /**
5938
+ * The display title of the tunnel.
5939
+ */
5940
+ title: z.string().meta({ title: camelCaseToHumanReadable("title"), description: `The display title of the tunnel.` }),
5941
+ /**
5942
+ * The display description of the tunnel.
5943
+ */
5944
+ description: z.string().optional().meta({ title: camelCaseToHumanReadable("description"), description: `The display description of the tunnel.` }),
5945
+ /**
5946
+ * The display icon URL of the tunnel.
5947
+ *
5948
+ * Must only be `data:` URL with SVG image.
5949
+ */
5950
+ iconUrl: z.url().optional().meta({ title: camelCaseToHumanReadable("iconUrl"), description: `The display icon URL of the tunnel.
5951
+
5952
+ Must only be \`data:\` URL with SVG image.` })
5953
+ });
5954
+ var feedMetadataSchema = z.object({
5955
+ /**
5956
+ * The ID of the tunnel in the feed.
5957
+ */
5958
+ id: z.string().meta({ title: camelCaseToHumanReadable("id"), description: `The ID of the tunnel in the feed.` }),
5959
+ /**
5960
+ * The suggested name of the interface for the tunnel.
5961
+ */
5962
+ name: genericNameSchema.meta({ title: camelCaseToHumanReadable("name"), description: `The suggested name of the interface for the tunnel.` }),
5963
+ /**
5964
+ * Whether the tunnel should be enabled by the client.
5965
+ */
5966
+ enabled: z.boolean().default(false).meta({ title: camelCaseToHumanReadable("enabled"), description: `Whether the tunnel should be enabled by the client.` }),
5967
+ /**
5968
+ * Whether the tunnel state must be forced by the client.
5969
+ */
5970
+ forced: z.boolean().default(false).meta({ title: camelCaseToHumanReadable("forced"), description: `Whether the tunnel state must be forced by the client.` }),
5971
+ /**
5972
+ * Whether the tunnel is exclusive and should not be enabled with other tunnels.
5973
+ */
5974
+ exclusive: z.boolean().default(false).meta({ title: camelCaseToHumanReadable("exclusive"), description: `Whether the tunnel is exclusive and should not be enabled with other tunnels.` }),
5975
+ /**
5976
+ * The display information of the tunnel.
5977
+ */
5978
+ displayInfo: feedDisplayInfoSchema.meta({ title: camelCaseToHumanReadable("displayInfo"), description: `The display information of the tunnel.` })
5979
+ });
5007
5980
  var peerEntity = defineEntity({
5008
5981
  type: "wireguard.peer.v1",
5009
5982
  includes: {
5010
- /**
5011
- * The endpoints where the WireGuard peer can be reached.
5012
- */
5013
- endpoints: {
5014
- entity: l4EndpointEntity,
5015
- multiple: true
5016
- }
5017
- },
5018
- schema: z.object({
5019
- /**
5020
- * The name of the WireGuard peer.
5021
- */
5022
- name: genericNameSchema.meta({ title: camelCaseToHumanReadable("name"), description: `The name of the WireGuard peer.` }),
5023
5983
  /**
5024
5984
  * The network to which the WireGuard peer belongs.
5025
5985
  *
5026
5986
  * Holds shared configuration for all identities, peers, and nodes.
5027
5987
  */
5028
- network: networkEntity.schema.optional().meta({ title: camelCaseToHumanReadable("network"), description: `The network to which the WireGuard peer belongs.
5029
-
5030
- Holds shared configuration for all identities, peers, and nodes.` }),
5988
+ network: {
5989
+ entity: networkEntity,
5990
+ required: false
5991
+ },
5031
5992
  /**
5032
5993
  * The addresses of the WireGuard interface.
5033
5994
  */
5034
- addresses: addressEntity.schema.array().meta({ title: camelCaseToHumanReadable("addresses"), description: `The addresses of the WireGuard interface.` }),
5995
+ addresses: {
5996
+ entity: addressEntity,
5997
+ multiple: true,
5998
+ required: false
5999
+ },
6000
+ /**
6001
+ * The list of DNS servers to setup for the interface connected to the WireGuard peer.
6002
+ */
6003
+ dns: {
6004
+ entity: addressEntity,
6005
+ multiple: true,
6006
+ required: false
6007
+ },
5035
6008
  /**
5036
6009
  * The allowed subnets of the WireGuard peer.
5037
6010
  *
5038
6011
  * Will be used to configure the `AllowedIPs` of the peer.
5039
6012
  */
5040
- allowedSubnets: subnetEntity.schema.array().meta({ title: camelCaseToHumanReadable("allowedSubnets"), description: `The allowed subnets of the WireGuard peer.
5041
-
5042
- Will be used to configure the \`AllowedIPs\` of the peer.` }),
6013
+ allowedSubnets: {
6014
+ entity: subnetEntity,
6015
+ multiple: true,
6016
+ required: false
6017
+ },
6018
+ /**
6019
+ * The endpoints where the WireGuard peer can be reached.
6020
+ */
6021
+ endpoints: {
6022
+ entity: l4EndpointEntity,
6023
+ multiple: true,
6024
+ required: false
6025
+ },
6026
+ /**
6027
+ * The peers which are relayed through this peer.
6028
+ *
6029
+ * All their allowed IPs will be added to this peer's allowed IPs
6030
+ * and will be used to setup routing for all other peers except the relayed ones.
6031
+ */
6032
+ relayedPeers: {
6033
+ entity: () => peerEntity,
6034
+ multiple: true,
6035
+ required: false
6036
+ }
6037
+ },
6038
+ schema: z.object({
6039
+ /**
6040
+ * The name of the WireGuard peer.
6041
+ */
6042
+ name: genericNameSchema.meta({ title: camelCaseToHumanReadable("name"), description: `The name of the WireGuard peer.` }),
5043
6043
  /**
5044
6044
  * The public key of the WireGuard peer.
5045
6045
  */
@@ -5051,7 +6051,7 @@ var peerEntity = defineEntity({
5051
6051
  *
5052
6052
  * Will be ignored if both peers have `presharedKeyPart` set.
5053
6053
  */
5054
- presharedKey: z.string().optional().meta({ title: camelCaseToHumanReadable("presharedKey"), description: `The pre-shared key of the WireGuard peer.
6054
+ presharedKey: secretSchema(z.string()).optional().meta({ title: camelCaseToHumanReadable("presharedKey"), description: `The pre-shared key of the WireGuard peer.
5055
6055
 
5056
6056
  If one of two peers has \`presharedKey\` set, the other peer must have \`presharedKey\` set too and they must be equal.
5057
6057
 
@@ -5061,13 +6061,9 @@ var peerEntity = defineEntity({
5061
6061
  *
5062
6062
  * If both peers have `presharedKeyPart` set, their `presharedKey` will be calculated as sha256 of the two parts.
5063
6063
  */
5064
- presharedKeyPart: z.string().optional().meta({ title: camelCaseToHumanReadable("presharedKeyPart"), description: `The pre-shared key part of the WireGuard peer.
6064
+ presharedKeyPart: secretSchema(z.string()).optional().meta({ title: camelCaseToHumanReadable("presharedKeyPart"), description: `The pre-shared key part of the WireGuard peer.
5065
6065
 
5066
6066
  If both peers have \`presharedKeyPart\` set, their \`presharedKey\` will be calculated as sha256 of the two parts.` }),
5067
- /**
5068
- * The list of DNS servers to setup for the interface connected to the WireGuard peer.
5069
- */
5070
- dns: addressEntity.schema.array().meta({ title: camelCaseToHumanReadable("dns"), description: `The list of DNS servers to setup for the interface connected to the WireGuard peer.` }),
5071
6067
  /**
5072
6068
  * The port where the WireGuard peer is listening.
5073
6069
  *
@@ -5089,20 +6085,19 @@ var peerEntity = defineEntity({
5089
6085
 
5090
6086
  If set to 0, keepalive is disabled.` }),
5091
6087
  /**
5092
- * The peers which are relayed through this peer.
6088
+ * The wg-feed metadata of the WireGuard peer.
5093
6089
  *
5094
- * All their allowed IPs will be added to this peer's allowed IPs
5095
- * and will be used to setup routing for all other peers except the relayed ones.
6090
+ * Will be used in the config referencing this peer (not the peer itself).
5096
6091
  */
5097
- get relayedPeers() {
5098
- return peerEntity.schema.array().optional().meta({ title: camelCaseToHumanReadable("relayedPeers"), description: `The peers which are relayed through this peer.
6092
+ feedMetadata: feedMetadataSchema.optional().meta({ title: camelCaseToHumanReadable("feedMetadata"), description: `The wg-feed metadata of the WireGuard peer.
5099
6093
 
5100
- All their allowed IPs will be added to this peer's allowed IPs
5101
- and will be used to setup routing for all other peers except the relayed ones.` });
5102
- }
6094
+ Will be used in the config referencing this peer (not the peer itself).` })
5103
6095
  }),
5104
6096
  meta: {
5105
- color: "#673AB7"
6097
+ color: "#673AB7",
6098
+ icon: "simple-icons:wireguard",
6099
+ secondaryIcon: "mdi:badge-account-horizontal",
6100
+ iconColor: "#88171a"
5106
6101
  }
5107
6102
  });
5108
6103
  var identityEntity = defineEntity({
@@ -5117,44 +6112,15 @@ var identityEntity = defineEntity({
5117
6112
  /**
5118
6113
  * The private key of the WireGuard identity.
5119
6114
  */
5120
- privateKey: z.string().meta({ title: camelCaseToHumanReadable("privateKey"), description: `The private key of the WireGuard identity.` })
6115
+ privateKey: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("privateKey"), description: `The private key of the WireGuard identity.` })
5121
6116
  }),
5122
6117
  meta: {
5123
- color: "#F44336"
6118
+ color: "#F44336",
6119
+ icon: "simple-icons:wireguard",
6120
+ secondaryIcon: "mdi:account",
6121
+ iconColor: "#88171a"
5124
6122
  }
5125
6123
  });
5126
- var feedDisplayInfoSchema = z.object({
5127
- /**
5128
- * The display title of the tunnel.
5129
- */
5130
- title: z.string().meta({ title: camelCaseToHumanReadable("title"), description: `The display title of the tunnel.` }),
5131
- /**
5132
- * The display description of the tunnel.
5133
- */
5134
- description: z.string().optional().meta({ title: camelCaseToHumanReadable("description"), description: `The display description of the tunnel.` }),
5135
- /**
5136
- * The display icon URL of the tunnel.
5137
- *
5138
- * Must only be `data:` URL with SVG image.
5139
- */
5140
- iconUrl: z.url().optional().meta({ title: camelCaseToHumanReadable("iconUrl"), description: `The display icon URL of the tunnel.
5141
-
5142
- Must only be \`data:\` URL with SVG image.` })
5143
- });
5144
- var feedMetadataSchema = z.object({
5145
- /**
5146
- * The ID of the tunnel in the feed.
5147
- */
5148
- id: z.string().meta({ title: camelCaseToHumanReadable("id"), description: `The ID of the tunnel in the feed.` }),
5149
- /**
5150
- * The suggested name of the interface for the tunnel.
5151
- */
5152
- name: genericNameSchema.meta({ title: camelCaseToHumanReadable("name"), description: `The suggested name of the interface for the tunnel.` }),
5153
- /**
5154
- * The display information of the tunnel.
5155
- */
5156
- displayInfo: feedDisplayInfoSchema.meta({ title: camelCaseToHumanReadable("displayInfo"), description: `The display information of the tunnel.` })
5157
- });
5158
6124
  var configEntity = defineEntity({
5159
6125
  type: "wireguard.config.v1",
5160
6126
  includes: {
@@ -5172,7 +6138,14 @@ var configEntity = defineEntity({
5172
6138
  feedMetadata: feedMetadataSchema.optional().meta({ title: camelCaseToHumanReadable("feedMetadata"), description: `The metadata to include in the wg-feed for this config.
5173
6139
 
5174
6140
  Must be provided for the configs uploaded to wg-feed.` })
5175
- })
6141
+ }),
6142
+ meta: {
6143
+ color: "#455A64",
6144
+ title: "WireGuard Config",
6145
+ icon: "simple-icons:wireguard",
6146
+ iconColor: "#88171a",
6147
+ secondaryIcon: "mdi:settings"
6148
+ }
5176
6149
  });
5177
6150
  var network = defineUnit({
5178
6151
  type: "wireguard.network.v1",
@@ -5192,6 +6165,32 @@ var network = defineUnit({
5192
6165
  path: "network"
5193
6166
  }
5194
6167
  });
6168
+ var sharedFeedArgs = $args({
6169
+ /**
6170
+ * The metadata to include in the wg-feed for this config.
6171
+ */
6172
+ feedMetadata: $addArgumentDescription(z.discriminatedUnion("provided", [
6173
+ z.object({
6174
+ /**
6175
+ * Whether this config is enabled for upload to wg-feed.
6176
+ *
6177
+ * You must fill the metadata fields.
6178
+ */
6179
+ provided: z.literal("yes").meta({ title: camelCaseToHumanReadable("provided"), description: `Whether this config is enabled for upload to wg-feed.
6180
+
6181
+ You must fill the metadata fields.` }),
6182
+ ...pick(feedMetadataSchema.shape, ["id", "name", "enabled", "forced", "exclusive"]),
6183
+ // Highstate does not support nested objects in UI
6184
+ ...feedDisplayInfoSchema.shape
6185
+ }),
6186
+ z.object({
6187
+ /**
6188
+ * Whether this config is enabled for upload to wg-feed.
6189
+ */
6190
+ provided: z.literal("no").meta({ title: camelCaseToHumanReadable("provided"), description: `Whether this config is enabled for upload to wg-feed.` })
6191
+ })
6192
+ ]).prefault({ provided: "no" }), `The metadata to include in the wg-feed for this config.`)
6193
+ });
5195
6194
  var sharedPeerArgs = $args({
5196
6195
  /**
5197
6196
  * The name of the WireGuard peer.
@@ -5294,7 +6293,8 @@ var sharedPeerArgs = $args({
5294
6293
  */
5295
6294
  persistentKeepalive: $addArgumentDescription(z.number().int().nonnegative().default(0), `The keepalive interval in seconds that will be used by all nodes connecting to this peer.
5296
6295
 
5297
- If set to 0, keepalive is disabled.`)
6296
+ If set to 0, keepalive is disabled.`),
6297
+ ...sharedFeedArgs
5298
6298
  });
5299
6299
  var sharedPeerInputs = $inputs({
5300
6300
  /**
@@ -5504,7 +6504,11 @@ var nodeK8s = defineUnit({
5504
6504
  entity: workloadEntity,
5505
6505
  required: false
5506
6506
  },
5507
- interface: {
6507
+ downstreamInterface: {
6508
+ entity: networkInterfaceEntity,
6509
+ required: false
6510
+ },
6511
+ fallbackInterface: {
5508
6512
  entity: networkInterfaceEntity,
5509
6513
  required: false
5510
6514
  },
@@ -5538,6 +6542,111 @@ var nodeK8s = defineUnit({
5538
6542
  path: "node.k8s"
5539
6543
  }
5540
6544
  });
6545
+ var nodeFeedK8s = defineUnit({
6546
+ type: "wireguard.node.feed.k8s.v1",
6547
+ args: {
6548
+ /**
6549
+ * The name of the namespace/deployment/statefulset where the daemon will be deployed.
6550
+ *
6551
+ * By default, the name is `wg-${identity.name}`.
6552
+ */
6553
+ appName: $addArgumentDescription(z.string().optional(), `The name of the namespace/deployment/statefulset where the daemon will be deployed.
6554
+
6555
+ By default, the name is \`wg-\${identity.name}\`.`),
6556
+ /**
6557
+ * Whether to expose the WireGuard node to the outside world.
6558
+ */
6559
+ external: $addArgumentDescription(z.boolean().default(false), `Whether to expose the WireGuard node to the outside world.`),
6560
+ /**
6561
+ * Whether to create a Service and allow ingress.
6562
+ */
6563
+ expose: $addArgumentDescription(z.boolean().default(false), `Whether to create a Service and allow ingress.`),
6564
+ /**
6565
+ * The UDP port that will be exposed by the Service.
6566
+ *
6567
+ * This is required for consumers that need to know the port ahead of time.
6568
+ */
6569
+ listenPort: $addArgumentDescription(z.number().default(51820), `The UDP port that will be exposed by the Service.
6570
+
6571
+ This is required for consumers that need to know the port ahead of time.`),
6572
+ /**
6573
+ * The name of the WireGuard interface to export as `interface` output.
6574
+ *
6575
+ * Note: wg-feed may manage multiple tunnels.
6576
+ * This output is a convenience handle for downstream units.
6577
+ */
6578
+ interfaceName: $addArgumentDescription(z.string().default("wg0"), `The name of the WireGuard interface to export as \`interface\` output.
6579
+
6580
+ Note: wg-feed may manage multiple tunnels.
6581
+ This output is a convenience handle for downstream units.`),
6582
+ /**
6583
+ * List of CIDR blocks that should be blocked from forwarding through this WireGuard node.
6584
+ *
6585
+ * This prevents other peers from reaching these destination CIDRs while still allowing
6586
+ * the peers in those CIDRs to access the internet and other allowed endpoints.
6587
+ *
6588
+ * Useful for peer isolation where you want to prevent cross-peer communication.
6589
+ */
6590
+ forwardRestrictedSubnets: $addArgumentDescription(z.string().array().default([]), `List of CIDR blocks that should be blocked from forwarding through this WireGuard node.
6591
+
6592
+ This prevents other peers from reaching these destination CIDRs while still allowing
6593
+ the peers in those CIDRs to access the internet and other allowed endpoints.
6594
+
6595
+ Useful for peer isolation where you want to prevent cross-peer communication.`),
6596
+ /**
6597
+ * The extra specification of the container which runs the wg-feed daemon.
6598
+ *
6599
+ * Will override any overlapping fields.
6600
+ */
6601
+ containerSpec: $addArgumentDescription(z.record(z.string(), z.unknown()).optional(), `The extra specification of the container which runs the wg-feed daemon.
6602
+
6603
+ Will override any overlapping fields.`)
6604
+ },
6605
+ inputs: {
6606
+ k8sCluster: clusterEntity,
6607
+ endpoints: {
6608
+ entity: l7EndpointEntity,
6609
+ multiple: true,
6610
+ required: false
6611
+ },
6612
+ peer: {
6613
+ entity: peerEntity,
6614
+ required: false
6615
+ },
6616
+ workload: {
6617
+ entity: workloadEntity,
6618
+ required: false
6619
+ },
6620
+ interface: {
6621
+ entity: networkInterfaceEntity,
6622
+ required: false
6623
+ }
6624
+ },
6625
+ outputs: {
6626
+ workload: {
6627
+ entity: workloadEntity
6628
+ },
6629
+ interface: {
6630
+ entity: networkInterfaceEntity
6631
+ },
6632
+ peer: {
6633
+ entity: peerEntity,
6634
+ required: false
6635
+ }
6636
+ },
6637
+ meta: {
6638
+ title: "WireGuard Feed Kubernetes Node",
6639
+ description: "The wg-feed daemon deployed in the Kubernetes cluster.",
6640
+ icon: "simple-icons:wireguard",
6641
+ iconColor: "#88171a",
6642
+ secondaryIcon: "devicon:kubernetes",
6643
+ category: "VPN"
6644
+ },
6645
+ source: {
6646
+ package: "@highstate/wireguard",
6647
+ path: "node.feed.k8s"
6648
+ }
6649
+ });
5541
6650
  var node2 = defineUnit({
5542
6651
  type: "wireguard.node.v1",
5543
6652
  args: {
@@ -5571,6 +6680,7 @@ var node2 = defineUnit({
5571
6680
  enableMasquerade: $addArgumentDescription(z.boolean().default(true), `Whether to enable IP masquerading (NAT) for outgoing traffic.
5572
6681
 
5573
6682
  By default, IP masquerading is enabled.`),
6683
+ ...configSharedArgs,
5574
6684
  /**
5575
6685
  * Script to run before bringing up the interface.
5576
6686
  */
@@ -5604,11 +6714,6 @@ var node2 = defineUnit({
5604
6714
  peer: {
5605
6715
  entity: peerEntity,
5606
6716
  required: false
5607
- },
5608
- endpoints: {
5609
- entity: l4EndpointEntity,
5610
- required: false,
5611
- multiple: true
5612
6717
  }
5613
6718
  },
5614
6719
  meta: {
@@ -5624,48 +6729,11 @@ var node2 = defineUnit({
5624
6729
  path: "node"
5625
6730
  }
5626
6731
  });
5627
- var sharedArgs3 = $args({
5628
- /**
5629
- * The filter to use when selecting endpoints for each peer.
5630
- *
5631
- * The first matching endpoint will be used.
5632
- *
5633
- * If not provided, all endpoints will be considered.
5634
- */
5635
- peerEndpointFilter: $addArgumentDescription(z.string().optional().meta({ language: "javascript" }), `The filter to use when selecting endpoints for each peer.
5636
-
5637
- The first matching endpoint will be used.
5638
-
5639
- If not provided, all endpoints will be considered.`)
5640
- });
5641
6732
  var config = defineUnit({
5642
6733
  type: "wireguard.config.v1",
5643
6734
  args: {
5644
- ...sharedArgs3,
5645
- /**
5646
- * The metadata to include in the wg-feed for this config.
5647
- */
5648
- feedMetadata: $addArgumentDescription(z.discriminatedUnion("enabled", [
5649
- z.object({
5650
- /**
5651
- * Whether this config is enabled for upload to wg-feed.
5652
- *
5653
- * You must fill the metadata fields.
5654
- */
5655
- enabled: z.literal("true").meta({ title: camelCaseToHumanReadable("enabled"), description: `Whether this config is enabled for upload to wg-feed.
5656
-
5657
- You must fill the metadata fields.` }),
5658
- ...pick(feedMetadataSchema.shape, ["id", "name"]),
5659
- // Highstate does not support nested objects in UI
5660
- ...feedDisplayInfoSchema.shape
5661
- }),
5662
- z.object({
5663
- /**
5664
- * Whether this config is enabled for upload to wg-feed.
5665
- */
5666
- enabled: z.literal("false").meta({ title: camelCaseToHumanReadable("enabled"), description: `Whether this config is enabled for upload to wg-feed.` })
5667
- })
5668
- ]).prefault({ enabled: "false" }), `The metadata to include in the wg-feed for this config.`)
6735
+ ...configSharedArgs,
6736
+ ...sharedFeedArgs
5669
6737
  },
5670
6738
  inputs: {
5671
6739
  identity: identityEntity,
@@ -5673,6 +6741,10 @@ var config = defineUnit({
5673
6741
  entity: peerEntity,
5674
6742
  multiple: true,
5675
6743
  required: false
6744
+ },
6745
+ network: {
6746
+ entity: networkEntity,
6747
+ required: false
5676
6748
  }
5677
6749
  },
5678
6750
  outputs: {
@@ -5694,7 +6766,7 @@ var config = defineUnit({
5694
6766
  var configBundle = defineUnit({
5695
6767
  type: "wireguard.config-bundle.v1",
5696
6768
  args: {
5697
- ...sharedArgs3
6769
+ ...configSharedArgs
5698
6770
  },
5699
6771
  inputs: {
5700
6772
  identity: identityEntity,
@@ -5790,7 +6862,7 @@ var feed = defineUnit({
5790
6862
  If not provided and \`publicKey\` is not provided, a new key pair will be generated.`)
5791
6863
  },
5792
6864
  inputs: {
5793
- etcd: etcdEntity,
6865
+ etcd: etcd_exports.connectionEntity,
5794
6866
  serverEndpoints: {
5795
6867
  entity: l4EndpointEntity,
5796
6868
  required: false,
@@ -5865,18 +6937,24 @@ var peer2 = defineUnit({
5865
6937
  // src/third-party/timeweb.ts
5866
6938
  var timeweb_exports = {};
5867
6939
  __export(timeweb_exports, {
5868
- connection: () => connection3,
5869
- connectionEntity: () => connectionEntity,
6940
+ connection: () => connection9,
6941
+ connectionEntity: () => connectionEntity9,
5870
6942
  virtualMachine: () => virtualMachine2
5871
6943
  });
5872
- var connectionEntity = defineEntity({
6944
+ var connectionEntity9 = defineEntity({
5873
6945
  type: "timeweb.connection.v1",
5874
6946
  schema: z.object({
5875
6947
  name: z.string(),
5876
- apiToken: z.string()
5877
- })
6948
+ apiToken: secretSchema(z.string())
6949
+ }),
6950
+ meta: {
6951
+ color: "#0078FF",
6952
+ title: "Timeweb Connection",
6953
+ icon: "material-symbols:cloud",
6954
+ iconColor: "#0078FF"
6955
+ }
5878
6956
  });
5879
- var connection3 = defineUnit({
6957
+ var connection9 = defineUnit({
5880
6958
  type: "timeweb.connection.v1",
5881
6959
  secrets: {
5882
6960
  /**
@@ -5889,7 +6967,7 @@ var connection3 = defineUnit({
5889
6967
  Can be obtained from the Timeweb control panel.`)
5890
6968
  },
5891
6969
  outputs: {
5892
- connection: connectionEntity
6970
+ connection: connectionEntity9
5893
6971
  },
5894
6972
  meta: {
5895
6973
  description: `The Timeweb connection for a single account.`,
@@ -5943,7 +7021,7 @@ var virtualMachine2 = defineUnit({
5943
7021
  ssh: $addArgumentDescription(vmSshArgs, `The SSH arguments to use for the virtual machine.`)
5944
7022
  },
5945
7023
  inputs: {
5946
- connection: connectionEntity,
7024
+ connection: connectionEntity9,
5947
7025
  ...inputs
5948
7026
  },
5949
7027
  secrets: vmSecrets,
@@ -5966,22 +7044,24 @@ var virtualMachine2 = defineUnit({
5966
7044
  // src/third-party/yandex.ts
5967
7045
  var yandex_exports = {};
5968
7046
  __export(yandex_exports, {
5969
- connection: () => connection4,
5970
- connectionEntity: () => connectionEntity2,
7047
+ connection: () => connection10,
7048
+ connectionEntity: () => connectionEntity10,
5971
7049
  disk: () => disk,
5972
7050
  diskEntity: () => diskEntity,
5973
7051
  diskSchema: () => diskSchema,
5974
7052
  existingImage: () => existingImage2,
5975
7053
  imageEntity: () => imageEntity2,
7054
+ instanceGroup: () => instanceGroup,
7055
+ platformIdSchema: () => platformIdSchema,
5976
7056
  virtualMachine: () => virtualMachine3
5977
7057
  });
5978
- var connectionEntity2 = defineEntity({
7058
+ var connectionEntity10 = defineEntity({
5979
7059
  type: "yandex.connection.v1",
5980
7060
  schema: z.object({
5981
7061
  /**
5982
- * The service account key file content (JSON).
7062
+ * The JSON of the authorized key for the service account.
5983
7063
  */
5984
- serviceAccountKeyFile: z.string().optional().meta({ title: camelCaseToHumanReadable("serviceAccountKeyFile"), description: `The service account key file content (JSON).` }),
7064
+ authorizedKeyJson: secretSchema(z.string()).meta({ title: camelCaseToHumanReadable("authorizedKeyJson"), description: `The JSON of the authorized key for the service account.` }),
5985
7065
  /**
5986
7066
  * The ID of the cloud.
5987
7067
  */
@@ -5997,13 +7077,20 @@ var connectionEntity2 = defineEntity({
5997
7077
  /**
5998
7078
  * The region ID.
5999
7079
  */
6000
- regionId: z.string().optional().meta({ title: camelCaseToHumanReadable("regionId"), description: `The region ID.` })
7080
+ regionId: z.string().optional().meta({ title: camelCaseToHumanReadable("regionId"), description: `The region ID.` }),
7081
+ /**
7082
+ * The ID of the service account used for authentication.
7083
+ */
7084
+ serviceAccountId: z.string().meta({ title: camelCaseToHumanReadable("serviceAccountId"), description: `The ID of the service account used for authentication.` })
6001
7085
  }),
6002
7086
  meta: {
6003
- color: "#0080ff"
7087
+ color: "#0080ff",
7088
+ title: "YC Connection",
7089
+ icon: "simple-icons:yandexcloud",
7090
+ iconColor: "#0080ff"
6004
7091
  }
6005
7092
  });
6006
- var connection4 = defineUnit({
7093
+ var connection10 = defineUnit({
6007
7094
  type: "yandex.connection.v1",
6008
7095
  args: {
6009
7096
  /**
@@ -6038,18 +7125,18 @@ var connection4 = defineUnit({
6038
7125
  },
6039
7126
  secrets: {
6040
7127
  /**
6041
- * The service account key file content (JSON).
7128
+ * The JSON of the authorized key for the service account.
6042
7129
  *
6043
7130
  * Important: service account must have `iam.serviceAccounts.user` role to work properly.
6044
7131
  *
6045
7132
  * See [Creating an authorized key](https://yandex.cloud/en/docs/iam/operations/authentication/manage-authorized-keys#create-authorized-key) for details.
6046
7133
  */
6047
- serviceAccountKeyFile: $addArgumentDescription({
7134
+ authorizedKeyJson: $addArgumentDescription({
6048
7135
  schema: z.string().meta({ language: "json" }),
6049
7136
  meta: {
6050
- title: "Service Account Key File"
7137
+ title: "Authorized Key JSON"
6051
7138
  }
6052
- }, `The service account key file content (JSON).
7139
+ }, `The JSON of the authorized key for the service account.
6053
7140
 
6054
7141
  Important: service account must have \`iam.serviceAccounts.user\` role to work properly.
6055
7142
 
@@ -6062,7 +7149,7 @@ var connection4 = defineUnit({
6062
7149
  /**
6063
7150
  * The Yandex Cloud connection.
6064
7151
  */
6065
- connection: $addInputDescription(connectionEntity2, `The Yandex Cloud connection.`)
7152
+ connection: $addInputDescription(connectionEntity10, `The Yandex Cloud connection.`)
6066
7153
  },
6067
7154
  meta: {
6068
7155
  description: `The connection to a Yandex Cloud account.`,
@@ -6098,7 +7185,15 @@ var diskSchema = z.object({
6098
7185
  */
6099
7186
  size: z.number().default(20).meta({ title: camelCaseToHumanReadable("size"), description: `The disk size in GB.
6100
7187
 
6101
- For \`network-ssd-nonreplicated\` and \`network-ssd-io-m3\` must be multiple of 93.` })
7188
+ For \`network-ssd-nonreplicated\` and \`network-ssd-io-m3\` must be multiple of 93.` }),
7189
+ /**
7190
+ * Whether the disk should be encrypted by separate key in KMS.
7191
+ *
7192
+ * If `true`, a new key will be created for the disk.
7193
+ */
7194
+ encrypted: z.boolean().default(true).meta({ title: camelCaseToHumanReadable("encrypted"), description: `Whether the disk should be encrypted by separate key in KMS.
7195
+
7196
+ If \`true\`, a new key will be created for the disk.` })
6102
7197
  });
6103
7198
  var diskEntity = defineEntity({
6104
7199
  type: "yandex.disk.v1",
@@ -6127,7 +7222,7 @@ var disk = defineUnit({
6127
7222
  ...diskSchema.shape
6128
7223
  },
6129
7224
  inputs: {
6130
- connection: connectionEntity2
7225
+ connection: connectionEntity10
6131
7226
  },
6132
7227
  outputs: {
6133
7228
  /**
@@ -6157,7 +7252,7 @@ var imageEntity2 = defineEntity({
6157
7252
  id: z.string().meta({ title: camelCaseToHumanReadable("id"), description: `The global ID of the image.` })
6158
7253
  }),
6159
7254
  meta: {
6160
- title: "Yandex Cloud Image",
7255
+ title: "YC Image",
6161
7256
  icon: "simple-icons:yandexcloud",
6162
7257
  iconColor: "#0080ff",
6163
7258
  secondaryIcon: "mage:compact-disk-fill"
@@ -6178,7 +7273,7 @@ var existingImage2 = defineUnit({
6178
7273
  You can also use user images by specifying their IDs.`)
6179
7274
  },
6180
7275
  inputs: {
6181
- connection: connectionEntity2
7276
+ connection: connectionEntity10
6182
7277
  },
6183
7278
  outputs: {
6184
7279
  /**
@@ -6199,99 +7294,123 @@ var existingImage2 = defineUnit({
6199
7294
  path: "existing-image"
6200
7295
  }
6201
7296
  });
6202
- var virtualMachine3 = defineUnit({
6203
- type: "yandex.virtual-machine.v1",
6204
- args: {
6205
- /**
6206
- * The name of the virtual machine.
6207
- * If not specified, the name of the unit will be used.
6208
- */
6209
- vmName: $addArgumentDescription(z.string().optional(), `The name of the virtual machine.
6210
- If not specified, the name of the unit will be used.`),
6211
- /**
6212
- * The platform ID for the instance.
6213
- *
6214
- * See [Platforms](https://yandex.cloud/en/docs/compute/concepts/vm-platforms) for details.
6215
- */
6216
- platformId: $addArgumentDescription(z.enum([
6217
- // standard platforms
6218
- "standard-v1",
6219
- "standard-v2",
6220
- "standard-v3",
6221
- "amd-v1",
6222
- "standard-v4a",
6223
- // high-performance platforms
6224
- "highfreq-v3",
6225
- "highfreq-v4a",
6226
- // with gpu
6227
- "gpu-standard-v1",
6228
- "gpu-standard-v2",
6229
- "gpu-standard-v3",
6230
- "gpu-standard-v3i",
6231
- "standard-v3-t4",
6232
- "standard-v3-t4i",
6233
- "gpu-platform-v4"
6234
- ]).default("standard-v3"), `The platform ID for the instance.
7297
+ var platformIdSchema = z.enum([
7298
+ // standard platforms
7299
+ "standard-v1",
7300
+ "standard-v2",
7301
+ "standard-v3",
7302
+ "amd-v1",
7303
+ "standard-v4a",
7304
+ // high-performance platforms
7305
+ "highfreq-v3",
7306
+ "highfreq-v4a",
7307
+ // with gpu
7308
+ "gpu-standard-v1",
7309
+ "gpu-standard-v2",
7310
+ "gpu-standard-v3",
7311
+ "gpu-standard-v3i",
7312
+ "standard-v3-t4",
7313
+ "standard-v3-t4i",
7314
+ "gpu-platform-v4"
7315
+ ]);
7316
+ var vmArgs = $args({
7317
+ /**
7318
+ * The platform ID for the instance.
7319
+ *
7320
+ * See [Platforms](https://yandex.cloud/en/docs/compute/concepts/vm-platforms) for details.
7321
+ */
7322
+ platformId: $addArgumentDescription(platformIdSchema.default("standard-v3"), `The platform ID for the instance.
6235
7323
 
6236
7324
  See [Platforms](https://yandex.cloud/en/docs/compute/concepts/vm-platforms) for details.`),
7325
+ /**
7326
+ * The resources to allocate to the virtual machine.
7327
+ */
7328
+ resources: $addArgumentDescription(z.object({
6237
7329
  /**
6238
- * The resources to allocate to the virtual machine.
7330
+ * The number of CPU cores.
6239
7331
  */
6240
- resources: $addArgumentDescription(z.object({
6241
- /**
6242
- * The number of CPU cores.
6243
- */
6244
- cores: z.number().default(2).meta({ title: camelCaseToHumanReadable("cores"), description: `The number of CPU cores.` }),
6245
- /**
6246
- * The amount of memory in GB.
6247
- */
6248
- memory: z.number().default(4).meta({ title: camelCaseToHumanReadable("memory"), description: `The amount of memory in GB.` }),
6249
- /**
6250
- * The guaranteed CPU core performance (10-100).
6251
- */
6252
- coreFraction: z.number().min(10).max(100).optional().meta({ title: camelCaseToHumanReadable("coreFraction"), description: `The guaranteed CPU core performance (10-100).` })
6253
- }).prefault({}), `The resources to allocate to the virtual machine.`),
7332
+ cores: z.number().default(2).meta({ title: camelCaseToHumanReadable("cores"), description: `The number of CPU cores.` }),
6254
7333
  /**
6255
- * The boot disk configuration.
7334
+ * The amount of memory in GB.
6256
7335
  */
6257
- bootDisk: $addArgumentDescription(diskSchema.prefault({}), `The boot disk configuration.`),
7336
+ memory: z.number().default(4).meta({ title: camelCaseToHumanReadable("memory"), description: `The amount of memory in GB.` }),
6258
7337
  /**
6259
- * The network configuration.
7338
+ * The guaranteed CPU core performance (10-100).
6260
7339
  */
6261
- network: $addArgumentDescription(z.object({
6262
- /**
6263
- * The subnet ID to connect to.
6264
- * If not specified, will auto-discover the default subnet for the zone.
6265
- */
6266
- subnetId: z.string().optional().meta({ title: camelCaseToHumanReadable("subnetId"), description: `The subnet ID to connect to.
7340
+ coreFraction: z.number().min(10).max(100).default(100).meta({ title: camelCaseToHumanReadable("coreFraction"), description: `The guaranteed CPU core performance (10-100).` })
7341
+ }).prefault({}), `The resources to allocate to the virtual machine.`),
7342
+ /**
7343
+ * The boot disk configuration.
7344
+ */
7345
+ bootDisk: $addArgumentDescription(diskSchema.prefault({}), `The boot disk configuration.`),
7346
+ /**
7347
+ * The network configuration.
7348
+ */
7349
+ network: $addArgumentDescription(z.object({
7350
+ /**
7351
+ * The subnet ID to connect to.
7352
+ * If not specified, will auto-discover the default subnet for the zone.
7353
+ */
7354
+ subnetId: z.string().optional().meta({ title: camelCaseToHumanReadable("subnetId"), description: `The subnet ID to connect to.
6267
7355
  If not specified, will auto-discover the default subnet for the zone.` }),
6268
- /**
6269
- * Whether to assign a public IP.
6270
- */
6271
- assignPublicIp: z.boolean().default(true).meta({ title: camelCaseToHumanReadable("assignPublicIp"), description: `Whether to assign a public IP.` }),
6272
- /**
6273
- * Whether to reserve the public IP permanently.
6274
- *
6275
- * If not set, the public IP can be changed when the VM is stopped and started again.
6276
- *
6277
- * Makes no sense if `assignPublicIp` is false.
6278
- */
6279
- reservePublicIp: z.boolean().default(true).meta({ title: camelCaseToHumanReadable("reservePublicIp"), description: `Whether to reserve the public IP permanently.
7356
+ /**
7357
+ * Whether to assign a public IP.
7358
+ */
7359
+ assignPublicIp: z.boolean().default(true).meta({ title: camelCaseToHumanReadable("assignPublicIp"), description: `Whether to assign a public IP.` }),
7360
+ /**
7361
+ * Whether to reserve the public IP permanently.
7362
+ *
7363
+ * If not set, the public IP can be changed when the VM is stopped and started again.
7364
+ *
7365
+ * Makes no sense if `assignPublicIp` is false.
7366
+ */
7367
+ reservePublicIp: z.boolean().default(true).meta({ title: camelCaseToHumanReadable("reservePublicIp"), description: `Whether to reserve the public IP permanently.
6280
7368
 
6281
7369
  If not set, the public IP can be changed when the VM is stopped and started again.
6282
7370
 
6283
7371
  Makes no sense if \`assignPublicIp\` is false.` })
6284
- }).prefault({}), `The network configuration.`),
7372
+ }).prefault({}), `The network configuration.`),
7373
+ /**
7374
+ * The SSH configuration.
7375
+ */
7376
+ ssh: $addArgumentDescription(vmSshArgs, `The SSH configuration.`),
7377
+ /**
7378
+ * Whether the virtual machine is preemptible.
7379
+ *
7380
+ * See [Preemptible VMs](https://yandex.cloud/en/docs/compute/concepts/preemptible-vms) for details.
7381
+ */
7382
+ preemptible: $addArgumentDescription(z.boolean().default(false), `Whether the virtual machine is preemptible.
7383
+
7384
+ See [Preemptible VMs](https://yandex.cloud/en/docs/compute/concepts/preemptible-vms) for details.`)
7385
+ });
7386
+ var virtualMachine3 = defineUnit({
7387
+ type: "yandex.virtual-machine.v1",
7388
+ args: {
7389
+ /**
7390
+ * The name of the virtual machine.
7391
+ * If not specified, the name of the unit will be used.
7392
+ */
7393
+ vmName: $addArgumentDescription(z.string().optional(), `The name of the virtual machine.
7394
+ If not specified, the name of the unit will be used.`),
6285
7395
  /**
6286
- * The SSH configuration.
7396
+ * The ID of the cloud to create the VM in.
7397
+ * If not specified, will use the cloud from the connection.
6287
7398
  */
6288
- ssh: $addArgumentDescription(vmSshArgs, `The SSH configuration.`)
7399
+ cloudId: $addArgumentDescription(z.string().optional(), `The ID of the cloud to create the VM in.
7400
+ If not specified, will use the cloud from the connection.`),
7401
+ /**
7402
+ * The ID of the folder to create the VM in.
7403
+ * If not specified, will use the default folder from the connection.
7404
+ */
7405
+ folderId: $addArgumentDescription(z.string().optional(), `The ID of the folder to create the VM in.
7406
+ If not specified, will use the default folder from the connection.`),
7407
+ ...vmArgs
6289
7408
  },
6290
7409
  secrets: {
6291
7410
  ...vmSecrets
6292
7411
  },
6293
7412
  inputs: {
6294
- connection: connectionEntity2,
7413
+ connection: connectionEntity10,
6295
7414
  image: imageEntity2,
6296
7415
  ...inputs
6297
7416
  },
@@ -6309,7 +7428,61 @@ var virtualMachine3 = defineUnit({
6309
7428
  path: "virtual-machine"
6310
7429
  }
6311
7430
  });
7431
+ var instanceGroup = defineUnit({
7432
+ type: "yandex.instance-group.v1",
7433
+ args: {
7434
+ /**
7435
+ * The name of the instance group.
7436
+ * If not specified, the name of the unit will be used.
7437
+ */
7438
+ groupName: $addArgumentDescription(z.string().optional(), `The name of the instance group.
7439
+ If not specified, the name of the unit will be used.`),
7440
+ /**
7441
+ * The ID of the cloud to create the instance group in.
7442
+ * If not specified, will use the cloud from the connection.
7443
+ */
7444
+ cloudId: $addArgumentDescription(z.string().optional(), `The ID of the cloud to create the instance group in.
7445
+ If not specified, will use the cloud from the connection.`),
7446
+ /**
7447
+ * The ID of the folder to create the instance group in.
7448
+ * If not specified, will use the default folder from the connection.
7449
+ */
7450
+ folderId: $addArgumentDescription(z.string().optional(), `The ID of the folder to create the instance group in.
7451
+ If not specified, will use the default folder from the connection.`),
7452
+ /**
7453
+ * The number of instances to create in the group.
7454
+ */
7455
+ size: $addArgumentDescription(z.number().default(1), `The number of instances to create in the group.`),
7456
+ ...vmArgs
7457
+ },
7458
+ secrets: {
7459
+ ...vmSecrets
7460
+ },
7461
+ inputs: {
7462
+ connection: connectionEntity10,
7463
+ image: imageEntity2,
7464
+ ...inputs
7465
+ },
7466
+ outputs: {
7467
+ servers: {
7468
+ entity: serverEntity,
7469
+ multiple: true
7470
+ }
7471
+ },
7472
+ meta: {
7473
+ description: `The instance group on Yandex Cloud.`,
7474
+ title: "YC Instance Group",
7475
+ category: "Yandex Cloud",
7476
+ icon: "simple-icons:yandexcloud",
7477
+ iconColor: "#0080ff",
7478
+ secondaryIcon: "mdi:group"
7479
+ },
7480
+ source: {
7481
+ package: "@highstate/yandex",
7482
+ path: "instance-group"
7483
+ }
7484
+ });
6312
7485
 
6313
- export { booleanPatchSchema, cloudflare_exports as cloudflare, common_exports as common, databases_exports as databases, distributions_exports as distributions, dns_exports as dns, git_exports as git, implementationReferenceSchema, k3s_exports as k3s, k8s_exports as k8s, metadataKeySchema, metadataSchema, mullvad_exports as mullvad, network_exports as network, nixos_exports as nixos, 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, toPatchArgs, wireguard_exports as wireguard, yandex_exports as yandex };
7486
+ export { booleanPatchSchema, cloudflare_exports as cloudflare, common_exports as common, distributions_exports as distributions, dns_exports as dns, etcd_exports as etcd, git_exports as git, implementationReferenceSchema, influxdb3_exports as influxdb3, k3s_exports as k3s, k8s_exports as k8s, metadataKeySchema, metadataSchema, minio_exports as minio, mongodb_exports as mongodb, mullvad_exports as mullvad, mysql_exports as mysql, network_exports as network, nixos_exports as nixos, postgresql_exports as postgresql, prefixKeysWith, proxmox_exports as proxmox, redis_exports as redis, restic_exports as restic, s3_exports as s3, sops_exports as sops, ssh_exports as ssh, talos_exports as talos, timeweb_exports as timeweb, toPatchArgs, wireguard_exports as wireguard, yandex_exports as yandex };
6314
7487
  //# sourceMappingURL=index.js.map
6315
7488
  //# sourceMappingURL=index.js.map