Liking cljdoc? Tell your friends :D

psosf.api

The cross-language contract. Every function takes and returns JSON-shaped data only: maps with string keys, vectors, strings, numbers, booleans and nil, with no keywords. Language adapters (JavaScript, Python, .NET, the command line) pass this data across their boundary unchanged.

Keys are kebab-case, as in PSOSF's own JSON files.

classify entries [options] -> {"level" "invalid"|"valid"|"compatible", "errors" [...], "warnings" [...], "compatibility-errors" [...], "archive" {...}} read entries -> {"archive" {...}, "errors" [...], "warnings" [...]} write archive -> entries diff entries entries -> diff (complete and versioned; see psosf.diff) summarize diff [options] -> {"summary" "...", "details" "...", "report" ["..."]} patch entries diff -> entries

entries is a map of archive path to file text. options may hold "allowed-functions", a list of function names.

classify-json and friends take and return JSON text, for adapters that cross a C or process boundary.

The cross-language contract. Every function takes and returns JSON-shaped
data only: maps with string keys, vectors, strings, numbers, booleans and
nil, with no keywords. Language adapters (JavaScript, Python, .NET, the
command line) pass this data across their boundary unchanged.

Keys are kebab-case, as in PSOSF's own JSON files.

classify  entries [options] -> {"level" "invalid"|"valid"|"compatible",
                                 "errors" [...], "warnings" [...],
                                 "compatibility-errors" [...], "archive" {...}}
read      entries           -> {"archive" {...}, "errors" [...], "warnings" [...]}
write     archive           -> entries
diff      entries entries   -> diff (complete and versioned; see psosf.diff)
summarize diff [options]    -> {"summary" "...", "details" "...", "report" ["..."]}
patch     entries diff      -> entries

entries is a map of archive path to file text. options may hold
"allowed-functions", a list of function names.

classify-json and friends take and return JSON text, for adapters that
cross a C or process boundary.
raw docstring

attach-signature-jsonclj

(attach-signature-json text)

{"entries", "key-id", "role", "signer", "signed-at", "signature", "public-key"?} -> {"entries"}. With public-key, a signature that does not verify is refused.

{"entries", "key-id", "role", "signer", "signed-at", "signature",
 "public-key"?} -> {"entries"}. With public-key, a signature that does
not verify is refused.
sourceraw docstring

call-javaclj

(call-java f request)

For the Java class: calls the JSON function named f + "-json" with a request built from Java collections. The result is Clojure maps and vectors, which Java sees as java.util.Map and java.util.List.

For the Java class: calls the JSON function named f + "-json" with a
request built from Java collections. The result is Clojure maps and
vectors, which Java sees as java.util.Map and java.util.List.
sourceraw docstring

classifyclj/s

(classify entries)
(classify entries options)
source

classify-fileclj

(classify-file path)
(classify-file path options)

Reads and classifies a .psosf file (JVM). Same result shape as classify; an archive that cannot be read is reported as invalid.

Reads and classifies a .psosf file (JVM). Same result shape as classify;
an archive that cannot be read is reported as invalid.
sourceraw docstring

classify-file-jsonclj

(classify-file-json text)

{"path", "options"?} -> classify result, as JSON text.

{"path", "options"?} -> classify result, as JSON text.
sourceraw docstring

classify-jsonclj/s

(classify-json text)

{"entries": {...}, "options": {...}} -> result, as JSON text.

{"entries": {...}, "options": {...}} -> result, as JSON text.
sourceraw docstring

diffclj/s

(diff entries-a entries-b)

The diff between two archives, as JSON-shaped data: a complete, versioned description of every change. Pass it to summarize for people, or to patch to apply it. See psosf.diff.

The diff between two archives, as JSON-shaped data: a complete, versioned
description of every change. Pass it to summarize for people, or to patch
to apply it. See psosf.diff.
sourceraw docstring

diff-files-jsonclj

(diff-files-json text)

{"from": path, "to": path} -> the diff, as JSON text. Each .psosf file is read as untrusted input.

{"from": path, "to": path} -> the diff, as JSON text. Each .psosf file
is read as untrusted input.
sourceraw docstring

diff-jsonclj/s

(diff-json text)

{"from": entries, "to": entries} -> the diff, as JSON text.

