@vertracloud/api-types 0.3.4 → 0.3.5

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.
@@ -113,6 +113,45 @@ interface APIApplicationGithub {
113
113
  repo_owner: string;
114
114
  repo_name: string;
115
115
  }
116
+ /**
117
+ * How a new deploy replaces the running version. `auto` = without downtime only when the app receives
118
+ * traffic through web publishing, otherwise with downtime; `on` = always without downtime (Enterprise);
119
+ * `off` = the running version stops before the new one starts.
120
+ *
121
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig
122
+ */
123
+ type ApplicationZeroDowntime = "auto" | "on" | "off";
124
+ declare const ApplicationZeroDowntime: {
125
+ readonly AUTO: "auto";
126
+ readonly ON: "on";
127
+ readonly OFF: "off";
128
+ };
129
+ /**
130
+ * Deploy behavior of an application. Changed with `PATCH /v1/apps/:id/config` (`deploy`).
131
+ *
132
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig
133
+ */
134
+ interface APIApplicationDeploySettings {
135
+ /** The saved choice. Defaults to `auto`. */
136
+ zero_downtime: ApplicationZeroDowntime;
137
+ /**
138
+ * Whether the next deploy runs without downtime. `true` on Enterprise when `zero_downtime` is `on`,
139
+ * or when it is `auto` and the app receives traffic through web publishing.
140
+ */
141
+ zero_downtime_active: boolean;
142
+ /**
143
+ * If the new version stops within 60 seconds after a deploy, the platform switches back to the
144
+ * previous version, once. Acts from the Intermediary plan; the saved value is returned on any plan.
145
+ */
146
+ auto_rollback: boolean;
147
+ /**
148
+ * HTTP path the platform calls on the new version before it receives traffic. Any HTTP response,
149
+ * including 404, counts as healthy; a refused connection, a timeout or a 5xx counts as a failure.
150
+ * Starts with `/`, at most 200 characters, printable ASCII only with no spaces; percent-encode anything
151
+ * else (`%20`, `%C3%A9`). `null` = `/`.
152
+ */
153
+ health_check_path: string | null;
154
+ }
116
155
  /**
117
156
  * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get
118
157
  */
@@ -156,6 +195,8 @@ interface APIApplication {
156
195
  missing_dependencies?: string[];
157
196
  /** Active Vertra Shield containment (burst/rate limit); `null` when there is none. */
158
197
  shield_cooldown: APIApplicationShieldCooldown | null;
198
+ /** Deploy behavior: zero downtime, automatic rollback and health check. */
199
+ deploy: APIApplicationDeploySettings;
159
200
  }
160
201
  /**
161
202
  * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get
@@ -267,6 +308,123 @@ interface APIApplicationDeployment {
267
308
  branch: string;
268
309
  created_at: ISODateString;
269
310
  }
311
+ /**
312
+ * How a release was created.
313
+ * `github` = push to the connected repository; `cli` = the Vertra CLI; `upload` = upload from the
314
+ * dashboard, an SDK or an extension; `editor` = edits made in the file manager; `rollback` = a
315
+ * release that restores an earlier one; `env_change` = a change to the environment variables only.
316
+ *
317
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list
318
+ */
319
+ type ApplicationReleaseSource = "github" | "cli" | "upload" | "editor" | "rollback" | "env_change";
320
+ declare const ApplicationReleaseSource: {
321
+ readonly GITHUB: "github";
322
+ readonly CLI: "cli";
323
+ readonly UPLOAD: "upload";
324
+ readonly EDITOR: "editor";
325
+ readonly ROLLBACK: "rollback";
326
+ readonly ENV_CHANGE: "env_change";
327
+ };
328
+ /**
329
+ * Lifecycle of a release. `deploying` = being built and started; `active` = the application's current
330
+ * code, one per application (see `first_started_at`: files committed without a restart are `active`
331
+ * before the application runs them); `superseded` = replaced by a newer release; `failed` = the
332
+ * application stopped right after this release was deployed and the platform rolled back to the
333
+ * previous one; `rolled_back` = the active release was replaced by a rollback; `expired` = its code is
334
+ * no longer kept.
335
+ *
336
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list
337
+ */
338
+ type ApplicationReleaseStatus = "deploying" | "active" | "superseded" | "failed" | "rolled_back" | "expired";
339
+ declare const ApplicationReleaseStatus: {
340
+ readonly DEPLOYING: "deploying";
341
+ readonly ACTIVE: "active";
342
+ readonly SUPERSEDED: "superseded";
343
+ readonly FAILED: "failed";
344
+ readonly ROLLED_BACK: "rolled_back";
345
+ readonly EXPIRED: "expired";
346
+ };
347
+ /**
348
+ * One version of an application's code, kept so it can be listed and, when the plan allows it,
349
+ * restored. The list is newest first. A release stays listed after its code expires.
350
+ *
351
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list
352
+ */
353
+ interface APIApplicationRelease {
354
+ id: SnowFlake;
355
+ app_id: SnowFlake;
356
+ source: ApplicationReleaseSource;
357
+ status: ApplicationReleaseStatus;
358
+ /** Commit or upload message. `null` when none was given, and always `null` for file manager edits. */
359
+ message: string | null;
360
+ /** The GitHub pusher, or the name of the user who uploaded or edited the files. */
361
+ author: string;
362
+ /** The GitHub push that produced this release. `null` for any other source. */
363
+ github: APIApplicationDeployment | null;
364
+ /** Number of files changed by the operation that produced this release. */
365
+ files_changed: number;
366
+ rollback: {
367
+ /**
368
+ * `false` for the active release, for an expired release, and when the plan does not allow
369
+ * rolling back to this release.
370
+ */
371
+ available: boolean;
372
+ /**
373
+ * When this release's code stops being kept, counted from the moment it stopped being the active
374
+ * release. `null` for the active release and when no code was kept.
375
+ */
376
+ expires_at: ISODateString | null;
377
+ /** The release this one restores, when `source` is `rollback`. `null` otherwise. */
378
+ from: SnowFlake | null;
379
+ };
380
+ /** `true` when a crash log was recorded for this release. The log can still expire; see the log endpoint. */
381
+ has_log: boolean;
382
+ /**
383
+ * Time, in milliseconds, the platform took to install dependencies, build and start this release.
384
+ * `null` when the release was not deployed with a build (for example, files committed without a restart).
385
+ */
386
+ build_duration_ms: number | null;
387
+ /**
388
+ * When the application first started with this release's code. `null` while the code is in the
389
+ * application folder but the application has not been started with it yet (for example, files
390
+ * committed without a restart): changes only take effect after a restart.
391
+ */
392
+ first_started_at: ISODateString | null;
393
+ created_at: ISODateString;
394
+ }
395
+ /**
396
+ * Crash log of a release. `content` is `null` when there is no log or it has expired.
397
+ *
398
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/log
399
+ */
400
+ interface APIApplicationReleaseLog {
401
+ content: string | null;
402
+ }
403
+ /**
404
+ * How an environment variable changes if a rollback restores the release's variables, compared with the
405
+ * active release. `added` = the release has it and the active release does not; `removed` = the active
406
+ * release has it and the release does not; `modified` = both have it with different values.
407
+ *
408
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview
409
+ */
410
+ type ApplicationEnvironmentChange = "added" | "modified" | "removed";
411
+ declare const ApplicationEnvironmentChange: {
412
+ readonly ADDED: "added";
413
+ readonly MODIFIED: "modified";
414
+ readonly REMOVED: "removed";
415
+ };
416
+ /**
417
+ * What a rollback to a release would change in the environment variables. Only variable names and the
418
+ * kind of change are returned, never values. Sorted by key. Empty when the release has no stored variables.
419
+ *
420
+ * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview
421
+ */
422
+ interface APIApplicationRollbackPreview {
423
+ environment_changes: {
424
+ key: string;
425
+ change: ApplicationEnvironmentChange;
426
+ }[];
427
+ }
270
428
  /**
271
429
  * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns
272
430
  */
