@stacksjs/ts-cloud 0.5.6 → 0.5.8

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.
@@ -28,6 +28,23 @@ export interface ResolvedContext {
28
28
  artifactBucket: string;
29
29
  assetsBucket: string;
30
30
  }
31
+ /**
32
+ * Resolve the deployed function names, region, and slug for an environment —
33
+ * shared by the logs/metrics/env/warming CLI commands. Throws if the env has no
34
+ * serverless app configured.
35
+ */
36
+ export declare function resolveServerlessFunctions(config: CloudConfig, environment: EnvironmentType): {
37
+ region: string;
38
+ slug: string;
39
+ stackName: string;
40
+ functions: {
41
+ http: string;
42
+ queue: string;
43
+ cli: string;
44
+ };
45
+ };
46
+ /** Resolve secrets from Secrets Manager into a flat env map. */
47
+ export declare function resolveSecrets(app: ServerlessAppConfig, region: string): Promise<Record<string, string>>;
31
48
  /**
32
49
  * Derive framework env vars (DB/Redis hosts) from the deployed stack outputs so
33
50
  * a Laravel app connects to the Aurora/RDS-Proxy/ElastiCache resources the
@@ -57,6 +74,24 @@ export declare function rollbackServerlessApp(config: CloudConfig, environment:
57
74
  export declare function setMaintenance(config: CloudConfig, environment: EnvironmentType, enabled: boolean, bypassSecret?: string): Promise<void>;
58
75
  /** Invoke the CLI function with an arbitrary command (e.g. `cloud command "migrate"`). */
59
76
  export declare function runRemoteCommand(config: CloudConfig, environment: EnvironmentType, command: string): Promise<string>;
77
+ /** One recorded `cloud command` invocation. */
78
+ export interface CommandRecord {
79
+ id: number;
80
+ command: string;
81
+ timestamp: string;
82
+ status: 'ok' | 'error';
83
+ output: string;
84
+ }
85
+ /** Run a command on the CLI function AND record it to the history log (best-effort). */
86
+ export declare function runAndRecordCommand(config: CloudConfig, environment: EnvironmentType, command: string): Promise<{
87
+ id: number;
88
+ status: 'ok' | 'error';
89
+ output: string;
90
+ }>;
91
+ /** Return the recorded command history (most-recent last). */
92
+ export declare function listCommandHistory(config: CloudConfig, environment: EnvironmentType): Promise<CommandRecord[]>;
93
+ /** Look up one history record by id (or the most recent when id is omitted). */
94
+ export declare function getCommandRecord(config: CloudConfig, environment: EnvironmentType, id?: number): Promise<CommandRecord | undefined>;
60
95
  /**
61
96
  * Run a SQL statement against a (private, in-VPC) serverless database via the CLI
62
97
  * function — no bastion needed. Requires the `tscloud/serverless` PHP bridge
@@ -64,3 +99,14 @@ export declare function runRemoteCommand(config: CloudConfig, environment: Envir
64
99
  * whitespace argument parsing.
65
100
  */
66
101
  export declare function runDbQuery(config: CloudConfig, environment: EnvironmentType, sql: string): Promise<string>;
102
+ /** Rescale the serverless Aurora cluster's min/max ACU capacity. */
103
+ export declare function scaleServerlessDatabase(config: CloudConfig, environment: EnvironmentType, minCapacity: number, maxCapacity: number): Promise<void>;
104
+ /**
105
+ * Restore the serverless Aurora cluster to a point in time as a NEW cluster
106
+ * (the source is untouched). Returns the new cluster identifier.
107
+ */
108
+ export declare function restoreServerlessDatabase(config: CloudConfig, environment: EnvironmentType, opts: {
109
+ toTime?: Date;
110
+ latest?: boolean;
111
+ target?: string;
112
+ }): Promise<string>;