{"from": entries, "to": entries} -> the diff, as JSON text.
sourceraw docstring

generate-key-jsonclj

(generate-key-json _)

{} -> {"private-key", "public-key"}: a new Ed25519 key pair, each as the Base64 of its raw 32 bytes. For callers without their own key generator.

{} -> {"private-key", "public-key"}: a new Ed25519 key pair, each as the
Base64 of its raw 32 bytes. For callers without their own key generator.
sourceraw docstring

parse-json-javaclj

(parse-json-java text)

JSON text as Java-compatible data, for the Java class's fromJson.

JSON text as Java-compatible data, for the Java class's fromJson.
sourceraw docstring

patchclj/s

(patch entries d)

Applies a diff to the archive it was made from: the patched entries. Throws when the archive isn't the one the diff expects.

Applies a diff to the archive it was made from: the patched entries. Throws
when the archive isn't the one the diff expects.
sourceraw docstring

patch-jsonclj/s

(patch-json text)

{"entries": entries, "diff": diff} -> {"entries"}, as JSON text.

{"entries": entries, "diff": diff} -> {"entries"}, as JSON text.
sourceraw docstring

readclj/s

(read entries)
source

read-file-jsonclj

(read-file-json text)

{"path"} -> {"entries", "errors"}: a .psosf file read as hostile input.

{"path"} -> {"entries", "errors"}: a .psosf file read as hostile input.
sourceraw docstring

read-jsonclj/s

(read-json text)

{"entries": {...}} -> {"archive" ..., "errors" ..., "warnings" ...}, as JSON text.

{"entries": {...}} -> {"archive" ..., "errors" ..., "warnings" ...}, as JSON text.
sourceraw docstring

sign-jsonclj

(sign-json text)

{"entries", "private-key" (Base64 raw 32-byte seed), "key-id", "role", "signer", "signed-at"} -> {"entries"}.

{"entries", "private-key" (Base64 raw 32-byte seed), "key-id", "role",
"signer", "signed-at"} -> {"entries"}.
sourceraw docstring

signing-message-jsonclj

(signing-message-json text)

{"entries", "key-id", "role", "signer", "signed-at"} -> {"message"}: the exact text to sign, for signing in two steps.

{"entries", "key-id", "role", "signer", "signed-at"} -> {"message"}:
the exact text to sign, for signing in two steps.
sourceraw docstring

summarizeclj/s

(summarize d)
(summarize d {:strs [max-rows]})

A diff for people: "summary" one paragraph "details" Markdown: which formulas, data, directives and columns changed, to what, and where, by cell address (input worksheets give the affected row numbers) "report" compact lines, one per change "max-rows" caps each section (default 50 for details, 20 for the report).

A diff for people:
  "summary"  one paragraph
  "details"  Markdown: which formulas, data, directives and columns changed,
              to what, and where, by cell address (input worksheets give the
              affected row numbers)
  "report"   compact lines, one per change
"max-rows" caps each section (default 50 for details, 20 for the report).
sourceraw docstring

summarize-jsonclj/s

(summarize-json text)

{"diff": diff, "options"?: {"max-rows"}} -> {"summary", "report"}, as JSON text.

{"diff": diff, "options"?: {"max-rows"}} -> {"summary", "report"}, as JSON text.
sourceraw docstring

verify-jsonclj

(verify-json text)

{"entries", "keys": [key records], "received-at"?, "approver-custody"?} -> verification result, as JSON text. See psosf.sign.

{"entries", "keys": [key records], "received-at"?, "approver-custody"?}
-> verification result, as JSON text. See psosf.sign.
sourceraw docstring

writeclj/s

(write archive)
source

write-file-jsonclj

(write-file-json text)

{"path", "entries"} -> {}: writes entries to a .psosf file.

{"path", "entries"} -> {}: writes entries to a .psosf file.
sourceraw docstring

write-jsonclj/s

(write-json text)

{"archive": {...}} -> {"entries": {...}}, as JSON text.

{"archive": {...}} -> {"entries": {...}}, as JSON text.
sourceraw docstring

write-json-javaclj

(write-json-java x)

Java collections as canonical JSON text, for the Java class's toJson.

Java collections as canonical JSON text, for the Java class's toJson.
sourceraw docstring

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