Files: the bytes behind /files, each also a File record on /data.
(require '[synthigy.client.files :as files])
(files/folder "/site/img/") ; the folder, and any missing above it (def f (files/put "/site/img/logo.png" (io/file "logo.png"))) ; again: a new version (files/download "/site/img/logo.png") ; bytes; :as :stream :text (files/move f "/site/brand/")
A file is a path (/a/b/name), an xid or the file itself; a folder is a path ending in /, an xid or the folder itself. Response keys follow the client's :key-format: kebab-case by default, wire snake_case otherwise.
Files: the bytes behind /files, each also a File record on /data. (require '[synthigy.client.files :as files]) (files/folder "/site/img/") ; the folder, and any missing above it (def f (files/put "/site/img/logo.png" (io/file "logo.png"))) ; again: a new version (files/download "/site/img/logo.png") ; bytes; :as :stream :text (files/move f "/site/brand/") A file is a path (/a/b/name), an xid or the file itself; a folder is a path ending in /, an xid or the folder itself. Response keys follow the client's :key-format: kebab-case by default, wire snake_case otherwise.
Files: the bytes behind /files, each also a File record on /data. Every call returns a Promise.
(require '[synthigy.client.files :as files])
(p/let [_ (files/folder "/site/img/") ; the folder, and any missing above it f (files/put "/site/img/logo.png" blob) ; creates it; again: a new version bytes (files/download "/site/img/logo.png")] ; Uint8Array; :as :blob :text … (files/move f "/site/brand/"))
A file is a path (/a/b/name), an xid or the file itself; a folder is a path ending in /, an xid or the folder itself. Response keys follow the client's :key-format: kebab-case by default, wire snake_case otherwise.
Files: the bytes behind /files, each also a File record on /data. Every call returns a Promise.
(require '[synthigy.client.files :as files])
(p/let [_ (files/folder "/site/img/") ; the folder, and any missing above it
f (files/put "/site/img/logo.png" blob) ; creates it; again: a new version
bytes (files/download "/site/img/logo.png")] ; Uint8Array; :as :blob :text …
(files/move f "/site/brand/"))
A file is a path (/a/b/name), an xid or the file itself; a folder is a path
ending in /, an xid or the folder itself. Response keys follow the client's
:key-format: kebab-case by default, wire snake_case otherwise.(access folder)Who holds read, write and delete on folder.
Who holds read, write and delete on `folder`.
(body+type data content-type)Bytes to send and their content type; a stream is read into memory so the 401 retry can resend it.
Bytes to send and their content type; a stream is read into memory so the 401 retry can resend it.
Body to send and its content type.
Body to send and its content type.
(delete ref)Delete a file, or an empty folder (a path ending in /, or the folder itself).
Delete a file, or an empty folder (a path ending in /, or the folder itself).
(download ref & {:keys [as range version if-none-match] :or {as :bytes}})The bytes of file ref, or nil while :if-none-match still matches. Options: :as (:bytes default, :text, :stream to close yourself) :range [start end] (inclusive, nil leaves a side open) :version :if-none-match
The bytes of file `ref`, or nil while :if-none-match still matches. Options: :as (:bytes default, :text, :stream to close yourself) :range [start end] (inclusive, nil leaves a side open) :version :if-none-match
The bytes of file ref, or nil while :if-none-match still matches. Options: :as (:bytes default, :blob :text :array-buffer :stream :response) :range [start end] (inclusive, nil leaves a side open) :version :if-none-match
The bytes of file `ref`, or nil while :if-none-match still matches. Options: :as (:bytes default, :blob :text :array-buffer :stream :response) :range [start end] (inclusive, nil leaves a side open) :version :if-none-match
(enc-part s)One path segment percent-encoded but for RFC 3986 unreserved characters, as the server builds links.
One path segment percent-encoded but for RFC 3986 unreserved characters, as the server builds links.
(file-at ref)(file-at ref tail)Path and query of one file: /<xid><tail>, or <tail>?path= for a path.
Path and query of one file: /<xid><tail>, or <tail>?path= for a path.
(folder path)(folder path settings)The folder at path, made with every missing folder above it; settings {:public :cache} sets its own values (nil inherits).
The folder at `path`, made with every missing folder above it; `settings` {:public :cache} sets its own values (nil inherits).
(folder-at ref)(folder-at ref tail)Path and query of one folder: /folders/<xid><tail>, or /folders<tail>?path= for a path.
Path and query of one folder: /folders/<xid><tail>, or /folders<tail>?path= for a path.
(holds-words? q s)Whether s holds the words of q in order, ignoring case.
Whether `s` holds the words of `q` in order, ignoring case.
(info ref)File ref, or nil when it is not there or you cannot see it.
File `ref`, or nil when it is not there or you cannot see it.
(json-call method path)(json-call method path payload)(json-call method path payload query)(list)(list folder & {:keys [q limit offset]}){:files :folders}: a folder's files and subfolders; nil is the files in no folder, :all (or no folder) every file you can see, newest first. Options: :q :limit :offset
{:files :folders}: a folder's files and subfolders; nil is the files in no folder, :all (or no folder) every file you can see, newest first. Options: :q :limit :offset
(move from to)Rename or move: a file goes to to (/a/new.png), or into a folder when to ends in / (the name stays); a folder's to is its new path.
Rename or move: a file goes to `to` (/a/new.png), or into a folder when `to` ends in / (the name stays); a folder's `to` is its new path.
(move-body from to)PATCH body for moving from to path to.
PATCH body for moving `from` to path `to`.
(object-url ref)Browser: download with your token into a blob: URL for <img> or <iframe>: {:url :revoke}.
Browser: download with your token into a blob: URL for <img> or <iframe>: {:url :revoke}.
(put target data & {:keys [content-type if-match]})Store bytes: a path (/a/b/name, the folder must exist) creates or replaces that file, an xid or the file replaces it, {:name n} makes a new file in no folder. Options: :content-type :if-match (a hash, or the file)
Store bytes: a path (/a/b/name, the folder must exist) creates or replaces that file, an xid or the file replaces it, {:name n} makes a new file in no folder. Options: :content-type :if-match (a hash, or the file)
(refusal {:keys [status body headers]})(refusal {:keys [status body-text headers]})The ex-info for a refused /files call.
The ex-info for a refused /files call.
(restore ref version)Make kept version (its :id, or the version) of file ref current again; no bytes are copied.
Make kept `version` (its :id, or the version) of file `ref` current again; no bytes are copied.
(search q & {:keys [folder limit offset]})Folders and files whose paths hold the words of q in order, shortest first: {:results :truncated}, each result with :type. Options: :folder :limit :offset
Folders and files whose paths hold the words of `q` in order, shortest first: {:results :truncated}, each result with :type. Options: :folder :limit :offset
(serve ref request & {:keys [inline]})Ring: answer request with file ref as a ring response (body an InputStream); Range and If-None-Match pass through, a refusal is the engine's own answer. Option :inline
Ring: answer `request` with file `ref` as a ring response (body an InputStream); Range and If-None-Match pass through, a refusal is the engine's own answer. Option :inline
Server: answer a browser's js/Request (or {:method :headers}) with file ref as a js/Response; Range and If-None-Match pass through, a refusal is the engine's own answer. Option :inline
Server: answer a browser's js/Request (or {:method :headers}) with file `ref` as a js/Response; Range and If-None-Match pass through, a refusal is the engine's own answer. Option :inline
(share folder access to)Give {:users :groups} (xids or records) access (read, write or delete) on folder; writers of the folder may.
Give {:users :groups} (xids or records) `access` (read, write or delete) on `folder`; writers of the folder may.
(unshare folder access from)Take access on folder away from {:users :groups}.
Take `access` on `folder` away from {:users :groups}.
(url ref & {:keys [inline]})Where file ref loads from, without a request: /files/<xid>, or /files/path/… for a path. Option :inline opens it in the browser instead.
Where file `ref` loads from, without a request: /files/<xid>, or /files/path/… for a path. Option :inline opens it in the browser instead.
(versions ref)The kept versions of file ref (the last ten), newest first.
The kept versions of file `ref` (the last ten), newest first.
(xid-at ref)The xid of file ref; a path costs one info call.
The xid of file `ref`; a path costs one info call.
Promise of the xid of file ref; a path costs one info call.
Promise of the xid of file `ref`; a path costs one info call.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |