@highstate/library 0.9.10 → 0.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -571,7 +571,8 @@ var clusterEntity = defineEntity5({
571
571
  defaultNodeName: Type6.String(),
572
572
  defaultDatastoreId: Type6.String(),
573
573
  password: Type6.Optional(Type6.String()),
574
- apiToken: Type6.Optional(Type6.String())
574
+ apiToken: Type6.Optional(Type6.String()),
575
+ sshKeyPair: Type6.Optional(keyPairEntity.schema)
575
576
  }),
576
577
  meta: {
577
578
  color: "#e56901"
@@ -599,6 +600,12 @@ var connection = defineUnit4({
599
600
  password: Type6.Optional(Type6.String()),
600
601
  apiToken: Type6.Optional(Type6.String())
601
602
  },
603
+ inputs: {
604
+ sshKeyPair: {
605
+ entity: keyPairEntity,
606
+ required: false
607
+ }
608
+ },
602
609
  outputs: {
603
610
  proxmoxCluster: clusterEntity
604
611
  },
@@ -669,19 +676,20 @@ var virtualMachine = defineUnit4({
669
676
  type: "proxmox.virtual-machine",
670
677
  args: {
671
678
  nodeName: Type6.Optional(Type6.String()),
672
- cpuType: Type6.Optional(Type6.String({ default: "host" })),
673
- cores: Type6.Optional(Type6.Number({ default: 1 })),
674
- sockets: Type6.Optional(Type6.Number({ default: 1 })),
675
- memory: Type6.Optional(Type6.Number({ default: 512 })),
679
+ cpuType: Type6.Default(Type6.String(), "host"),
680
+ cores: Type6.Default(Type6.Number(), 1),
681
+ sockets: Type6.Default(Type6.Number(), 1),
682
+ memory: Type6.Default(Type6.Number(), 512),
676
683
  ipv4: Type6.Optional(Type6.String()),
677
684
  ipv4Gateway: Type6.Optional(Type6.String()),
678
685
  dns: Type6.Optional(Type6.Array(Type6.String())),
679
686
  datastoreId: Type6.Optional(Type6.String()),
680
- diskSize: Type6.Optional(Type6.Number({ default: 8 })),
681
- bridge: Type6.Optional(Type6.String({ default: "vmbr0" })),
682
- sshPort: Type6.Optional(Type6.Number({ default: 22 })),
683
- sshUser: Type6.Optional(Type6.String({ default: "root" })),
684
- waitForAgent: Type6.Optional(Type6.Boolean({ default: true }))
687
+ diskSize: Type6.Default(Type6.Number(), 8),
688
+ bridge: Type6.Default(Type6.String(), "vmbr0"),
689
+ sshPort: Type6.Default(Type6.Number(), 22),
690
+ sshUser: Type6.Default(Type6.String(), "root"),
691
+ waitForAgent: Type6.Default(Type6.Boolean(), true),
692
+ vendorData: Type6.Optional(Type6.String({ language: "yaml" }))
685
693
  },
686
694
  secrets: {
687
695
  sshPassword: Type6.Optional(Type6.String())
@@ -715,6 +723,7 @@ __export(k8s_exports, {
715
723
  accessPoint: () => accessPoint,
716
724
  accessPointEntity: () => accessPointEntity,
717
725
  certManager: () => certManager,
726
+ cilium: () => cilium,
718
727
  clusterDns: () => clusterDns,
719
728
  clusterEntity: () => clusterEntity2,
720
729
  clusterInfoProperties: () => clusterInfoProperties,
@@ -890,6 +899,15 @@ var clusterInfoProperties = {
890
899
  quirks: {
891
900
  ...Type7.Optional(clusterQuirksSchema),
892
901
  description: `The extra quirks of the cluster to improve compatibility.`
902
+ },
903
+ /**
904
+ * The extra metadata to attach to the cluster.
905
+ *
906
+ * @schema
907
+ */
908
+ metadata: {
909
+ ...Type7.Optional(Type7.Record(Type7.String(), Type7.Unknown())),
910
+ description: `The extra metadata to attach to the cluster.`
893
911
  }
894
912
  };
895
913
  var serviceTypeSchema = Type7.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"]);
@@ -1115,7 +1133,7 @@ var clusterPatch = defineUnit5({
1115
1133
  }
1116
1134
  });
1117
1135
  var clusterDns = defineUnit5({
1118
- type: "cluster-dns",
1136
+ type: "k8s.cluster-dns",
1119
1137
  args: {
1120
1138
  ...createArgs(),
1121
1139
  ...createArgs("api")
@@ -1324,6 +1342,36 @@ var gatewayApi = defineUnit5({
1324
1342
  path: "units/gateway-api"
1325
1343
  }
1326
1344
  });
1345
+ var cilium = defineUnit5({
1346
+ type: "k8s.cilium",
1347
+ args: {
1348
+ /**
1349
+ * If set to `true`, the generated network policy will allow
1350
+ * all DNS queries to be resolved, even if they are
1351
+ * for forbidden (non-allowed) FQDNs.
1352
+ *
1353
+ * By default, is `false`.
1354
+ */
1355
+ allowForbiddenFqdnResolution: Type7.Default(Type7.Boolean(), false)
1356
+ },
1357
+ inputs: {
1358
+ k8sCluster: clusterEntity2
1359
+ },
1360
+ outputs: {
1361
+ k8sCluster: clusterEntity2
1362
+ },
1363
+ meta: {
1364
+ displayName: "Cilium",
1365
+ description: "The Cilium CNI deployed on Kubernetes.",
1366
+ primaryIcon: "simple-icons:cilium",
1367
+ secondaryIcon: "devicon:kubernetes",
1368
+ category: "Kubernetes"
1369
+ },
1370
+ source: {
1371
+ package: "@highstate/cilium",
1372
+ path: "unit"
1373
+ }
1374
+ });
1327
1375
 
1328
1376
  // src/talos.ts
1329
1377
  var talos_exports = {};
@@ -2197,6 +2245,7 @@ __export(apps_exports, {
2197
2245
  endpointFilter: () => endpointFilter,
2198
2246
  explicitEndpointFilterSchema: () => explicitEndpointFilterSchema,
2199
2247
  grocy: () => grocy,
2248
+ hubble: () => hubble,
2200
2249
  kubernetesDashboard: () => kubernetesDashboard,
2201
2250
  mariadb: () => mariadb,
2202
2251
  mariadbDatabase: () => mariadbDatabase,
@@ -2965,13 +3014,29 @@ var codeServer = defineUnit21({
2965
3014
  }
2966
3015
  });
2967
3016
 
3017
+ // src/apps/hubble.ts
3018
+ import { defineUnit as defineUnit22 } from "@highstate/contract";
3019
+ var hubble = defineUnit22({
3020
+ type: "apps.hubble",
3021
+ args: createArgs2("hubble", ["fqdn"]),
3022
+ inputs: createInputs(["accessPoint"]),
3023
+ meta: {
3024
+ displayName: "Hubble",
3025
+ description: "Exposes Hubble UI to the user. It must be already installed in the cluster as part of the Cilium.",
3026
+ primaryIcon: "mdi:eye",
3027
+ secondaryIcon: "simple-icons:cilium",
3028
+ category: "Observability"
3029
+ },
3030
+ source: createSource("hubble")
3031
+ });
3032
+
2968
3033
  // src/cloudflare.ts
2969
3034
  var cloudflare_exports = {};
2970
3035
  __export(cloudflare_exports, {
2971
3036
  connection: () => connection2
2972
3037
  });
2973
- import { defineUnit as defineUnit22, Type as Type23 } from "@highstate/contract";
2974
- var connection2 = defineUnit22({
3038
+ import { defineUnit as defineUnit23, Type as Type23 } from "@highstate/contract";
3039
+ var connection2 = defineUnit23({
2975
3040
  type: "cloudflare.connection",
2976
3041
  secrets: {
2977
3042
  apiToken: Type23.String()
@@ -2994,12 +3059,57 @@ var connection2 = defineUnit22({
2994
3059
  // src/k3s.ts
2995
3060
  var k3s_exports = {};
2996
3061
  __export(k3s_exports, {
2997
- cluster: () => cluster2
2998
- });
2999
- import { defineUnit as defineUnit23, Type as Type24 } from "@highstate/contract";
3000
- var cluster2 = defineUnit23({
3062
+ cluster: () => cluster2,
3063
+ cniSchema: () => cniSchema3,
3064
+ componentSchema: () => componentSchema,
3065
+ internalComponents: () => internalComponents,
3066
+ packagedComponents: () => packagedComponents
3067
+ });
3068
+ import { defineUnit as defineUnit24, Type as Type24 } from "@highstate/contract";
3069
+ var packagedComponents = [
3070
+ "coredns",
3071
+ "servicelb",
3072
+ "traefik",
3073
+ "local-storage",
3074
+ "metrics-server",
3075
+ "runtimes"
3076
+ ];
3077
+ var internalComponents = [
3078
+ "scheduler",
3079
+ "cloud-controller",
3080
+ "kube-proxy",
3081
+ "network-policy",
3082
+ "helm-controller"
3083
+ ];
3084
+ var componentSchema = Type24.StringEnum([...packagedComponents, ...internalComponents]);
3085
+ var cniSchema3 = Type24.StringEnum(["none", "flannel"]);
3086
+ var cluster2 = defineUnit24({
3001
3087
  type: "k3s.cluster",
3002
3088
  args: {
3089
+ /**
3090
+ * The components to disable in the K3S cluster.
3091
+ *
3092
+ * @schema
3093
+ */
3094
+ disabledComponents: {
3095
+ ...Type24.Default(Type24.Array(componentSchema), []),
3096
+ description: `The components to disable in the K3S cluster.`
3097
+ },
3098
+ /**
3099
+ * The CNI to use in the K3S cluster.
3100
+ *
3101
+ * Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
3102
+ * If needed, you can disable them using `disabledComponents` argument.
3103
+ *
3104
+ * @schema
3105
+ */
3106
+ cni: {
3107
+ ...Type24.Default(cniSchema3, "flannel"),
3108
+ description: `The CNI to use in the K3S cluster.
3109
+
3110
+ Setting this to "none" will disable default Flannel CNI, but will not disable network policy controller and kube-proxy.
3111
+ If needed, you can disable them using \`disabledComponents\` argument.`
3112
+ },
3003
3113
  /**
3004
3114
  * The K3S configuration to pass to each server or agent in the cluster.
3005
3115
  *
@@ -3047,8 +3157,8 @@ var mullvad_exports = {};
3047
3157
  __export(mullvad_exports, {
3048
3158
  peer: () => peer2
3049
3159
  });
3050
- import { defineUnit as defineUnit24, Type as Type25 } from "@highstate/contract";
3051
- var peer2 = defineUnit24({
3160
+ import { defineUnit as defineUnit25, Type as Type25 } from "@highstate/contract";
3161
+ var peer2 = defineUnit25({
3052
3162
  type: "mullvad.peer",
3053
3163
  args: {
3054
3164
  hostname: Type25.Optional(Type25.String()),
@@ -3108,7 +3218,7 @@ __export(timeweb_exports, {
3108
3218
  connectionEntity: () => connectionEntity,
3109
3219
  virtualMachine: () => virtualMachine2
3110
3220
  });
3111
- import { defineEntity as defineEntity13, defineUnit as defineUnit25, Type as Type26 } from "@highstate/contract";
3221
+ import { defineEntity as defineEntity13, defineUnit as defineUnit26, Type as Type26 } from "@highstate/contract";
3112
3222
  var connectionEntity = defineEntity13({
3113
3223
  type: "timeweb.connection",
3114
3224
  schema: Type26.Object({
@@ -3116,7 +3226,7 @@ var connectionEntity = defineEntity13({
3116
3226
  apiToken: Type26.String()
3117
3227
  })
3118
3228
  });
3119
- var connection3 = defineUnit25({
3229
+ var connection3 = defineUnit26({
3120
3230
  type: "timeweb.connection",
3121
3231
  secrets: {
3122
3232
  apiToken: Type26.String()
@@ -3135,7 +3245,7 @@ var connection3 = defineUnit25({
3135
3245
  path: "connection"
3136
3246
  }
3137
3247
  });
3138
- var virtualMachine2 = defineUnit25({
3248
+ var virtualMachine2 = defineUnit26({
3139
3249
  type: "timeweb.virtual-machine",
3140
3250
  args: {
3141
3251
  presetId: Type26.Optional(Type26.Number()),
@@ -3178,7 +3288,7 @@ __export(nixos_exports, {
3178
3288
  remoteFlake: () => remoteFlake,
3179
3289
  system: () => system
3180
3290
  });
3181
- import { defineEntity as defineEntity14, defineUnit as defineUnit26, Type as Type27 } from "@highstate/contract";
3291
+ import { defineEntity as defineEntity14, defineUnit as defineUnit27, Type as Type27 } from "@highstate/contract";
3182
3292
  var inlineModuleEntity = defineEntity14({
3183
3293
  type: "nixos.inline-module",
3184
3294
  schema: Type27.Object({
@@ -3190,7 +3300,7 @@ var inlineModuleEntity = defineEntity14({
3190
3300
  color: "#5277c3"
3191
3301
  }
3192
3302
  });
3193
- var inlineModule = defineUnit26({
3303
+ var inlineModule = defineUnit27({
3194
3304
  type: "nixos.inline-module",
3195
3305
  args: {
3196
3306
  code: Type27.String({ language: "nix" })
@@ -3229,7 +3339,7 @@ var flakeEntity = defineEntity14({
3229
3339
  color: "#5277c3"
3230
3340
  }
3231
3341
  });
3232
- var remoteFlake = defineUnit26({
3342
+ var remoteFlake = defineUnit27({
3233
3343
  type: "nixos.remote-flake",
3234
3344
  args: {
3235
3345
  url: Type27.String()
@@ -3251,7 +3361,7 @@ var remoteFlake = defineUnit26({
3251
3361
  path: "flake"
3252
3362
  }
3253
3363
  });
3254
- var inlineFlake = defineUnit26({
3364
+ var inlineFlake = defineUnit27({
3255
3365
  type: "nixos.inline-flake",
3256
3366
  args: {
3257
3367
  code: Type27.String({ language: "nix" })
@@ -3289,7 +3399,7 @@ var inlineFlake = defineUnit26({
3289
3399
  path: "inline-flake"
3290
3400
  }
3291
3401
  });
3292
- var system = defineUnit26({
3402
+ var system = defineUnit27({
3293
3403
  type: "nixos.system",
3294
3404
  args: {
3295
3405
  system: Type27.Optional(Type27.String())
@@ -3325,8 +3435,8 @@ var sops_exports = {};
3325
3435
  __export(sops_exports, {
3326
3436
  secrets: () => secrets
3327
3437
  });
3328
- import { defineUnit as defineUnit27, Type as Type28 } from "@highstate/contract";
3329
- var secrets = defineUnit27({
3438
+ import { defineUnit as defineUnit28, Type as Type28 } from "@highstate/contract";
3439
+ var secrets = defineUnit28({
3330
3440
  type: "sops.secrets",
3331
3441
  args: {
3332
3442
  secrets: Type28.Record(Type28.String(), Type28.Any())
@@ -3527,8 +3637,8 @@ __export(phantun_exports, {
3527
3637
  deobfuscator: () => deobfuscator,
3528
3638
  obfuscator: () => obfuscator
3529
3639
  });
3530
- import { defineUnit as defineUnit28 } from "@highstate/contract";
3531
- var deobfuscator = defineUnit28({
3640
+ import { defineUnit as defineUnit29 } from "@highstate/contract";
3641
+ var deobfuscator = defineUnit29({
3532
3642
  type: "obfuscators.phantun.deobfuscator",
3533
3643
  ...deobfuscatorSpec,
3534
3644
  meta: {
@@ -3543,7 +3653,7 @@ var deobfuscator = defineUnit28({
3543
3653
  path: "phantun/deobfuscator"
3544
3654
  }
3545
3655
  });
3546
- var obfuscator = defineUnit28({
3656
+ var obfuscator = defineUnit29({
3547
3657
  type: "obfuscators.phantun.obfuscator",
3548
3658
  ...obfuscatorSpec,
3549
3659
  meta: {