@vertracloud/api-types 0.4.0 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertracloud/api-types",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "private": false,
5
5
  "description": "TypeScript types for the public API of Vertra Cloud, a Brazilian application hosting platform (PaaS) for applications, managed databases and bots.",
6
6
  "homepage": "https://vertracloud.app",
package/rest/v1/blob.d.ts CHANGED
@@ -12,6 +12,11 @@ interface RESTBlobObjectWriteOptions {
12
12
  overwrite?: boolean;
13
13
  /** Insert `-<10 random characters>` before the extension. */
14
14
  random_suffix?: boolean;
15
+ /**
16
+ * When `path` is taken, save as `name-1.ext`, `name-2.ext`, … (the first free one) instead of returning
17
+ * `BLOB_OBJECT_ALREADY_EXISTS`. The object comes back with the final `path`. Cannot be combined with `overwrite`.
18
+ */
19
+ rename_on_conflict?: boolean;
15
20
  cache_control?: string;
16
21
  content_disposition?: BlobContentDisposition;
17
22
  filename?: string;
@@ -159,6 +164,11 @@ interface RESTPostAPIBlobObjectCopyBody {
159
164
  move?: boolean;
160
165
  overwrite?: boolean;
161
166
  random_suffix?: boolean;
167
+ /**
168
+ * Copy only: when `path` is taken (including the source's own path), save as `name-1.ext`, `name-2.ext`, …
169
+ * instead of returning `BLOB_OBJECT_ALREADY_EXISTS`. Cannot be combined with `overwrite`; ignored on a move.
170
+ */
171
+ rename_on_conflict?: boolean;
162
172
  visibility?: BlobVisibility;
163
173
  }
164
174
  type RESTPostAPIBlobObjectCopyQuery = RESTAPIWorkspaceQuery;
@@ -1 +1 @@
1
- {"version":3,"sources":["blob.ts"],"sourcesContent":["import type {\n\tAPIBlobBatchResult,\n\tAPIBlobCustomDomain,\n\tAPIBlobDeleteResult,\n\tAPIBlobDownload,\n\tAPIBlobObject,\n\tAPIBlobObjectList,\n\tAPIBlobRule,\n\tAPIBlobRules,\n\tAPIBlobS3Credentials,\n\tAPIBlobShare,\n\tAPIBlobSharePublic,\n\tAPIBlobStats,\n\tAPIBlobUpload,\n\tAPIBlobUploadPart,\n\tAPIBlobUploadToken,\n\tAPIPayload,\n\tBlobContentDisposition,\n\tBlobVisibility,\n\tISODateString,\n\tRESTAPIWorkspaceQuery,\n\tSnowFlake,\n} from \"../../v1\";\n\n// Blob Storage routes are served at `https://blob.vertracloud.app/v1/...`. Every route accepts\n// `workspace_id` (query) to act on the blob of a workspace owner. Authenticate with a dashboard\n// session, an API key (`blob:read` / `blob:write`) or, on the upload routes only, an upload token.\n\n/**\n * Options shared by both ways of uploading. Defaults: `visibility: \"private\"`, `overwrite: false`,\n * `random_suffix: false` (always `true` for an upload token without a fixed `path`).\n */\nexport interface RESTBlobObjectWriteOptions {\n\tvisibility?: BlobVisibility;\n\t/** Replace an existing object at `path`. Without it a taken path returns `BLOB_OBJECT_ALREADY_EXISTS`. */\n\toverwrite?: boolean;\n\t/** Insert `-<10 random characters>` before the extension. */\n\trandom_suffix?: boolean;\n\tcache_control?: string;\n\tcontent_disposition?: BlobContentDisposition;\n\tfilename?: string;\n\texpires_at?: ISODateString;\n\t/**\n\t * Hex SHA-256 of the file; a mismatch returns `BLOB_CHECKSUM_MISMATCH`. Only valid for the\n\t * single-request upload and for a direct upload sent in one part: a multipart upload refuses it\n\t * (`VALIDATION_ERROR`), because a SHA-256 of the whole object cannot be verified from separate parts.\n\t */\n\tchecksum_sha256?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Upload\n// ---------------------------------------------------------------------------\n\n/**\n * `POST /v1/objects` — single-request upload (up to the plan's `max_simple_upload_bytes`). The\n * body is `multipart/form-data` with one `file` field; options go in the query. Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/upload\n */\nexport interface RESTPostAPIBlobObjectQuery extends RESTAPIWorkspaceQuery, RESTBlobObjectWriteOptions {\n\tpath: string;\n\t/** JSON object, URL-encoded. */\n\tmetadata?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/upload\n */\nexport type RESTPostAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * `POST /v1/uploads` — starts a direct upload (single or multipart, chosen by `size`). Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/create\n */\nexport interface RESTPostAPIBlobUploadBody extends RESTBlobObjectWriteOptions {\n\tpath: string;\n\tsize: number;\n\tmetadata?: Record<string, string>;\n}\nexport type RESTPostAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/create\n */\nexport type RESTPostAPIBlobUploadResponse = APIPayload<APIBlobUpload>;\n\n/** `GET /v1/uploads` — uploads still in progress. */\nexport type RESTGetAPIBlobUploadsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/list\n */\nexport type RESTGetAPIBlobUploadsResponse = APIPayload<APIBlobUpload[]>;\n\n/** `GET /v1/uploads/:upload_id` — status of one upload, to resume it. Accepts an upload token. */\nexport type RESTGetAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/get\n */\nexport type RESTGetAPIBlobUploadResponse = APIPayload<APIBlobUpload>;\n\n/**\n * `POST /v1/uploads/:upload_id/parts` — URLs for up to 100 parts. Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/parts\n */\nexport interface RESTPostAPIBlobUploadPartsBody {\n\tpart_numbers: number[];\n}\nexport type RESTPostAPIBlobUploadPartsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/parts\n */\nexport type RESTPostAPIBlobUploadPartsResponse = APIPayload<APIBlobUploadPart[]>;\n\n/** `POST /v1/uploads/:upload_id/complete` — checks the parts and creates the object. Accepts an upload token. */\nexport type RESTPostAPIBlobUploadCompleteQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/complete\n */\nexport type RESTPostAPIBlobUploadCompleteResponse = APIPayload<APIBlobObject>;\n\n/** `DELETE /v1/uploads/:upload_id` — aborts an upload; repeating it is not an error. Accepts an upload token. */\nexport type RESTDeleteAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/abort\n */\nexport type RESTDeleteAPIBlobUploadResponse = APIPayload<null>;\n\n// ---------------------------------------------------------------------------\n// Objects\n// ---------------------------------------------------------------------------\n\n/**\n * `GET /v1/objects`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/list\n */\nexport interface RESTGetAPIBlobObjectsQuery extends RESTAPIWorkspaceQuery {\n\tprefix?: string;\n\t/** Group paths into folders at `/`. Omit it for a flat list. */\n\tdelimiter?: \"/\";\n\tvisibility?: BlobVisibility;\n\tcursor?: string;\n\t/** 1–1000. Default 100. */\n\tlimit?: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/list\n */\nexport type RESTGetAPIBlobObjectsResponse = APIPayload<APIBlobObjectList>;\n\n/** `GET /v1/objects/:object_id`. */\nexport type RESTGetAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/get\n */\nexport type RESTGetAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * Fields of an object that can change. `null` restores the default; a `null` metadata value removes that key.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update\n */\nexport interface RESTPatchAPIBlobObjectBody {\n\tvisibility?: BlobVisibility;\n\tcache_control?: string | null;\n\tcontent_disposition?: BlobContentDisposition | null;\n\tfilename?: string | null;\n\texpires_at?: ISODateString | null;\n\tmetadata?: Record<string, string | null>;\n}\n\n/** `PATCH /v1/objects/:object_id`. */\nexport type RESTPatchAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update\n */\nexport type RESTPatchAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * `PATCH /v1/objects` — applies the same changes to up to 100 objects.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update-many\n */\nexport interface RESTPatchAPIBlobObjectsBody {\n\tids: SnowFlake[];\n\tchanges: RESTPatchAPIBlobObjectBody;\n}\nexport type RESTPatchAPIBlobObjectsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update-many\n */\nexport type RESTPatchAPIBlobObjectsResponse = APIPayload<APIBlobBatchResult[]>;\n\n/**\n * `POST /v1/objects/copy` — copies or moves an object. A move keeps the `id`; a copy creates\n * another object that counts toward storage.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/copy\n */\nexport interface RESTPostAPIBlobObjectCopyBody {\n\tsource: SnowFlake;\n\tpath: string;\n\tmove?: boolean;\n\toverwrite?: boolean;\n\trandom_suffix?: boolean;\n\tvisibility?: BlobVisibility;\n}\nexport type RESTPostAPIBlobObjectCopyQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/copy\n */\nexport type RESTPostAPIBlobObjectCopyResponse = APIPayload<APIBlobObject>;\n\n/** `DELETE /v1/objects/:object_id`. */\nexport type RESTDeleteAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete\n */\nexport type RESTDeleteAPIBlobObjectResponse = APIPayload<null>;\n\n/**\n * `DELETE /v1/objects` — up to 1000 objects per call, by `ids` or by folder `prefix` (send one of them).\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete-many\n */\nexport type RESTDeleteAPIBlobObjectsBody = { ids: SnowFlake[]; prefix?: never } | { prefix: string; ids?: never };\nexport type RESTDeleteAPIBlobObjectsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete-many\n */\nexport type RESTDeleteAPIBlobObjectsResponse = APIPayload<APIBlobDeleteResult>;\n\n/**\n * `GET /v1/objects/:object_id/download` — temporary download link; it cannot be revoked. With\n * `redirect` true (default) the response is a `302` to the link; with `false` it is `RESTGetAPIBlobObjectDownloadResponse`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/download\n */\nexport interface RESTGetAPIBlobObjectDownloadQuery extends RESTAPIWorkspaceQuery {\n\t/** Seconds, 60–86400. Default 3600. */\n\texpires_in?: number;\n\tdisposition?: BlobContentDisposition;\n\tfilename?: string;\n\tredirect?: boolean;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/download\n */\nexport type RESTGetAPIBlobObjectDownloadResponse = APIPayload<APIBlobDownload>;\n\n// ---------------------------------------------------------------------------\n// Shares\n// ---------------------------------------------------------------------------\n\n/**\n * `POST /v1/shares` — responds `201`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/create\n */\nexport interface RESTPostAPIBlobShareBody {\n\tobject_id: SnowFlake;\n\t/** Seconds, 60 to 30 days. Default 24 hours. */\n\texpires_in?: number;\n\t/** 1–10000. */\n\tmax_downloads?: number;\n\t/** 8–128 characters; plan-dependent. */\n\tpassword?: string;\n}\nexport type RESTPostAPIBlobShareQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/create\n */\nexport type RESTPostAPIBlobShareResponse = APIPayload<APIBlobShare>;\n\n/**\n * `GET /v1/shares`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/list\n */\nexport interface RESTGetAPIBlobSharesQuery extends RESTAPIWorkspaceQuery {\n\tobject_id?: SnowFlake;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/list\n */\nexport type RESTGetAPIBlobSharesResponse = APIPayload<APIBlobShare[]>;\n\n/** `DELETE /v1/shares/:share_id` — revokes the share. */\nexport type RESTDeleteAPIBlobShareQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/revoke\n */\nexport type RESTDeleteAPIBlobShareResponse = APIPayload<null>;\n\n/** `GET /v1/shares/public/:token` — no authentication; used by the share page. `BLOB_SHARE_NOT_FOUND` / `BLOB_SHARE_EXHAUSTED`. */\nexport type RESTGetAPIBlobSharePublicResponse = APIPayload<APIBlobSharePublic>;\n\n/** `POST /v1/shares/public/:token/download` — no authentication. Counts one download and returns a temporary link. A wrong password returns `BLOB_SHARE_PASSWORD_INVALID` (rate limited). */\nexport interface RESTPostAPIBlobSharePublicDownloadBody {\n\tpassword?: string;\n}\nexport type RESTPostAPIBlobSharePublicDownloadResponse = APIPayload<APIBlobDownload>;\n\n// ---------------------------------------------------------------------------\n// Folder rules\n// ---------------------------------------------------------------------------\n\n/** Rule fields a client sends; `prefix` and `created_at` are not part of the body, `active_from` is set by the platform. */\nexport type RESTBlobRuleInput = Omit<APIBlobRule, \"prefix\" | \"created_at\" | \"active_from\">;\n\n/** `GET /v1/rules`. */\nexport type RESTGetAPIBlobRulesQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/get\n */\nexport type RESTGetAPIBlobRulesResponse = APIPayload<APIBlobRules>;\n\n/**\n * `PUT /v1/rules` — replaces the whole list. Requires the `If-Match` header with the `etag` of the list you read. Returns the saved list and its new `etag`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport interface RESTPutAPIBlobRulesBody {\n\trules: (RESTBlobRuleInput & { prefix: string })[];\n}\nexport type RESTPutAPIBlobRulesQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport interface RESTPutAPIBlobRulesHeaders {\n\t\"If-Match\": string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport type RESTPutAPIBlobRulesResponse = APIPayload<APIBlobRules>;\n\n/**\n * `PUT /v1/rules/:prefix` — creates or changes one rule (URL-encode the prefix). Returns the whole list and its new `etag`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/put\n */\nexport type RESTPutAPIBlobRuleBody = RESTBlobRuleInput;\nexport type RESTPutAPIBlobRuleQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/put\n */\nexport type RESTPutAPIBlobRuleResponse = APIPayload<APIBlobRules>;\n\n/** `DELETE /v1/rules/:prefix` (URL-encode the prefix). Returns the remaining list and its new `etag`. */\nexport type RESTDeleteAPIBlobRuleQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/delete\n */\nexport type RESTDeleteAPIBlobRuleResponse = APIPayload<APIBlobRules>;\n\n// ---------------------------------------------------------------------------\n// Account, upload tokens, S3 and custom domains\n// ---------------------------------------------------------------------------\n\n/** `GET /v1/stats`. */\nexport type RESTGetAPIBlobStatsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/stats\n */\nexport type RESTGetAPIBlobStatsResponse = APIPayload<APIBlobStats>;\n\n/**\n * `POST /v1/upload-tokens` — creates a token that fixes every constraint below. Send `path` (one\n * file) or `prefix` (any file under a folder, random suffix forced). It stops working when the\n * API key that created it is revoked.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/upload-tokens\n */\nexport interface RESTPostAPIBlobUploadTokenBody {\n\tpath?: string;\n\tprefix?: string;\n\tvisibility?: BlobVisibility;\n\tmax_size?: number;\n\t/** 1–20 extensions, lowercase, without the dot. */\n\tallowed_extensions?: string[];\n\tcache_control?: string;\n\tcontent_disposition?: BlobContentDisposition;\n\texpires_at?: ISODateString;\n\tmetadata?: Record<string, string>;\n\t/**\n\t * Allow the token to replace an existing object. Default `false`: a token without `overwrite: true`\n\t * never replaces an object, even if the upload asks for `overwrite`.\n\t */\n\toverwrite?: boolean;\n\t/** Seconds the token stays valid, 60–3600. Default 900. */\n\texpires_in?: number;\n\t/** 1–100. Default 1. */\n\tmax_uses?: number;\n}\nexport type RESTPostAPIBlobUploadTokenQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/upload-tokens\n */\nexport type RESTPostAPIBlobUploadTokenResponse = APIPayload<APIBlobUploadToken>;\n\n/** `GET /v1/s3/credentials` — read-only access when the API key only has `blob:read`. Limited to 10 calls per hour. */\nexport type RESTGetAPIBlobS3CredentialsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/s3-credentials\n */\nexport type RESTGetAPIBlobS3CredentialsResponse = APIPayload<APIBlobS3Credentials>;\n\n/** `GET /v1/domains`. */\nexport type RESTGetAPIBlobDomainsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/list\n */\nexport type RESTGetAPIBlobDomainsResponse = APIPayload<APIBlobCustomDomain[]>;\n\n/**\n * `POST /v1/domains` — responds `201`. Plan-dependent.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/add\n */\nexport interface RESTPostAPIBlobDomainBody {\n\thostname: string;\n\tprefix?: string;\n\t/** Defaults to `false`. See {@link APIBlobCustomDomain.web_content}. */\n\tweb_content?: boolean;\n}\nexport type RESTPostAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/add\n */\nexport type RESTPostAPIBlobDomainResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `POST /v1/domains/:domain_id/verify` — checks the ownership record, the CNAME and the certificate again. */\nexport type RESTPostAPIBlobDomainVerifyQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/verify\n */\nexport type RESTPostAPIBlobDomainVerifyResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `PATCH /v1/domains/:domain_id`. */\nexport interface RESTPatchAPIBlobDomainBody {\n\t/** See {@link APIBlobCustomDomain.web_content}. Takes effect within about a minute. */\n\tweb_content?: boolean;\n}\nexport type RESTPatchAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/update\n */\nexport type RESTPatchAPIBlobDomainResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `DELETE /v1/domains/:domain_id`. */\nexport type RESTDeleteAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/delete\n */\nexport type RESTDeleteAPIBlobDomainResponse = APIPayload<null>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["blob.ts"],"sourcesContent":["import type {\n\tAPIBlobBatchResult,\n\tAPIBlobCustomDomain,\n\tAPIBlobDeleteResult,\n\tAPIBlobDownload,\n\tAPIBlobObject,\n\tAPIBlobObjectList,\n\tAPIBlobRule,\n\tAPIBlobRules,\n\tAPIBlobS3Credentials,\n\tAPIBlobShare,\n\tAPIBlobSharePublic,\n\tAPIBlobStats,\n\tAPIBlobUpload,\n\tAPIBlobUploadPart,\n\tAPIBlobUploadToken,\n\tAPIPayload,\n\tBlobContentDisposition,\n\tBlobVisibility,\n\tISODateString,\n\tRESTAPIWorkspaceQuery,\n\tSnowFlake,\n} from \"../../v1\";\n\n// Blob Storage routes are served at `https://blob.vertracloud.app/v1/...`. Every route accepts\n// `workspace_id` (query) to act on the blob of a workspace owner. Authenticate with a dashboard\n// session, an API key (`blob:read` / `blob:write`) or, on the upload routes only, an upload token.\n\n/**\n * Options shared by both ways of uploading. Defaults: `visibility: \"private\"`, `overwrite: false`,\n * `random_suffix: false` (always `true` for an upload token without a fixed `path`).\n */\nexport interface RESTBlobObjectWriteOptions {\n\tvisibility?: BlobVisibility;\n\t/** Replace an existing object at `path`. Without it a taken path returns `BLOB_OBJECT_ALREADY_EXISTS`. */\n\toverwrite?: boolean;\n\t/** Insert `-<10 random characters>` before the extension. */\n\trandom_suffix?: boolean;\n\t/**\n\t * When `path` is taken, save as `name-1.ext`, `name-2.ext`, … (the first free one) instead of returning\n\t * `BLOB_OBJECT_ALREADY_EXISTS`. The object comes back with the final `path`. Cannot be combined with `overwrite`.\n\t */\n\trename_on_conflict?: boolean;\n\tcache_control?: string;\n\tcontent_disposition?: BlobContentDisposition;\n\tfilename?: string;\n\texpires_at?: ISODateString;\n\t/**\n\t * Hex SHA-256 of the file; a mismatch returns `BLOB_CHECKSUM_MISMATCH`. Only valid for the\n\t * single-request upload and for a direct upload sent in one part: a multipart upload refuses it\n\t * (`VALIDATION_ERROR`), because a SHA-256 of the whole object cannot be verified from separate parts.\n\t */\n\tchecksum_sha256?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Upload\n// ---------------------------------------------------------------------------\n\n/**\n * `POST /v1/objects` — single-request upload (up to the plan's `max_simple_upload_bytes`). The\n * body is `multipart/form-data` with one `file` field; options go in the query. Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/upload\n */\nexport interface RESTPostAPIBlobObjectQuery extends RESTAPIWorkspaceQuery, RESTBlobObjectWriteOptions {\n\tpath: string;\n\t/** JSON object, URL-encoded. */\n\tmetadata?: string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/upload\n */\nexport type RESTPostAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * `POST /v1/uploads` — starts a direct upload (single or multipart, chosen by `size`). Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/create\n */\nexport interface RESTPostAPIBlobUploadBody extends RESTBlobObjectWriteOptions {\n\tpath: string;\n\tsize: number;\n\tmetadata?: Record<string, string>;\n}\nexport type RESTPostAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/create\n */\nexport type RESTPostAPIBlobUploadResponse = APIPayload<APIBlobUpload>;\n\n/** `GET /v1/uploads` — uploads still in progress. */\nexport type RESTGetAPIBlobUploadsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/list\n */\nexport type RESTGetAPIBlobUploadsResponse = APIPayload<APIBlobUpload[]>;\n\n/** `GET /v1/uploads/:upload_id` — status of one upload, to resume it. Accepts an upload token. */\nexport type RESTGetAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/get\n */\nexport type RESTGetAPIBlobUploadResponse = APIPayload<APIBlobUpload>;\n\n/**\n * `POST /v1/uploads/:upload_id/parts` — URLs for up to 100 parts. Accepts an upload token.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/parts\n */\nexport interface RESTPostAPIBlobUploadPartsBody {\n\tpart_numbers: number[];\n}\nexport type RESTPostAPIBlobUploadPartsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/parts\n */\nexport type RESTPostAPIBlobUploadPartsResponse = APIPayload<APIBlobUploadPart[]>;\n\n/** `POST /v1/uploads/:upload_id/complete` — checks the parts and creates the object. Accepts an upload token. */\nexport type RESTPostAPIBlobUploadCompleteQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/complete\n */\nexport type RESTPostAPIBlobUploadCompleteResponse = APIPayload<APIBlobObject>;\n\n/** `DELETE /v1/uploads/:upload_id` — aborts an upload; repeating it is not an error. Accepts an upload token. */\nexport type RESTDeleteAPIBlobUploadQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/uploads/abort\n */\nexport type RESTDeleteAPIBlobUploadResponse = APIPayload<null>;\n\n// ---------------------------------------------------------------------------\n// Objects\n// ---------------------------------------------------------------------------\n\n/**\n * `GET /v1/objects`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/list\n */\nexport interface RESTGetAPIBlobObjectsQuery extends RESTAPIWorkspaceQuery {\n\tprefix?: string;\n\t/** Group paths into folders at `/`. Omit it for a flat list. */\n\tdelimiter?: \"/\";\n\tvisibility?: BlobVisibility;\n\tcursor?: string;\n\t/** 1–1000. Default 100. */\n\tlimit?: number;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/list\n */\nexport type RESTGetAPIBlobObjectsResponse = APIPayload<APIBlobObjectList>;\n\n/** `GET /v1/objects/:object_id`. */\nexport type RESTGetAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/get\n */\nexport type RESTGetAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * Fields of an object that can change. `null` restores the default; a `null` metadata value removes that key.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update\n */\nexport interface RESTPatchAPIBlobObjectBody {\n\tvisibility?: BlobVisibility;\n\tcache_control?: string | null;\n\tcontent_disposition?: BlobContentDisposition | null;\n\tfilename?: string | null;\n\texpires_at?: ISODateString | null;\n\tmetadata?: Record<string, string | null>;\n}\n\n/** `PATCH /v1/objects/:object_id`. */\nexport type RESTPatchAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update\n */\nexport type RESTPatchAPIBlobObjectResponse = APIPayload<APIBlobObject>;\n\n/**\n * `PATCH /v1/objects` — applies the same changes to up to 100 objects.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update-many\n */\nexport interface RESTPatchAPIBlobObjectsBody {\n\tids: SnowFlake[];\n\tchanges: RESTPatchAPIBlobObjectBody;\n}\nexport type RESTPatchAPIBlobObjectsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/update-many\n */\nexport type RESTPatchAPIBlobObjectsResponse = APIPayload<APIBlobBatchResult[]>;\n\n/**\n * `POST /v1/objects/copy` — copies or moves an object. A move keeps the `id`; a copy creates\n * another object that counts toward storage.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/copy\n */\nexport interface RESTPostAPIBlobObjectCopyBody {\n\tsource: SnowFlake;\n\tpath: string;\n\tmove?: boolean;\n\toverwrite?: boolean;\n\trandom_suffix?: boolean;\n\t/**\n\t * Copy only: when `path` is taken (including the source's own path), save as `name-1.ext`, `name-2.ext`, …\n\t * instead of returning `BLOB_OBJECT_ALREADY_EXISTS`. Cannot be combined with `overwrite`; ignored on a move.\n\t */\n\trename_on_conflict?: boolean;\n\tvisibility?: BlobVisibility;\n}\nexport type RESTPostAPIBlobObjectCopyQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/copy\n */\nexport type RESTPostAPIBlobObjectCopyResponse = APIPayload<APIBlobObject>;\n\n/** `DELETE /v1/objects/:object_id`. */\nexport type RESTDeleteAPIBlobObjectQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete\n */\nexport type RESTDeleteAPIBlobObjectResponse = APIPayload<null>;\n\n/**\n * `DELETE /v1/objects` — up to 1000 objects per call, by `ids` or by folder `prefix` (send one of them).\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete-many\n */\nexport type RESTDeleteAPIBlobObjectsBody = { ids: SnowFlake[]; prefix?: never } | { prefix: string; ids?: never };\nexport type RESTDeleteAPIBlobObjectsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/delete-many\n */\nexport type RESTDeleteAPIBlobObjectsResponse = APIPayload<APIBlobDeleteResult>;\n\n/**\n * `GET /v1/objects/:object_id/download` — temporary download link; it cannot be revoked. With\n * `redirect` true (default) the response is a `302` to the link; with `false` it is `RESTGetAPIBlobObjectDownloadResponse`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/download\n */\nexport interface RESTGetAPIBlobObjectDownloadQuery extends RESTAPIWorkspaceQuery {\n\t/** Seconds, 60–86400. Default 3600. */\n\texpires_in?: number;\n\tdisposition?: BlobContentDisposition;\n\tfilename?: string;\n\tredirect?: boolean;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/objects/download\n */\nexport type RESTGetAPIBlobObjectDownloadResponse = APIPayload<APIBlobDownload>;\n\n// ---------------------------------------------------------------------------\n// Shares\n// ---------------------------------------------------------------------------\n\n/**\n * `POST /v1/shares` — responds `201`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/create\n */\nexport interface RESTPostAPIBlobShareBody {\n\tobject_id: SnowFlake;\n\t/** Seconds, 60 to 30 days. Default 24 hours. */\n\texpires_in?: number;\n\t/** 1–10000. */\n\tmax_downloads?: number;\n\t/** 8–128 characters; plan-dependent. */\n\tpassword?: string;\n}\nexport type RESTPostAPIBlobShareQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/create\n */\nexport type RESTPostAPIBlobShareResponse = APIPayload<APIBlobShare>;\n\n/**\n * `GET /v1/shares`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/list\n */\nexport interface RESTGetAPIBlobSharesQuery extends RESTAPIWorkspaceQuery {\n\tobject_id?: SnowFlake;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/list\n */\nexport type RESTGetAPIBlobSharesResponse = APIPayload<APIBlobShare[]>;\n\n/** `DELETE /v1/shares/:share_id` — revokes the share. */\nexport type RESTDeleteAPIBlobShareQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/shares/revoke\n */\nexport type RESTDeleteAPIBlobShareResponse = APIPayload<null>;\n\n/** `GET /v1/shares/public/:token` — no authentication; used by the share page. `BLOB_SHARE_NOT_FOUND` / `BLOB_SHARE_EXHAUSTED`. */\nexport type RESTGetAPIBlobSharePublicResponse = APIPayload<APIBlobSharePublic>;\n\n/** `POST /v1/shares/public/:token/download` — no authentication. Counts one download and returns a temporary link. A wrong password returns `BLOB_SHARE_PASSWORD_INVALID` (rate limited). */\nexport interface RESTPostAPIBlobSharePublicDownloadBody {\n\tpassword?: string;\n}\nexport type RESTPostAPIBlobSharePublicDownloadResponse = APIPayload<APIBlobDownload>;\n\n// ---------------------------------------------------------------------------\n// Folder rules\n// ---------------------------------------------------------------------------\n\n/** Rule fields a client sends; `prefix` and `created_at` are not part of the body, `active_from` is set by the platform. */\nexport type RESTBlobRuleInput = Omit<APIBlobRule, \"prefix\" | \"created_at\" | \"active_from\">;\n\n/** `GET /v1/rules`. */\nexport type RESTGetAPIBlobRulesQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/get\n */\nexport type RESTGetAPIBlobRulesResponse = APIPayload<APIBlobRules>;\n\n/**\n * `PUT /v1/rules` — replaces the whole list. Requires the `If-Match` header with the `etag` of the list you read. Returns the saved list and its new `etag`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport interface RESTPutAPIBlobRulesBody {\n\trules: (RESTBlobRuleInput & { prefix: string })[];\n}\nexport type RESTPutAPIBlobRulesQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport interface RESTPutAPIBlobRulesHeaders {\n\t\"If-Match\": string;\n}\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/replace\n */\nexport type RESTPutAPIBlobRulesResponse = APIPayload<APIBlobRules>;\n\n/**\n * `PUT /v1/rules/:prefix` — creates or changes one rule (URL-encode the prefix). Returns the whole list and its new `etag`.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/put\n */\nexport type RESTPutAPIBlobRuleBody = RESTBlobRuleInput;\nexport type RESTPutAPIBlobRuleQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/put\n */\nexport type RESTPutAPIBlobRuleResponse = APIPayload<APIBlobRules>;\n\n/** `DELETE /v1/rules/:prefix` (URL-encode the prefix). Returns the remaining list and its new `etag`. */\nexport type RESTDeleteAPIBlobRuleQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/rules/delete\n */\nexport type RESTDeleteAPIBlobRuleResponse = APIPayload<APIBlobRules>;\n\n// ---------------------------------------------------------------------------\n// Account, upload tokens, S3 and custom domains\n// ---------------------------------------------------------------------------\n\n/** `GET /v1/stats`. */\nexport type RESTGetAPIBlobStatsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/stats\n */\nexport type RESTGetAPIBlobStatsResponse = APIPayload<APIBlobStats>;\n\n/**\n * `POST /v1/upload-tokens` — creates a token that fixes every constraint below. Send `path` (one\n * file) or `prefix` (any file under a folder, random suffix forced). It stops working when the\n * API key that created it is revoked.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/upload-tokens\n */\nexport interface RESTPostAPIBlobUploadTokenBody {\n\tpath?: string;\n\tprefix?: string;\n\tvisibility?: BlobVisibility;\n\tmax_size?: number;\n\t/** 1–20 extensions, lowercase, without the dot. */\n\tallowed_extensions?: string[];\n\tcache_control?: string;\n\tcontent_disposition?: BlobContentDisposition;\n\texpires_at?: ISODateString;\n\tmetadata?: Record<string, string>;\n\t/**\n\t * Allow the token to replace an existing object. Default `false`: a token without `overwrite: true`\n\t * never replaces an object, even if the upload asks for `overwrite`.\n\t */\n\toverwrite?: boolean;\n\t/** Seconds the token stays valid, 60–3600. Default 900. */\n\texpires_in?: number;\n\t/** 1–100. Default 1. */\n\tmax_uses?: number;\n}\nexport type RESTPostAPIBlobUploadTokenQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/upload-tokens\n */\nexport type RESTPostAPIBlobUploadTokenResponse = APIPayload<APIBlobUploadToken>;\n\n/** `GET /v1/s3/credentials` — read-only access when the API key only has `blob:read`. Limited to 10 calls per hour. */\nexport type RESTGetAPIBlobS3CredentialsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/account/s3-credentials\n */\nexport type RESTGetAPIBlobS3CredentialsResponse = APIPayload<APIBlobS3Credentials>;\n\n/** `GET /v1/domains`. */\nexport type RESTGetAPIBlobDomainsQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/list\n */\nexport type RESTGetAPIBlobDomainsResponse = APIPayload<APIBlobCustomDomain[]>;\n\n/**\n * `POST /v1/domains` — responds `201`. Plan-dependent.\n *\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/add\n */\nexport interface RESTPostAPIBlobDomainBody {\n\thostname: string;\n\tprefix?: string;\n\t/** Defaults to `false`. See {@link APIBlobCustomDomain.web_content}. */\n\tweb_content?: boolean;\n}\nexport type RESTPostAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/add\n */\nexport type RESTPostAPIBlobDomainResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `POST /v1/domains/:domain_id/verify` — checks the ownership record, the CNAME and the certificate again. */\nexport type RESTPostAPIBlobDomainVerifyQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/verify\n */\nexport type RESTPostAPIBlobDomainVerifyResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `PATCH /v1/domains/:domain_id`. */\nexport interface RESTPatchAPIBlobDomainBody {\n\t/** See {@link APIBlobCustomDomain.web_content}. Takes effect within about a minute. */\n\tweb_content?: boolean;\n}\nexport type RESTPatchAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/update\n */\nexport type RESTPatchAPIBlobDomainResponse = APIPayload<APIBlobCustomDomain>;\n\n/** `DELETE /v1/domains/:domain_id`. */\nexport type RESTDeleteAPIBlobDomainQuery = RESTAPIWorkspaceQuery;\n\n/**\n * @see https://docs.vertracloud.app/api-reference/endpoint/blob/domains/delete\n */\nexport type RESTDeleteAPIBlobDomainResponse = APIPayload<null>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}