Skip to content

Commit aef98a8

Browse files
committed
v1.2.5
1 parent dcab78f commit aef98a8

File tree

22 files changed

+313
-31
lines changed

22 files changed

+313
-31
lines changed

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":176,"assertions":636,"lines":{"total":414,"covered":414,"skipped":0,"pct":100},"statements":{"total":466,"covered":466,"skipped":0,"pct":100},"functions":{"total":179,"covered":179,"skipped":0,"pct":100},"branches":{"total":147,"covered":147,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
1+
{"tests":182,"assertions":649,"lines":{"total":427,"covered":427,"skipped":0,"pct":100},"statements":{"total":480,"covered":480,"skipped":0,"pct":100},"functions":{"total":185,"covered":185,"skipped":0,"pct":100},"branches":{"total":159,"covered":158,"skipped":0,"pct":99.37},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"atrule",
1212
"attw",
1313
"Deleter",
14+
"destructures",
1415
"onwarn",
1516
"Pearce",
1617
"Shantell",

docs/api/all.html

Lines changed: 94 additions & 3 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<nav><ul><li><a href="/">TinyTick</a></li><li><a href="/api/">API</a></li><li><a href="/api/tinytick/"><code>tinytick</code></a></li><li><a href="/api/tinytick/interfaces/">Interfaces</a></li><li><a href="/api/tinytick/interfaces/manager/manager/"><code>Manager</code></a></li><li><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/">TaskRun methods</a></li></ul></nav><section class="s1" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/" data-id="M2/M3/TR"><h1>TaskRun methods</h1><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/getrunningtaskrunids/" data-id="gRTRI"><h2><code>getRunningTaskRunIds</code></h2><p>The <code>getRunningTaskRunIds</code> method returns an array containing all running task run <a href="/api/tinytick/type-aliases/identity/ids/"><code>Ids</code></a>. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/getrunningtaskrunids/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/getscheduledtaskrunids/" data-id="gSTRI"><h2><code>getScheduledTaskRunIds</code></h2><p>The <code>getScheduledTaskRunIds</code> method returns an array containing all scheduled task run <a href="/api/tinytick/type-aliases/identity/ids/"><code>Ids</code></a>. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/getscheduledtaskrunids/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunconfig/" data-id="gTRC"><h2><code>getTaskRunConfig</code></h2><p>The <code>getTaskRunConfig</code> method returns the configuration of a task run. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunconfig/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskruninfo/" data-id="gTRI"><h2><code>getTaskRunInfo</code></h2><p>The <code>getTaskRunInfo</code> method returns information about a scheduled or running task run. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskruninfo/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunrunning/" data-id="gTRR"><h2><code>getTaskRunRunning</code></h2><p>The <code>getTaskRunRunning</code> method returns whether a task run is running yet or not. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunrunning/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/" data-id="sTR"><h2><code>scheduleTaskRun</code></h2><p>The <code>scheduleTaskRun</code> method schedules a specific task to run in the future. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/untiltaskrundone/" data-id="uTRD"><h2><code>untilTaskRunDone</code></h2><p>The <code>untilTaskRunDone</code> method returns a Promise that resolves when a task run has finished running, regardless of whether it was successful or not. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/untiltaskrundone/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/deltaskrun/" data-id="dTR"><h2><code>delTaskRun</code></h2><p>The <code>delTaskRun</code> method deletes a scheduled task run or aborts a running one. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/deltaskrun/">Read more</a>.</p></section></section>
1+
<nav><ul><li><a href="/">TinyTick</a></li><li><a href="/api/">API</a></li><li><a href="/api/tinytick/"><code>tinytick</code></a></li><li><a href="/api/tinytick/interfaces/">Interfaces</a></li><li><a href="/api/tinytick/interfaces/manager/manager/"><code>Manager</code></a></li><li><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/">TaskRun methods</a></li></ul></nav><section class="s1" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/" data-id="M2/M3/TR"><h1>TaskRun methods</h1><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/getrunningtaskrunids/" data-id="gRTRI"><h2><code>getRunningTaskRunIds</code></h2><p>The <code>getRunningTaskRunIds</code> method returns an array containing all running task run <a href="/api/tinytick/type-aliases/identity/ids/"><code>Ids</code></a>. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/getrunningtaskrunids/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/getscheduledtaskrunids/" data-id="gSTRI"><h2><code>getScheduledTaskRunIds</code></h2><p>The <code>getScheduledTaskRunIds</code> method returns an array containing all scheduled task run <a href="/api/tinytick/type-aliases/identity/ids/"><code>Ids</code></a>. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/getscheduledtaskrunids/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunconfig/" data-id="gTRC"><h2><code>getTaskRunConfig</code></h2><p>The <code>getTaskRunConfig</code> method returns the configuration of a task run. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunconfig/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskruninfo/" data-id="gTRI"><h2><code>getTaskRunInfo</code></h2><p>The <code>getTaskRunInfo</code> method returns information about a scheduled or running task run. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskruninfo/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunrunning/" data-id="gTRR"><h2><code>getTaskRunRunning</code></h2><p>The <code>getTaskRunRunning</code> method returns whether a task run is running yet or not. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunrunning/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/" data-id="sTR"><h2><code>scheduleTaskRun</code></h2><p>The <code>scheduleTaskRun</code> method schedules a specific task to run in the future. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/">Read more</a>.</p><p>When called with an object as the first argument, the <code>scheduleTaskRun</code> method destructures it to make it easier to skip optional parameters. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/untiltaskrundone/" data-id="uTRD"><h2><code>untilTaskRunDone</code></h2><p>The <code>untilTaskRunDone</code> method returns a Promise that resolves when a task run has finished running, regardless of whether it was successful or not. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/untiltaskrundone/">Read more</a>.</p></section><section class="s2" id="/api/tinytick/interfaces/manager/manager/methods/taskrun/deltaskrun/" data-id="dTR"><h2><code>delTaskRun</code></h2><p>The <code>delTaskRun</code> method deletes a scheduled task run or aborts a running one. <a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/deltaskrun/">Read more</a>.</p></section></section>

docs/api/tinytick/interfaces/manager/manager/methods/taskrun/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/article.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,20 @@
3939

4040
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>manager<span class="punctuation">.</span><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskrunconfig/">getTaskRunConfig</a></span><span class="punctuation">(</span>taskRunId<span class="punctuation">,</span> <span class="boolean">true</span><span class="punctuation">)</span><span class="punctuation">)</span><span class="punctuation">;</span>
4141
<span class="comment">// -> {maxDuration: 5000, maxRetries: 3, retryDelay: 10, repeatDelay: null}</span>
42-
</code></pre></section><section class="s2"><h2>Since</h2><p>v1.0.0</p></section></section>
42+
</code></pre></section><section class="s2"><h2>Since</h2><p>v1.0.0</p></section><p>When called with an object as the first argument, the <code>scheduleTaskRun</code> method destructures it to make it easier to skip optional parameters.</p><pre><code><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/">scheduleTaskRun</a></span><span class="punctuation">(</span>args<span class="operator">:</span> <span class="punctuation">{</span>
43+
taskId<span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">;</span>
44+
arg<span class="operator">?</span><span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">;</span>
45+
startAfter<span class="operator">?</span><span class="operator">:</span> <span class="builtin">number</span><span class="punctuation">;</span>
46+
config<span class="operator">?</span><span class="operator">:</span> <span class="type"><a href="/api/tinytick/type-aliases/taskrun/taskrunconfig/">TaskRunConfig</a></span><span class="punctuation">;</span>
47+
<span class="punctuation">}</span><span class="punctuation">)</span><span class="operator">:</span> <span class="keyword">undefined</span> <span class="operator">|</span> <span class="builtin">string</span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>args</code></th><td><code><span class="punctuation">{</span> taskId<span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">;</span> arg<span class="operator">?</span><span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">;</span> startAfter<span class="operator">?</span><span class="operator">:</span> <span class="builtin">number</span><span class="punctuation">;</span> config<span class="operator">?</span><span class="operator">:</span> <span class="type"><a href="/api/tinytick/type-aliases/taskrun/taskrunconfig/">TaskRunConfig</a></span><span class="punctuation">;</span> <span class="punctuation">}</span></code></td><td><p>An object containing the <a href="/api/tinytick/type-aliases/identity/id/"><code>Id</code></a> of the task to run, an optional string argument to pass to the <a href="/api/tinytick/type-aliases/task/task/"><code>Task</code></a>, an optional timestamp at, or duration after which, the task should run; and an optional <a href="/api/tinytick/type-aliases/taskrun/taskrunconfig/"><code>TaskRunConfig</code></a> to set for this run.</p></td></tr><tr><th class="right">returns</th><td><code><span class="keyword">undefined</span> <span class="operator">|</span> <span class="builtin">string</span></code></td><td><p></p><p>A new unique <a href="/api/tinytick/type-aliases/identity/id/"><code>Id</code></a> of the scheduled task run, or <code>undefined</code> if unsuccessful.</p><p></p></td></tr></table></div><section class="s2"><h2>Example</h2><p>This example registers a task that is then scheduled to run.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createManager<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinytick'</span><span class="punctuation">;</span>
48+
49+
<span class="keyword">const</span> manager <span class="operator">=</span> <span class="function"><a href="/api/tinytick/functions/creation/createmanager/">createManager</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
50+
manager<span class="punctuation">.</span><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/task/settask/">setTask</a></span><span class="punctuation">(</span><span class="string">'ping'</span><span class="punctuation">,</span> <span class="keyword">async</span> <span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">await</span> <span class="function">fetch</span><span class="punctuation">(</span><span class="string">'https://example.org'</span><span class="punctuation">)</span><span class="punctuation">)</span><span class="punctuation">;</span>
51+
52+
<span class="keyword">const</span> taskRunId <span class="operator">=</span> manager<span class="punctuation">.</span><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/scheduletaskrun/">scheduleTaskRun</a></span><span class="punctuation">(</span><span class="punctuation">{</span><span class="literal-property">taskId</span><span class="operator">:</span> <span class="string">'ping'</span><span class="punctuation">,</span> <span class="literal-property">startAfter</span><span class="operator">:</span> <span class="number">1</span><span class="punctuation">}</span><span class="punctuation">)</span><span class="punctuation">;</span>
53+
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>manager<span class="punctuation">.</span><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/getscheduledtaskrunids/">getScheduledTaskRunIds</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">.</span>length<span class="punctuation">)</span><span class="punctuation">;</span>
54+
<span class="comment">// -> 1</span>
55+
56+
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>manager<span class="punctuation">.</span><span class="function"><a href="/api/tinytick/interfaces/manager/manager/methods/taskrun/gettaskruninfo/">getTaskRunInfo</a></span><span class="punctuation">(</span>taskRunId<span class="punctuation">)</span><span class="punctuation">.</span>taskId<span class="punctuation">)</span><span class="punctuation">;</span>
57+
<span class="comment">// -> 'ping'</span>
58+
</code></pre></section><section class="s2"><h2>Since</h2><p>v1.2.5</p></section></section>

0 commit comments

Comments
 (0)