cabinets resource on the Figranium Swift SDK is the typed client for the Cabinets API. Cabinets are durable, installation-wide download queues. Tasks can route intercepted browser downloads into a selected Cabinet, and later actions can upload the newest unuploaded item from that queue.
main.swift
Supported operations
cabinets covers the Cabinet lifecycle and item-management API.
Cabinet lifecycle
List, create, rename, migrate, clear, and delete Cabinets.
Item management
List Cabinet items, update upload status, and remove one or many items.
Archives
Create ZIP archives and safely extract compatible archives.
Downloads
Build item download URLs for files stored in a Cabinet.
Methods
list
list
List all Cabinets.
- HTTP endpoint:
GET /api/cabinets - Signature:
cabinets.list(options: RequestOptions = .init()) async throws -> [Cabinet]
list_cabinets.swift
create
create
Create a new Cabinet.
- HTTP endpoint:
POST /api/cabinets - Signature:
cabinets.create(_ name: String, options: RequestOptions = .init()) async throws -> Cabinet
create_cabinet.swift
rename
rename
Rename an existing Cabinet.
- HTTP endpoint:
PATCH /api/cabinets/{cabinetId} - Signature:
cabinets.rename(_ id: String, name: String, options: RequestOptions = .init()) async throws -> Cabinet
rename_cabinet.swift
delete
delete
Delete a Cabinet. You can optionally migrate its items to another Cabinet first.When
- HTTP endpoint:
DELETE /api/cabinets/{cabinetId} - Signature:
cabinets.delete(_ id: String, targetCabinetID: String? = nil, migrate: Bool = false, options: RequestOptions = .init()) async throws -> JSONObject
delete_cabinet.swift
migrate is true, items are moved to targetCabinetID before the Cabinet is removed.listItems
listItems
List the items inside a Cabinet.
- HTTP endpoint:
GET /api/cabinets/{cabinetId}/items - Signature:
cabinets.listItems(_ id: String, options: RequestOptions = .init()) async throws -> [CabinetItem]
list_items.swift
clear
clear
Remove every item from a Cabinet.
- HTTP endpoint:
POST /api/cabinets/{cabinetId}/clear - Signature:
cabinets.clear(_ id: String, options: RequestOptions = .init()) async throws -> JSONObject
clear_cabinet.swift
setItemStatus
setItemStatus
Update the status of one or more Cabinet items.Valid statuses are
- HTTP endpoint:
PATCH /api/cabinets/{cabinetId}/items/status - Signature:
cabinets.setItemStatus(_ cabinetID: String, itemIDs: [String], status: String, options: RequestOptions = .init()) async throws -> [CabinetItem]
set_status.swift
"pending" and "uploaded".removeItems
removeItems
Remove specific items from a Cabinet.
- HTTP endpoint:
DELETE /api/cabinets/{cabinetId}/items - Signature:
cabinets.removeItems(_ cabinetID: String, itemIDs: [String], options: RequestOptions = .init()) async throws -> JSONObject
remove_items.swift
zipItems
zipItems
Create a ZIP archive from selected Cabinet items.
- HTTP endpoint:
POST /api/cabinets/{cabinetId}/zip - Signature:
cabinets.zipItems(_ cabinetID: String, itemIDs: [String], name: String? = nil, options: RequestOptions = .init()) async throws -> CabinetItem
zip_items.swift
unzipItem
unzipItem
Extract a ZIP archive that is stored as a Cabinet item.
- HTTP endpoint:
POST /api/cabinets/{cabinetId}/items/{itemId}/unzip - Signature:
cabinets.unzipItem(_ cabinetID: String, itemID: String, options: RequestOptions = .init()) async throws -> [CabinetItem]
unzip_item.swift
downloadURL
downloadURL
Build a download URL for a Cabinet item. This method does not make an HTTP request. It returns a
URL synchronously.- Signature:
cabinets.downloadURL(cabinetID: String, itemID: String) -> URL
download_url.swift
Use a Cabinet from a task
Tasks can setcabinetId to select where intercepted browser downloads are stored:
task_with_cabinet.swift
cabinetId, Figranium uses the instance’s default Cabinet. An individual Upload action can override the task-level selection with its own cabinetId.
Upload status
Cabinet items track whether they have been uploaded. Theupload action normally selects the newest unuploaded item. You can mark an item uploaded immediately with markAsUploaded, or keep finalization separate and call finalizeUploads later in the workflow.
Models
Cabinet
CabinetItem
Related resources
Action helpers
Build Upload and Finalize Uploads actions.
Tasks resource
Save and run tasks that select a Cabinet with
cabinetId.File downloads
Understand Cabinets, intercepted downloads, and the upload lifecycle.