@@ -394,7 +552,10 @@ type APIApplicationRuntimes = Record<ApplicationLanguage, APIApplicationRuntime>
394
552
  /**
395
553
  * `event` field of the `GET /v1/apps/:id/realtime` stream (`text/event-stream`).
396
554
  * `logs` = application output (one or more lines); `system` = stream/platform notices (e.g.
397
- * `install_note:started`); `heartbeat` = keep-alive, no content.
555
+ * `install_note:started`, `deploy_note:failed:<release_id>`, `deploy_note:rollback:<from>:<to>`,
556
+ * `deploy_note:discarded:<release_id>` (Enterprise zero-downtime: the new release did not become healthy
557
+ * and was dropped; the previous one keeps running), where `<from>` and `<to>` identify the releases
558
+ * involved); `heartbeat` = keep-alive, no content.
398
559
  * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime
399
560
  */
400
561
  type ApplicationRealtimeEventType = "logs" | "system" | "heartbeat";
@@ -413,4 +574,4 @@ interface APIApplicationRealtimeEvent {
413
574
  data: string;
414
575
  }
415
576
 
416
- export { type APIApplication, type APIApplicationConfig, type APIApplicationCustomDomain, type APIApplicationDeployment, type APIApplicationDnsRecord, type APIApplicationEnvironment, type APIApplicationFile, type APIApplicationFileContent, type APIApplicationFileTree, type APIApplicationFileUpload, type APIApplicationGithub, type APIApplicationMetric, type APIApplicationNetwork, type APIApplicationOperationResponse, type APIApplicationRealtimeEvent, type APIApplicationRuntime, type APIApplicationRuntimes, type APIApplicationScanSuggestions, type APIApplicationShieldCooldown, type APIApplicationStatus, type APIApplicationStatusShort, type APIApplicationSubdomain, type APIApplicationWebPublish, type APIApplicationWebhook, type APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationStatus, ApplicationType, ApplicationVersion, ShieldIncidentDirection, ShieldIncidentReason };
577
+ export { type APIApplication, type APIApplicationConfig, type APIApplicationCustomDomain, type APIApplicationDeploySettings, type APIApplicationDeployment, type APIApplicationDnsRecord, type APIApplicationEnvironment, type APIApplicationFile, type APIApplicationFileContent, type APIApplicationFileTree, type APIApplicationFileUpload, type APIApplicationGithub, type APIApplicationMetric, type APIApplicationNetwork, type APIApplicationOperationResponse, type APIApplicationRealtimeEvent, type APIApplicationRelease, type APIApplicationReleaseLog, type APIApplicationRollbackPreview, type APIApplicationRuntime, type APIApplicationRuntimes, type APIApplicationScanSuggestions, type APIApplicationShieldCooldown, type APIApplicationStatus, type APIApplicationStatusShort, type APIApplicationSubdomain, type APIApplicationWebPublish, type APIApplicationWebhook, type APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationEnvironmentChange, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationReleaseSource, ApplicationReleaseStatus, ApplicationStatus, ApplicationType, ApplicationVersion, ApplicationZeroDowntime, ShieldIncidentDirection, ShieldIncidentReason };
@@ -23,13 +23,17 @@ __export(application_exports, {
23
23
  ApplicationCluster: () => ApplicationCluster,
24
24
  ApplicationDnsRecordStatus: () => ApplicationDnsRecordStatus,
25
25
  ApplicationDnsRecordType: () => ApplicationDnsRecordType,
26
+ ApplicationEnvironmentChange: () => ApplicationEnvironmentChange,
26
27
  ApplicationFileContentType: () => ApplicationFileContentType,
27
28
  ApplicationFileType: () => ApplicationFileType,
28
29
  ApplicationLanguage: () => ApplicationLanguage,
29
30
  ApplicationRealtimeEventType: () => ApplicationRealtimeEventType,
31
+ ApplicationReleaseSource: () => ApplicationReleaseSource,
32
+ ApplicationReleaseStatus: () => ApplicationReleaseStatus,
30
33
  ApplicationStatus: () => ApplicationStatus,
31
34
  ApplicationType: () => ApplicationType,
32
35
  ApplicationVersion: () => ApplicationVersion,
36
+ ApplicationZeroDowntime: () => ApplicationZeroDowntime,
33
37
  ShieldIncidentDirection: () => ShieldIncidentDirection,
34
38
  ShieldIncidentReason: () => ShieldIncidentReason
35
39
  });
