@vertracloud/api-types 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1.mjs CHANGED
@@ -61,6 +61,8 @@ var APIApiKeyScope = {
61
61
  WORKSPACES_WRITE: "workspaces:write",
62
62
  WORKSPACES_DELETE: "workspaces:delete",
63
63
  WORKSPACES_INVITES: "workspaces:invites",
64
+ BLOB_READ: "blob:read",
65
+ BLOB_WRITE: "blob:write",
64
66
  BILLING_READ: "billing:read",
65
67
  BILLING_WRITE: "billing:write",
66
68
  REDEEM_WRITE: "redeem:write"
@@ -245,6 +247,47 @@ var API_KEY_SCOPES = {
245
247
  { method: "POST", path: "/v1/workspaces/invites/:token/decline" }
246
248
  ]
247
249
  },
250
+ /** Blob Storage (`blob.vertracloud.app`). Upload tokens (`vcup_`) are a separate credential, not a scope. */
251
+ "blob:read": {
252
+ group: "blob",
253
+ routes: [
254
+ { method: "GET", path: "/v1/blob/objects" },
255
+ { method: "GET", path: "/v1/blob/objects/:object_id" },
256
+ { method: "GET", path: "/v1/blob/objects/:object_id/download" },
257
+ { method: "GET", path: "/v1/blob/shares" },
258
+ { method: "GET", path: "/v1/blob/rules" },
259
+ { method: "GET", path: "/v1/blob/stats" },
260
+ { method: "GET", path: "/v1/blob/s3/credentials" },
261
+ { method: "GET", path: "/v1/blob/domains" }
262
+ ]
263
+ },
264
+ "blob:write": {
265
+ group: "blob",
266
+ routes: [
267
+ { method: "POST", path: "/v1/blob/objects" },
268
+ { method: "PATCH", path: "/v1/blob/objects" },
269
+ { method: "PATCH", path: "/v1/blob/objects/:object_id" },
270
+ { method: "POST", path: "/v1/blob/objects/copy" },
271
+ { method: "DELETE", path: "/v1/blob/objects" },
272
+ { method: "DELETE", path: "/v1/blob/objects/:object_id" },
273
+ { method: "POST", path: "/v1/blob/uploads" },
274
+ { method: "GET", path: "/v1/blob/uploads" },
275
+ { method: "GET", path: "/v1/blob/uploads/:upload_id" },
276
+ { method: "POST", path: "/v1/blob/uploads/:upload_id/parts" },
277
+ { method: "POST", path: "/v1/blob/uploads/:upload_id/complete" },
278
+ { method: "DELETE", path: "/v1/blob/uploads/:upload_id" },
279
+ { method: "POST", path: "/v1/blob/shares" },
280
+ { method: "DELETE", path: "/v1/blob/shares/:share_id" },
281
+ { method: "PUT", path: "/v1/blob/rules" },
282
+ { method: "PUT", path: "/v1/blob/rules/:prefix" },
283
+ { method: "DELETE", path: "/v1/blob/rules/:prefix" },
284
+ { method: "POST", path: "/v1/blob/upload-tokens" },
285
+ { method: "POST", path: "/v1/blob/domains" },
286
+ { method: "POST", path: "/v1/blob/domains/:domain_id/verify" },
287
+ { method: "PATCH", path: "/v1/blob/domains/:domain_id" },
288
+ { method: "DELETE", path: "/v1/blob/domains/:domain_id" }
289
+ ]
290
+ },
248
291
  "billing:read": {
249
292
  group: "billing",
250
293
  routes: [
@@ -292,6 +335,8 @@ var WorkspacePermission = {
292
335
  DATABASES_DELETE: "databases:delete",
293
336
  SNAPSHOTS_READ: "snapshots:read",
294
337
  SNAPSHOTS_MANAGE: "snapshots:manage",
338
+ BLOB_READ: "blob:read",
339
+ BLOB_MANAGE: "blob:manage",
295
340
  MEMBERS_READ: "members:read",
296
341
  MEMBERS_MANAGE: "members:manage",
297
342
  ROLES_MANAGE: "roles:manage",
@@ -312,6 +357,8 @@ var WORKSPACE_PERMISSIONS = {
312
357
  "databases:delete": { group: "databases" },
313
358
  "snapshots:read": { group: "snapshots" },
314
359
  "snapshots:manage": { group: "snapshots" },
360
+ "blob:read": { group: "blob" },
361
+ "blob:manage": { group: "blob" },
315
362
  "members:read": { group: "members" },
316
363
  "members:manage": { group: "members" },
317
364
  "roles:manage": { group: "roles" },
@@ -327,7 +374,7 @@ var WorkspaceRolePreset = {
327
374
  function workspacePresetPermissions(preset) {
328
375
  switch (preset) {
329
376
  case "admin":
330
- return WORKSPACE_PERMISSION_LIST.filter((p) => p !== "snapshots:manage");
377
+ return WORKSPACE_PERMISSION_LIST.filter((p) => p !== "snapshots:manage" && p !== "blob:read" && p !== "blob:manage");
331
378
  case "developer":
332
379
  return ["apps:read", "apps:manage", "apps:lifecycle", "apps:envs", "apps:files", "databases:read", "databases:manage", "databases:lifecycle", "databases:credentials", "databases:data", "snapshots:read", "members:read", "activities:read"];
333
380
  case "operator":
@@ -412,6 +459,52 @@ var API_ERROR_CODES = {
412
459
  APP_NOT_PUBLISHED: "APP_NOT_PUBLISHED",
413
460
  APP_ALREADY_IN_WORKSPACE: "APP_ALREADY_IN_WORKSPACE",
414
461
  APP_NOT_FOUND_IN_WORKSPACE: "APP_NOT_FOUND_IN_WORKSPACE",
462
+ /** 404 — the object does not exist or belongs to another account. */
463
+ BLOB_OBJECT_NOT_FOUND: "BLOB_OBJECT_NOT_FOUND",
464
+ /** 409 — the path is taken and `overwrite` is not set. */
465
+ BLOB_OBJECT_ALREADY_EXISTS: "BLOB_OBJECT_ALREADY_EXISTS",
466
+ /** 404 — the upload does not exist, is not yours, or is already completed or aborted. */
467
+ BLOB_UPLOAD_NOT_FOUND: "BLOB_UPLOAD_NOT_FOUND",
468
+ /** 410 — the upload passed its deadline. */
469
+ BLOB_UPLOAD_EXPIRED: "BLOB_UPLOAD_EXPIRED",
470
+ /** 409 — parts are missing or the stored size differs from the declared size. */
471
+ BLOB_UPLOAD_INCOMPLETE: "BLOB_UPLOAD_INCOMPLETE",
472
+ /** 409 — more uploads open than the plan allows. */
473
+ BLOB_UPLOAD_LIMIT: "BLOB_UPLOAD_LIMIT",
474
+ /** 400 — the SHA-256 sent does not match the file. */
475
+ BLOB_CHECKSUM_MISMATCH: "BLOB_CHECKSUM_MISMATCH",
476
+ /** 413 — the file exceeds the plan, single-request upload, folder rule or upload token limit. */
477
+ BLOB_FILE_TOO_LARGE: "BLOB_FILE_TOO_LARGE",
478
+ /** 403 — Blob Storage is suspended for the account (grace period, abuse or deletion). */
479
+ BLOB_NAMESPACE_SUSPENDED: "BLOB_NAMESPACE_SUSPENDED",
480
+ /** 401 — the upload token does not exist, expired or was revoked. */
481
+ BLOB_UPLOAD_TOKEN_INVALID: "BLOB_UPLOAD_TOKEN_INVALID",
482
+ /** 401 — the upload token has no uses left. */
483
+ BLOB_UPLOAD_TOKEN_EXHAUSTED: "BLOB_UPLOAD_TOKEN_EXHAUSTED",
484
+ /** 403 — upload tokens only work on the upload routes. */
485
+ BLOB_UPLOAD_TOKEN_NOT_ALLOWED: "BLOB_UPLOAD_TOKEN_NOT_ALLOWED",
486
+ /** 403 — the path, size or extension is outside what the upload token allows. */
487
+ BLOB_UPLOAD_TOKEN_CONSTRAINT: "BLOB_UPLOAD_TOKEN_CONSTRAINT",
488
+ /** 404 — the share does not exist, was revoked or expired. */
489
+ BLOB_SHARE_NOT_FOUND: "BLOB_SHARE_NOT_FOUND",
490
+ /** 410 — the share reached its download limit. */
491
+ BLOB_SHARE_EXHAUSTED: "BLOB_SHARE_EXHAUSTED",
492
+ /** 401 — wrong share password. */
493
+ BLOB_SHARE_PASSWORD_INVALID: "BLOB_SHARE_PASSWORD_INVALID",
494
+ /** 409 — the `If-Match` of the rule list is outdated; read it again. */
495
+ BLOB_RULES_CONFLICT: "BLOB_RULES_CONFLICT",
496
+ /** 409 — more folder rules than the plan allows. */
497
+ BLOB_RULE_LIMIT: "BLOB_RULE_LIMIT",
498
+ /** 409 — more custom domains than the plan allows. */
499
+ BLOB_CUSTOM_DOMAIN_LIMIT: "BLOB_CUSTOM_DOMAIN_LIMIT",
500
+ /** 409 — the hostname is already in use. */
501
+ BLOB_CUSTOM_DOMAIN_TAKEN: "BLOB_CUSTOM_DOMAIN_TAKEN",
502
+ /** 404 — the domain does not exist or belongs to another account. */
503
+ BLOB_CUSTOM_DOMAIN_NOT_FOUND: "BLOB_CUSTOM_DOMAIN_NOT_FOUND",
504
+ /** 422 — the file extension is blocked, outside the rule or token, or the content is an executable. */
505
+ BLOCKED_FILE_TYPE: "BLOCKED_FILE_TYPE",
506
+ /** 403 — the upload would exceed the storage quota. */
507
+ STORAGE_QUOTA_EXCEEDED: "STORAGE_QUOTA_EXCEEDED",
415
508
  BUILD_FAILED: "BUILD_FAILED",
416
509
  BUILD_TIMEOUT: "BUILD_TIMEOUT",
417
510
  /** 400 — the order needs complete billing details for the service invoice (name, address and, in Brazil, CPF/CNPJ). Fill them with `PUT /v1/users/me/billing`. */
@@ -667,6 +760,26 @@ var BillingTaxIdType = {
667
760
  CNPJ: "cnpj"
668
761
  };
669
762
 
763
+ // payloads/v1/blob.ts
764
+ var BlobVisibility = { PUBLIC: "public", PRIVATE: "private" };
765
+ var BlobContentDisposition = {
766
+ INLINE: "inline",
767
+ ATTACHMENT: "attachment"
768
+ };
769
+ var BlobUploadMode = { SINGLE: "single", MULTIPART: "multipart" };
770
+ var BlobUploadStatus = {
771
+ PENDING: "pending",
772
+ COMPLETED: "completed",
773
+ ABORTED: "aborted",
774
+ EXPIRED: "expired"
775
+ };
776
+ var BlobCustomDomainStatus = {
777
+ PENDING: "pending",
778
+ ACTIVE: "active",
779
+ FAILED: "failed",
780
+ SUSPENDED: "suspended"
781
+ };
782
+
670
783
  // payloads/v1/database.ts
671
784
  var DatabaseType = {
672
785
  POSTGRESQL: 1,
@@ -805,6 +918,11 @@ export {
805
918
  ApplicationVersion,
806
919
  ApplicationZeroDowntime,
807
920
  BillingTaxIdType,
921
+ BlobContentDisposition,
922
+ BlobCustomDomainStatus,
923
+ BlobUploadMode,
924
+ BlobUploadStatus,
925
+ BlobVisibility,
808
926
  DatabaseCluster,
809
927
  DatabaseFilterOperator,
810
928
  DatabaseRedisKeyType,