@ts-cloud/core 0.16.51 → 0.16.53

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.
@@ -67,6 +67,19 @@ export interface ProvisionComputeOptions {
67
67
  config: CloudConfig;
68
68
  environment: EnvironmentType;
69
69
  }
70
+ export interface ComputeChangePlan {
71
+ serverId: string;
72
+ changes: Array<{
73
+ resource: string;
74
+ action: string;
75
+ detail: string;
76
+ }>;
77
+ waitingForCapacity?: string;
78
+ }
79
+ export interface ApplyComputeChangesOptions extends ProvisionComputeOptions {
80
+ /** Plan without provider writes, remote commands, or local state writes. */
81
+ dryRun?: boolean;
82
+ }
70
83
  export interface FindComputeTargetsOptions {
71
84
  slug: string;
72
85
  environment: EnvironmentType;
@@ -116,6 +129,8 @@ export interface CloudDriver {
116
129
  readonly usesCloudFormation: boolean;
117
130
  /** Provision compute infrastructure (Hetzner). AWS uses InfrastructureGenerator + CFN. */
118
131
  provisionComputeInfrastructure?(options: ProvisionComputeOptions): Promise<ComputeStackOutputs>;
132
+ /** Apply configured resize, persistent volumes and deployment placement without deploying sites. */
133
+ applyComputeChanges?(options: ApplyComputeChangesOptions): Promise<ComputeChangePlan>;
119
134
  /**
120
135
  * Tear down the lightweight single-server compute (instance + security
121
136
  * group/firewall + local state) provisioned by
package/dist/types.d.ts CHANGED
@@ -1717,6 +1717,11 @@ export interface DaemonConfig {
1717
1717
  }
1718
1718
  /** A lifecycle event that can trigger a notification. */
1719
1719
  export type NotifyEvent = 'deploy' | 'deploy-failed' | 'ssl' | 'health' | 'backup';
1720
+ /** A literal URL, or a value read on the server without evaluating its env file. */
1721
+ export type NotificationEndpoint = string | {
1722
+ envFile: string;
1723
+ variable: string;
1724
+ };
1720
1725
  /**
1721
1726
  * Notification channels (Forge-style). Configure any subset; each configured
1722
1727
  * channel receives the events listed in {@link events} (all events by default).
@@ -1724,11 +1729,11 @@ export type NotifyEvent = 'deploy' | 'deploy-failed' | 'ssl' | 'health' | 'backu
1724
1729
  export interface NotificationsConfig {
1725
1730
  /** Slack incoming-webhook URL. */
1726
1731
  slack?: {
1727
- webhookUrl: string;
1732
+ webhookUrl: NotificationEndpoint;
1728
1733
  };
1729
1734
  /** Discord webhook URL. */
1730
1735
  discord?: {
1731
- webhookUrl: string;
1736
+ webhookUrl: NotificationEndpoint;
1732
1737
  };
1733
1738
  /** Telegram bot token + chat id. */
1734
1739
  telegram?: {
@@ -3021,6 +3026,23 @@ export interface ContainerItemConfig {
3021
3026
  };
3022
3027
  }
3023
3028
  export interface ComputeConfig {
3029
+ /** Explicitly reconcile an existing Hetzner server's size. Never resize by default. */
3030
+ resize?: {
3031
+ /** Keep serving on the current type when the requested type has no capacity. */
3032
+ whenUnavailable?: 'keep-current' | 'fail';
3033
+ /** Enlarge the primary disk with the server. Cannot be undone. @default true */
3034
+ upgradeDisk?: boolean;
3035
+ };
3036
+ /** Named Hetzner block volumes. Reconciled only by the server owner; host requires Bun. */
3037
+ volumes?: Record<string, ComputeVolumeConfig>;
3038
+ /** Place releases and optional deployment backups on a named volume. */
3039
+ deploymentStorage?: {
3040
+ volume: string;
3041
+ /** Copy existing release trees online, then verify under deployment locks. */
3042
+ migrateExisting?: boolean;
3043
+ /** Include project-level pre-migration backup directories. @default true */
3044
+ includeBackups?: boolean;
3045
+ };
3024
3046
  /**
3025
3047
  * Compute mode: 'server' for EC2, 'serverless' for Fargate/Lambda
3026
3048
  */
@@ -3451,6 +3473,17 @@ export interface ComputeConfig {
3451
3473
  */
3452
3474
  hostCleanup?: boolean | ComputeHostCleanupConfig;
3453
3475
  }
3476
+ /** Persistent Linux block storage managed by the compute owner. */
3477
+ export interface ComputeVolumeConfig {
3478
+ /** Provider resource name; defaults to <project>-<environment>-<key>. */
3479
+ name?: string;
3480
+ /** Capacity in GB. Existing volumes may grow but never shrink. */
3481
+ size: number;
3482
+ /** Absolute Linux mount path, persisted by filesystem UUID. */
3483
+ mountPath: string;
3484
+ /** Refuse provider-side deletion. @default true */
3485
+ deleteProtection?: boolean;
3486
+ }
3454
3487
  /**
3455
3488
  * Retention windows for {@link ComputeConfig.hostCleanup}. Each field is an age
3456
3489
  * past which the matching files are deleted; omit one to keep its default.
@@ -3551,6 +3584,11 @@ export interface SshKeyConfig {
3551
3584
  export interface ComputeMonitoringConfig {
3552
3585
  /** Enable the metrics collector. @default true */
3553
3586
  enabled?: boolean;
3587
+ /** Filesystems to report and alert on. A required mount must be a mount point. */
3588
+ filesystems?: Array<string | {
3589
+ path: string;
3590
+ requiredMount?: boolean;
3591
+ }>;
3554
3592
  /** Alert thresholds; omit a field to keep its default. */
3555
3593
  alerts?: {
3556
3594
  /** Alert when 1-min load average per CPU exceeds this. @default 2 */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
3
  "type": "module",
4
- "version": "0.16.51",
4
+ "version": "0.16.53",
5
5
  "description": "Core CloudFormation generation library for ts-cloud",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@ts-cloud/aws-types": "0.16.51"
34
+ "@ts-cloud/aws-types": "0.16.53"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^7.0.2"