@@ -71,6 +75,32 @@ var ApplicationVersion = {
71
75
  var ApplicationFileContentType = {
72
76
  BASE64: "base64"
73
77
  };
78
+ var ApplicationZeroDowntime = {
79
+ AUTO: "auto",
80
+ ON: "on",
81
+ OFF: "off"
82
+ };
83
+ var ApplicationReleaseSource = {
84
+ GITHUB: "github",
85
+ CLI: "cli",
86
+ UPLOAD: "upload",
87
+ EDITOR: "editor",
88
+ ROLLBACK: "rollback",
89
+ ENV_CHANGE: "env_change"
90
+ };
91
+ var ApplicationReleaseStatus = {
92
+ DEPLOYING: "deploying",
93
+ ACTIVE: "active",
94
+ SUPERSEDED: "superseded",
95
+ FAILED: "failed",
96
+ ROLLED_BACK: "rolled_back",
97
+ EXPIRED: "expired"
98
+ };
99
+ var ApplicationEnvironmentChange = {
100
+ ADDED: "added",
101
+ MODIFIED: "modified",
102
+ REMOVED: "removed"
103
+ };
74
104
  var ApplicationDnsRecordType = {
75
105
  CNAME: "CNAME",
76
106
  TXT: "TXT"
@@ -97,13 +127,17 @@ var ApplicationRealtimeEventType = {
97
127
  ApplicationCluster,
98
128
  ApplicationDnsRecordStatus,
99
129
  ApplicationDnsRecordType,
130
+ ApplicationEnvironmentChange,
100
131
  ApplicationFileContentType,
101
132
  ApplicationFileType,
102
133
  ApplicationLanguage,
103
134
  ApplicationRealtimeEventType,
135
+ ApplicationReleaseSource,
136
+ ApplicationReleaseStatus,
104
137
  ApplicationStatus,
105
138
  ApplicationType,
106
139
  ApplicationVersion,
140
+ ApplicationZeroDowntime,
107
141
  ShieldIncidentDirection,
108
142
  ShieldIncidentReason
109
143
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["application.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationLanguage = \"javascript\" | \"typescript\" | \"bun\" | \"python\" | \"static\" | \"php\" | \"go\" | \"ruby\" | \"java\" | \"rust\";\nexport const ApplicationLanguage = {\n\tJAVASCRIPT: \"javascript\",\n\tTYPESCRIPT: \"typescript\",\n\tBUN: \"bun\",\n\tPYTHON: \"python\",\n\tSTATIC: \"static\",\n\tPHP: \"php\",\n\tGO: \"go\",\n\tRUBY: \"ruby\",\n\tJAVA: \"java\",\n\tRUST: \"rust\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationStatus = \"up\" | \"down\";\nexport const ApplicationStatus = {\n\tUP: \"up\",\n\tDOWN: \"down\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationCluster = number;\nexport const ApplicationCluster = {\n\tUSA_1: 1,\n\tUSA_2: 2,\n\tUSA_3: 3,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationType = 1 | 2;\nexport const ApplicationType = {\n\tBOT: 1,\n\tWEBSITE: 2,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type ApplicationFileType = \"file\" | \"directory\";\nexport const ApplicationFileType = {\n\tFILE: \"file\",\n\tDIRECTORY: \"directory\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationVersion = \"recommended\" | \"latest\" | \"auto\" | (string & {});\nexport const ApplicationVersion = {\n\tRECOMMENDED: \"recommended\",\n\tLATEST: \"latest\",\n\tAUTO: \"auto\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type ApplicationFileContentType = \"base64\";\nexport const ApplicationFileContentType = {\n\tBASE64: \"base64\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface APIApplicationFile {\n\ttype: ApplicationFileType;\n\tname: string;\n\tpath: string;\n\tsize?: string;\n\tlast_modified: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport interface APIApplicationFileTree extends APIApplicationFile {\n\tchildren?: APIApplicationFileTree[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface APIApplicationFileContent {\n\ttype: \"base64\";\n\t/** File bytes in standard base64 (with padding). */\n\tdata: string;\n\t/** Actual size in bytes (not the length of the base64 string). */\n\tsize: number;\n\t/** File mtime; send it back on PUT (`last_modified`) to detect edit conflicts. */\n\tlast_modified: ISODateString;\n}\n\n/**\n * Successful ZIP upload through `POST /v1/apps/:id/files/upload`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface APIApplicationFileUpload {\n\tapp_id: SnowFlake;\n\tupdated_at: ISODateString;\n\tmissing_dependencies: string[];\n\tremoved_directories: string[];\n}\n\n/**\n * Repository linked to the application for auto-deploy. The webhook URL is not included here.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationGithub {\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplication {\n\tid: SnowFlake;\n\tcluster: ApplicationCluster;\n\ttype: ApplicationType;\n\tname: string;\n\tdescription?: string;\n\towner_id: string; // UUID\n\towner_plan_id: UserPlan; // Owner's plan\n\tlanguage: ApplicationLanguage;\n\tram: number;\n\tstatus: ApplicationStatus;\n\tsubdomain: string | null; // example: \"my-app.vertraweb.app\"\n\t/**\n\t * Canonical public URL of the app, computed by the server (`custom_domain` > `subdomain` >\n\t * `null`). Clients should use it as-is instead of building the URL from the subdomain.\n\t */\n\tpublic_url: string | null;\n\t/**\n\t * GitHub integration of this application, if any. `null` = the source is a zip (or snapshot).\n\t * May be absent in older payloads. The webhook URL is available from\n\t * `GET /v1/apps/:id/deploys/webhook`.\n\t */\n\tgithub?: APIApplicationGithub | null;\n\tcustom_domain: string | null; // example: \"my-app.com.br\"\n\tlast_snapshot: ISODateString | null;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n\tmain_file: string;\n\tversion: ApplicationVersion;\n\tstart_command: string | null;\n\t/**\n\t * Build command, run once per deploy, after dependencies are installed and before the app\n\t * starts — in the build environment, with more memory than the app. `null` = no build step.\n\t * If it fails, the deploy fails and the app does not start.\n\t */\n\tbuild_command: string | null;\n\toffline_since: ISODateString | null;\n\tmissing_dependencies?: string[]; // Undeclared packages detected on build/deploy\n\t/** Active Vertra Shield containment (burst/rate limit); `null` when there is none. */\n\tshield_cooldown: APIApplicationShieldCooldown | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationNetwork {\n\ttotal: string;\n\tnow: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport interface APIApplicationStatus {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** @deprecated Not returned by `GET /v1/apps/:id/status`; use `running`. */\n\tstatus?: ApplicationStatus;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\tstorage: string;\n\t/** `null` when network usage is unavailable (e.g. the app is stopped). */\n\tnetwork: APIApplicationNetwork | null;\n\tuptime: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport interface APIApplicationStatusShort {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** Absent when the app's status could not be read. */\n\tstorage?: string;\n\t/** Absent when the app's status could not be read; `null` when network usage is unavailable. */\n\tnetwork?: APIApplicationNetwork | null;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\t/**\n\t * Seconds since the app started.\n\t *\n\t * A duration, not a point in time — hence `number` rather than `ISODateString`. Same unit and\n\t * type as `APIApplicationStatus.uptime`.\n\t *\n\t * `null` when unknown (the app is stopped or its status could not be read). **`0` is never used\n\t * as a sentinel** — `0` means \"just started\".\n\t */\n\tuptime: number | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface APIApplicationMetric {\n\tcpu: number;\n\tram: number;\n\tstorage: number;\n\tdate: ISODateString;\n\tnetwork: number[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface APIApplicationConfig {\n\tNAME: string;\n\tMEMORY: number;\n\tMAIN: string;\n\tVERSION: ApplicationVersion;\n\tDESCRIPTION?: string;\n\tSTART?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tBUILD?: string;\n\tSUBDOMAIN?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport interface APIApplicationEnvironment {\n\tid: string;\n\tkey: string;\n\tvalue: string;\n\tnote: string | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport interface APIApplicationOperationResponse {\n\tstatus: \"success\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport interface APIApplicationDeployment {\n\tapp_id: SnowFlake;\n\tcommit_id: string;\n\tmessage: string;\n\tpusher: string;\n\tbranch: string;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordType = \"CNAME\" | \"TXT\";\nexport const ApplicationDnsRecordType = {\n\tCNAME: \"CNAME\",\n\tTXT: \"TXT\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordStatus = \"active\" | \"pending_validation\";\nexport const ApplicationDnsRecordStatus = {\n\tACTIVE: \"active\",\n\tPENDING_VALIDATION: \"pending_validation\",\n} as const;\n\n/**\n * DNS record the user must create at their DNS provider for the custom domain.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport interface APIApplicationDnsRecord {\n\ttype: ApplicationDnsRecordType;\n\tname: string;\n\tvalue: string;\n\tstatus: ApplicationDnsRecordStatus;\n}\n\n/**\n * Returned when the auto-deploy webhook is created.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface APIApplicationWebhookUrl {\n\turl: string;\n}\n\n/**\n * Auto-deploy webhook of an application and the repository it is linked to.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport interface APIApplicationWebhook {\n\twebhook_url: string;\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface APIApplicationSubdomain {\n\t/** Full hostname (`my-app.vertraweb.app`). */\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface APIApplicationCustomDomain {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentReason = \"burst\" | \"rate_limit\";\nexport const ShieldIncidentReason = {\n\tBURST: \"burst\",\n\tRATE_LIMIT: \"rate_limit\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentDirection = \"in\" | \"out\";\nexport const ShieldIncidentDirection = {\n\tIN: \"in\",\n\tOUT: \"out\",\n} as const;\n\n/**\n * Active Vertra Shield containment on this application (bandwidth limit after a burst/rate limit).\n * `null` when no containment is in effect.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationShieldCooldown {\n\tuntil: ISODateString;\n\treason: ShieldIncidentReason;\n\tdirection: ShieldIncidentDirection;\n\tstrikes: number;\n}\n\n/**\n * Web publishing state of an application.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface APIApplicationWebPublish {\n\t/** `null` when web publishing is off. */\n\tsubdomain: string | null;\n\tcustom_domain: string | null;\n\ttype: ApplicationType;\n}\n\n/**\n * Suggestions from scanning the zip before creating an application. Nothing is applied\n * automatically: they are meant to pre-fill a creation form that the user can edit.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface APIApplicationScanSuggestions {\n\tsuggested_start_command?: string;\n\tsuggested_build_command?: string;\n\tsuggested_memory_mb?: number;\n\tsuggested_public_web?: boolean;\n\tmissing_dependencies?: string[];\n}\n\n/**\n * One runtime of `GET /v1/apps/runtimes`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport interface APIApplicationRuntime {\n\t/** Recommended version for new applications. */\n\trecommended: string;\n\tlatest: string;\n\t/** Other exact versions that can be pinned. Empty for runtimes without version pinning. */\n\tspecific: string[];\n}\n\n/**\n * Catalog of supported runtimes, keyed by language.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type APIApplicationRuntimes = Record<ApplicationLanguage, APIApplicationRuntime>;\n\n/**\n * `event` field of the `GET /v1/apps/:id/realtime` stream (`text/event-stream`).\n * `logs` = application output (one or more lines); `system` = stream/platform notices (e.g.\n * `install_note:started`); `heartbeat` = keep-alive, no content.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type ApplicationRealtimeEventType = \"logs\" | \"system\" | \"heartbeat\";\nexport const ApplicationRealtimeEventType = {\n\tLOGS: \"logs\",\n\tSYSTEM: \"system\",\n\tHEARTBEAT: \"heartbeat\",\n} as const;\n\n/**\n * One server-sent event of `GET /v1/apps/:id/realtime`. `data` is plain text, not JSON; a `logs`\n * event may carry several lines separated by `\\n`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface APIApplicationRealtimeEvent {\n\tevent: ApplicationRealtimeEventType;\n\tdata: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,sBAAsB;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAMO,IAAM,oBAAoB;AAAA,EAChC,IAAI;AAAA,EACJ,MAAM;AACP;AAMO,IAAM,qBAAqB;AAAA,EACjC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;AAMO,IAAM,kBAAkB;AAAA,EAC9B,KAAK;AAAA,EACL,SAAS;AACV;AAMO,IAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,EACN,WAAW;AACZ;AAMO,IAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AACP;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AACT;AA6NO,IAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,KAAK;AACN;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AAAA,EACR,oBAAoB;AACrB;AAmDO,IAAM,uBAAuB;AAAA,EACnC,OAAO;AAAA,EACP,YAAY;AACb;AAMO,IAAM,0BAA0B;AAAA,EACtC,IAAI;AAAA,EACJ,KAAK;AACN;AAkEO,IAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AACZ;","names":[]}
1
+ {"version":3,"sources":["application.ts"],"sourcesContent":["import type { ISODateString, SnowFlake, UserPlan } from \"../../v1\";\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationLanguage = \"javascript\" | \"typescript\" | \"bun\" | \"python\" | \"static\" | \"php\" | \"go\" | \"ruby\" | \"java\" | \"rust\";\nexport const ApplicationLanguage = {\n\tJAVASCRIPT: \"javascript\",\n\tTYPESCRIPT: \"typescript\",\n\tBUN: \"bun\",\n\tPYTHON: \"python\",\n\tSTATIC: \"static\",\n\tPHP: \"php\",\n\tGO: \"go\",\n\tRUBY: \"ruby\",\n\tJAVA: \"java\",\n\tRUST: \"rust\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationStatus = \"up\" | \"down\";\nexport const ApplicationStatus = {\n\tUP: \"up\",\n\tDOWN: \"down\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationCluster = number;\nexport const ApplicationCluster = {\n\tUSA_1: 1,\n\tUSA_2: 2,\n\tUSA_3: 3,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationType = 1 | 2;\nexport const ApplicationType = {\n\tBOT: 1,\n\tWEBSITE: 2,\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport type ApplicationFileType = \"file\" | \"directory\";\nexport const ApplicationFileType = {\n\tFILE: \"file\",\n\tDIRECTORY: \"directory\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ApplicationVersion = \"recommended\" | \"latest\" | \"auto\" | (string & {});\nexport const ApplicationVersion = {\n\tRECOMMENDED: \"recommended\",\n\tLATEST: \"latest\",\n\tAUTO: \"auto\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport type ApplicationFileContentType = \"base64\";\nexport const ApplicationFileContentType = {\n\tBASE64: \"base64\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/files\n */\nexport interface APIApplicationFile {\n\ttype: ApplicationFileType;\n\tname: string;\n\tpath: string;\n\tsize?: string;\n\tlast_modified: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/tree\n */\nexport interface APIApplicationFileTree extends APIApplicationFile {\n\tchildren?: APIApplicationFileTree[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/content\n */\nexport interface APIApplicationFileContent {\n\ttype: \"base64\";\n\t/** File bytes in standard base64 (with padding). */\n\tdata: string;\n\t/** Actual size in bytes (not the length of the base64 string). */\n\tsize: number;\n\t/** File mtime; send it back on PUT (`last_modified`) to detect edit conflicts. */\n\tlast_modified: ISODateString;\n}\n\n/**\n * Successful ZIP upload through `POST /v1/apps/:id/files/upload`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/filemanager/upload\n */\nexport interface APIApplicationFileUpload {\n\tapp_id: SnowFlake;\n\tupdated_at: ISODateString;\n\tmissing_dependencies: string[];\n\tremoved_directories: string[];\n}\n\n/**\n * Repository linked to the application for auto-deploy. The webhook URL is not included here.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationGithub {\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * How a new deploy replaces the running version. `auto` = without downtime only when the app receives\n * traffic through web publishing, otherwise with downtime; `on` = always without downtime (Enterprise);\n * `off` = the running version stops before the new one starts.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport type ApplicationZeroDowntime = \"auto\" | \"on\" | \"off\";\nexport const ApplicationZeroDowntime = {\n\tAUTO: \"auto\",\n\tON: \"on\",\n\tOFF: \"off\",\n} as const;\n\n/**\n * Deploy behavior of an application. Changed with `PATCH /v1/apps/:id/config` (`deploy`).\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/updateconfig\n */\nexport interface APIApplicationDeploySettings {\n\t/** The saved choice. Defaults to `auto`. */\n\tzero_downtime: ApplicationZeroDowntime;\n\t/**\n\t * Whether the next deploy runs without downtime. `true` on Enterprise when `zero_downtime` is `on`,\n\t * or when it is `auto` and the app receives traffic through web publishing.\n\t */\n\tzero_downtime_active: boolean;\n\t/**\n\t * If the new version stops within 60 seconds after a deploy, the platform switches back to the\n\t * previous version, once. Acts from the Intermediary plan; the saved value is returned on any plan.\n\t */\n\tauto_rollback: boolean;\n\t/**\n\t * HTTP path the platform calls on the new version before it receives traffic. Any HTTP response,\n\t * including 404, counts as healthy; a refused connection, a timeout or a 5xx counts as a failure.\n\t * Starts with `/`, at most 200 characters, printable ASCII only with no spaces; percent-encode anything\n\t * else (`%20`, `%C3%A9`). `null` = `/`.\n\t */\n\thealth_check_path: string | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplication {\n\tid: SnowFlake;\n\tcluster: ApplicationCluster;\n\ttype: ApplicationType;\n\tname: string;\n\tdescription?: string;\n\towner_id: string; // UUID\n\towner_plan_id: UserPlan; // Owner's plan\n\tlanguage: ApplicationLanguage;\n\tram: number;\n\tstatus: ApplicationStatus;\n\tsubdomain: string | null; // example: \"my-app.vertraweb.app\"\n\t/**\n\t * Canonical public URL of the app, computed by the server (`custom_domain` > `subdomain` >\n\t * `null`). Clients should use it as-is instead of building the URL from the subdomain.\n\t */\n\tpublic_url: string | null;\n\t/**\n\t * GitHub integration of this application, if any. `null` = the source is a zip (or snapshot).\n\t * May be absent in older payloads. The webhook URL is available from\n\t * `GET /v1/apps/:id/deploys/webhook`.\n\t */\n\tgithub?: APIApplicationGithub | null;\n\tcustom_domain: string | null; // example: \"my-app.com.br\"\n\tlast_snapshot: ISODateString | null;\n\tcreated_at: ISODateString;\n\tupdated_at: ISODateString;\n\tmain_file: string;\n\tversion: ApplicationVersion;\n\tstart_command: string | null;\n\t/**\n\t * Build command, run once per deploy, after dependencies are installed and before the app\n\t * starts — in the build environment, with more memory than the app. `null` = no build step.\n\t * If it fails, the deploy fails and the app does not start.\n\t */\n\tbuild_command: string | null;\n\toffline_since: ISODateString | null;\n\tmissing_dependencies?: string[]; // Undeclared packages detected on build/deploy\n\t/** Active Vertra Shield containment (burst/rate limit); `null` when there is none. */\n\tshield_cooldown: APIApplicationShieldCooldown | null;\n\t/** Deploy behavior: zero downtime, automatic rollback and health check. */\n\tdeploy: APIApplicationDeploySettings;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationNetwork {\n\ttotal: string;\n\tnow: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/status\n */\nexport interface APIApplicationStatus {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** @deprecated Not returned by `GET /v1/apps/:id/status`; use `running`. */\n\tstatus?: ApplicationStatus;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\tstorage: string;\n\t/** `null` when network usage is unavailable (e.g. the app is stopped). */\n\tnetwork: APIApplicationNetwork | null;\n\tuptime: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/allstatus\n */\nexport interface APIApplicationStatusShort {\n\tid: SnowFlake;\n\tcpu: string;\n\tram: string;\n\t/** Absent when the app's status could not be read. */\n\tstorage?: string;\n\t/** Absent when the app's status could not be read; `null` when network usage is unavailable. */\n\tnetwork?: APIApplicationNetwork | null;\n\trunning: boolean;\n\t/**\n\t * `true` while dependencies are being installed.\n\t *\n\t * During this window the app itself is not running yet, so `running: false` alone does not\n\t * mean the app is stopped. Optional: omitted when no installation is in progress.\n\t */\n\tinstalling?: boolean;\n\t/**\n\t * Seconds since the app started.\n\t *\n\t * A duration, not a point in time — hence `number` rather than `ISODateString`. Same unit and\n\t * type as `APIApplicationStatus.uptime`.\n\t *\n\t * `null` when unknown (the app is stopped or its status could not be read). **`0` is never used\n\t * as a sentinel** — `0` means \"just started\".\n\t */\n\tuptime: number | null;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/metrics\n */\nexport interface APIApplicationMetric {\n\tcpu: number;\n\tram: number;\n\tstorage: number;\n\tdate: ISODateString;\n\tnetwork: number[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/create\n */\nexport interface APIApplicationConfig {\n\tNAME: string;\n\tMEMORY: number;\n\tMAIN: string;\n\tVERSION: ApplicationVersion;\n\tDESCRIPTION?: string;\n\tSTART?: string;\n\t/** Build command (see `APIApplication.build_command`). */\n\tBUILD?: string;\n\tSUBDOMAIN?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/enviroments/get\n */\nexport interface APIApplicationEnvironment {\n\tid: string;\n\tkey: string;\n\tvalue: string;\n\tnote: string | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/start\n */\nexport interface APIApplicationOperationResponse {\n\tstatus: \"success\";\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/recents\n */\nexport interface APIApplicationDeployment {\n\tapp_id: SnowFlake;\n\tcommit_id: string;\n\tmessage: string;\n\tpusher: string;\n\tbranch: string;\n\tcreated_at: ISODateString;\n}\n\n/**\n * How a release was created.\n * `github` = push to the connected repository; `cli` = the Vertra CLI; `upload` = upload from the\n * dashboard, an SDK or an extension; `editor` = edits made in the file manager; `rollback` = a\n * release that restores an earlier one; `env_change` = a change to the environment variables only.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseSource = \"github\" | \"cli\" | \"upload\" | \"editor\" | \"rollback\" | \"env_change\";\nexport const ApplicationReleaseSource = {\n\tGITHUB: \"github\",\n\tCLI: \"cli\",\n\tUPLOAD: \"upload\",\n\tEDITOR: \"editor\",\n\tROLLBACK: \"rollback\",\n\tENV_CHANGE: \"env_change\",\n} as const;\n\n/**\n * Lifecycle of a release. `deploying` = being built and started; `active` = the application's current\n * code, one per application (see `first_started_at`: files committed without a restart are `active`\n * before the application runs them); `superseded` = replaced by a newer release; `failed` = the\n * application stopped right after this release was deployed and the platform rolled back to the\n * previous one; `rolled_back` = the active release was replaced by a rollback; `expired` = its code is\n * no longer kept.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport type ApplicationReleaseStatus = \"deploying\" | \"active\" | \"superseded\" | \"failed\" | \"rolled_back\" | \"expired\";\nexport const ApplicationReleaseStatus = {\n\tDEPLOYING: \"deploying\",\n\tACTIVE: \"active\",\n\tSUPERSEDED: \"superseded\",\n\tFAILED: \"failed\",\n\tROLLED_BACK: \"rolled_back\",\n\tEXPIRED: \"expired\",\n} as const;\n\n/**\n * One version of an application's code, kept so it can be listed and, when the plan allows it,\n * restored. The list is newest first. A release stays listed after its code expires.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/list\n */\nexport interface APIApplicationRelease {\n\tid: SnowFlake;\n\tapp_id: SnowFlake;\n\tsource: ApplicationReleaseSource;\n\tstatus: ApplicationReleaseStatus;\n\t/** Commit or upload message. `null` when none was given, and always `null` for file manager edits. */\n\tmessage: string | null;\n\t/** The GitHub pusher, or the name of the user who uploaded or edited the files. */\n\tauthor: string;\n\t/** The GitHub push that produced this release. `null` for any other source. */\n\tgithub: APIApplicationDeployment | null;\n\t/** Number of files changed by the operation that produced this release. */\n\tfiles_changed: number;\n\trollback: {\n\t\t/**\n\t\t * `false` for the active release, for an expired release, and when the plan does not allow\n\t\t * rolling back to this release.\n\t\t */\n\t\tavailable: boolean;\n\t\t/**\n\t\t * When this release's code stops being kept, counted from the moment it stopped being the active\n\t\t * release. `null` for the active release and when no code was kept.\n\t\t */\n\t\texpires_at: ISODateString | null;\n\t\t/** The release this one restores, when `source` is `rollback`. `null` otherwise. */\n\t\tfrom: SnowFlake | null;\n\t};\n\t/** `true` when a crash log was recorded for this release. The log can still expire; see the log endpoint. */\n\thas_log: boolean;\n\t/**\n\t * Time, in milliseconds, the platform took to install dependencies, build and start this release.\n\t * `null` when the release was not deployed with a build (for example, files committed without a restart).\n\t */\n\tbuild_duration_ms: number | null;\n\t/**\n\t * When the application first started with this release's code. `null` while the code is in the\n\t * application folder but the application has not been started with it yet (for example, files\n\t * committed without a restart): changes only take effect after a restart.\n\t */\n\tfirst_started_at: ISODateString | null;\n\tcreated_at: ISODateString;\n}\n\n/**\n * Crash log of a release. `content` is `null` when there is no log or it has expired.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/log\n */\nexport interface APIApplicationReleaseLog {\n\tcontent: string | null;\n}\n\n/**\n * How an environment variable changes if a rollback restores the release's variables, compared with the\n * active release. `added` = the release has it and the active release does not; `removed` = the active\n * release has it and the release does not; `modified` = both have it with different values.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport type ApplicationEnvironmentChange = \"added\" | \"modified\" | \"removed\";\nexport const ApplicationEnvironmentChange = {\n\tADDED: \"added\",\n\tMODIFIED: \"modified\",\n\tREMOVED: \"removed\",\n} as const;\n\n/**\n * What a rollback to a release would change in the environment variables. Only variable names and the\n * kind of change are returned, never values. Sorted by key. Empty when the release has no stored variables.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/releases/rollback-preview\n */\nexport interface APIApplicationRollbackPreview {\n\tenvironment_changes: { key: string; change: ApplicationEnvironmentChange }[];\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordType = \"CNAME\" | \"TXT\";\nexport const ApplicationDnsRecordType = {\n\tCNAME: \"CNAME\",\n\tTXT: \"TXT\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport type ApplicationDnsRecordStatus = \"active\" | \"pending_validation\";\nexport const ApplicationDnsRecordStatus = {\n\tACTIVE: \"active\",\n\tPENDING_VALIDATION: \"pending_validation\",\n} as const;\n\n/**\n * DNS record the user must create at their DNS provider for the custom domain.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/dns\n */\nexport interface APIApplicationDnsRecord {\n\ttype: ApplicationDnsRecordType;\n\tname: string;\n\tvalue: string;\n\tstatus: ApplicationDnsRecordStatus;\n}\n\n/**\n * Returned when the auto-deploy webhook is created.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/create\n */\nexport interface APIApplicationWebhookUrl {\n\turl: string;\n}\n\n/**\n * Auto-deploy webhook of an application and the repository it is linked to.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/deploys/webhookurl\n */\nexport interface APIApplicationWebhook {\n\twebhook_url: string;\n\trepo_owner: string;\n\trepo_name: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/subdomain\n */\nexport interface APIApplicationSubdomain {\n\t/** Full hostname (`my-app.vertraweb.app`). */\n\tsubdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/customdomain\n */\nexport interface APIApplicationCustomDomain {\n\tdomain: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentReason = \"burst\" | \"rate_limit\";\nexport const ShieldIncidentReason = {\n\tBURST: \"burst\",\n\tRATE_LIMIT: \"rate_limit\",\n} as const;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport type ShieldIncidentDirection = \"in\" | \"out\";\nexport const ShieldIncidentDirection = {\n\tIN: \"in\",\n\tOUT: \"out\",\n} as const;\n\n/**\n * Active Vertra Shield containment on this application (bandwidth limit after a burst/rate limit).\n * `null` when no containment is in effect.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/get\n */\nexport interface APIApplicationShieldCooldown {\n\tuntil: ISODateString;\n\treason: ShieldIncidentReason;\n\tdirection: ShieldIncidentDirection;\n\tstrikes: number;\n}\n\n/**\n * Web publishing state of an application.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/network/publish\n */\nexport interface APIApplicationWebPublish {\n\t/** `null` when web publishing is off. */\n\tsubdomain: string | null;\n\tcustom_domain: string | null;\n\ttype: ApplicationType;\n}\n\n/**\n * Suggestions from scanning the zip before creating an application. Nothing is applied\n * automatically: they are meant to pre-fill a creation form that the user can edit.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/scan\n */\nexport interface APIApplicationScanSuggestions {\n\tsuggested_start_command?: string;\n\tsuggested_build_command?: string;\n\tsuggested_memory_mb?: number;\n\tsuggested_public_web?: boolean;\n\tmissing_dependencies?: string[];\n}\n\n/**\n * One runtime of `GET /v1/apps/runtimes`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport interface APIApplicationRuntime {\n\t/** Recommended version for new applications. */\n\trecommended: string;\n\tlatest: string;\n\t/** Other exact versions that can be pinned. Empty for runtimes without version pinning. */\n\tspecific: string[];\n}\n\n/**\n * Catalog of supported runtimes, keyed by language.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/runtimes\n */\nexport type APIApplicationRuntimes = Record<ApplicationLanguage, APIApplicationRuntime>;\n\n/**\n * `event` field of the `GET /v1/apps/:id/realtime` stream (`text/event-stream`).\n * `logs` = application output (one or more lines); `system` = stream/platform notices (e.g.\n * `install_note:started`, `deploy_note:failed:<release_id>`, `deploy_note:rollback:<from>:<to>`,\n * `deploy_note:discarded:<release_id>` (Enterprise zero-downtime: the new release did not become healthy\n * and was dropped; the previous one keeps running), where `<from>` and `<to>` identify the releases\n * involved); `heartbeat` = keep-alive, no content.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport type ApplicationRealtimeEventType = \"logs\" | \"system\" | \"heartbeat\";\nexport const ApplicationRealtimeEventType = {\n\tLOGS: \"logs\",\n\tSYSTEM: \"system\",\n\tHEARTBEAT: \"heartbeat\",\n} as const;\n\n/**\n * One server-sent event of `GET /v1/apps/:id/realtime`. `data` is plain text, not JSON; a `logs`\n * event may carry several lines separated by `\\n`.\n * @see https://docs.vertracloud.app/api-reference/endpoint/apps/realtime\n */\nexport interface APIApplicationRealtimeEvent {\n\tevent: ApplicationRealtimeEventType;\n\tdata: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,sBAAsB;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAMO,IAAM,oBAAoB;AAAA,EAChC,IAAI;AAAA,EACJ,MAAM;AACP;AAMO,IAAM,qBAAqB;AAAA,EACjC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;AAMO,IAAM,kBAAkB;AAAA,EAC9B,KAAK;AAAA,EACL,SAAS;AACV;AAMO,IAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,EACN,WAAW;AACZ;AAMO,IAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AACP;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AACT;AA8DO,IAAM,0BAA0B;AAAA,EACtC,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,KAAK;AACN;AA2MO,IAAM,2BAA2B;AAAA,EACvC,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AACb;AAaO,IAAM,2BAA2B;AAAA,EACvC,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AACV;AAoEO,IAAM,+BAA+B;AAAA,EAC3C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AACV;AAgBO,IAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,KAAK;AACN;AAMO,IAAM,6BAA6B;AAAA,EACzC,QAAQ;AAAA,EACR,oBAAoB;AACrB;AAmDO,IAAM,uBAAuB;AAAA,EACnC,OAAO;AAAA,EACP,YAAY;AACb;AAMO,IAAM,0BAA0B;AAAA,EACtC,IAAI;AAAA,EACJ,KAAK;AACN;AAqEO,IAAM,+BAA+B;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,WAAW;AACZ;","names":[]}
@@ -36,6 +36,32 @@ var ApplicationVersion = {
36
36
  var ApplicationFileContentType = {
37
37
  BASE64: "base64"
38
38
  };
39
+ var ApplicationZeroDowntime = {
40
+ AUTO: "auto",
41
+ ON: "on",
42
+ OFF: "off"
43
+ };
44
+ var ApplicationReleaseSource = {
45
+ GITHUB: "github",
46
+ CLI: "cli",
47
+ UPLOAD: "upload",
48
+ EDITOR: "editor",
49
+ ROLLBACK: "rollback",
50
+ ENV_CHANGE: "env_change"
51
+ };
52
+ var ApplicationReleaseStatus = {
53
+ DEPLOYING: "deploying",
54
+ ACTIVE: "active",
55
+ SUPERSEDED: "superseded",
56
+ FAILED: "failed",
57
+ ROLLED_BACK: "rolled_back",
58
+ EXPIRED: "expired"
59
+ };
60
+ var ApplicationEnvironmentChange = {
61
+ ADDED: "added",
62
+ MODIFIED: "modified",
63
+ REMOVED: "removed"
64
+ };
39
65
  var ApplicationDnsRecordType = {
40
66
  CNAME: "CNAME",
41
67
  TXT: "TXT"
@@ -61,13 +87,17 @@ export {
61
87
  ApplicationCluster,
62
88
  ApplicationDnsRecordStatus,
63
89
  ApplicationDnsRecordType,
90
+ ApplicationEnvironmentChange,
64
91
  ApplicationFileContentType,
65
92
  ApplicationFileType,
66
93
  ApplicationLanguage,
67
94
  ApplicationRealtimeEventType,
95
+ ApplicationReleaseSource,
96
+ ApplicationReleaseStatus,
68
97
  ApplicationStatus,
69
98
  ApplicationType,
70
99
  ApplicationVersion,
100
+ ApplicationZeroDowntime,
71
101
  ShieldIncidentDirection,
72
102
  ShieldIncidentReason
73
103
  };
@@ -1,7 +1,7 @@
1
1
  export { APIActivity, ActivityOrigin, ActivityStatus, ActivityTargetType } from './activity.js';
2
2
  export { APIApiKey, APIApiKeyCreated, APIApiKeyPreset, APIApiKeyRoute, APIApiKeyRouteMethod, APIApiKeyScope, APIApiKeyScopeEntry, API_KEY_MAX_ALLOWED_IPS, API_KEY_MAX_PER_USER, API_KEY_NAME_MAX_LENGTH, API_KEY_SCOPES, API_KEY_SCOPE_LIST, apiKeyPresetScopes } from './api-key.js';
3
3
  export { APIErrorCode, API_ERROR_CODES } from './api-error.js';
4
- export { APIApplication, APIApplicationConfig, APIApplicationCustomDomain, APIApplicationDeployment, APIApplicationDnsRecord, APIApplicationEnvironment, APIApplicationFile, APIApplicationFileContent, APIApplicationFileTree, APIApplicationFileUpload, APIApplicationGithub, APIApplicationMetric, APIApplicationNetwork, APIApplicationOperationResponse, APIApplicationRealtimeEvent, APIApplicationRuntime, APIApplicationRuntimes, APIApplicationScanSuggestions, APIApplicationShieldCooldown, APIApplicationStatus, APIApplicationStatusShort, APIApplicationSubdomain, APIApplicationWebPublish, APIApplicationWebhook, APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationStatus, ApplicationType, ApplicationVersion, ShieldIncidentDirection, ShieldIncidentReason } from './application.js';
4
+ export { APIApplication, APIApplicationConfig, APIApplicationCustomDomain, APIApplicationDeploySettings, APIApplicationDeployment, APIApplicationDnsRecord, APIApplicationEnvironment, APIApplicationFile, APIApplicationFileContent, APIApplicationFileTree, APIApplicationFileUpload, APIApplicationGithub, APIApplicationMetric, APIApplicationNetwork, APIApplicationOperationResponse, APIApplicationRealtimeEvent, APIApplicationRelease, APIApplicationReleaseLog, APIApplicationRollbackPreview, APIApplicationRuntime, APIApplicationRuntimes, APIApplicationScanSuggestions, APIApplicationShieldCooldown, APIApplicationStatus, APIApplicationStatusShort, APIApplicationSubdomain, APIApplicationWebPublish, APIApplicationWebhook, APIApplicationWebhookUrl, ApplicationCluster, ApplicationDnsRecordStatus, ApplicationDnsRecordType, ApplicationEnvironmentChange, ApplicationFileContentType, ApplicationFileType, ApplicationLanguage, ApplicationRealtimeEventType, ApplicationReleaseSource, ApplicationReleaseStatus, ApplicationStatus, ApplicationType, ApplicationVersion, ApplicationZeroDowntime, ShieldIncidentDirection, ShieldIncidentReason } from './application.js';
5
5
  export { APIBillingAddress, APIBillingCard, APIBillingDetails, APIBillingRenewal, APIBillingTaxId, BillingTaxIdType } from './billing.js';
6
6
  export { APIDatabase, APIDatabaseCertificate, APIDatabaseMetrics, APIDatabaseNetwork, APIDatabaseOperationResponse, APIDatabasePasswordReset, APIDatabaseStatus, APIDatabaseStatusShort, DatabaseCluster, DatabaseStatus, DatabaseType } from './database.js';
7
7
  export { APIDatabaseCollection, APIDatabaseColumn, APIDatabaseColumnReference, APIDatabaseDataError, APIDatabaseDataOverview, APIDatabaseDocumentListParams, APIDatabaseDocumentsPage, APIDatabaseIndex, APIDatabaseListParams, APIDatabaseMongoIndex, APIDatabaseQueryResult, APIDatabaseRedisInfo, APIDatabaseRedisKey, APIDatabaseRedisKeyValue, APIDatabaseRedisKeysPage, APIDatabaseRedisScanParams, APIDatabaseRedisZSetMember, APIDatabaseRowFilter, APIDatabaseRowsPage, APIDatabaseSchema, APIDatabaseTable, DatabaseFilterOperator, DatabaseRedisKeyType, DatabaseSortDirection, DatabaseTableKind } from './database-data.js';
@@ -37,13 +37,17 @@ __export(v1_exports, {
37
37
  ApplicationCluster: () => ApplicationCluster,
38
38
  ApplicationDnsRecordStatus: () => ApplicationDnsRecordStatus,
39
39
  ApplicationDnsRecordType: () => ApplicationDnsRecordType,
40
+ ApplicationEnvironmentChange: () => ApplicationEnvironmentChange,
40
41
  ApplicationFileContentType: () => ApplicationFileContentType,
41
42
  ApplicationFileType: () => ApplicationFileType,
42
43
  ApplicationLanguage: () => ApplicationLanguage,
43
44
  ApplicationRealtimeEventType: () => ApplicationRealtimeEventType,
45
+ ApplicationReleaseSource: () => ApplicationReleaseSource,
46
+ ApplicationReleaseStatus: () => ApplicationReleaseStatus,
44
47
  ApplicationStatus: () => ApplicationStatus,
45
48
  ApplicationType: () => ApplicationType,
46
49
  ApplicationVersion: () => ApplicationVersion,
50
+ ApplicationZeroDowntime: () => ApplicationZeroDowntime,
47
51
  BillingTaxIdType: () => BillingTaxIdType,
48
52
  DatabaseCluster: () => DatabaseCluster,
49
53
  DatabaseFilterOperator: () => DatabaseFilterOperator,
@@ -140,6 +144,8 @@ var API_KEY_SCOPES = {
140
144
  { method: "GET", path: "/v1/apps/:id/download" },
141
145
  { method: "GET", path: "/v1/apps/:id/deploys" },
142
146
  { method: "GET", path: "/v1/apps/:id/deploys/webhook" },
147
+ { method: "GET", path: "/v1/apps/:id/releases" },
148
+ { method: "GET", path: "/v1/apps/:id/releases/:release_id/log" },
143
149
  { method: "GET", path: "/v1/apps/:id/network/custom" },
144
150
  { method: "GET", path: "/v1/apps/:id/network/dns" }
145
151
  ]
@@ -159,7 +165,8 @@ var API_KEY_SCOPES = {
159
165
  { method: "POST", path: "/v1/apps/:id/network/purge-cache" },
160
166
  { method: "PATCH", path: "/v1/apps/:id/network/subdomain" },
161
167
  { method: "POST", path: "/v1/apps/:id/network/publish" },
162
- { method: "DELETE", path: "/v1/apps/:id/network/publish" }
168
+ { method: "DELETE", path: "/v1/apps/:id/network/publish" },
169
+ { method: "POST", path: "/v1/apps/:id/releases/:release_id/rollback" }
163
170
  ]
164
171
  },
165
172
  "apps:delete": { group: "apps", routes: [{ method: "DELETE", path: "/v1/apps/:id" }] },
@@ -168,7 +175,8 @@ var API_KEY_SCOPES = {
168
175
  routes: [
169
176
  { method: "GET", path: "/v1/apps/:id/envs" },
170
177
  { method: "POST", path: "/v1/apps/:id/envs" },
171
- { method: "DELETE", path: "/v1/apps/:id/envs/:envId" }
178
+ { method: "DELETE", path: "/v1/apps/:id/envs/:envId" },
179
+ { method: "GET", path: "/v1/apps/:id/releases/:release_id/rollback" }
172
180
  ]
173
181
  },
174
182
  "apps:files": {
@@ -581,13 +589,25 @@ var API_ERROR_CODES = {
581
589
  PATH_IS_FILE: "PATH_IS_FILE",
582
590
  PENDING_ORDER_LIMIT_REACHED: "PENDING_ORDER_LIMIT_REACHED",
583
591
  PAYMENT_METHOD_UNAVAILABLE: "PAYMENT_METHOD_UNAVAILABLE",
592
+ /** 403 — the plan does not include automatic rollback (`deploy.auto_rollback: true` below Intermediary). */
593
+ PLAN_DOES_NOT_SUPPORT_AUTO_ROLLBACK: "PLAN_DOES_NOT_SUPPORT_AUTO_ROLLBACK",
584
594
  PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_DOMAIN",
585
595
  PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN: "PLAN_DOES_NOT_SUPPORT_CUSTOM_SUBDOMAIN",
596
+ /** 403 — the plan does not include rollback to earlier releases. */
597
+ PLAN_DOES_NOT_SUPPORT_ROLLBACK: "PLAN_DOES_NOT_SUPPORT_ROLLBACK",
586
598
  PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH: "PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH",
599
+ /** 403 — the plan does not include zero-downtime deploys (`deploy.zero_downtime: "on"` below Enterprise). */
600
+ PLAN_DOES_NOT_SUPPORT_ZERO_DOWNTIME: "PLAN_DOES_NOT_SUPPORT_ZERO_DOWNTIME",
587
601
  PLAN_MISMATCH_FOR_RENEWAL: "PLAN_MISMATCH_FOR_RENEWAL",
588
602
  PLAN_NOT_ALLOWED: "PLAN_NOT_ALLOWED",
589
603
  RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED",
590
604
  REFUND_AMOUNT_EXCEEDS_PRICE: "REFUND_AMOUNT_EXCEEDS_PRICE",
605
+ /** 409 — the release is already the active one. */
606
+ RELEASE_ALREADY_ACTIVE: "RELEASE_ALREADY_ACTIVE",
607
+ /** 410 — the release's kept code has expired or is outside the limit of the plan. */
608
+ RELEASE_EXPIRED: "RELEASE_EXPIRED",
609
+ /** 404 — the release does not exist or belongs to another application. */
610
+ RELEASE_NOT_FOUND: "RELEASE_NOT_FOUND",
591
611
  REPO_ALREADY_LINKED: "REPO_ALREADY_LINKED",
592
612
  RESTORE_COOLDOWN: "RESTORE_COOLDOWN",
593
613
  SNAPSHOT_ENGINE_MISMATCH: "SNAPSHOT_ENGINE_MISMATCH",
@@ -657,6 +677,32 @@ var ApplicationVersion = {
657
677
  var ApplicationFileContentType = {
658
678
  BASE64: "base64"
659
679
  };
680
+ var ApplicationZeroDowntime = {
681
+ AUTO: "auto",
682
+ ON: "on",
683
+ OFF: "off"
684
+ };
685
+ var ApplicationReleaseSource = {
686
+ GITHUB: "github",
687
+ CLI: "cli",
688
+ UPLOAD: "upload",
689
+ EDITOR: "editor",
690
+ ROLLBACK: "rollback",
691
+ ENV_CHANGE: "env_change"
692
+ };
693
+ var ApplicationReleaseStatus = {
694
+ DEPLOYING: "deploying",
695
+ ACTIVE: "active",
696
+ SUPERSEDED: "superseded",
697
+ FAILED: "failed",
698
+ ROLLED_BACK: "rolled_back",
699
+ EXPIRED: "expired"
700
+ };
701
+ var ApplicationEnvironmentChange = {
702
+ ADDED: "added",
703
+ MODIFIED: "modified",
704
+ REMOVED: "removed"
705
+ };
660
706
  var ApplicationDnsRecordType = {
661
707
  CNAME: "CNAME",
662
708
  TXT: "TXT"
@@ -812,13 +858,17 @@ var UserLanguage = {
812
858
  ApplicationCluster,
813
859
  ApplicationDnsRecordStatus,
814
860
  ApplicationDnsRecordType,
861
+ ApplicationEnvironmentChange,
815
862
  ApplicationFileContentType,
816
863
  ApplicationFileType,
817
864
  ApplicationLanguage,
818
865
  ApplicationRealtimeEventType,
866
+ ApplicationReleaseSource,
867
+ ApplicationReleaseStatus,
819
868
  ApplicationStatus,
820
869
  ApplicationType,
821
870
  ApplicationVersion,
871
+ ApplicationZeroDowntime,
822
872
  BillingTaxIdType,
823
873
  DatabaseCluster,
824
874
  DatabaseFilterOperator,