scratch
Methods and types of the `scratch` namespace (`client.scratch` / `bot.scratch`).
Interfaces
CompleteUploadBody
Properties
CompleteUploadResponse
Properties
PromoteBody
Properties
| Property | Type | Description |
|---|---|---|
fileName? | string | Optional rename — lands on Asset.name. Defaults to a row-id-derived name. |
PromoteResponse
Properties
Functions
default()
function default(client): {
completeUpload: Promise<CompleteUploadResponse>;
promote: Promise<PromoteResponse>;
};Scratch — platform-wide temporary object-storage with explicit lifecycle.
There is NO public surface for creating scratch rows or minting
upload URLs. Parent processes (e.g. AI Revision) initiate the
multipart upload server-side and return the
{ scratchId, uploadId, key, urls[] } bundle in their own response
payload. The FE uploads each part directly against its signed URL
(same pattern as asset uploads), then calls completeUpload here to
finalise.
completeUpload mirrors nuramaClient.asset.completeUpload:
the body is the same { uploadId, parts } shape, the server runs the
S3-compatible CompleteMultipartUploadCommand, and (for scratch
specifically) HEADs the resulting object, increments workspace
storage usage, and writes the audit row.
Parameters
| Parameter | Type |
|---|---|
client | default |
Returns
| Name | Type | Description |
|---|---|---|
completeUpload() | (scratchId, data) => Promise<CompleteUploadResponse> | Finish a multipart upload for a scratch row. Same { uploadId, parts } body the asset complete-upload route accepts. Server runs CompleteMultipartUploadCommand against the media bucket, HEADs the object for size, increments workspace storage usage, writes the audit row, and flips status pendingUpload → active. Creator-only. |
promote() | (scratchId, data?) => Promise<PromoteResponse> | Promote a scratch row to a real Asset. Creator-only — only the user who created the scratch row can call this. Destination is derived server-side from the row itself: - row has projectId → asset created in that project - row has only workspace → asset created at the workspace No body fields for destination on purpose: the FE doesn't get to claim a scratch belongs to a different workspace / project. The only optional input is fileName to override the asset's user-facing name. |