24 lines
14 KiB
HTML
24 lines
14 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
||
"">
|
||
<html><head><meta charset="UTF-8" /><title>dog-and-duck.quack.picky documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Dog-and-duck</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="Desiderata.html"><div class="inner"><span>Desiderata</span></div></a></li><li class="depth-1 "><a href="Using_ActivityPub.html"><div class="inner"><span>Using ActivityPub</span></div></a></li><li class="depth-1 "><a href="Validation_Faults.html"><div class="inner"><span>Validation Faults in ActivityPub documents</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>dog-and-duck</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>quack</span></div></div></li><li class="depth-3 current"><a href="dog-and-duck.quack.picky.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>picky</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.collections.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>collections</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.constants.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>constants</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.control-variables.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>control-variables</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.fault-messages.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fault-messages</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.required-properties.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>required-properties</span></div></a></li><li class="depth-4"><a href="dog-and-duck.quack.picky.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-3"><a href="dog-and-duck.quack.quack.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>quack</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -269px;"><span class="top" style="height: 278px;"></span><span class="bottom"></span></span><span>scratch</span></div></div></li><li class="depth-3 branch"><a href="dog-and-duck.scratch.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-3 branch"><a href="dog-and-duck.scratch.parser.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>parser</span></div></a></li><li class="depth-3"><a href="dog-and-duck.scratch.scratch.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scratch</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>utils</span></div></div></li><li class="depth-3"><a href="dog-and-duck.utils.process.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>process</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-accept-required-properties"><div class="inner"><span>accept-required-properties</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-activity-faults"><div class="inner"><span>activity-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-activity-required-properties"><div class="inner"><span>activity-required-properties</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-activity-type-faults"><div class="inner"><span>activity-type-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-actor-faults"><div class="inner"><span>actor-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-base-activity-required-properties"><div class="inner"><span>base-activity-required-properties</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-collection-faults"><div class="inner"><span>collection-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-intransitive-activity-required-properties"><div class="inner"><span>intransitive-activity-required-properties</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-link-faults"><div class="inner"><span>link-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-persistent-object-faults"><div class="inner"><span>persistent-object-faults</span></div></a></li><li class="depth-1"><a href="dog-and-duck.quack.picky.html#var-uri-or-fault"><div class="inner"><span>uri-or-fault</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">dog-and-duck.quack.picky</h1><div class="doc"><div class="markdown"><p>Fault-finder for ActivityPub documents. </p>
|
||
<p>Generally, each <code>-faults</code> function will return:</p>
|
||
<ol>
|
||
<li><code>nil</code> if no faults were found;</li>
|
||
<li>a sequence of fault objects if faults were found.</li>
|
||
</ol>
|
||
<p>Each fault object shall have the properties:</p>
|
||
<ol>
|
||
<li><code>:@context</code> whose value shall be the URL of a document specifying this vocabulary;</li>
|
||
<li><code>:type</code> whose value shall be <code>Fault</code>;</li>
|
||
<li><code>:severity</code> whose value shall be one of <code>info</code>, <code>minor</code>, <code>should</code>, <code>must</code> or <code>critical</code>;</li>
|
||
<li><code>:fault</code> whose value shall be a unique token representing the particular fault type;</li>
|
||
<li><code>:narrative</code> whose value shall be a natural language description of the fault type.</li>
|
||
</ol>
|
||
<p>Note that the reason for the <code>:fault</code> property is to be able to have a well known place, linked to from the @context URL, which allows narratives for each fault type to be served in as many natural languages as possible.</p>
|
||
<p>The idea further is that it should ultimately be possible to serialise a fault report as a document which in its own right conforms to the ActivityStreams spec.</p></div></div><div class="public anchor" id="var-accept-required-properties"><h3>accept-required-properties</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>As base-activity-required-properties, except that the type of the object is restricted.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L141">view source</a></div></div><div class="public anchor" id="var-activity-faults"><h3>activity-faults</h3><div class="usage"><code>(activity-faults x)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L207">view source</a></div></div><div class="public anchor" id="var-activity-required-properties"><h3>activity-required-properties</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Properties activities should have, keyed by activity type. Values are maps of the format of <code>base-activity-required-properties</code>, q.v.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L151">view source</a></div></div><div class="public anchor" id="var-activity-type-faults"><h3>activity-type-faults</h3><div class="usage"><code>(activity-type-faults x)</code><code>(activity-type-faults x type)</code></div><div class="doc"><div class="markdown"><p>Return a list of faults found in the activity <code>x</code>; if <code>type</code> is also specified, it should be a string naming a specific activity type for which checks should be performed.</p>
|
||
<p>Some specific activity types have specific requirements which are not requirements.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L190">view source</a></div></div><div class="public anchor" id="var-actor-faults"><h3>actor-faults</h3><div class="usage"><code>(actor-faults x)</code></div><div class="doc"><div class="markdown"><p>Return a list of faults found in actor <code>x</code>, or <code>nil</code> if none are.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L99">view source</a></div></div><div class="public anchor" id="var-base-activity-required-properties"><h3>base-activity-required-properties</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Properties most activities should have. Values are validating functions, each.</p>
|
||
<p>See <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity">https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity</a></p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L126">view source</a></div></div><div class="public anchor" id="var-collection-faults"><h3>collection-faults</h3><div class="usage"><code>(collection-faults x)</code><code>(collection-faults x type)</code></div><div class="doc"><div class="markdown"><p>Return a list of faults found in the collection <code>x</code>; if <code>type</code> is also specified, it should be a string naming a specific collection type for which checks should be performed. </p>
|
||
<p>Every collection <em>should</em>(?) have a <code>totalItems</code> field (an integer).</p>
|
||
<p>Beyond that, collections are either ‘just collections’ (in which case they <em>should</em> have an <code>items</code> field (a sequence)), or else they’re paged collections, in which case they <em>must</em>(?) have a <code>first</code> field which is a collection page or a URI pointing to a collection page, and <em>should</em> have a <code>last</code> field which is similar.</p>
|
||
<p>The pages of collections <em>should</em> be collection pages; the pages of ordered collections <em>should</em> be ordered collection pages.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L218">view source</a></div></div><div class="public anchor" id="var-intransitive-activity-required-properties"><h3>intransitive-activity-required-properties</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Properties intransitive activities should have.</p>
|
||
<p>See <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity">https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity</a></p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L135">view source</a></div></div><div class="public anchor" id="var-link-faults"><h3>link-faults</h3><div class="usage"><code>(link-faults x)</code></div><div class="doc"><div class="markdown"><p>A link object is required to have an <code>href</code> property. It may have all of <code>rel</code> | <code>mediaType</code> | <code>name</code> | <code>hreflang</code> | <code>height</code> | <code>width</code> | <code>preview</code> but I <em>think</em> they’re all optional.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L112">view source</a></div></div><div class="public anchor" id="var-persistent-object-faults"><h3>persistent-object-faults</h3><div class="usage"><code>(persistent-object-faults x)</code><code>(persistent-object-faults x types severity token)</code></div><div class="doc"><div class="markdown"><p>Return a list of faults found in persistent object <code>x</code>, or <code>nil</code> if none are.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L78">view source</a></div></div><div class="public anchor" id="var-uri-or-fault"><h3>uri-or-fault</h3><div class="usage"><code>(uri-or-fault u severity if-missing-token)</code><code>(uri-or-fault u severity if-missing-token if-invalid-token)</code></div><div class="doc"><div class="markdown"><p>If <code>u</code> is not a valid URI, return a fault object with this <code>severity</code> and <code>if-invalid-token</code>. If it’s <code>nil</code>, return a fault object with this <code>severity</code> and <code>if-missing-token</code>. Otherwise return nil.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/dog-and-duck/blob/master/src/dog_and_duck/quack/picky.clj#L62">view source</a></div></div></div></body></html> |