keuss 1.6.10 → 1.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Pipeline/Queue.js +12 -2
- package/Queue.js +18 -8
- package/TODO +0 -1
- package/backends/bucket-mongo-safe.js +42 -44
- package/backends/bucket-mongo.js +6 -8
- package/examples/snippets/06-random-consumer-producer.js +5 -5
- package/package.json +6 -6
- package/test/backends_bucket-at-least-once.js +43 -35
- package/test/backends_deadletter.js +10 -1
- package/.nyc_output/ad035de4-a3d3-451b-b2ad-402e8ed517b8.json +0 -1
- package/.nyc_output/c8683d6c-e7e6-496b-ab0d-1ff730837d08.json +0 -1
- package/.nyc_output/processinfo/ad035de4-a3d3-451b-b2ad-402e8ed517b8.json +0 -1
- package/.nyc_output/processinfo/c8683d6c-e7e6-496b-ab0d-1ff730837d08.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -79
- package/coverage/index.html +0 -162
- package/coverage/keuss/Pipeline/BaseLink.js.html +0 -636
- package/coverage/keuss/Pipeline/Builder.js.html +0 -615
- package/coverage/keuss/Pipeline/ChoiceLink.js.html +0 -294
- package/coverage/keuss/Pipeline/DirectLink.js.html +0 -231
- package/coverage/keuss/Pipeline/Pipeline.js.html +0 -258
- package/coverage/keuss/Pipeline/Queue.js.html +0 -939
- package/coverage/keuss/Pipeline/Sink.js.html +0 -147
- package/coverage/keuss/Pipeline/index.html +0 -175
- package/coverage/keuss/QFactory-MongoDB-defaults.js.html +0 -219
- package/coverage/keuss/QFactory.js.html +0 -459
- package/coverage/keuss/Queue.js.html +0 -2274
- package/coverage/keuss/Signal.js.html +0 -312
- package/coverage/keuss/Stats.js.html +0 -174
- package/coverage/keuss/backends/bucket-mongo-safe.js.html +0 -2952
- package/coverage/keuss/backends/bucket-mongo.js.html +0 -1167
- package/coverage/keuss/backends/index.html +0 -175
- package/coverage/keuss/backends/mongo.js.html +0 -897
- package/coverage/keuss/backends/pl-mongo.js.html +0 -723
- package/coverage/keuss/backends/ps-mongo.js.html +0 -1038
- package/coverage/keuss/backends/redis-list.js.html +0 -513
- package/coverage/keuss/backends/redis-oq.js.html +0 -543
- package/coverage/keuss/bench/all-mongo.js.html +0 -393
- package/coverage/keuss/bench/index.html +0 -149
- package/coverage/keuss/bench/multi-q.js.html +0 -324
- package/coverage/keuss/bench/redis-oq-consumer-producer.js.html +0 -225
- package/coverage/keuss/bench/redis-oq-consumer.js.html +0 -189
- package/coverage/keuss/bench/redis-oq-producer.js.html +0 -198
- package/coverage/keuss/docusaurus/.docusaurus/client-modules.js.html +0 -93
- package/coverage/keuss/docusaurus/.docusaurus/docusaurus.config.js.html +0 -402
- package/coverage/keuss/docusaurus/.docusaurus/index.html +0 -136
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/01a85c17.4e57aa0a.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/09d5ad39.3009117f.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/1.12cf3eb8.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/12559443.a244228c.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/17896441.5efb3558.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/1be78505.f9c04817.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/2.4e2dc02c.js.html +0 -72
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/3.d549a05d.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/36.db0e809a.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/37637b3c.28c0900b.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/3d8d21df.2228b429.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/45a5cd1f.951da354.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/52c38f7a.785707bc.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/57ffbe3d.04d3e53e.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/5f7c35e9.2fa77599.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/6299bd84.ec197a3e.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/6875c492.cdf3e939.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/6beec1d2.6873e708.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/7b786ad4.bbce08e6.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/8070e160.400a4e57.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/88c93c54.e868a433.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/8d3e6f9e.aadf6d32.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/9bc74468.516633c5.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/9beb87c2.71e3744d.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/a3732fac.b0f98dbf.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/a6aa9e1f.6ac55e6c.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/baf0d4a2.b50efd2d.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/c4f5d8e4.e9dfd999.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/ccc49370.1831890b.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/d4942345.7d23b349.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/e2244795.4ea3d168.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/e64fe266.308265e8.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/f78725cc.5f3e115d.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/fa8d8063.2312a332.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/index.html +0 -565
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/main.66f1008c.js.html +0 -72
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/runtime~main.7d73b048.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/keuss-gh-pages/styles.b5ee3016.js.html +0 -69
- package/coverage/keuss/docusaurus/.docusaurus/registry.js.html +0 -165
- package/coverage/keuss/docusaurus/.docusaurus/routes.js.html +0 -447
- package/coverage/keuss/docusaurus/build/01a85c17.4e57aa0a.js.html +0 -69
- package/coverage/keuss/docusaurus/build/09d5ad39.3009117f.js.html +0 -69
- package/coverage/keuss/docusaurus/build/1.12cf3eb8.js.html +0 -69
- package/coverage/keuss/docusaurus/build/12559443.a244228c.js.html +0 -69
- package/coverage/keuss/docusaurus/build/17896441.5efb3558.js.html +0 -69
- package/coverage/keuss/docusaurus/build/1be78505.f9c04817.js.html +0 -69
- package/coverage/keuss/docusaurus/build/2.4e2dc02c.js.html +0 -72
- package/coverage/keuss/docusaurus/build/3.d549a05d.js.html +0 -69
- package/coverage/keuss/docusaurus/build/36.db0e809a.js.html +0 -69
- package/coverage/keuss/docusaurus/build/37637b3c.28c0900b.js.html +0 -69
- package/coverage/keuss/docusaurus/build/3d8d21df.2228b429.js.html +0 -69
- package/coverage/keuss/docusaurus/build/45a5cd1f.951da354.js.html +0 -69
- package/coverage/keuss/docusaurus/build/52c38f7a.785707bc.js.html +0 -69
- package/coverage/keuss/docusaurus/build/57ffbe3d.04d3e53e.js.html +0 -69
- package/coverage/keuss/docusaurus/build/5f7c35e9.2fa77599.js.html +0 -69
- package/coverage/keuss/docusaurus/build/6299bd84.ec197a3e.js.html +0 -69
- package/coverage/keuss/docusaurus/build/6875c492.cdf3e939.js.html +0 -69
- package/coverage/keuss/docusaurus/build/6beec1d2.6873e708.js.html +0 -69
- package/coverage/keuss/docusaurus/build/7b786ad4.bbce08e6.js.html +0 -69
- package/coverage/keuss/docusaurus/build/8070e160.400a4e57.js.html +0 -69
- package/coverage/keuss/docusaurus/build/88c93c54.e868a433.js.html +0 -69
- package/coverage/keuss/docusaurus/build/8d3e6f9e.aadf6d32.js.html +0 -69
- package/coverage/keuss/docusaurus/build/9bc74468.516633c5.js.html +0 -69
- package/coverage/keuss/docusaurus/build/9beb87c2.71e3744d.js.html +0 -69
- package/coverage/keuss/docusaurus/build/a3732fac.b0f98dbf.js.html +0 -69
- package/coverage/keuss/docusaurus/build/a6aa9e1f.6ac55e6c.js.html +0 -69
- package/coverage/keuss/docusaurus/build/baf0d4a2.b50efd2d.js.html +0 -69
- package/coverage/keuss/docusaurus/build/c4f5d8e4.e9dfd999.js.html +0 -69
- package/coverage/keuss/docusaurus/build/ccc49370.1831890b.js.html +0 -69
- package/coverage/keuss/docusaurus/build/d4942345.7d23b349.js.html +0 -69
- package/coverage/keuss/docusaurus/build/e2244795.4ea3d168.js.html +0 -69
- package/coverage/keuss/docusaurus/build/e64fe266.308265e8.js.html +0 -69
- package/coverage/keuss/docusaurus/build/f78725cc.5f3e115d.js.html +0 -69
- package/coverage/keuss/docusaurus/build/fa8d8063.2312a332.js.html +0 -69
- package/coverage/keuss/docusaurus/build/index.html +0 -565
- package/coverage/keuss/docusaurus/build/main.66f1008c.js.html +0 -72
- package/coverage/keuss/docusaurus/build/runtime~main.7d73b048.js.html +0 -69
- package/coverage/keuss/docusaurus/build/styles.b5ee3016.js.html +0 -69
- package/coverage/keuss/docusaurus/docusaurus.config.js.html +0 -360
- package/coverage/keuss/docusaurus/index.html +0 -110
- package/coverage/keuss/docusaurus/sidebars.js.html +0 -96
- package/coverage/keuss/docusaurus/src/pages/index.html +0 -97
- package/coverage/keuss/docusaurus/src/pages/index.js.html +0 -450
- package/coverage/keuss/examples/pipelines/builder/index.html +0 -97
- package/coverage/keuss/examples/pipelines/builder/index.js.html +0 -450
- package/coverage/keuss/examples/pipelines/simplest/index.html +0 -97
- package/coverage/keuss/examples/pipelines/simplest/index.js.html +0 -183
- package/coverage/keuss/examples/pipelines/simulation-fork/index.html +0 -97
- package/coverage/keuss/examples/pipelines/simulation-fork/index.js.html +0 -414
- package/coverage/keuss/examples/snippets/01-simplest-pop-push.js.html +0 -195
- package/coverage/keuss/examples/snippets/02-simplest-reserve-rollback-commit.js.html +0 -201
- package/coverage/keuss/examples/snippets/03-simplest-producer-consumer-loops.js.html +0 -300
- package/coverage/keuss/examples/snippets/04-bucket-mongo-safe-insert-reserve-commit.js.html +0 -303
- package/coverage/keuss/examples/snippets/05-insert-reserve-rollback-deadletter.js.html +0 -384
- package/coverage/keuss/examples/snippets/06-random-consumer-producer.js.html +0 -879
- package/coverage/keuss/examples/snippets/index.html +0 -188
- package/coverage/keuss/examples/snippets/redislabs-consumer-producer.js.html +0 -201
- package/coverage/keuss/examples/snippets/with-redis-stats-and-signaller-consumer-producer.js.html +0 -222
- package/coverage/keuss/examples/webhooks/app.js.html +0 -279
- package/coverage/keuss/examples/webhooks/consumer.js.html +0 -363
- package/coverage/keuss/examples/webhooks/index.html +0 -123
- package/coverage/keuss/examples/webhooks/index.js.html +0 -234
- package/coverage/keuss/index.html +0 -149
- package/coverage/keuss/playground/index.html +0 -136
- package/coverage/keuss/playground/pl-rollback.js.html +0 -234
- package/coverage/keuss/playground/pl1.js.html +0 -291
- package/coverage/keuss/playground/q1.js.html +0 -168
- package/coverage/keuss/playground/simple-pl.js.html +0 -195
- package/coverage/keuss/signal/index.html +0 -123
- package/coverage/keuss/signal/local.js.html +0 -306
- package/coverage/keuss/signal/mongo-capped.js.html +0 -378
- package/coverage/keuss/signal/redis-pubsub.js.html +0 -399
- package/coverage/keuss/stats/index.html +0 -123
- package/coverage/keuss/stats/mem.js.html +0 -519
- package/coverage/keuss/stats/mongo.js.html +0 -930
- package/coverage/keuss/stats/redis.js.html +0 -894
- package/coverage/keuss/utils/RedisConn.js.html +0 -150
- package/coverage/keuss/utils/RedisOrderedQueue.js.html +0 -864
- package/coverage/keuss/utils/index.html +0 -110
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -170
- package/docusaurus/README.md +0 -33
- package/docusaurus/babel.config.js +0 -3
- package/docusaurus/blog/2020-08-04-welcome.md +0 -10
- package/docusaurus/docs/about.md +0 -14
- package/docusaurus/docs/api/factory.md +0 -102
- package/docusaurus/docs/api/queue.md +0 -247
- package/docusaurus/docs/api/signal.md +0 -38
- package/docusaurus/docs/api/stats.md +0 -37
- package/docusaurus/docs/changelog.md +0 -51
- package/docusaurus/docs/concepts.md +0 -116
- package/docusaurus/docs/examples.md +0 -10
- package/docusaurus/docs/quickstart.md +0 -195
- package/docusaurus/docs/style-guide.md +0 -202
- package/docusaurus/docs/usage/buckets.md +0 -43
- package/docusaurus/docs/usage/no-signaller.md +0 -16
- package/docusaurus/docs/usage/pipelines/about.md +0 -128
- package/docusaurus/docs/usage/pipelines/building.md +0 -158
- package/docusaurus/docs/usage/pipelines/examples.md +0 -10
- package/docusaurus/docs/usage/pipelines/processors.md +0 -187
- package/docusaurus/docs/usage/putting-all-together.md +0 -153
- package/docusaurus/docs/usage/redis-conns.md +0 -70
- package/docusaurus/docs/usage/shutdown.md +0 -11
- package/docusaurus/docusaurus.config.js +0 -96
- package/docusaurus/package.json +0 -33
- package/docusaurus/sidebars.js +0 -44
- package/docusaurus/src/css/custom.css +0 -25
- package/docusaurus/src/pages/index.js +0 -127
- package/docusaurus/src/pages/styles.module.css +0 -37
- package/docusaurus/static/.nojekyll +0 -0
- package/docusaurus/static/img/favicon.ico +0 -0
- package/docusaurus/static/img/logo.svg +0 -1
- package/docusaurus/yarn.lock +0 -8384
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Code coverage report for keuss/examples/webhooks/app.js</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<link rel="stylesheet" href="../../../prettify.css" />
|
|
7
|
-
<link rel="stylesheet" href="../../../base.css" />
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<style type='text/css'>
|
|
10
|
-
.coverage-summary .sorter {
|
|
11
|
-
background-image: url(../../../sort-arrow-sprite.png);
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div class='wrapper'>
|
|
17
|
-
<div class='pad1'>
|
|
18
|
-
<h1>
|
|
19
|
-
<a href="../../../index.html">All files</a> / <a href="index.html">keuss/examples/webhooks</a> app.js
|
|
20
|
-
</h1>
|
|
21
|
-
<div class='clearfix'>
|
|
22
|
-
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">0% </span>
|
|
24
|
-
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>0/38</span>
|
|
26
|
-
</div>
|
|
27
|
-
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">0% </span>
|
|
29
|
-
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>0/8</span>
|
|
31
|
-
</div>
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">0% </span>
|
|
34
|
-
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>0/11</span>
|
|
36
|
-
</div>
|
|
37
|
-
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">0% </span>
|
|
39
|
-
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>0/31</span>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
<p class="quiet">
|
|
44
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
45
|
-
</p>
|
|
46
|
-
</div>
|
|
47
|
-
<div class='status-line low'></div>
|
|
48
|
-
<pre><table class="coverage">
|
|
49
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
51
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
52
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
53
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
54
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
55
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
56
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
57
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
58
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
59
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
60
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
61
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
62
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
63
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
64
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
65
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
66
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
67
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
68
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
69
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
70
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
71
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
72
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
73
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
74
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
75
|
-
<a name='L27'></a><a href='#L27'>27</a>
|
|
76
|
-
<a name='L28'></a><a href='#L28'>28</a>
|
|
77
|
-
<a name='L29'></a><a href='#L29'>29</a>
|
|
78
|
-
<a name='L30'></a><a href='#L30'>30</a>
|
|
79
|
-
<a name='L31'></a><a href='#L31'>31</a>
|
|
80
|
-
<a name='L32'></a><a href='#L32'>32</a>
|
|
81
|
-
<a name='L33'></a><a href='#L33'>33</a>
|
|
82
|
-
<a name='L34'></a><a href='#L34'>34</a>
|
|
83
|
-
<a name='L35'></a><a href='#L35'>35</a>
|
|
84
|
-
<a name='L36'></a><a href='#L36'>36</a>
|
|
85
|
-
<a name='L37'></a><a href='#L37'>37</a>
|
|
86
|
-
<a name='L38'></a><a href='#L38'>38</a>
|
|
87
|
-
<a name='L39'></a><a href='#L39'>39</a>
|
|
88
|
-
<a name='L40'></a><a href='#L40'>40</a>
|
|
89
|
-
<a name='L41'></a><a href='#L41'>41</a>
|
|
90
|
-
<a name='L42'></a><a href='#L42'>42</a>
|
|
91
|
-
<a name='L43'></a><a href='#L43'>43</a>
|
|
92
|
-
<a name='L44'></a><a href='#L44'>44</a>
|
|
93
|
-
<a name='L45'></a><a href='#L45'>45</a>
|
|
94
|
-
<a name='L46'></a><a href='#L46'>46</a>
|
|
95
|
-
<a name='L47'></a><a href='#L47'>47</a>
|
|
96
|
-
<a name='L48'></a><a href='#L48'>48</a>
|
|
97
|
-
<a name='L49'></a><a href='#L49'>49</a>
|
|
98
|
-
<a name='L50'></a><a href='#L50'>50</a>
|
|
99
|
-
<a name='L51'></a><a href='#L51'>51</a>
|
|
100
|
-
<a name='L52'></a><a href='#L52'>52</a>
|
|
101
|
-
<a name='L53'></a><a href='#L53'>53</a>
|
|
102
|
-
<a name='L54'></a><a href='#L54'>54</a>
|
|
103
|
-
<a name='L55'></a><a href='#L55'>55</a>
|
|
104
|
-
<a name='L56'></a><a href='#L56'>56</a>
|
|
105
|
-
<a name='L57'></a><a href='#L57'>57</a>
|
|
106
|
-
<a name='L58'></a><a href='#L58'>58</a>
|
|
107
|
-
<a name='L59'></a><a href='#L59'>59</a>
|
|
108
|
-
<a name='L60'></a><a href='#L60'>60</a>
|
|
109
|
-
<a name='L61'></a><a href='#L61'>61</a>
|
|
110
|
-
<a name='L62'></a><a href='#L62'>62</a>
|
|
111
|
-
<a name='L63'></a><a href='#L63'>63</a>
|
|
112
|
-
<a name='L64'></a><a href='#L64'>64</a>
|
|
113
|
-
<a name='L65'></a><a href='#L65'>65</a>
|
|
114
|
-
<a name='L66'></a><a href='#L66'>66</a>
|
|
115
|
-
<a name='L67'></a><a href='#L67'>67</a>
|
|
116
|
-
<a name='L68'></a><a href='#L68'>68</a>
|
|
117
|
-
<a name='L69'></a><a href='#L69'>69</a>
|
|
118
|
-
<a name='L70'></a><a href='#L70'>70</a>
|
|
119
|
-
<a name='L71'></a><a href='#L71'>71</a></td><td class="line-coverage quiet"><span class="cline-any cline-no"> </span>
|
|
120
|
-
<span class="cline-any cline-no"> </span>
|
|
121
|
-
<span class="cline-any cline-neutral"> </span>
|
|
122
|
-
<span class="cline-any cline-neutral"> </span>
|
|
123
|
-
<span class="cline-any cline-no"> </span>
|
|
124
|
-
<span class="cline-any cline-no"> </span>
|
|
125
|
-
<span class="cline-any cline-neutral"> </span>
|
|
126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
127
|
-
<span class="cline-any cline-no"> </span>
|
|
128
|
-
<span class="cline-any cline-neutral"> </span>
|
|
129
|
-
<span class="cline-any cline-neutral"> </span>
|
|
130
|
-
<span class="cline-any cline-no"> </span>
|
|
131
|
-
<span class="cline-any cline-no"> </span>
|
|
132
|
-
<span class="cline-any cline-no"> </span>
|
|
133
|
-
<span class="cline-any cline-neutral"> </span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span>
|
|
135
|
-
<span class="cline-any cline-no"> </span>
|
|
136
|
-
<span class="cline-any cline-neutral"> </span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-no"> </span>
|
|
139
|
-
<span class="cline-any cline-no"> </span>
|
|
140
|
-
<span class="cline-any cline-no"> </span>
|
|
141
|
-
<span class="cline-any cline-no"> </span>
|
|
142
|
-
<span class="cline-any cline-neutral"> </span>
|
|
143
|
-
<span class="cline-any cline-neutral"> </span>
|
|
144
|
-
<span class="cline-any cline-neutral"> </span>
|
|
145
|
-
<span class="cline-any cline-no"> </span>
|
|
146
|
-
<span class="cline-any cline-no"> </span>
|
|
147
|
-
<span class="cline-any cline-neutral"> </span>
|
|
148
|
-
<span class="cline-any cline-neutral"> </span>
|
|
149
|
-
<span class="cline-any cline-neutral"> </span>
|
|
150
|
-
<span class="cline-any cline-neutral"> </span>
|
|
151
|
-
<span class="cline-any cline-neutral"> </span>
|
|
152
|
-
<span class="cline-any cline-neutral"> </span>
|
|
153
|
-
<span class="cline-any cline-neutral"> </span>
|
|
154
|
-
<span class="cline-any cline-no"> </span>
|
|
155
|
-
<span class="cline-any cline-neutral"> </span>
|
|
156
|
-
<span class="cline-any cline-no"> </span>
|
|
157
|
-
<span class="cline-any cline-no"> </span>
|
|
158
|
-
<span class="cline-any cline-no"> </span>
|
|
159
|
-
<span class="cline-any cline-neutral"> </span>
|
|
160
|
-
<span class="cline-any cline-neutral"> </span>
|
|
161
|
-
<span class="cline-any cline-neutral"> </span>
|
|
162
|
-
<span class="cline-any cline-no"> </span>
|
|
163
|
-
<span class="cline-any cline-no"> </span>
|
|
164
|
-
<span class="cline-any cline-neutral"> </span>
|
|
165
|
-
<span class="cline-any cline-neutral"> </span>
|
|
166
|
-
<span class="cline-any cline-neutral"> </span>
|
|
167
|
-
<span class="cline-any cline-neutral"> </span>
|
|
168
|
-
<span class="cline-any cline-neutral"> </span>
|
|
169
|
-
<span class="cline-any cline-no"> </span>
|
|
170
|
-
<span class="cline-any cline-no"> </span>
|
|
171
|
-
<span class="cline-any cline-no"> </span>
|
|
172
|
-
<span class="cline-any cline-no"> </span>
|
|
173
|
-
<span class="cline-any cline-neutral"> </span>
|
|
174
|
-
<span class="cline-any cline-neutral"> </span>
|
|
175
|
-
<span class="cline-any cline-no"> </span>
|
|
176
|
-
<span class="cline-any cline-neutral"> </span>
|
|
177
|
-
<span class="cline-any cline-neutral"> </span>
|
|
178
|
-
<span class="cline-any cline-no"> </span>
|
|
179
|
-
<span class="cline-any cline-neutral"> </span>
|
|
180
|
-
<span class="cline-any cline-neutral"> </span>
|
|
181
|
-
<span class="cline-any cline-no"> </span>
|
|
182
|
-
<span class="cline-any cline-no"> </span>
|
|
183
|
-
<span class="cline-any cline-no"> </span>
|
|
184
|
-
<span class="cline-any cline-neutral"> </span>
|
|
185
|
-
<span class="cline-any cline-neutral"> </span>
|
|
186
|
-
<span class="cline-any cline-no"> </span>
|
|
187
|
-
<span class="cline-any cline-neutral"> </span>
|
|
188
|
-
<span class="cline-any cline-neutral"> </span>
|
|
189
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const express = <span class="cstat-no" title="statement not covered" >require ('express');</span>
|
|
190
|
-
const bodyParser = <span class="cstat-no" title="statement not covered" >require ('body-parser');</span>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<span class="cstat-no" title="statement not covered" >module.exports = <span class="fstat-no" title="function not covered" >(c</span>ontext) => {</span>
|
|
194
|
-
var app = <span class="cstat-no" title="statement not covered" >express();</span>
|
|
195
|
-
|
|
196
|
-
// parse everything as text. A more robust and generic solution shoudl use raw() and manage Buffers, though
|
|
197
|
-
<span class="cstat-no" title="statement not covered" > app.use (bodyParser.text ({type: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >true}</span>));</span>
|
|
198
|
-
|
|
199
|
-
// main server entry point: anything here is queued for async delivery
|
|
200
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/wh', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => {</span>
|
|
201
|
-
const url = <span class="cstat-no" title="statement not covered" >req.headers['x-dest-url'];</span>
|
|
202
|
-
let delay = <span class="cstat-no" title="statement not covered" >0;</span>
|
|
203
|
-
|
|
204
|
-
// we expect a header x-dest-url to specif the webhook's url
|
|
205
|
-
<span class="cstat-no" title="statement not covered" > if (!url) <span class="cstat-no" title="statement not covered" >return res.status (400).send ('no x-dest-url, ignoring request');</span></span>
|
|
206
|
-
|
|
207
|
-
// one can specify the initial delay, if desired
|
|
208
|
-
const delay_str = <span class="cstat-no" title="statement not covered" >req.headers['x-delay'];</span>
|
|
209
|
-
<span class="cstat-no" title="statement not covered" > if (delay_str) {</span>
|
|
210
|
-
<span class="cstat-no" title="statement not covered" > delete req.headers['x-delay'];</span>
|
|
211
|
-
<span class="cstat-no" title="statement not covered" > delay = parseInt (delay_str);</span>
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// build the payload...
|
|
215
|
-
<span class="cstat-no" title="statement not covered" > delete req.headers['x-dest-url'];</span>
|
|
216
|
-
const pl = <span class="cstat-no" title="statement not covered" >{</span>
|
|
217
|
-
url: url,
|
|
218
|
-
method: req.method,
|
|
219
|
-
headers: req.headers,
|
|
220
|
-
body: req.body
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
// ...and queue it
|
|
224
|
-
<span class="cstat-no" title="statement not covered" > context.q.push (pl, {delay: delay}, <span class="fstat-no" title="function not covered" >(e</span>rr, id) => {</span>
|
|
225
|
-
// error while queuing?
|
|
226
|
-
<span class="cstat-no" title="statement not covered" > if (err) {</span>
|
|
227
|
-
<span class="cstat-no" title="statement not covered" > console.error ('error whipe pushing payload:', err);</span>
|
|
228
|
-
<span class="cstat-no" title="statement not covered" > return res.status (500).send (err);</span>
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// no errors, return a 201 Created...
|
|
232
|
-
<span class="cstat-no" title="statement not covered" > console.log ('inserted element with id %s', id);</span>
|
|
233
|
-
<span class="cstat-no" title="statement not covered" > return res.status (201).send ({res: 'ok', id: id});</span>
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
// test respnses for various http response codes
|
|
239
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/200', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => <span class="cstat-no" title="statement not covered" >res.status (200).send ('a 200'))</span>;</span>
|
|
240
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/400', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => <span class="cstat-no" title="statement not covered" >res.status (400).send ('a 400'))</span>;</span>
|
|
241
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/404', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => <span class="cstat-no" title="statement not covered" >res.status (404).send ('a 404'))</span>;</span>
|
|
242
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/500', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => <span class="cstat-no" title="statement not covered" >res.status (500).send ('a 500'))</span>;</span>
|
|
243
|
-
|
|
244
|
-
// do not respond
|
|
245
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/noresponse', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => {});</span>
|
|
246
|
-
|
|
247
|
-
// close socket
|
|
248
|
-
<span class="cstat-no" title="statement not covered" > app.all ('/test/drop', <span class="fstat-no" title="function not covered" >(r</span>eq, res) => <span class="cstat-no" title="statement not covered" >req.socket.destroy())</span>;</span>
|
|
249
|
-
|
|
250
|
-
// express error manager
|
|
251
|
-
<span class="cstat-no" title="statement not covered" > app.use (<span class="fstat-no" title="function not covered" >fu</span>nction (err, req, res, next) {</span>
|
|
252
|
-
<span class="cstat-no" title="statement not covered" > console.error ('error caught: %s', err.stack);</span>
|
|
253
|
-
<span class="cstat-no" title="statement not covered" > res.status (err.status || 500).send (err.stack);</span>
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
<span class="cstat-no" title="statement not covered" > return app;</span>
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
</pre></td></tr>
|
|
260
|
-
</table></pre>
|
|
261
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
262
|
-
</div><!-- /wrapper -->
|
|
263
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
264
|
-
Code coverage
|
|
265
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sun Aug 30 2020 20:39:29 GMT+0200 (GMT+02:00)
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
<script src="../../../prettify.js"></script>
|
|
269
|
-
<script>
|
|
270
|
-
window.onload = function () {
|
|
271
|
-
if (typeof prettyPrint === 'function') {
|
|
272
|
-
prettyPrint();
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
</script>
|
|
276
|
-
<script src="../../../sorter.js"></script>
|
|
277
|
-
<script src="../../../block-navigation.js"></script>
|
|
278
|
-
</body>
|
|
279
|
-
</html>
|