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 storage with an explicit lifecycle.
There is NO public surface for creating scratch uploads or minting
upload URLs. Parent features (e.g. AI Revision) initiate the
multipart upload server-side and return the
{ scratchId, uploadId, key, urls[] } bundle in their own response
payload. The caller 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. For scratch uploads the
server additionally counts the finished object's size against
workspace storage usage and records the upload in the audit log.
Parameters
| Parameter | Type |
|---|---|
client | default |
Returns
| Name | Type | Description |
|---|---|---|
completeUpload() | (scratchId, data) => Promise<CompleteUploadResponse> | Finish a multipart upload for a scratch upload. Same { uploadId, parts } body the asset complete-upload route accepts. The server finalises the object in storage, counts its size against workspace storage usage, records the audit entry, and moves the scratch status from pendingUpload to active. Creator-only. |
promote() | (scratchId, data?) => Promise<PromoteResponse> | Promote a scratch upload to a real Asset. Creator-only — only the user who created the scratch upload can call this. Destination is derived server-side from the scratch upload itself: - it has a projectId → asset created in that project - it has only a workspace → asset created at the workspace The destination cannot be overridden in the body: a scratch upload always lands in the workspace / project it was created for. The only optional input is fileName to override the asset's user-facing name. |