@ts-cloud/core 0.10.0 → 0.11.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 (2) hide show
  1. package/dist/types.d.ts +46 -0
  2. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -2835,6 +2835,23 @@ export interface ComputeConfig {
2835
2835
  * @default true for PHP boxes
2836
2836
  */
2837
2837
  autoUpdates?: boolean;
2838
+ /**
2839
+ * Self-updating binaries to keep current on the box.
2840
+ *
2841
+ * `autoUpdates` above covers the *operating system*. This covers the tools
2842
+ * you deploy: anything that ships as a GitHub release and can replace itself
2843
+ * (`<binary> upgrade`). ts-cloud renders the systemd service, timer and pause
2844
+ * switch for each one, so a project never hand-writes that into `userData`:
2845
+ *
2846
+ * ```ts
2847
+ * appUpdates: [{ service: 'mail', binary: '/opt/mail/mail-server' }]
2848
+ * ```
2849
+ *
2850
+ * ts-cloud only schedules the check. Skipping when already current, refusing
2851
+ * to downgrade, and rolling back a binary that will not start are the tool's
2852
+ * own responsibility — list a tool here only if its `upgrade` does those.
2853
+ */
2854
+ appUpdates?: ComputeAppUpdateTarget[];
2838
2855
  /**
2839
2856
  * Scheduled database backups (powered by `ts-backups`), synced to object
2840
2857
  * storage. Off unless configured.
@@ -2996,6 +3013,35 @@ export interface ComputeWafConfig {
2996
3013
  bypassPaths?: string[];
2997
3014
  }
2998
3015
  /** Scheduled database backup configuration. See {@link ComputeConfig.backups}. */
3016
+ /**
3017
+ * One self-updating binary that ts-cloud should keep current. See
3018
+ * `ComputeConfig.appUpdates`.
3019
+ */
3020
+ export interface ComputeAppUpdateTarget {
3021
+ /**
3022
+ * systemd service the tool runs as. Also names the generated units
3023
+ * (`<service>-upgrade.service` / `.timer`) and is passed to the tool so it
3024
+ * restarts the right unit after installing.
3025
+ */
3026
+ service: string;
3027
+ /** Absolute path of the installed binary to replace. */
3028
+ binary: string;
3029
+ /** Subcommand that performs the self-update. @default 'upgrade' */
3030
+ command?: string;
3031
+ /** Release channel to follow. @default 'stable' */
3032
+ channel?: 'stable' | 'canary';
3033
+ /** systemd `OnCalendar` expression for the check. @default 'daily' */
3034
+ schedule?: string;
3035
+ /**
3036
+ * Randomized spread applied to the scheduled time, so a fleet does not
3037
+ * stampede the release API at once. @default '4h'
3038
+ */
3039
+ randomizedDelay?: string;
3040
+ /** Extra flags appended to the update command (e.g. `--repo owner/name`). */
3041
+ args?: string[];
3042
+ /** Set false to render nothing for this target. @default true */
3043
+ enabled?: boolean;
3044
+ }
2999
3045
  export interface ComputeBackupConfig {
3000
3046
  /** Enable scheduled backups. @default false */
3001
3047
  enabled?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.11.1",
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.10.0"
34
+ "@ts-cloud/aws-types": "0.11.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^7.0.2"