@miosa/sdk 2.0.0 → 2.0.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.
package/dist/index.d.ts CHANGED
@@ -3897,6 +3897,7 @@ type DatabaseId = string & {
3897
3897
  interface DatabaseData {
3898
3898
  id: DatabaseId;
3899
3899
  tenant_id: string;
3900
+ environment_id?: string | null;
3900
3901
  name: string;
3901
3902
  state?: string;
3902
3903
  engine?: string;
@@ -3948,6 +3949,9 @@ interface DatabaseCreateParams {
3948
3949
  /** @deprecated use cpu_count/memory_mb/storage_mb. */
3949
3950
  size?: string;
3950
3951
  region?: string;
3952
+ workspace_id?: string;
3953
+ project_id?: string;
3954
+ environment_id?: string;
3951
3955
  idempotencyKey?: string;
3952
3956
  idempotency_key?: string;
3953
3957
  [key: string]: unknown;
@@ -4117,6 +4121,8 @@ interface DeploymentData {
4117
4121
  runtime_image?: string | null;
4118
4122
  current_build_id?: string | null;
4119
4123
  active_version_id?: string | null;
4124
+ active_release_id?: string | null;
4125
+ running_artifact_sha256?: string | null;
4120
4126
  source_type?: DeploymentSourceType;
4121
4127
  state: DeploymentState;
4122
4128
  auto_deploy?: boolean;
@@ -4187,6 +4193,16 @@ interface DeploymentVersionData {
4187
4193
  created_at?: string;
4188
4194
  updated_at?: string;
4189
4195
  }
4196
+ interface MigrationBackupData {
4197
+ id: string;
4198
+ database_id: string;
4199
+ state: string;
4200
+ backup_type?: string;
4201
+ size_bytes?: number | null;
4202
+ started_at?: string | null;
4203
+ completed_at?: string | null;
4204
+ created_at?: string | null;
4205
+ }
4190
4206
  interface DeploymentReleaseData {
4191
4207
  id: DeploymentReleaseId;
4192
4208
  deployment_id?: DeploymentId;
@@ -4458,6 +4474,10 @@ declare class DeploymentVersions {
4458
4474
  environment?: string;
4459
4475
  idempotencyKey?: string;
4460
4476
  }): Promise<DeploymentData>;
4477
+ prepareMigrationBackup(versionId: string): Promise<{
4478
+ backup: MigrationBackupData;
4479
+ version: DeploymentVersionData;
4480
+ }>;
4461
4481
  }
4462
4482
  declare class DeploymentReleases {
4463
4483
  private readonly http;
@@ -4465,6 +4485,7 @@ declare class DeploymentReleases {
4465
4485
  constructor(http: HttpClient, deploymentId: string);
4466
4486
  list(): Promise<DeploymentReleaseData[]>;
4467
4487
  get(releaseId: string): Promise<DeploymentReleaseData>;
4488
+ promote(releaseId: string, idempotencyKey?: string): Promise<DeploymentData>;
4468
4489
  }
4469
4490
  declare class DeploymentRuntimeInstances {
4470
4491
  private readonly http;
package/dist/index.js CHANGED
@@ -168,7 +168,7 @@ var TokenRefreshFailedError = class extends MiosaError {
168
168
  };
169
169
 
170
170
  // src/version.ts
171
- var SDK_VERSION = "2.0.0";
171
+ var SDK_VERSION = "2.0.1";
172
172
  var SDK_USER_AGENT = `@miosa/sdk/${SDK_VERSION}`;
173
173
 
174
174
  // src/http.ts
@@ -5277,6 +5277,13 @@ var DeploymentVersions = class {
5277
5277
  );
5278
5278
  return unwrap30(data);
5279
5279
  }
5280
+ async prepareMigrationBackup(versionId) {
5281
+ const data = await this.http.request(
5282
+ `/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
5283
+ { method: "POST", body: {} }
5284
+ );
5285
+ return unwrap30(data);
5286
+ }
5280
5287
  };
5281
5288
  var DeploymentReleases = class {
5282
5289
  constructor(http, deploymentId) {
@@ -5297,6 +5304,18 @@ var DeploymentReleases = class {
5297
5304
  );
5298
5305
  return unwrap30(data);
5299
5306
  }
5307
+ async promote(releaseId, idempotencyKey11) {
5308
+ const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
5309
+ const data = await this.http.request(
5310
+ `/deployments/${this.deploymentId}/releases/${releaseId}/promote`,
5311
+ {
5312
+ method: "POST",
5313
+ body: {},
5314
+ headers: { "Idempotency-Key": key }
5315
+ }
5316
+ );
5317
+ return unwrap30(data);
5318
+ }
5300
5319
  };
5301
5320
  var DeploymentRuntimeInstances = class {
5302
5321
  constructor(http, deploymentId) {