@highstate/library 0.9.16 → 0.9.19

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 (82) hide show
  1. package/dist/highstate.library.msgpack +0 -0
  2. package/dist/index.js +3548 -2985
  3. package/dist/index.js.map +1 -1
  4. package/package.json +5 -5
  5. package/src/common/access-point.ts +105 -0
  6. package/src/common/files.ts +137 -0
  7. package/src/common/index.ts +3 -0
  8. package/src/common/server.ts +231 -0
  9. package/src/databases/index.ts +4 -0
  10. package/src/databases/mariadb.ts +37 -0
  11. package/src/databases/mongodb.ts +37 -0
  12. package/src/databases/postgresql.ts +37 -0
  13. package/src/databases/shared.ts +61 -0
  14. package/src/distributions/ubuntu.ts +13 -11
  15. package/src/dns.ts +116 -18
  16. package/src/git.ts +14 -10
  17. package/src/impl-ref.ts +26 -0
  18. package/src/index.ts +14 -15
  19. package/src/k3s.ts +14 -12
  20. package/src/k8s/apps/code-server.ts +48 -0
  21. package/src/k8s/apps/gitea.ts +25 -0
  22. package/src/k8s/apps/grocy.ts +39 -0
  23. package/src/k8s/apps/hubble.ts +30 -0
  24. package/src/{apps → k8s/apps}/index.ts +16 -13
  25. package/src/k8s/apps/kubernetes-dashboard.ts +28 -0
  26. package/src/k8s/apps/mariadb.ts +83 -0
  27. package/src/k8s/apps/maybe.ts +39 -0
  28. package/src/k8s/apps/mongodb.ts +84 -0
  29. package/src/k8s/apps/postgresql.ts +86 -0
  30. package/src/k8s/apps/shared.ts +149 -0
  31. package/src/k8s/apps/syncthing.ts +72 -0
  32. package/src/k8s/apps/traefik.ts +40 -0
  33. package/src/k8s/apps/vaultwarden.ts +31 -0
  34. package/src/k8s/apps/workload.ts +214 -0
  35. package/src/k8s/apps/zitadel.ts +26 -0
  36. package/src/k8s/cert-manager.ts +80 -0
  37. package/src/k8s/cilium.ts +64 -0
  38. package/src/k8s/gateway.ts +70 -0
  39. package/src/k8s/index.ts +9 -0
  40. package/src/{obfuscators → k8s/obfuscators}/phantun.ts +14 -10
  41. package/src/{obfuscators → k8s/obfuscators}/shared.ts +17 -11
  42. package/src/k8s/resources.ts +111 -0
  43. package/src/k8s/service.ts +65 -0
  44. package/src/k8s/shared.ts +343 -0
  45. package/src/k8s/workload.ts +77 -0
  46. package/src/network.ts +249 -63
  47. package/src/nixos.ts +38 -77
  48. package/src/proxmox.ts +203 -96
  49. package/src/restic.ts +28 -19
  50. package/src/sops.ts +19 -8
  51. package/src/ssh.ts +122 -24
  52. package/src/talos.ts +21 -19
  53. package/src/third-party/cloudflare.ts +59 -0
  54. package/src/third-party/index.ts +3 -0
  55. package/src/{mullvad.ts → third-party/mullvad.ts} +11 -9
  56. package/src/third-party/timeweb.ts +99 -0
  57. package/src/utils.ts +27 -6
  58. package/src/wireguard.ts +249 -115
  59. package/src/apps/code-server.ts +0 -34
  60. package/src/apps/deployment.ts +0 -60
  61. package/src/apps/dns.ts +0 -107
  62. package/src/apps/gitea.ts +0 -18
  63. package/src/apps/grocy.ts +0 -20
  64. package/src/apps/hubble.ts +0 -20
  65. package/src/apps/kubernetes-dashboard.ts +0 -19
  66. package/src/apps/mariadb.ts +0 -81
  67. package/src/apps/maybe.ts +0 -25
  68. package/src/apps/mongodb.ts +0 -81
  69. package/src/apps/network.ts +0 -55
  70. package/src/apps/postgresql.ts +0 -81
  71. package/src/apps/shared.ts +0 -290
  72. package/src/apps/syncthing.ts +0 -54
  73. package/src/apps/test.ts +0 -19
  74. package/src/apps/traefik.ts +0 -36
  75. package/src/apps/vaultwarden.ts +0 -23
  76. package/src/apps/zitadel.ts +0 -21
  77. package/src/cloudflare.ts +0 -26
  78. package/src/common.ts +0 -200
  79. package/src/files.ts +0 -146
  80. package/src/k8s.ts +0 -638
  81. package/src/timeweb.ts +0 -75
  82. package/src/{obfuscators → k8s/obfuscators}/index.ts +1 -1
