Liking cljdoc? Tell your friends :D

synthigy.client.files

clj

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.
cljs

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.
raw docstring

accessclj/s

(access folder)

Who holds read, write and delete on folder.

Who holds read, write and delete on `folder`.
source (clj)source (cljs)raw docstring

blob?cljs

(blob? x)
source

body+typeclj/s≠

(body+type data content-type)
clj

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.
cljs

Body to send and its content type.

Body to send and its content type.
source (clj)source (cljs)raw docstring

deleteclj/s

(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).
source (clj)source (cljs)raw docstring

downloadclj/s≠

(download ref & {:keys [as range version if-none-match] :or {as :bytes}})
clj

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
cljs

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
source (clj)source (cljs)raw docstring

enc-partclj/s

(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.
source (clj)source (cljs)raw docstring

endpoint-urlclj/s

(endpoint-url path query)
source (clj)source (cljs)

file-atclj/s

(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.
source (clj)source (cljs)raw docstring

folderclj/s

(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).
source (clj)source (cljs)raw docstring

folder-atclj/s

(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.
source (clj)source (cljs)raw docstring

folder-refclj/s

(folder-ref x)
source (clj)source (cljs)

folder?clj/s

(folder? x)
source (clj)source (cljs)

granteesclj/s

(grantees {:keys [users groups]})
source (clj)source (cljs)

holds-words?clj/s

(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.
source (clj)source (cljs)raw docstring

infoclj/s

(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.
source (clj)source (cljs)raw docstring

json-callclj/s

(json-call method path)
(json-call method path payload)
(json-call method path payload query)
source (clj)source (cljs)

kebabclj/s

(kebab data)
source (clj)source (cljs)

listclj/s

(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
source (clj)source (cljs)raw docstring

moveclj/s

(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.
source (clj)source (cljs)raw docstring

move-bodyclj/s

(move-body from to)

PATCH body for moving from to path to.

PATCH body for moving `from` to path `to`.
source (clj)source (cljs)raw docstring

object-urlcljs

(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}.
sourceraw docstring

parse-jsoncljs

(parse-json text)
source

path?clj/s

(path? x)
source (clj)source (cljs)

putclj/s

(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)
source (clj)source (cljs)raw docstring

refusalclj/s≠

clj
(refusal {:keys [status body headers]})
cljs
(refusal {:keys [status body-text headers]})

The ex-info for a refused /files call.

The ex-info for a refused /files call.
source (clj)source (cljs)raw docstring

restoreclj/s

(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.
source (clj)source (cljs)raw docstring

(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
source (clj)source (cljs)raw docstring

send!clj/s

(send! method u opts)
source (clj)source (cljs)

serveclj/s≠

(serve ref request & {:keys [inline]})
clj

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
cljs

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
source (clj)source (cljs)raw docstring

served-headersclj/s

source (clj)source (cljs)

shapeclj/s≠

clj
(shape data)
cljs
(shape client data)
source (clj)source (cljs)

shareclj/s

(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.
source (clj)source (cljs)raw docstring

unshareclj/s

(unshare folder access from)

Take access on folder away from {:users :groups}.

Take `access` on `folder` away from {:users :groups}.
source (clj)source (cljs)raw docstring

urlclj/s

(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.
source (clj)source (cljs)raw docstring

version-idclj/s

(version-id v)
source (clj)source (cljs)

versionsclj/s

(versions ref)

The kept versions of file ref (the last ten), newest first.

The kept versions of file `ref` (the last ten), newest first.
source (clj)source (cljs)raw docstring

xid-atclj/s≠

(xid-at ref)
clj

The xid of file ref; a path costs one info call.

The xid of file `ref`; a path costs one info call.
cljs

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.
source (clj)source (cljs)raw docstring

xid-ofclj/s

(xid-of x)
source (clj)source (cljs)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close