@highstate/library 0.7.0 → 0.7.1

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 (3) hide show
  1. package/dist/index.d.ts +1999 -166
  2. package/dist/index.mjs +504 -39
  3. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -302,12 +302,53 @@ var proxmox = /*#__PURE__*/Object.freeze({
302
302
  virtualMachine: virtualMachine
303
303
  });
304
304
 
305
+ const clusterInfoSchema = Type.Object({
306
+ id: Type.String(),
307
+ name: Type.String(),
308
+ cni: Type.Optional(Type.String())
309
+ });
310
+ const serviceTypeSchema = Type.Union([
311
+ Type.Literal("NodePort"),
312
+ Type.Literal("LoadBalancer"),
313
+ Type.Literal("ClusterIP")
314
+ ]);
315
+ const metadataSchema = Type.Object({
316
+ namespace: Type.Optional(Type.String()),
317
+ name: Type.String(),
318
+ labels: Type.Optional(Type.Record(Type.String(), Type.String())),
319
+ annotations: Type.Optional(Type.Record(Type.String(), Type.String()))
320
+ });
321
+ const servicePortSchema = Type.Object({
322
+ name: Type.Optional(Type.String()),
323
+ port: Type.Optional(Type.Number()),
324
+ targetPort: Type.Optional(Type.Union([Type.Number(), Type.String()])),
325
+ protocol: Type.Optional(Type.String())
326
+ });
327
+ const serviceSpecSchema = Type.Object({
328
+ type: Type.Optional(Type.String()),
329
+ selector: Type.Record(Type.String(), Type.String()),
330
+ ports: Type.Array(servicePortSchema),
331
+ clusterIP: Type.Optional(Type.String()),
332
+ clusterIPs: Type.Optional(Type.Array(Type.String())),
333
+ externalIPs: Type.Optional(Type.Array(Type.String()))
334
+ });
335
+ const serviceEntity = defineEntity({
336
+ type: "k8s.service",
337
+ schema: Type.Object({
338
+ type: Type.Literal("k8s.service"),
339
+ clusterInfo: clusterInfoSchema,
340
+ metadata: metadataSchema,
341
+ spec: serviceSpecSchema
342
+ }),
343
+ meta: {
344
+ color: "#2196F3"
345
+ }
346
+ });
305
347
  const clusterEntity$1 = defineEntity({
306
348
  type: "k8s.cluster",
307
349
  schema: Type.Object({
308
- name: Type.String(),
309
- kubeconfig: Type.String(),
310
- cni: Type.String()
350
+ info: clusterInfoSchema,
351
+ kubeconfig: Type.String()
311
352
  }),
312
353
  meta: {
313
354
  color: "#2196F3"
@@ -335,11 +376,12 @@ const existingCluster = defineUnit({
335
376
  const gatewayEntity = defineEntity({
336
377
  type: "k8s.gateway",
337
378
  schema: Type.Object({
338
- clusterName: Type.String(),
379
+ clusterInfo: clusterInfoSchema,
339
380
  gatewayClassName: Type.String(),
340
381
  httpListenerPort: Type.Number(),
341
382
  httpsListenerPort: Type.Number(),
342
- ip: Type.String()
383
+ ip: Type.String(),
384
+ service: Type.Optional(serviceEntity.schema)
343
385
  }),
344
386
  meta: {
345
387
  color: "#4CAF50"
@@ -348,7 +390,7 @@ const gatewayEntity = defineEntity({
348
390
  const tlsIssuerEntity = defineEntity({
349
391
  type: "k8s.tls-issuer",
350
392
  schema: Type.Object({
351
- clusterName: Type.String(),
393
+ clusterInfo: clusterInfoSchema,
352
394
  clusterIssuerName: Type.String()
353
395
  }),
354
396
  meta: {
@@ -426,24 +468,56 @@ const dns01TlsIssuer = defineUnit({
426
468
  path: "dns01-issuer"
427
469
  }
428
470
  });
429
- const serviceTypeSchema = Type.Union([
430
- Type.Literal("NodePort"),
431
- Type.Literal("LoadBalancer"),
432
- Type.Literal("ClusterIP")
433
- ]);
434
- const serviceEntity = defineEntity({
435
- type: "k8s.service",
471
+ const containerSchema = Type.Object({
472
+ name: Type.String(),
473
+ image: Type.String()
474
+ });
475
+ const labelSelectorSchema = Type.Object({
476
+ matchLabels: Type.Record(Type.String(), Type.String())
477
+ });
478
+ const deploymentSpecSchema = Type.Object({
479
+ replicas: Type.Number(),
480
+ selector: labelSelectorSchema,
481
+ template: Type.Object({
482
+ metadata: metadataSchema,
483
+ spec: Type.Object({
484
+ containers: Type.Array(containerSchema)
485
+ })
486
+ })
487
+ });
488
+ const deploymentEntity = defineEntity({
489
+ type: "k8s.deployment",
436
490
  schema: Type.Object({
437
- clusterName: Type.String(),
438
- name: Type.String(),
439
- namespace: Type.String(),
440
- selector: Type.Record(Type.String(), Type.String()),
441
- serviceType: serviceTypeSchema,
442
- ip: Type.Optional(Type.String()),
443
- ports: Type.Array(Type.Number())
491
+ type: Type.Literal("k8s.deployment"),
492
+ clusterInfo: clusterInfoSchema,
493
+ metadata: metadataSchema,
494
+ service: Type.Optional(serviceEntity.schema)
444
495
  }),
445
496
  meta: {
446
- color: "#2196F3"
497
+ color: "#4CAF50"
498
+ }
499
+ });
500
+ const statefulSetEntity = defineEntity({
501
+ type: "k8s.stateful-set",
502
+ schema: Type.Object({
503
+ type: Type.Literal("k8s.stateful-set"),
504
+ clusterInfo: clusterInfoSchema,
505
+ metadata: metadataSchema,
506
+ service: Type.Optional(serviceEntity.schema)
507
+ }),
508
+ meta: {
509
+ color: "#FFC107"
510
+ }
511
+ });
512
+ const persistentVolumeClaimEntity = defineEntity({
513
+ type: "k8s.persistent-volume-claim",
514
+ schema: Type.Object({
515
+ type: Type.Literal("k8s.persistent-volume-claim"),
516
+ clusterInfo: clusterInfoSchema,
517
+ metadata: metadataSchema
518
+ }),
519
+ meta: {
520
+ color: "#FFC107"
447
521
  }
448
522
  });
449
523
 
@@ -453,11 +527,21 @@ var k8s = /*#__PURE__*/Object.freeze({
453
527
  accessPointEntity: accessPointEntity,
454
528
  certManager: certManager,
455
529
  clusterEntity: clusterEntity$1,
530
+ clusterInfoSchema: clusterInfoSchema,
531
+ containerSchema: containerSchema,
532
+ deploymentEntity: deploymentEntity,
533
+ deploymentSpecSchema: deploymentSpecSchema,
456
534
  dns01TlsIssuer: dns01TlsIssuer,
457
535
  existingCluster: existingCluster,
458
536
  gatewayEntity: gatewayEntity,
537
+ labelSelectorSchema: labelSelectorSchema,
538
+ metadataSchema: metadataSchema,
539
+ persistentVolumeClaimEntity: persistentVolumeClaimEntity,
459
540
  serviceEntity: serviceEntity,
541
+ servicePortSchema: servicePortSchema,
542
+ serviceSpecSchema: serviceSpecSchema,
460
543
  serviceTypeSchema: serviceTypeSchema,
544
+ statefulSetEntity: statefulSetEntity,
461
545
  tlsIssuerEntity: tlsIssuerEntity
462
546
  });
463
547
 
@@ -607,13 +691,14 @@ const identityEntity = defineEntity({
607
691
  schema: Type.Object({
608
692
  name: Type.String(),
609
693
  network: Type.Optional(networkEntity.schema),
610
- address: Type.String(),
694
+ address: Type.Optional(Type.String()),
611
695
  privateKey: Type.String(),
612
696
  presharedKeyPart: Type.Optional(Type.String()),
613
697
  k8sServices: Type.Array(serviceEntity.schema),
614
698
  exitNode: Type.Boolean(),
615
699
  listenPort: Type.Optional(Type.Number()),
616
- externalIp: Type.Optional(Type.String())
700
+ externalIp: Type.Optional(Type.String()),
701
+ endpoint: Type.Optional(Type.String())
617
702
  }),
618
703
  meta: {
619
704
  color: "#F44336"
@@ -625,7 +710,7 @@ const peerEntity = defineEntity({
625
710
  name: Type.String(),
626
711
  network: Type.Optional(networkEntity.schema),
627
712
  publicKey: Type.String(),
628
- address: Type.String(),
713
+ address: Type.Optional(Type.String()),
629
714
  allowedIps: Type.Array(Type.String()),
630
715
  endpoint: Type.Optional(Type.String()),
631
716
  presharedKeyPart: Type.Optional(Type.String())
@@ -709,7 +794,7 @@ const identity = defineUnit({
709
794
  *
710
795
  * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
711
796
  */
712
- address: Type.String(),
797
+ address: Type.Optional(Type.String()),
713
798
  /**
714
799
  * The list of allowed IPs for the peer.
715
800
  *
@@ -796,21 +881,101 @@ const identity = defineUnit({
796
881
  path: "identity"
797
882
  }
798
883
  });
884
+ const peer$1 = defineUnit({
885
+ type: "wireguard.peer",
886
+ args: {
887
+ /**
888
+ * The name of the WireGuard peer.
889
+ *
890
+ * If not provided, the peer will be named after the unit.
891
+ */
892
+ peerName: Type.Optional(Type.String()),
893
+ /**
894
+ * The address of the WireGuard interface.
895
+ *
896
+ * The address may be any IPv4 or IPv6 address. CIDR notation is also supported.
897
+ */
898
+ address: Type.Optional(Type.String()),
899
+ /**
900
+ * The list of allowed IPs for the peer.
901
+ *
902
+ * Does not affect node which implements the peer, but is used in the peer configuration of other nodes.
903
+ */
904
+ allowedIps: Type.Optional(Type.Array(Type.String())),
905
+ /**
906
+ * The endpoint of the WireGuard peer.
907
+ *
908
+ * By default, the endpoint is calculated as `externalIp:listenPort`.
909
+ *
910
+ * If overridden, does not affect node which implements the peer, but is used in the peer configuration of other nodes.
911
+ */
912
+ endpoint: Type.Optional(Type.String()),
913
+ /**
914
+ * The public key of the WireGuard peer.
915
+ */
916
+ publicKey: Type.String()
917
+ },
918
+ inputs: {
919
+ /**
920
+ * The network to use for the WireGuard peer.
921
+ *
922
+ * If not provided, the peer will use default network configuration.
923
+ */
924
+ network: {
925
+ entity: networkEntity,
926
+ required: false
927
+ }
928
+ },
929
+ outputs: {
930
+ peer: peerEntity
931
+ },
932
+ meta: {
933
+ description: "The WireGuard peer with the public key.",
934
+ primaryIcon: "simple-icons:wireguard",
935
+ primaryIconColor: "#88171a",
936
+ secondaryIcon: "mdi:badge-account-horizontal"
937
+ },
938
+ source: {
939
+ type: "npm",
940
+ package: "@highstate/wireguard",
941
+ path: "peer"
942
+ }
943
+ });
799
944
  const node = defineUnit({
800
945
  type: "wireguard.node",
801
946
  args: {
802
947
  appName: Type.Optional(Type.String()),
803
- serviceType: Type.Optional(serviceTypeSchema)
948
+ serviceType: Type.Optional(serviceTypeSchema),
949
+ prototype: Type.Optional(Type.Boolean()),
950
+ dns: Type.Optional(Type.Array(Type.String()))
804
951
  },
805
952
  inputs: {
806
953
  identity: identityEntity,
807
954
  k8sCluster: clusterEntity$1,
955
+ deployment: {
956
+ entity: deploymentEntity,
957
+ required: false
958
+ },
959
+ statefulSet: {
960
+ entity: statefulSetEntity,
961
+ required: false
962
+ },
808
963
  peers: {
809
964
  entity: peerEntity,
810
965
  multiple: true,
811
966
  required: false
812
967
  }
813
968
  },
969
+ outputs: {
970
+ deployment: {
971
+ entity: deploymentEntity,
972
+ required: false
973
+ },
974
+ service: {
975
+ entity: serviceEntity,
976
+ required: false
977
+ }
978
+ },
814
979
  meta: {
815
980
  description: "The WireGuard node running on the Kubernetes.",
816
981
  primaryIcon: "simple-icons:wireguard",
@@ -906,6 +1071,7 @@ var wireguard = /*#__PURE__*/Object.freeze({
906
1071
  network: network,
907
1072
  networkEntity: networkEntity,
908
1073
  node: node,
1074
+ peer: peer$1,
909
1075
  peerEntity: peerEntity,
910
1076
  presharedKeyModeSchema: presharedKeyModeSchema
911
1077
  });
@@ -957,15 +1123,12 @@ var restic = /*#__PURE__*/Object.freeze({
957
1123
  });
958
1124
 
959
1125
  const mariadbEntity = defineEntity({
960
- type: "mariadb",
1126
+ type: "apps.mariadb",
961
1127
  schema: Type.Object({
1128
+ service: Type.Optional(serviceEntity.schema),
962
1129
  host: Type.String(),
963
1130
  port: Type.Number(),
964
- rootPassword: Type.String(),
965
- clusterName: Type.Optional(Type.String()),
966
- clusterHost: Type.String(),
967
- clusterIp: Type.String(),
968
- fqdn: Type.Optional(Type.String())
1131
+ rootPassword: Type.String()
969
1132
  }),
970
1133
  meta: {
971
1134
  color: "#f06292"
@@ -1007,17 +1170,39 @@ const mariadb = defineUnit({
1007
1170
  path: "mariadb/app"
1008
1171
  }
1009
1172
  });
1173
+ const mariadbDatabase = defineUnit({
1174
+ type: "apps.mariadb.database",
1175
+ args: {
1176
+ database: Type.Optional(Type.String()),
1177
+ username: Type.Optional(Type.String())
1178
+ },
1179
+ secrets: {
1180
+ password: Type.Optional(Type.String())
1181
+ },
1182
+ inputs: {
1183
+ k8sCluster: clusterEntity$1,
1184
+ mariadb: mariadbEntity
1185
+ },
1186
+ meta: {
1187
+ displayName: "MariaDB Database",
1188
+ description: "The virtual MariaDB database created on the MariaDB instance. Works only for MariaDB instances deployed on Kubernetes.",
1189
+ primaryIcon: "simple-icons:mariadb",
1190
+ secondaryIcon: "mdi:database-plus"
1191
+ },
1192
+ source: {
1193
+ type: "npm",
1194
+ package: "@highstate/apps",
1195
+ path: "mariadb/database"
1196
+ }
1197
+ });
1010
1198
 
1011
1199
  const postgresqlEntity = defineEntity({
1012
- type: "postgresql",
1200
+ type: "apps.postgresql",
1013
1201
  schema: Type.Object({
1202
+ service: Type.Optional(serviceEntity.schema),
1014
1203
  host: Type.String(),
1015
1204
  port: Type.Number(),
1016
- rootPassword: Type.String(),
1017
- clusterName: Type.Optional(Type.String()),
1018
- clusterHost: Type.String(),
1019
- clusterIp: Type.String(),
1020
- fqdn: Type.Optional(Type.String())
1205
+ rootPassword: Type.String()
1021
1206
  }),
1022
1207
  meta: {
1023
1208
  color: "#336791"
@@ -1059,6 +1244,31 @@ const postgresql = defineUnit({
1059
1244
  path: "postgresql/app"
1060
1245
  }
1061
1246
  });
1247
+ const postgresqlDatabase = defineUnit({
1248
+ type: "apps.postgresql.database",
1249
+ args: {
1250
+ database: Type.Optional(Type.String()),
1251
+ username: Type.Optional(Type.String())
1252
+ },
1253
+ secrets: {
1254
+ password: Type.Optional(Type.String())
1255
+ },
1256
+ inputs: {
1257
+ k8sCluster: clusterEntity$1,
1258
+ postgresql: postgresqlEntity
1259
+ },
1260
+ meta: {
1261
+ displayName: "PostgreSQL Database",
1262
+ description: "The virtual PostgreSQL database created on the PostgreSQL instance. Works only for PostgreSQL instances deployed on Kubernetes.",
1263
+ primaryIcon: "simple-icons:postgresql",
1264
+ secondaryIcon: "mdi:database-plus"
1265
+ },
1266
+ source: {
1267
+ type: "npm",
1268
+ package: "@highstate/apps",
1269
+ path: "postgresql/database"
1270
+ }
1271
+ });
1062
1272
 
1063
1273
  const vaultwarden = defineUnit({
1064
1274
  type: "apps.vaultwarden",
@@ -1192,15 +1402,236 @@ const maybe = defineUnit({
1192
1402
  }
1193
1403
  });
1194
1404
 
1405
+ const mongodbEntity = defineEntity({
1406
+ type: "apps.mongodb",
1407
+ schema: Type.Object({
1408
+ service: Type.Optional(serviceEntity.schema),
1409
+ host: Type.String(),
1410
+ port: Type.Number(),
1411
+ rootPassword: Type.String()
1412
+ }),
1413
+ meta: {
1414
+ color: "#13aa52"
1415
+ }
1416
+ });
1417
+ const mongodb = defineUnit({
1418
+ type: "apps.mongodb",
1419
+ args: {
1420
+ fqdn: Type.Optional(Type.String()),
1421
+ appName: Type.Optional(Type.String()),
1422
+ serviceType: Type.Optional(serviceTypeSchema)
1423
+ },
1424
+ secrets: {
1425
+ rootPassword: Type.Optional(Type.String())
1426
+ },
1427
+ inputs: {
1428
+ k8sCluster: clusterEntity$1,
1429
+ resticRepo: {
1430
+ entity: repoEntity,
1431
+ required: false
1432
+ },
1433
+ dnsProvider: {
1434
+ entity: dnsProviderEntity,
1435
+ required: false
1436
+ }
1437
+ },
1438
+ outputs: {
1439
+ mongodb: mongodbEntity,
1440
+ service: serviceEntity
1441
+ },
1442
+ meta: {
1443
+ displayName: "MongoDB",
1444
+ description: "The MongoDB instance deployed on Kubernetes.",
1445
+ primaryIcon: "simple-icons:mongodb",
1446
+ secondaryIcon: "mdi:database"
1447
+ },
1448
+ source: {
1449
+ type: "npm",
1450
+ package: "@highstate/apps",
1451
+ path: "mongodb/app"
1452
+ }
1453
+ });
1454
+ const mongodbDatabase = defineUnit({
1455
+ type: "apps.mongodb.database",
1456
+ args: {
1457
+ database: Type.Optional(Type.String()),
1458
+ username: Type.Optional(Type.String())
1459
+ },
1460
+ secrets: {
1461
+ password: Type.Optional(Type.String())
1462
+ },
1463
+ inputs: {
1464
+ k8sCluster: clusterEntity$1,
1465
+ mongodb: mongodbEntity
1466
+ },
1467
+ meta: {
1468
+ displayName: "MongoDB Database",
1469
+ description: "The virtual MongoDB database created on the MongoDB instance. Works only for MongoDB instances deployed on Kubernetes.",
1470
+ primaryIcon: "simple-icons:mongodb",
1471
+ secondaryIcon: "mdi:database-plus"
1472
+ },
1473
+ source: {
1474
+ type: "npm",
1475
+ package: "@highstate/apps",
1476
+ path: "mongodb/database"
1477
+ }
1478
+ });
1479
+
1480
+ const deployment = defineUnit({
1481
+ type: "apps.deployment",
1482
+ args: {
1483
+ appName: Type.Optional(Type.String()),
1484
+ fqdn: Type.Optional(Type.String()),
1485
+ serviceType: Type.Optional(serviceTypeSchema),
1486
+ image: Type.Optional(Type.String()),
1487
+ port: Type.Optional(Type.Number()),
1488
+ replicas: Type.Optional(Type.Number()),
1489
+ dataPath: Type.Optional(Type.String()),
1490
+ env: Type.Optional(Type.Record(Type.String(), Type.Any())),
1491
+ mariadbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1492
+ postgresqlEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1493
+ mongodbEnvMapping: Type.Optional(Type.Record(Type.String(), Type.Any())),
1494
+ manifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
1495
+ serviceManifest: Type.Optional(Type.Record(Type.String(), Type.Any())),
1496
+ httpRouteManifest: Type.Optional(Type.Record(Type.String(), Type.Any()))
1497
+ },
1498
+ inputs: {
1499
+ k8sCluster: clusterEntity$1,
1500
+ mariadb: {
1501
+ entity: mariadbEntity,
1502
+ required: false
1503
+ },
1504
+ postgresql: {
1505
+ entity: postgresqlEntity,
1506
+ required: false
1507
+ },
1508
+ mongodb: {
1509
+ entity: mongodbEntity,
1510
+ required: false
1511
+ },
1512
+ resticRepo: {
1513
+ entity: repoEntity,
1514
+ required: false
1515
+ },
1516
+ dnsProvider: {
1517
+ entity: dnsProviderEntity,
1518
+ required: false
1519
+ }
1520
+ },
1521
+ outputs: {
1522
+ deployment: deploymentEntity,
1523
+ service: serviceEntity
1524
+ },
1525
+ secrets: {
1526
+ mariadbPassword: Type.Optional(Type.String()),
1527
+ postgresqlPassword: Type.Optional(Type.String()),
1528
+ mongodbPassword: Type.Optional(Type.String())
1529
+ },
1530
+ meta: {
1531
+ displayName: "Kubernetes Deployment",
1532
+ description: "A generic Kubernetes deployment with optional service and gateway routes.",
1533
+ primaryIcon: "mdi:kubernetes",
1534
+ secondaryIcon: "mdi:cube-outline"
1535
+ },
1536
+ source: {
1537
+ type: "npm",
1538
+ package: "@highstate/apps"
1539
+ }
1540
+ });
1541
+
1542
+ const backupModeSchema = Type.Union([Type.Literal("metadata"), Type.Literal("full")]);
1543
+ const syncthing = defineUnit({
1544
+ type: "apps.syncthing",
1545
+ args: {
1546
+ fqdn: Type.String(),
1547
+ deviceFqdn: Type.Optional(Type.String()),
1548
+ appName: Type.Optional(Type.String()),
1549
+ backupMode: Type.Optional({ ...backupModeSchema, default: "metadata" })
1550
+ },
1551
+ inputs: {
1552
+ accessPoint: accessPointEntity,
1553
+ k8sCluster: clusterEntity$1,
1554
+ resticRepo: {
1555
+ entity: repoEntity,
1556
+ required: false
1557
+ },
1558
+ volume: {
1559
+ entity: persistentVolumeClaimEntity,
1560
+ required: false
1561
+ }
1562
+ },
1563
+ outputs: {
1564
+ service: serviceEntity,
1565
+ volume: persistentVolumeClaimEntity
1566
+ },
1567
+ meta: {
1568
+ displayName: "Syncthing",
1569
+ description: "The Syncthing instance deployed on Kubernetes.",
1570
+ primaryIcon: "simple-icons:syncthing"
1571
+ },
1572
+ source: {
1573
+ type: "npm",
1574
+ package: "@highstate/apps",
1575
+ path: "syncthing"
1576
+ }
1577
+ });
1578
+
1579
+ const codeServer = defineUnit({
1580
+ type: "apps.code-server",
1581
+ args: {
1582
+ fqdn: Type.String(),
1583
+ appName: Type.Optional(Type.String())
1584
+ },
1585
+ secrets: {
1586
+ password: Type.Optional(Type.String()),
1587
+ sudoPassword: Type.Optional(Type.String())
1588
+ },
1589
+ inputs: {
1590
+ accessPoint: accessPointEntity,
1591
+ k8sCluster: clusterEntity$1,
1592
+ resticRepo: {
1593
+ entity: repoEntity,
1594
+ required: false
1595
+ },
1596
+ volume: {
1597
+ entity: persistentVolumeClaimEntity,
1598
+ required: false
1599
+ }
1600
+ },
1601
+ outputs: {
1602
+ statefulSet: statefulSetEntity,
1603
+ volume: persistentVolumeClaimEntity
1604
+ },
1605
+ meta: {
1606
+ displayName: "Code Server",
1607
+ description: "The Code Server instance deployed on Kubernetes.",
1608
+ primaryIcon: "material-icon-theme:vscode"
1609
+ },
1610
+ source: {
1611
+ type: "npm",
1612
+ package: "@highstate/apps",
1613
+ path: "code-server"
1614
+ }
1615
+ });
1616
+
1195
1617
  var index = /*#__PURE__*/Object.freeze({
1196
1618
  __proto__: null,
1619
+ backupModeSchema: backupModeSchema,
1620
+ codeServer: codeServer,
1621
+ deployment: deployment,
1197
1622
  grocy: grocy,
1198
1623
  kubernetesDashboard: kubernetesDashboard,
1199
1624
  mariadb: mariadb,
1625
+ mariadbDatabase: mariadbDatabase,
1200
1626
  mariadbEntity: mariadbEntity,
1201
1627
  maybe: maybe,
1628
+ mongodb: mongodb,
1629
+ mongodbDatabase: mongodbDatabase,
1630
+ mongodbEntity: mongodbEntity,
1202
1631
  postgresql: postgresql,
1632
+ postgresqlDatabase: postgresqlDatabase,
1203
1633
  postgresqlEntity: postgresqlEntity,
1634
+ syncthing: syncthing,
1204
1635
  traefikGateway: traefikGateway,
1205
1636
  vaultwarden: vaultwarden
1206
1637
  });
@@ -1257,4 +1688,38 @@ var k3s = /*#__PURE__*/Object.freeze({
1257
1688
  cluster: cluster
1258
1689
  });
1259
1690
 
1260
- export { index as apps, cloudflare, common, k3s, k8s, proxmox, restic, ssh, talos, wireguard };
1691
+ const endpointType = Type.Union([
1692
+ Type.Literal("fqdn"),
1693
+ Type.Literal("ipv4"),
1694
+ Type.Literal("ipv6")
1695
+ ]);
1696
+ const peer = defineUnit({
1697
+ type: "mullvad.peer",
1698
+ args: {
1699
+ hostname: Type.Optional(Type.String()),
1700
+ endpointType: Type.Optional({ ...endpointType, default: "fqdn" })
1701
+ },
1702
+ outputs: {
1703
+ peer: peerEntity
1704
+ },
1705
+ meta: {
1706
+ displayName: "Mullvad Peer",
1707
+ description: "The Mullvad WireGuard peer fetched from the Mullvad API.",
1708
+ primaryIcon: "simple-icons:mullvad",
1709
+ secondaryIcon: "cib:wireguard",
1710
+ secondaryIconColor: "#88171a"
1711
+ },
1712
+ source: {
1713
+ type: "npm",
1714
+ package: "@highstate/mullvad",
1715
+ path: "peer"
1716
+ }
1717
+ });
1718
+
1719
+ var mullvad = /*#__PURE__*/Object.freeze({
1720
+ __proto__: null,
1721
+ endpointType: endpointType,
1722
+ peer: peer
1723
+ });
1724
+
1725
+ export { index as apps, cloudflare, common, k3s, k8s, mullvad, proxmox, restic, ssh, talos, wireguard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/library",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "build": "pkgroll --tsconfig=tsconfig.build.json"
21
21
  },
22
22
  "dependencies": {
23
- "@highstate/contract": "^0.7.0",
23
+ "@highstate/contract": "^0.7.1",
24
24
  "@sinclair/typebox": "^0.34.11",
25
25
  "ip-cidr": "^4.0.2",
26
26
  "remeda": "^2.21.0"
@@ -28,5 +28,5 @@
28
28
  "devDependencies": {
29
29
  "pkgroll": "^2.5.1"
30
30
  },
31
- "gitHead": "2f5227f7b88cf38946e490fc4cdb96127bd8b174"
31
+ "gitHead": "76c38ce5dbf7a710cf0e6339f52e86358537a99a"
32
32
  }