/selise-blocks:blocks-data-storagefrom selise-blocks
Build file and document management on SELISE Blocks Data: uploads, directory trees, versions, sharing, access policies, and trash/restore.
Ships in selise-blocks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When invoking a project-scoped blocks command, either use the resolved account's saved selection or pass --project <tenantId> for that one command without changing saved state. --project applies to CLI commands only, never SDK calls.
Treat storage as one permission-aware object tree containing directories and files. Uploading a new file now creates the file object in that tree; there is no second DMS registration step.
Use:
blocks data files * for supported terminal/admin operations.@seliseblocks/client for app code. Use the shared blocksClient created by blocks-bootstrap.configurationName.Select a project first with blocks use <tenantId>. If login/project state or the shared client setup is unknown, use blocks-bootstrap before this skill.
Store the returned fileId in a Data record when attaching a file to domain data. Use blocks-data-gateway-crud for the record mutation.
The current CLI and SDK follow the backend's file, directory, and object resource groups.
blocks --version
blocks --help
blocks data files * for terminal/admin work and run
blocks help data files <command> --json for exact flags. Do not probe a
subcommand with --help; subcommands do not consistently treat it as help and
may execute real logic. The help command never reaches a handler.blocksClient.data.files for bytes, metadata, versions, and file operations.blocksClient.data.directories for directory create/get/update/delete/move.blocksClient.data.objects for browse/search/trash/shared/restore/share/access/inheritance.Legacy data.dms.*, dms-upload, dms-list, create-folder, and delete-folder wrappers are retired. Uploads need no registration call.
Choose one path from the project's storage configuration.
| Provider category | Sequence |
|---|---|
| Cloud object storage | request a pre-signed URL, then PUT the bytes to it |
| Local/SFTP storage | send one authenticated multipart upload |
Both paths create the file object and initial version directly. Do not call dms-upload afterward.
Prefer the composed command. It previews and confirms both metadata creation and the provider PUT:
blocks data files upload --file ./invoice.pdf --parent-id <directoryId> \
--configuration-name Default --access-modifier Private --dry-run --json
blocks data files upload --file ./invoice.pdf --parent-id <directoryId> \
--configuration-name Default --access-modifier Private --yes --json
Use the two explicit commands only when the intermediate upload URL is required:
blocks data files presigned-upload-url \
--name invoice.pdf \
--parent-directory-id <directoryId> \
--configuration-name Default \
--access-modifier Private \
--dry-run --json
blocks data files presigned-upload-url \
--name invoice.pdf \
--parent-directory-id <directoryId> \
--configuration-name Default \
--access-modifier Private \
--yes --json
blocks data files upload-to-url \
--url "<uploadUrl>" \
--file ./invoice.pdf \
--content-type application/pdf \
--dry-run --json
blocks data files upload-to-url \
--url "<uploadUrl>" \
--file ./invoice.pdf \
--content-type application/pdf \
--yes --json
The presign response contains uploadUrl, fileId, fileVersionId, requiredHeaders, uploadCompletionRequired, and isSuccess. The first call creates the file metadata/version; the PUT fills its object-storage key. Handle PUT failure explicitly because it can leave metadata for missing bytes. Pass --size-in-bytes, --content-type and --checksum (with --checksum-algorithm SHA256|SHA1|MD5) so blocks-data can refuse an oversized file before issuing a URL and verify the bytes later.
Upload completion. When the storage configuration lists the file's access modifier in uploadCompletionRequiredFor (see blocks-storage-configuration), the response says uploadCompletionRequired: true and the bytes land in private quarantine: the file is in the tree but unreadable until completed. Send the requiredHeaders on the PUT, then:
blocks data files complete-upload <fileId> <fileVersionId> --dry-run --json
blocks data files complete-upload <fileId> <fileVersionId> --yes --json
It verifies declared size, content type, checksum, and that the real file type matches the extension, then promotes the file (verificationStatus: "Verified") or rejects it with a rejectionReason. It is idempotent. On a version that never needed completion it answers file_version_not_found. data files upload does all of this itself: it declares size/type/SHA-256 checksum, uses the server's headers, completes when required, and fails on a rejection.
Access defaults. --object-access-level Creator|Organization sets who can reach an unshared file (omitted keeps the legacy allow-all default), and --inherits-parent-access=false stops a broad grant on a parent directory from carrying down. Both apply to upload, presigned-upload-url and upload-to-local-storage.
When parentDirectoryId is empty, the cloud upload resolves moduleName to that module's default directory. The backend default is module value 8 (Default_Construct), but pass the intended module or a concrete directory id instead of relying on that default.
const presign = await blocksClient.data.files.presignedUploadUrl({
name: "invoice.pdf",
parentDirectoryId: directoryId,
configurationName: "Default",
accessModifier: "Private",
tags: "invoice,2026",
});
if (!presign || typeof presign !== "object") {
throw new Error("Unexpected upload response");
}
const result = presign as {
uploadUrl: string;
fileId: string;
isSuccess: boolean;
errors?: Record<string, string>;
};
if (!result.isSuccess) throw new Error(JSON.stringify(result.errors));
await blocksClient.data.files.uploadToUrl({
url: result.uploadUrl,
body: file,
contentType: file.type || "application/octet-stream",
});
uploadToUrl is provider-direct and sends no bearer token or x-blocks-key. The SDK adds Azure's x-ms-blob-type: Blockblob header unless overridden; ensure that header matches the signed provider policy (the presign response's requiredHeaders names the ones the provider expects).
The SDK has no upload-completion call yet. If the presign response says uploadCompletionRequired, the file stays quarantined until the upload is completed with its fileId and fileVersionId. Use blocks data files complete-upload from the terminal, or avoid completion-required access modifiers for app-code uploads until the SDK exposes it.
blocks data files upload-to-local-storage \
--file ./invoice.pdf \
--parent-directory-id <directoryId> \
--configuration-name Default \
--access-modifier Private \
--dry-run --json
blocks data files upload-to-local-storage \
--file ./invoice.pdf \
--parent-directory-id <directoryId> \
--configuration-name Default \
--access-modifier Private \
--yes --json
const uploaded = await blocksClient.data.files.uploadToLocalStorage({
name: file.name,
file,
parentDirectoryId: directoryId,
configurationName: "Default",
accessModifier: "Private",
tags: ["invoice", "2026"],
});
This call creates the file object and uploads version 1 in one request. Unlike cloud presign, an empty local parentDirectoryId stays at the top level; it is not resolved through moduleName.
Supplying an existing itemId to either upload flow creates another version after the caller passes the file's Edit check. For cloud storage, the dedicated command/method returns another pre-signed URL:
blocks data files versions <fileId> --limit 25 --json
blocks data files create-version <fileId> --configuration-name Default --dry-run --json
blocks data files create-version <fileId> --configuration-name Default --yes --json
const history = await blocksClient.data.files.versions({ fileId, limit: 25 });
const next = await blocksClient.data.files.createVersion({ fileId, configurationName: "Default" });
Version history is newest-first and cursor-paginated. Use the returned opaque nextCursor; the current backend uses the last version number internally, but callers must not construct cursors. Limits are 1–100, default 25.
blocks data files get <fileId> --configuration-name Default --json
blocks data files get <fileId> --version <versionNo> --configuration-name Default --json
blocks data files get-many <fileId...> --configuration-name Default --json
const file = await blocksClient.data.files.get(fileId, {
configurationName: "Default",
version: 2,
});
The response includes a download URL plus metadata. Download requires the caller's Download permission. Access-denied reads may deliberately look like missing resources so clients cannot probe hidden object ids.
For browsing, directories, search, move/copy/rename, trash, sharing, and ACL behavior, read flows/object-management.md.
blocks data files update-additional-info <fileId> \
--additional-properties '{"status":"reviewed"}' \
--dry-run --json
blocks data files update-additional-info <fileId> \
--additional-properties '{"status":"reviewed"}' \
--yes --json
This updates additionalProperties; it does not rename, move, tag, or version the file.
Deletion now distinguishes trash from permanent removal:
permanent: false archives the file or directory so it can be restored.permanent: true removes it for good.true when permanent is omitted.The CLI defaults to safe soft deletion. Add --permanent only after explicit approval.
blocks data files delete <fileId> --dry-run --json
blocks data files delete <fileId> --yes --json
blocks data files delete <fileId> --permanent --dry-run --json
In app code, send the choice explicitly: blocksClient.data.files.delete({ fileId, permanent: false }).
Every storage request passes two checks:
Capabilities are ordered: View, Download, Edit, Delete, Manage, Owner. Higher capabilities imply lower ones. Directory children inherit ancestor access while inheritsParentAccess is true. New files inherit from their directory.
Do not infer permission from a visible button or endpoint grant. Render actions from each object's returned permissions flags and still handle 403/404 races.
Private is the safe default. Use Public only when unauthenticated download is intended.configurationName selects an existing provider record; it does not configure storage.Promise<unknown>; validate responses at the boundary.What SKILL.md sets; muted values are Claude Code's defaults
25 skills in this plugin
/blocksStart here for any SELISE Blocks work. Routes a plain-language request — sign-in and projects, SSO, users, roles, MFA, data schemas and records, file storage, translations, mail, notifications, workflows, functions, proxies, secrets, deployments — to the right Blocks skill, and carries the rules every Blocks skill follows: the blocks CLI and @seliseblocks/client SDK only, never raw HTTP to the platform API; --dry-run before --yes; never read the CLI's credential files; when to report a finding. Use whenever work touches SELISE Blocks, the blocks CLI, or @seliseblocks/client./blocks-bootstrapGet a user from any starting state to a working SELISE Blocks setup — CLI installed, logged in, project selected — using the `blocks` CLI, never raw fetch/curl. Detects state from `blocks auth status --json` and `blocks doctor --json`, then routes to a flow: select or create a project, inventory a project that already exists, resolve the app's OIDC client, add a social identity provider, create the first end user, scaffold a new web app, or wire an existing one. Use for a new user, for `not_logged_in`/`project_not_selected`, or whenever login/project/app state is unclear./blocks-captchaConfigure the login captcha of a SELISE Blocks project through the blocks CLI ('captcha list/get/save/enable/disable/delete'): register a reCAPTCHA or hCaptcha site key and secret, switch it on or off, see which configuration blocks-iam actually enforces at login, and retire one. CLI-only, project-scoped; the captcha secret is stored server-side and never shown. Use for 'enable captcha on login', 'change the recaptcha keys', 'why is captcha not showing', 'turn captcha off'./blocks-data-gateway-configurationConfigure a SELISE Blocks project's data model via the blocks CLI — never raw fetch/curl against api.seliseblocks.com. Covers data-source config (data config get/create/update), schema authoring and push (data schema list/pull/push, plus granular get/fields/info/indexes commands), data-access policies (data rules pull/deploy/policy), field-level validation rules (data validation *), and reloading so changes go live (data reload, or the composed data sync). Use for defining, editing, securing, validating, or reloading a project's DATA MODEL — schema fields, access policies, and validation rules./blocks-data-gateway-crudImplement create/read/update/delete against a SELISE Blocks project's runtime Data Gateway using the @seliseblocks/client SDK. Use data.collection(schemaName) for straightforward per-item CRUD, data.graphql() for joins or custom query shapes, and data.schemas.*/data.validations.* for schema/validation metadata. Shows how to wire CRUD into the React 18 + Vite + TanStack Query app that blocks new web scaffolds. Use whenever the user wants to read or write actual records through a Blocks Data schema from app code./blocks-frontend-local-httpsRun a scaffolded (`blocks new web`) Blocks app locally over HTTPS on its real project domain — required for hosted IAM login, since plain HTTP or localhost never gets the session cookie. The scaffold already automates cert generation (npm run cert, no OpenSSL needed) and HTTPS serving via vite.config.ts. Covers running that flow, trusting the cert, the hosts-file entry, and troubleshooting. Use when running a scaffolded app over HTTPS, hitting 'SSO cookie not set' / Vite 'Blocked request' errors, trusting the dev cert, or asking why local login redirects back but doesn't stay signed in.npx claudepluginhub selisedigitalplatforms/blocks-skills --plugin selise-blocksOther plugins' skills for the same job