package/src/k8s.ts DELETED
@@ -1,638 +0,0 @@
1
- import { defineEntity, defineUnit, Type, type Static } from "@highstate/contract"
2
- import { Literal } from "@sinclair/typebox"
3
- import * as dns from "./dns"
4
- import { l3EndpointEntity, l4EndpointEntity } from "./network"
5
- import { serverEntity } from "./common"
6
- import { arrayPatchModeSchema } from "./utils"
7
-
8
- export const fallbackKubeApiAccessSchema = Type.Object({
9
- serverIp: Type.String(),
10
- serverPort: Type.Number(),
11
- })
12
-
13
- export const tunDevicePolicySchema = Type.Union([
14
- Type.Object({
15
- type: Literal("host"),
16
- }),
17
- Type.Object({
18
- type: Literal("plugin"),
19
- resourceName: Type.String(),
20
- resourceValue: Type.String(),
21
- }),
22
- ])
23
-
24
- export const externalServiceTypeSchema = Type.StringEnum(["NodePort", "LoadBalancer"])
25
- export const scheduleOnMastersPolicySchema = Type.StringEnum(["always", "when-no-workers", "never"])
26
- export const cniSchema = Type.StringEnum(["cilium", "other"])
27
-
28
- export const clusterQuirksSchema = Type.Object({
29
- /**
30
- * The IP and port of the kube-apiserver available from the cluster.
31
- *
32
- * Will be used to create fallback network policy in CNIs which does not support allowing access to the kube-apiserver.
33
- */
34
- fallbackKubeApiAccess: Type.Optional(fallbackKubeApiAccessSchema),
35
-
36
- /**
37
- * Specifies the policy for using the tun device inside containers.
38
- *
39
- * If not provided, the default policy is `host` which assumes just mounting /dev/net/tun from the host.
40
- *
41
- * For some runtimes, like Talos's one, the /dev/net/tun device is not available in the host, so the plugin policy should be used.
42
- */
43
- tunDevicePolicy: Type.Optional(tunDevicePolicySchema),
44
-
45
- /**
46
- * The service type to use for external services.
47
- *
48
- * If not provided, the default service type is `NodePort` since `LoadBalancer` may not be available.
49
- */
50
- externalServiceType: Type.Optional(externalServiceTypeSchema),
51
- })
52
-
53
- export const clusterInfoProperties = {
54
- /**
55
- * The unique identifier of the cluster.
56
- *
57
- * Should be defined as a UUID of the `kube-system` namespace which is always present in the cluster.
58
- */
59
- id: Type.String(),
60
-
61
- /**
62
- * The name of the cluster.
63
- */
64
- name: Type.String(),
65
-
66
- /**
67
- * The name of the CNI plugin used by the cluster.
68
- *
69
- * Supported values are:
70
- * - `cilium`
71
- * - `other`
72
- */
73
- cni: cniSchema,
74
-
75
- /**
76
- * The endpoints of the cluster nodes.
77
- *
78
- * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
79
- *
80
- * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
81
- */
82
- endpoints: Type.Array(l3EndpointEntity.schema),
83
-
84
- /**
85
- * The endpoints of the API server.
86
- *
87
- * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
88
- *
89
- * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
90
- */
91
- apiEndpoints: Type.Array(l4EndpointEntity.schema),
92
-
93
- /**
94
- * The external IPs of the cluster nodes allowed to be used for external access.
95
- */
96
- externalIps: Type.Array(Type.String()),
97
-
98
- /**
99
- * The extra quirks of the cluster to improve compatibility.
100
- */
101
- quirks: Type.Optional(clusterQuirksSchema),
102
-
103
- /**
104
- * The extra metadata to attach to the cluster.
105
- */
106
- metadata: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
107
- } as const
108
-
109
- export const serviceTypeSchema = Type.StringEnum(["NodePort", "LoadBalancer", "ClusterIP"])
110
-
111
- export const metadataSchema = Type.Object({
112
- name: Type.String(),
113
- namespace: Type.String(),
114
- labels: Type.Optional(Type.Record(Type.String(), Type.String())),
115
- annotations: Type.Optional(Type.Record(Type.String(), Type.String())),
116
- })
117
-
118
- export const resourceSchema = Type.Object({
119
- clusterId: Type.String(),
120
- metadata: metadataSchema,
121
- })
122
-
123
- export const serviceEntity = defineEntity({
124
- type: "k8s.service",
125
-
126
- schema: Type.Object({
127
- type: Type.Literal("k8s.service"),
128
- ...resourceSchema.properties,
129
- endpoints: Type.Array(l4EndpointEntity.schema),
130
- }),
131
-
132
- meta: {
133
- color: "#2196F3",
134
- },
135
- })
136
-
137
- export const clusterEntity = defineEntity({
138
- type: "k8s.cluster",
139
-
140
- schema: Type.Object({
141
- ...clusterInfoProperties,
142
- kubeconfig: Type.String(),
143
- }),
144
-
145
- meta: {
146
- color: "#2196F3",
147
- },
148
- })
149
-
150
- export const internalIpsPolicySchema = Type.StringEnum(["always", "public", "never"])
151
-
152
- export const scheduleOnMastersPolicyArgs = {
153
- /**
154
- * The policy for scheduling workloads on master nodes.
155
- *
156
- * - `always`: always schedule workloads on master nodes regardless of the number of workers;
157
- * - `when-no-workers`: schedule workloads on master nodes only if there are no workers (default);
158
- * - `never`: never schedule workloads on master nodes.
159
- */
160
- scheduleOnMastersPolicy: Type.Default(scheduleOnMastersPolicySchema, "when-no-workers"),
161
- }
162
-
163
- export const clusterInputs = {
164
- masters: {
165
- entity: serverEntity,
166
- multiple: true,
167
- },
168
- workers: {
169
- entity: serverEntity,
170
- multiple: true,
171
- required: false,
172
- },
173
- } as const
174
-
175
- export const clusterOutputs = {
176
- k8sCluster: clusterEntity,
177
- apiEndpoints: {
178
- entity: l4EndpointEntity,
179
- multiple: true,
180
- },
181
- endpoints: {
182
- entity: l3EndpointEntity,
183
- multiple: true,
184
- },
185
- } as const
186
-
187
- export const existingCluster = defineUnit({
188
- type: "k8s.existing-cluster",
189
-
190
- args: {
191
- /**
192
- * The list of external IPs of the cluster nodes allowed to be used for external access.
193
- *
194
- * If not provided, will be automatically detected by querying the cluster nodes.
195
- */
196
- externalIps: Type.Optional(Type.Array(Type.String())),
197
-
198
- /**
199
- * The policy for using internal IPs of the nodes as external IPs.
200
- *
201
- * - `always`: always use internal IPs as external IPs;
202
- * - `public`: use internal IPs as external IPs only if they are (theoretically) routable from the public internet **(default)**;
203
- * - `never`: never use internal IPs as external IPs.
204
- */
205
- internalIpsPolicy: Type.Default(internalIpsPolicySchema, "public"),
206
-
207
- /**
208
- * The extra quirks of the cluster to improve compatibility.
209
- */
210
- quirks: Type.Optional(clusterQuirksSchema),
211
- },
212
-
213
- secrets: {
214
- /**
215
- * The kubeconfig of the cluster to use for connecting to the cluster.
216
- *
217
- * Will be available for all components using `cluster` output of this unit.
218
- */
219
- kubeconfig: Type.Record(Type.String(), Type.Any()),
220
- },
221
-
222
- outputs: clusterOutputs,
223
-
224
- meta: {
225
- displayName: "Existing Cluster",
226
- description: "An existing Kubernetes cluster.",
227
- primaryIcon: "devicon:kubernetes",
228
- category: "Kubernetes",
229
- },
230
-
231
- source: {
232
- package: "@highstate/k8s",
233
- path: "units/existing-cluster",
234
- },
235
- })
236
-
237
- export const clusterPatch = defineUnit({
238
- type: "k8s.cluster-patch",
239
-
240
- args: {
241
- /**
242
- * The endpoints of the API server.
243
- *
244
- * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
245
- *
246
- * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
247
- */
248
- apiEndpoints: Type.Default(Type.Array(Type.String()), []),
249
-
250
- /**
251
- * The mode to use for patching the API endpoints.
252
- *
253
- * - `prepend`: prepend the new endpoints to the existing ones (default);
254
- * - `replace`: replace the existing endpoints with the new ones.
255
- */
256
- apiEndpointsPatchMode: Type.Default(arrayPatchModeSchema, "prepend"),
257
-
258
- /**
259
- * The endpoints of the cluster nodes.
260
- *
261
- * The entry may represent real node endpoint or virtual endpoint (like a load balancer).
262
- *
263
- * The same node may also be represented by multiple entries (e.g. a node with private and public IP).
264
- */
265
- endpoints: Type.Default(Type.Array(Type.String()), []),
266
-
267
- /**
268
- * The mode to use for patching the endpoints.
269
- *
270
- * - `prepend`: prepend the new endpoints to the existing ones (default);
271
- * - `replace`: replace the existing endpoints with the new ones.
272
- */
273
- endpointsPatchMode: Type.Default(arrayPatchModeSchema, "prepend"),
274
- },
275
-
276
- inputs: {
277
- k8sCluster: clusterEntity,
278
- apiEndpoints: {
279
- entity: l4EndpointEntity,
280
- required: false,
281
- multiple: true,
282
- },
283
- endpoints: {
284
- entity: l3EndpointEntity,
285
- required: false,
286
- multiple: true,
287
- },
288
- },
289
-
290
- outputs: clusterOutputs,
291
-
292
- meta: {
293
- displayName: "Cluster Patch",
294
- description: "Patches some properties of the cluster.",
295
- primaryIcon: "devicon:kubernetes",
296
- secondaryIcon: "fluent:patch-20-filled",
297
- category: "Kubernetes",
298
- },
299
-
300
- source: {
301
- package: "@highstate/k8s",
302
- path: "units/cluster-patch",
303
- },
304
- })
305
-
306
- export const clusterDns = defineUnit({
307
- type: "k8s.cluster-dns",
308
-
309
- args: {
310
- ...dns.createArgs(),
311
- ...dns.createArgs("api"),
312
- },
313
-
314
- inputs: {
315
- k8sCluster: clusterEntity,
316
- ...dns.inputs,
317
- },
318
-
319
- outputs: clusterOutputs,
320
-
321
- meta: {
322
- displayName: "Cluster DNS",
323
- description: "Creates DNS records for the cluster and updates endpoints.",
324
- primaryIcon: "devicon:kubernetes",
325
- secondaryIcon: "mdi:dns",
326
- category: "Kubernetes",
327
- },
328
-
329
- source: {
330
- package: "@highstate/k8s",
331
- path: "units/cluster-dns",
332
- },
333
- })
334
-
335
- export const gatewayEntity = defineEntity({
336
- type: "k8s.gateway",
337
-
338
- schema: Type.Object({
339
- clusterId: Type.String(),
340
- gatewayClassName: Type.String(),
341
- httpListenerPort: Type.Number(),
342
- httpsListenerPort: Type.Number(),
343
- endpoints: Type.Array(l3EndpointEntity.schema),
344
- }),
345
-
346
- meta: {
347
- color: "#4CAF50",
348
- },
349
- })
350
-
351
- export const tlsIssuerEntity = defineEntity({
352
- type: "k8s.tls-issuer",
353
-
354
- schema: Type.Object({
355
- clusterId: Type.String(),
356
- clusterIssuerName: Type.String(),
357
- }),
358
-
359
- meta: {
360
- color: "#f06292",
361
- },
362
- })
363
-
364
- export const accessPointEntity = defineEntity({
365
- type: "k8s.access-point",
366
-
367
- schema: Type.Object({
368
- clusterId: Type.String(),
369
- gateway: gatewayEntity.schema,
370
- tlsIssuer: tlsIssuerEntity.schema,
371
- dnsProviders: Type.Array(dns.providerEntity.schema),
372
- }),
373
-
374
- meta: {
375
- color: "#F57F17",
376
- },
377
- })
378
-
379
- export const accessPoint = defineUnit({
380
- type: "k8s.access-point",
381
-
382
- inputs: {
383
- gateway: gatewayEntity,
384
- tlsIssuer: tlsIssuerEntity,
385
- dnsProviders: {
386
- entity: dns.providerEntity,
387
- multiple: true,
388
- },
389
- },
390
-
391
- outputs: {
392
- accessPoint: accessPointEntity,
393
- },
394
-
395
- meta: {
396
- displayName: "Access Point",
397
- description: "An access point which can be used to connect to services.",
398
- primaryIcon: "mdi:access-point",
399
- category: "Kubernetes",
400
- },
401
-
402
- source: {
403
- package: "@highstate/k8s",
404
- path: "units/access-point",
405
- },
406
- })
407
-
408
- export const certManager = defineUnit({
409
- type: "k8s.cert-manager",
410
-
411
- inputs: {
412
- k8sCluster: clusterEntity,
413
- },
414
-
415
- outputs: {
416
- k8sCluster: clusterEntity,
417
- },
418
-
419
- meta: {
420
- displayName: "Cert Manager",
421
- description: "A certificate manager for managing TLS certificates.",
422
- primaryIcon: "simple-icons:letsencrypt",
423
- category: "Kubernetes",
424
- },
425
-
426
- source: {
427
- package: "@highstate/k8s",
428
- path: "units/cert-manager",
429
- },
430
- })
431
-
432
- export const dns01TlsIssuer = defineUnit({
433
- type: "k8s.dns01-issuer",
434
-
435
- args: {
436
- /**
437
- * The top-level domains to filter the DNS01 challenge for.
438
- *
439
- * If not provided, will use all domains passed to the DNS providers.
440
- */
441
- domains: Type.Optional(Type.Array(Type.String())),
442
- },
443
-
444
- inputs: {
445
- k8sCluster: clusterEntity,
446
- dnsProviders: {
447
- entity: dns.providerEntity,
448
- multiple: true,
449
- },
450
- },
451
-
452
- outputs: {
453
- tlsIssuer: tlsIssuerEntity,
454
- },
455
-
456
- meta: {
457
- displayName: "DNS01 Issuer",
458
- description: "A TLS issuer for issuing certificate using DNS01 challenge.",
459
- primaryIcon: "mdi:certificate",
460
- category: "Kubernetes",
461
- },
462
-
463
- source: {
464
- package: "@highstate/k8s",
465
- path: "units/dns01-issuer",
466
- },
467
- })
468
-
469
- export const deploymentEntity = defineEntity({
470
- type: "k8s.deployment",
471
-
472
- schema: Type.Object({
473
- type: Type.Literal("k8s.deployment"),
474
- ...resourceSchema.properties,
475
- service: Type.Optional(serviceEntity.schema),
476
- }),
477
-
478
- meta: {
479
- color: "#4CAF50",
480
- },
481
- })
482
-
483
- export const statefulSetEntity = defineEntity({
484
- type: "k8s.stateful-set",
485
-
486
- schema: Type.Object({
487
- type: Type.Literal("k8s.stateful-set"),
488
- ...resourceSchema.properties,
489
- service: serviceEntity.schema,
490
- }),
491
-
492
- meta: {
493
- color: "#FFC107",
494
- },
495
- })
496
-
497
- export const exposableWorkloadEntity = defineEntity({
498
- type: "k8s.exposable-workload",
499
-
500
- schema: Type.Union([deploymentEntity.schema, statefulSetEntity.schema]),
501
-
502
- meta: {
503
- color: "#4CAF50",
504
- },
505
- })
506
-
507
- export const persistentVolumeClaimEntity = defineEntity({
508
- type: "k8s.persistent-volume-claim",
509
-
510
- schema: Type.Object({
511
- type: Type.Literal("k8s.persistent-volume-claim"),
512
- ...resourceSchema.properties,
513
- }),
514
-
515
- meta: {
516
- color: "#FFC107",
517
- },
518
- })
519
-
520
- export const interfaceEntity = defineEntity({
521
- type: "k8s.interface",
522
-
523
- schema: Type.Object({
524
- name: Type.String(),
525
- workload: exposableWorkloadEntity.schema,
526
- }),
527
-
528
- meta: {
529
- color: "#2196F3",
530
- description:
531
- "The interface in a network space of pod kernel which can accept or transmit packets.",
532
- },
533
- })
534
-
535
- export const gatewayApi = defineUnit({
536
- type: "k8s.gateway-api",
537
-
538
- inputs: {
539
- k8sCluster: clusterEntity,
540
- },
541
-
542
- outputs: {
543
- k8sCluster: clusterEntity,
544
- },
545
-
546
- meta: {
547
- displayName: "Gateway API",
548
- description: "Installs the Gateway API CRDs to the cluster.",
549
- primaryIcon: "devicon:kubernetes",
550
- secondaryIcon: "mdi:api",
551
- secondaryIconColor: "#4CAF50",
552
- category: "Kubernetes",
553
- },
554
-
555
- source: {
556
- package: "@highstate/k8s",
557
- path: "units/gateway-api",
558
- },
559
- })
560
-
561
- export const cilium = defineUnit({
562
- type: "k8s.cilium",
563
-
564
- args: {
565
- /**
566
- * If set to `true`, the generated network policy will allow
567
- * all DNS queries to be resolved, even if they are
568
- * for forbidden (non-allowed) FQDNs.
569
- *
570
- * By default, is `false`.
571
- */
572
- allowForbiddenFqdnResolution: Type.Default(Type.Boolean(), false),
573
- },
574
-
575
- inputs: {
576
- k8sCluster: clusterEntity,
577
- },
578
-
579
- outputs: {
580
- k8sCluster: clusterEntity,
581
- },
582
-
583
- meta: {
584
- displayName: "Cilium",
585
- description: "The Cilium CNI deployed on Kubernetes.",
586
- primaryIcon: "simple-icons:cilium",
587
- secondaryIcon: "devicon:kubernetes",
588
- category: "Kubernetes",
589
- },
590
-
591
- source: {
592
- package: "@highstate/cilium",
593
- path: "unit",
594
- },
595
- })
596
-
597
- export const monitorWorkerResourceGroupSchema = Type.Object({
598
- type: Type.StringEnum(["deployment", "statefulset", "pod", "service"]),
599
- namespace: Type.String(),
600
- names: Type.Optional(Type.Array(Type.String())),
601
- })
602
-
603
- export const monitorWorkerParamsSchema = Type.Object({
604
- /**
605
- * The ID of the secret containing the kubeconfig of the cluster.
606
- */
607
- kubeconfigSecretId: Type.String(),
608
-
609
- /**
610
- * The resources to monitor in the cluster.
611
- */
612
- resourceGroups: Type.Array(monitorWorkerResourceGroupSchema),
613
- })
614
-
615
- export type CNI = Static<typeof cniSchema>
616
- export type Cluster = Static<typeof clusterEntity.schema>
617
-
618
- export type Gateway = Static<typeof gatewayEntity.schema>
619
- export type TlsIssuer = Static<typeof tlsIssuerEntity.schema>
620
- export type AccessPoint = Static<typeof accessPointEntity.schema>
621
-
622
- export type Metadata = Static<typeof metadataSchema>
623
- export type Resource = Static<typeof resourceSchema>
624
-
625
- export type ServiceType = Static<typeof serviceTypeSchema>
626
- export type Service = Static<typeof serviceEntity.schema>
627
-
628
- export type Deployment = Static<typeof deploymentEntity.schema>
629
- export type ExposableWorkload = Static<typeof exposableWorkloadEntity.schema>
630
-
631
- export type PersistentVolumeClaim = Static<typeof persistentVolumeClaimEntity.schema>
632
- export type StatefulSet = Static<typeof statefulSetEntity.schema>
633
-
634
- export type Interface = Static<typeof interfaceEntity.schema>
635
- export type InternalIpsPolicy = Static<typeof internalIpsPolicySchema>
636
-
637
- export type MonitorWorkerParams = Static<typeof monitorWorkerParamsSchema>
638
- export type MonitorWorkerResourceGroup = Static<typeof monitorWorkerResourceGroupSchema>
package/src/timeweb.ts DELETED
@@ -1,75 +0,0 @@
1
- import { defineEntity, defineUnit, Type } from "@highstate/contract"
2
- import { serverEntity } from "./common"
3
- import { keyPairEntity } from "./ssh"
4
-
5
- export const connectionEntity = defineEntity({
6
- type: "timeweb.connection",
7
-
8
- schema: Type.Object({
9
- name: Type.String(),
10
- apiToken: Type.String(),
11
- }),
12
- })
13
-
14
- export const connection = defineUnit({
15
- type: "timeweb.connection",
16
-
17
- secrets: {
18
- apiToken: Type.String(),
19
- },
20
-
21
- outputs: {
22
- connection: connectionEntity,
23
- },
24
-
25
- meta: {
26
- displayName: "Timeweb Connection",
27
- description: "Creates a new Timeweb connection.",
28
- primaryIcon: "material-symbols:cloud",
29
- category: "Timeweb",
30
- },
31
-
32
- source: {
33
- package: "@highstate/timeweb",
34
- path: "connection",
35
- },
36
- })
37
-
38
- export const virtualMachine = defineUnit({
39
- type: "timeweb.virtual-machine",
40
-
41
- args: {
42
- presetId: Type.Optional(Type.Number()),
43
- osId: Type.Optional(Type.Number()),
44
- availabilityZone: Type.String(),
45
- },
46
-
47
- inputs: {
48
- connection: connectionEntity,
49
- sshKeyPair: {
50
- entity: keyPairEntity,
51
- required: false,
52
- },
53
- },
54
-
55
- secrets: {
56
- sshPrivateKey: Type.Optional(Type.String()),
57
- },
58
-
59
- outputs: {
60
- server: serverEntity,
61
- },
62
-
63
- meta: {
64
- displayName: "Timeweb Virtual Machine",
65
- description: "Creates a new Timeweb virtual machine.",
66
- primaryIcon: "material-symbols:cloud",
67
- secondaryIcon: "codicon:vm",
68
- category: "Timeweb",
69
- },
70
-
71
- source: {
72
- package: "@highstate/timeweb",
73
- path: "virtual-machine",
74
- },
75
- })
@@ -1,2 +1,2 @@
1
- export * from "./shared"
2
1
  export * as phantun from "./phantun"
2
+ export * from "./shared"