@hoststack.dev/sdk 0.9.2 → 0.10.0

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.
package/dist/index.d.cts CHANGED
@@ -520,6 +520,19 @@ declare class DatabasesResource {
520
520
  * `pgEngineType === 'patroni'` + `status === 'available'` to confirm.
521
521
  */
522
522
  upgradeToHa(teamId: IdInput, databaseId: IdInput): Promise<void>;
523
+ /**
524
+ * In-place engine version upgrade (postgres/redis standalone). The agent
525
+ * dumps the live data, recreates the container at `version` under the same
526
+ * DNS name, and restores — so connection URLs stay valid. There's a brief
527
+ * interruption (seconds) while the new container comes up.
528
+ *
529
+ * `version` must be a supported, strictly-newer version for the engine
530
+ * (e.g. '18' for postgres, '8' for redis). Throws 400 otherwise.
531
+ *
532
+ * Returns 202 — the upgrade is async; poll `get(...)` until `version`
533
+ * matches the target and `status === 'available'` to confirm.
534
+ */
535
+ upgradeVersion(teamId: IdInput, databaseId: IdInput, version: string): Promise<void>;
523
536
  /**
524
537
  * v89 Phase 5: cluster topology + failover history for a Patroni-managed
525
538
  * Postgres database. Returns 400 for standalone databases — call
@@ -882,6 +895,29 @@ declare class ServicesResource {
882
895
  }>;
883
896
  /** Delete a service. */
884
897
  delete(teamId: IdInput, serviceId: IdInput): Promise<void>;
898
+ /**
899
+ * Spin up an agentic dev environment FROM this service: a dev box that runs
900
+ * a clone of the app (repo auto-cloned into /workspace, env-vars copied, and
901
+ * the linked database cloned so it never touches prod), with an unguessable
902
+ * public dev URL and seamless `git push`. Returns the dev box, its dev URL,
903
+ * and the first deploy id.
904
+ */
905
+ spinUpDevEnvironment(teamId: IdInput, serviceId: IdInput, options?: {
906
+ includeDatabaseClone?: boolean;
907
+ name?: string;
908
+ }): Promise<{
909
+ service: Service;
910
+ devUrl: string;
911
+ deployId: number | null;
912
+ }>;
913
+ /**
914
+ * Tear a dev environment down: removes the dev box and cascade-deletes its
915
+ * cloned database, /workspace volume, and the empty `development`
916
+ * environment. `serviceId` is the dev box itself.
917
+ */
918
+ tearDownDevEnvironment(teamId: IdInput, serviceId: IdInput): Promise<{
919
+ success: true;
920
+ }>;
885
921
  /** Suspend a service. */
886
922
  suspend(teamId: IdInput, serviceId: IdInput): Promise<void>;
887
923
  /** Resume a suspended service. */
package/dist/index.d.ts CHANGED
@@ -520,6 +520,19 @@ declare class DatabasesResource {
520
520
  * `pgEngineType === 'patroni'` + `status === 'available'` to confirm.
521
521
  */
522
522
  upgradeToHa(teamId: IdInput, databaseId: IdInput): Promise<void>;
523
+ /**
524
+ * In-place engine version upgrade (postgres/redis standalone). The agent
525
+ * dumps the live data, recreates the container at `version` under the same
526
+ * DNS name, and restores — so connection URLs stay valid. There's a brief
527
+ * interruption (seconds) while the new container comes up.
528
+ *
529
+ * `version` must be a supported, strictly-newer version for the engine
530
+ * (e.g. '18' for postgres, '8' for redis). Throws 400 otherwise.
531
+ *
532
+ * Returns 202 — the upgrade is async; poll `get(...)` until `version`
533
+ * matches the target and `status === 'available'` to confirm.
534
+ */
535
+ upgradeVersion(teamId: IdInput, databaseId: IdInput, version: string): Promise<void>;
523
536
  /**
524
537
  * v89 Phase 5: cluster topology + failover history for a Patroni-managed
525
538
  * Postgres database. Returns 400 for standalone databases — call
@@ -882,6 +895,29 @@ declare class ServicesResource {
882
895
  }>;
883
896
  /** Delete a service. */
884
897
  delete(teamId: IdInput, serviceId: IdInput): Promise<void>;
898
+ /**
899
+ * Spin up an agentic dev environment FROM this service: a dev box that runs
900
+ * a clone of the app (repo auto-cloned into /workspace, env-vars copied, and
901
+ * the linked database cloned so it never touches prod), with an unguessable
902
+ * public dev URL and seamless `git push`. Returns the dev box, its dev URL,
903
+ * and the first deploy id.
904
+ */
905
+ spinUpDevEnvironment(teamId: IdInput, serviceId: IdInput, options?: {
906
+ includeDatabaseClone?: boolean;
907
+ name?: string;
908
+ }): Promise<{
909
+ service: Service;
910
+ devUrl: string;
911
+ deployId: number | null;
912
+ }>;
913
+ /**
914
+ * Tear a dev environment down: removes the dev box and cascade-deletes its
915
+ * cloned database, /workspace volume, and the empty `development`
916
+ * environment. `serviceId` is the dev box itself.
917
+ */
918
+ tearDownDevEnvironment(teamId: IdInput, serviceId: IdInput): Promise<{
919
+ success: true;
920
+ }>;
885
921
  /** Suspend a service. */
886
922
  suspend(teamId: IdInput, serviceId: IdInput): Promise<void>;
887
923
  /** Resume a suspended service. */
package/dist/index.js CHANGED
@@ -183,6 +183,25 @@ var DatabasesResource = class {
183
183
  const did = await this.client.resolveId(databaseId, { kind: "database", teamId: tid });
184
184
  return this.client.request("POST", `/api/databases/${tid}/${did}/upgrade-to-ha`);
185
185
  }
186
+ /**
187
+ * In-place engine version upgrade (postgres/redis standalone). The agent
188
+ * dumps the live data, recreates the container at `version` under the same
189
+ * DNS name, and restores — so connection URLs stay valid. There's a brief
190
+ * interruption (seconds) while the new container comes up.
191
+ *
192
+ * `version` must be a supported, strictly-newer version for the engine
193
+ * (e.g. '18' for postgres, '8' for redis). Throws 400 otherwise.
194
+ *
195
+ * Returns 202 — the upgrade is async; poll `get(...)` until `version`
196
+ * matches the target and `status === 'available'` to confirm.
197
+ */
198
+ async upgradeVersion(teamId, databaseId, version) {
199
+ const tid = await this.client.resolveId(teamId, { kind: "team" });
200
+ const did = await this.client.resolveId(databaseId, { kind: "database", teamId: tid });
201
+ return this.client.request("POST", `/api/databases/${tid}/${did}/upgrade-version`, {
202
+ version
203
+ });
204
+ }
186
205
  /**
187
206
  * v89 Phase 5: cluster topology + failover history for a Patroni-managed
188
207
  * Postgres database. Returns 400 for standalone databases — call
@@ -622,6 +641,32 @@ var ServicesResource = class {
622
641
  const sid = await this.client.resolveId(serviceId, { kind: "service", teamId: tid });
623
642
  return this.client.request("DELETE", `/api/services/${tid}/${sid}`);
624
643
  }
644
+ /**
645
+ * Spin up an agentic dev environment FROM this service: a dev box that runs
646
+ * a clone of the app (repo auto-cloned into /workspace, env-vars copied, and
647
+ * the linked database cloned so it never touches prod), with an unguessable
648
+ * public dev URL and seamless `git push`. Returns the dev box, its dev URL,
649
+ * and the first deploy id.
650
+ */
651
+ async spinUpDevEnvironment(teamId, serviceId, options) {
652
+ const tid = await this.client.resolveId(teamId, { kind: "team" });
653
+ const sid = await this.client.resolveId(serviceId, { kind: "service", teamId: tid });
654
+ return this.client.request(
655
+ "POST",
656
+ `/api/services/${tid}/${sid}/dev-environment`,
657
+ options ?? {}
658
+ );
659
+ }
660
+ /**
661
+ * Tear a dev environment down: removes the dev box and cascade-deletes its
662
+ * cloned database, /workspace volume, and the empty `development`
663
+ * environment. `serviceId` is the dev box itself.
664
+ */
665
+ async tearDownDevEnvironment(teamId, serviceId) {
666
+ const tid = await this.client.resolveId(teamId, { kind: "team" });
667
+ const sid = await this.client.resolveId(serviceId, { kind: "service", teamId: tid });
668
+ return this.client.request("DELETE", `/api/services/${tid}/${sid}/dev-environment`);
669
+ }
625
670
  /** Suspend a service. */
626
671
  async suspend(teamId, serviceId) {
627
672
  const tid = await this.client.resolveId(teamId, { kind: "team" });