mqtt-plus 0.9.7 → 0.9.8
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/doc/mqtt-plus-3-resource-transfer.svg +97 -90
- package/dst-stage1/mqtt-plus-resource.d.ts +2 -0
- package/dst-stage1/mqtt-plus-resource.js +52 -89
- package/dst-stage2/mqtt-plus.cjs.js +51 -77
- package/dst-stage2/mqtt-plus.esm.js +51 -77
- package/dst-stage2/mqtt-plus.umd.js +14 -14
- package/etc/stx.conf +2 -3
- package/package.json +1 -1
- package/src/mqtt-plus-resource.ts +81 -95
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" data-d2-version="v0.7.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0
|
|
2
|
-
.d2-
|
|
3
|
-
font-family: "d2-
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" data-d2-version="v0.7.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 826 1987"><svg class="d2-3815173987 d2-svg" width="826" height="1987" viewBox="11 51 826 1987"><rect x="11.000000" y="51.000000" width="826.000000" height="1987.000000" rx="0.000000" fill="#ffffff" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
|
2
|
+
.d2-3815173987 .text {
|
|
3
|
+
font-family: "d2-3815173987-font-regular";
|
|
4
4
|
}
|
|
5
5
|
@font-face {
|
|
6
|
-
font-family: d2-
|
|
7
|
-
src: url("data:application/font-woff;base64,
|
|
6
|
+
font-family: d2-3815173987-font-regular;
|
|
7
|
+
src: url("data:application/font-woff;base64,d09GRgABAAAAAA8YAAoAAAAAFvgAAguFAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAGAAAABgXd/Vo2NtYXAAAAFU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JUHwLKkoCSqakBOTMGdOixxHHDJgwpcRxpEqeWUjOiIpLIp3vLMJ3ZkhCRmmszsmIxdOJX6LsLsc4ehSKXa18vFbhKY7vlO255Yr9ikC/boXZ+rlLNhEX6meqrqTauZSCE+36czt8K1yxh7tXf9aZfLhHsf5XqnzKufSPpVQmJhnObdEhlINC9wTHgdZdQnXke7oMeEOPdwy07tCnT4cTBnR5rdwefRxf0+OEQ2V0hRd7R3LMCT/i+IauYnztxPqzUCzhFwpzdymOc91jRqGee+aB7prohndX2M9QvuaOUjlDzZGPdNIv05xFjM0VhRjO1MulN0rrX2yOmOkuXtubfT8NFzZ7yym+ItcMe7cuOHnlFow+pGpwyzOX+gmIiMk5VcSQnBktKq7E+y0R56Q4DtW9N5qSis51jj/nSi5JmIlBl0x15hT6G5lvQuM+XPO9s7ckVr5nenZ9q/uc4tSrG43eqXvLvdC6nKwo0DJV8xU3DcU1M+8nmqlV/qFyS71uOc/ok0j1VDe4/Q48J6DNDrvsM9E5Q+1c2BvR1jvR5hX76sEZiaJGcnViFXYJeMEuu7zixVrNDocc0GP/DhwXWT0OeH1rZ12nZRVndf4Um7b4Op5dr17eW6/P7+DLLzRRNy9jX9r4bl9YtRv/nxAx81zc1uqd3BOC/wAAAP//AQAA//8HW0wwAHicYmBmAIP/5xiMGLAAAAAAAP//AQAA//8vAQIDAAAA");
|
|
8
8
|
}
|
|
9
|
-
.d2-
|
|
10
|
-
font-family: "d2-
|
|
9
|
+
.d2-3815173987 .text-italic {
|
|
10
|
+
font-family: "d2-3815173987-font-italic";
|
|
11
11
|
}
|
|
12
12
|
@font-face {
|
|
13
|
-
font-family: d2-
|
|
14
|
-
src: url("data:application/font-woff;base64,
|
|
13
|
+
font-family: d2-3815173987-font-italic;
|
|
14
|
+
src: url("data:application/font-woff;base64,d09GRgABAAAAAA+AAAoAAAAAF9gAARhRAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAGAAAABgW1SVeGNtYXAAAAFUAAAAuAA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YkUcU+FIiUiJKRlbxLfyynmtjEOdZnbXpmJMzIk8TonJcOSMyMlIOFWcioqCF7RoUdIX34KKkoCSCSkBOTNGtOhwyBE9xkwocRwqkmcWkTOk4pxY+Z1Z+M70ScgojdUZGQPxdOKXyDvkCEeHQrarkY/WIjzE8aO8Pbdctt8S6NetMFvPu2QTM1c/U3Ul1c25JjjWrc/b5gfhihe4W/Vnncn1PRrof6XIJ5xp/gNNKhOTDOe2aBNJQZG7j2Nf55BIHfmJkB6v6PCGns5tunRpc0yPkJfy7dDF8R0djjmQRyi8uDuUYo75Bcf3hLLxsRPrz2JiCb9TmLpLcZypjimFeu6ZB6o1UYU3n7DfoXxNHaV8+tojb+k0v0x7FjMyVRRiOFUvl9oorX8DU8RUtfjZXt37bZjb7i23+IJcO+zVuuDkJ7dgdN1Ug/c0c66fgJgBOSey6JMzpUXFhXi/JuaMFMeBuvdKW1LRvvTxeS6kkoSpGIRkijOj0N/YdBMZ9/6a7p29JQP5e6anl1XdJotTr65m9EbdW95F1uVkZQItm2q+oqa+uGam/UQ7tco/km+p1y3nEaHiLnb7Q6/ADs/ZZY+xsvR1M7+886+Et9hTB05JZDWUpn0NjwnYJeApu+zynKfv9XLJxhkft8ZnNX+bA/bpsHdtNQvbDvu8XIv28cx/ie2O6nE8ujw9u/U0H9xAtd9o367eza4m56cxt2hX23FMzNRzcVurNbn7BP8DAAD//wEAAP//cqFRQAAAAAMAAP/1AAD/zgAyAAAAAAAAAAAAAAAAAAAAAAAAAAA=");
|
|
15
15
|
}]]></style><style type="text/css"><![CDATA[.shape {
|
|
16
16
|
shape-rendering: geometricPrecision;
|
|
17
17
|
stroke-linejoin: round;
|
|
@@ -25,85 +25,92 @@
|
|
|
25
25
|
opacity: 0.5;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.d2-
|
|
29
|
-
.d2-
|
|
30
|
-
.d2-
|
|
31
|
-
.d2-
|
|
32
|
-
.d2-
|
|
33
|
-
.d2-
|
|
34
|
-
.d2-
|
|
35
|
-
.d2-
|
|
36
|
-
.d2-
|
|
37
|
-
.d2-
|
|
38
|
-
.d2-
|
|
39
|
-
.d2-
|
|
40
|
-
.d2-
|
|
41
|
-
.d2-
|
|
42
|
-
.d2-
|
|
43
|
-
.d2-
|
|
44
|
-
.d2-
|
|
45
|
-
.d2-
|
|
46
|
-
.d2-
|
|
47
|
-
.d2-
|
|
48
|
-
.d2-
|
|
49
|
-
.d2-
|
|
50
|
-
.d2-
|
|
51
|
-
.d2-
|
|
52
|
-
.d2-
|
|
53
|
-
.d2-
|
|
54
|
-
.d2-
|
|
55
|
-
.d2-
|
|
56
|
-
.d2-
|
|
57
|
-
.d2-
|
|
58
|
-
.d2-
|
|
59
|
-
.d2-
|
|
60
|
-
.d2-
|
|
61
|
-
.d2-
|
|
62
|
-
.d2-
|
|
63
|
-
.d2-
|
|
64
|
-
.d2-
|
|
65
|
-
.d2-
|
|
66
|
-
.d2-
|
|
67
|
-
.d2-
|
|
68
|
-
.d2-
|
|
69
|
-
.d2-
|
|
70
|
-
.d2-
|
|
71
|
-
.d2-
|
|
72
|
-
.d2-
|
|
73
|
-
.d2-
|
|
74
|
-
.d2-
|
|
75
|
-
.d2-
|
|
76
|
-
.d2-
|
|
77
|
-
.d2-
|
|
78
|
-
.d2-
|
|
79
|
-
.d2-
|
|
80
|
-
.d2-
|
|
81
|
-
.d2-
|
|
82
|
-
.d2-
|
|
83
|
-
.d2-
|
|
84
|
-
.d2-
|
|
85
|
-
.d2-
|
|
86
|
-
.d2-
|
|
87
|
-
.d2-
|
|
88
|
-
.d2-
|
|
89
|
-
.d2-
|
|
90
|
-
.d2-
|
|
91
|
-
.d2-
|
|
92
|
-
.d2-
|
|
93
|
-
.d2-
|
|
94
|
-
.d2-
|
|
95
|
-
.d2-
|
|
96
|
-
.d2-
|
|
97
|
-
.d2-
|
|
98
|
-
.d2-
|
|
99
|
-
.d2-3961372893 .color-AB5{color:#ffe0c8;}.appendix text.text{fill:#303030}.md{--color-fg-default:#303030;--color-fg-muted:#606060;--color-fg-subtle:#909090;--color-canvas-default:#ffffff;--color-canvas-subtle:#f0f0f0;--color-border-default:#336699;--color-border-muted:#6699cc;--color-neutral-muted:#f0f0f0;--color-accent-fg:#6699cc;--color-accent-emphasis:#6699cc;--color-attention-subtle:#606060;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-dark-d2-3961372893);mix-blend-mode:overlay}.sketch-overlay-B2{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-B3{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-B4{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-B5{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-AA4{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-3961372893);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-3961372893);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-normal-d2-3961372893);mix-blend-mode:color-burn}.sketch-overlay-N6{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-3961372893);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g class="Y2xpZW50"><g class="shape" ><rect x="12.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#336699" fill="#e0f0ff" class=" stroke-B1 fill-B5" style="stroke-width:2;" /></g><text x="62.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Client</text></g><g class="YnJva2Vy brown"><g class="shape" ><rect x="318.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#cfb098" fill="#ffe0c9" style="stroke-width:2;" /></g><text x="368.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Broker</text></g><g class="c2VydmVy"><g class="shape" ><rect x="624.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#336699" fill="#e0f0ff" class=" stroke-B1 fill-B5" style="stroke-width:2;" /></g><text x="674.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Server</text></g><g class="KGNsaWVudCAtLSApWzBd"><path d="M 62.000000 120.000000 L 62.000000 1167.000000" stroke="#6699cc" fill="none" class="connection stroke-B2" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3961372893)" /></g><g class="KGJyb2tlciAtLSApWzBd"><path d="M 368.000000 120.000000 L 368.000000 1167.000000" stroke="#cfb098" fill="none" class="connection" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3961372893)" /></g><g class="KHNlcnZlciAtLSApWzBd"><path d="M 674.000000 120.000000 L 674.000000 1167.000000" stroke="#6699cc" fill="none" class="connection stroke-B2" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3961372893)" /></g><g class="JiMzOTtwcm92aXNpb24oJiMzNDtmb28vYmFyJiMzNDspJiMzOTs="><g class="shape blend" ><rect x="328.000000" y="175.000000" width="386.000000" height="92.000000" stroke="#336699" fill="#e0e0e0" class=" stroke-B1 fill-N5" style="stroke-width:0;" /></g><rect x="333.000000" y="180.000000" width="135.000000" height="21.000000" fill="#e0e0e0" class=" fill-N5" /><text x="400.500000" y="196.000000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">provision("foo/bar")</text></g><g class="JiMzOTt0cmFuc2ZlcigmIzM0O2Zvby9iYXImIzM0OykmIzM5Ow=="><g class="shape blend" ><rect x="22.000000" y="312.000000" width="692.000000" height="824.000000" stroke="#336699" fill="#e0e0e0" class=" stroke-B1 fill-N5" style="stroke-width:0;" /></g><rect x="27.000000" y="317.000000" width="126.000000" height="21.000000" fill="#e0e0e0" class=" fill-N5" /><text x="90.000000" y="333.000000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">transfer("foo/bar")</text></g><g class="KHNlcnZlciAtJmd0OyBicm9rZXIpWzBd"><marker id="mk-d2-3961372893-3488378134" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" fill="#336699" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 672.000000 237.000000 L 372.000000 237.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3961372893-3488378134)" mask="url(#d2-3961372893)" /><text x="521.000000" y="235.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="521.000000" dy="0.000000">op: subscribe</tspan><tspan x="521.000000" dy="18.500000">topic: foo/bar/resource-transfer/any</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzBd"><path d="M 64.000000 374.000000 L 364.000000 374.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3961372893-3488378134)" mask="url(#d2-3961372893)" /><text x="215.000000" y="372.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="215.000000" dy="0.000000">op: subscribe</tspan><tspan x="215.000000" dy="18.500000">topic: foo/bar/resource-transfer/XXX</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzFd"><path d="M 64.000000 488.000000 L 364.000000 488.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3961372893-3488378134)" mask="url(#d2-3961372893)" /><text x="215.000000" y="478.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="215.000000" dy="0.000000">op: publish</tspan><tspan x="215.000000" dy="17.666667">topic: foo/bar/resource-transfer/any</tspan><tspan x="215.000000" dy="17.666667">data: Resource-Transfer-Request</tspan></text></g><g class="KGJyb2tlciAtJmd0OyBzZXJ2ZXIpWzBd"><path d="M 370.000000 610.000000 L 670.000000 610.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3961372893-3488378134)" mask="url(#d2-3961372893)" /><text x="521.000000" y="600.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="521.000000" dy="0.000000">op: publish</tspan><tspan x="521.000000" dy="17.666667">topic: foo/bar/resource-transfer/any</tspan><tspan x="521.000000" dy="17.666667">data: Resource-Transfer-Request</tspan></text></g><g class="KGJyb2tlciAmbHQ7LSBzZXJ2ZXIpWzBd"><marker id="mk-d2-3961372893-2451250203" markerWidth="10.000000" markerHeight="12.000000" refX="3.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="10.000000,0.000000 0.000000,6.000000 10.000000,12.000000" fill="#336699" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 372.000000 732.000000 L 672.000000 732.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3961372893-2451250203)" mask="url(#d2-3961372893)" /><text x="521.500000" y="722.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="521.500000" dy="0.000000">op: publish</tspan><tspan x="521.500000" dy="17.666667">topic: foo/bar/resource-response/XXX</tspan><tspan x="521.500000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGNsaWVudCAmbHQ7LSBicm9rZXIpWzBd"><path d="M 66.000000 854.000000 L 366.000000 854.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3961372893-2451250203)" mask="url(#d2-3961372893)" /><text x="215.500000" y="844.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="215.500000" dy="0.000000">op: publish</tspan><tspan x="215.500000" dy="17.666667">topic: foo/bar/resource-response/XXX</tspan><tspan x="215.500000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGJyb2tlciAmbHQ7LSBzZXJ2ZXIpWzFd"><path d="M 372.000000 976.000000 L 672.000000 976.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3961372893-2451250203)" mask="url(#d2-3961372893)" /><text x="521.000000" y="966.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="521.000000" dy="0.000000">op: publish</tspan><tspan x="521.000000" dy="17.666667">topic: foo/bar/resource-response/XXX</tspan><tspan x="521.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><g class="KGNsaWVudCAmbHQ7LSBicm9rZXIpWzFd"><path d="M 66.000000 1098.000000 L 366.000000 1098.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3961372893-2451250203)" mask="url(#d2-3961372893)" /><text x="215.000000" y="1088.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="215.000000" dy="0.000000">op: publish</tspan><tspan x="215.000000" dy="17.666667">topic: foo/bar/resource-response/XXX</tspan><tspan x="215.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><mask id="d2-3961372893" maskUnits="userSpaceOnUse" x="11" y="51" width="714" height="1118">
|
|
100
|
-
<rect x="11" y="51" width="
|
|
101
|
-
<rect x="
|
|
102
|
-
<rect x="
|
|
103
|
-
<rect x="
|
|
104
|
-
<rect x="
|
|
105
|
-
<rect x="
|
|
106
|
-
<rect x="
|
|
107
|
-
<rect x="
|
|
108
|
-
<rect x="
|
|
28
|
+
.d2-3815173987 .fill-N1{fill:#303030;}
|
|
29
|
+
.d2-3815173987 .fill-N2{fill:#606060;}
|
|
30
|
+
.d2-3815173987 .fill-N3{fill:#909090;}
|
|
31
|
+
.d2-3815173987 .fill-N4{fill:#c0c0c0;}
|
|
32
|
+
.d2-3815173987 .fill-N5{fill:#e0e0e0;}
|
|
33
|
+
.d2-3815173987 .fill-N6{fill:#f0f0f0;}
|
|
34
|
+
.d2-3815173987 .fill-N7{fill:#ffffff;}
|
|
35
|
+
.d2-3815173987 .fill-B1{fill:#336699;}
|
|
36
|
+
.d2-3815173987 .fill-B2{fill:#6699cc;}
|
|
37
|
+
.d2-3815173987 .fill-B3{fill:#99ccff;}
|
|
38
|
+
.d2-3815173987 .fill-B4{fill:#c0d0ff;}
|
|
39
|
+
.d2-3815173987 .fill-B5{fill:#e0f0ff;}
|
|
40
|
+
.d2-3815173987 .fill-B6{fill:#f0f8ff;}
|
|
41
|
+
.d2-3815173987 .fill-AA2{fill:#cfb098;}
|
|
42
|
+
.d2-3815173987 .fill-AA4{fill:#efd0b8;}
|
|
43
|
+
.d2-3815173987 .fill-AA5{fill:#ffe0c8;}
|
|
44
|
+
.d2-3815173987 .fill-AB4{fill:#efd0b8;}
|
|
45
|
+
.d2-3815173987 .fill-AB5{fill:#ffe0c8;}
|
|
46
|
+
.d2-3815173987 .stroke-N1{stroke:#303030;}
|
|
47
|
+
.d2-3815173987 .stroke-N2{stroke:#606060;}
|
|
48
|
+
.d2-3815173987 .stroke-N3{stroke:#909090;}
|
|
49
|
+
.d2-3815173987 .stroke-N4{stroke:#c0c0c0;}
|
|
50
|
+
.d2-3815173987 .stroke-N5{stroke:#e0e0e0;}
|
|
51
|
+
.d2-3815173987 .stroke-N6{stroke:#f0f0f0;}
|
|
52
|
+
.d2-3815173987 .stroke-N7{stroke:#ffffff;}
|
|
53
|
+
.d2-3815173987 .stroke-B1{stroke:#336699;}
|
|
54
|
+
.d2-3815173987 .stroke-B2{stroke:#6699cc;}
|
|
55
|
+
.d2-3815173987 .stroke-B3{stroke:#99ccff;}
|
|
56
|
+
.d2-3815173987 .stroke-B4{stroke:#c0d0ff;}
|
|
57
|
+
.d2-3815173987 .stroke-B5{stroke:#e0f0ff;}
|
|
58
|
+
.d2-3815173987 .stroke-B6{stroke:#f0f8ff;}
|
|
59
|
+
.d2-3815173987 .stroke-AA2{stroke:#cfb098;}
|
|
60
|
+
.d2-3815173987 .stroke-AA4{stroke:#efd0b8;}
|
|
61
|
+
.d2-3815173987 .stroke-AA5{stroke:#ffe0c8;}
|
|
62
|
+
.d2-3815173987 .stroke-AB4{stroke:#efd0b8;}
|
|
63
|
+
.d2-3815173987 .stroke-AB5{stroke:#ffe0c8;}
|
|
64
|
+
.d2-3815173987 .background-color-N1{background-color:#303030;}
|
|
65
|
+
.d2-3815173987 .background-color-N2{background-color:#606060;}
|
|
66
|
+
.d2-3815173987 .background-color-N3{background-color:#909090;}
|
|
67
|
+
.d2-3815173987 .background-color-N4{background-color:#c0c0c0;}
|
|
68
|
+
.d2-3815173987 .background-color-N5{background-color:#e0e0e0;}
|
|
69
|
+
.d2-3815173987 .background-color-N6{background-color:#f0f0f0;}
|
|
70
|
+
.d2-3815173987 .background-color-N7{background-color:#ffffff;}
|
|
71
|
+
.d2-3815173987 .background-color-B1{background-color:#336699;}
|
|
72
|
+
.d2-3815173987 .background-color-B2{background-color:#6699cc;}
|
|
73
|
+
.d2-3815173987 .background-color-B3{background-color:#99ccff;}
|
|
74
|
+
.d2-3815173987 .background-color-B4{background-color:#c0d0ff;}
|
|
75
|
+
.d2-3815173987 .background-color-B5{background-color:#e0f0ff;}
|
|
76
|
+
.d2-3815173987 .background-color-B6{background-color:#f0f8ff;}
|
|
77
|
+
.d2-3815173987 .background-color-AA2{background-color:#cfb098;}
|
|
78
|
+
.d2-3815173987 .background-color-AA4{background-color:#efd0b8;}
|
|
79
|
+
.d2-3815173987 .background-color-AA5{background-color:#ffe0c8;}
|
|
80
|
+
.d2-3815173987 .background-color-AB4{background-color:#efd0b8;}
|
|
81
|
+
.d2-3815173987 .background-color-AB5{background-color:#ffe0c8;}
|
|
82
|
+
.d2-3815173987 .color-N1{color:#303030;}
|
|
83
|
+
.d2-3815173987 .color-N2{color:#606060;}
|
|
84
|
+
.d2-3815173987 .color-N3{color:#909090;}
|
|
85
|
+
.d2-3815173987 .color-N4{color:#c0c0c0;}
|
|
86
|
+
.d2-3815173987 .color-N5{color:#e0e0e0;}
|
|
87
|
+
.d2-3815173987 .color-N6{color:#f0f0f0;}
|
|
88
|
+
.d2-3815173987 .color-N7{color:#ffffff;}
|
|
89
|
+
.d2-3815173987 .color-B1{color:#336699;}
|
|
90
|
+
.d2-3815173987 .color-B2{color:#6699cc;}
|
|
91
|
+
.d2-3815173987 .color-B3{color:#99ccff;}
|
|
92
|
+
.d2-3815173987 .color-B4{color:#c0d0ff;}
|
|
93
|
+
.d2-3815173987 .color-B5{color:#e0f0ff;}
|
|
94
|
+
.d2-3815173987 .color-B6{color:#f0f8ff;}
|
|
95
|
+
.d2-3815173987 .color-AA2{color:#cfb098;}
|
|
96
|
+
.d2-3815173987 .color-AA4{color:#efd0b8;}
|
|
97
|
+
.d2-3815173987 .color-AA5{color:#ffe0c8;}
|
|
98
|
+
.d2-3815173987 .color-AB4{color:#efd0b8;}
|
|
99
|
+
.d2-3815173987 .color-AB5{color:#ffe0c8;}.appendix text.text{fill:#303030}.md{--color-fg-default:#303030;--color-fg-muted:#606060;--color-fg-subtle:#909090;--color-canvas-default:#ffffff;--color-canvas-subtle:#f0f0f0;--color-border-default:#336699;--color-border-muted:#6699cc;--color-neutral-muted:#f0f0f0;--color-accent-fg:#6699cc;--color-accent-emphasis:#6699cc;--color-attention-subtle:#606060;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-dark-d2-3815173987);mix-blend-mode:overlay}.sketch-overlay-B2{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-B3{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-B4{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-B5{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-AA4{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-3815173987);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-3815173987);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-normal-d2-3815173987);mix-blend-mode:color-burn}.sketch-overlay-N6{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-3815173987);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g class="Y2xpZW50"><g class="shape" ><rect x="12.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#336699" fill="#e0f0ff" class=" stroke-B1 fill-B5" style="stroke-width:2;" /></g><text x="62.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Client</text></g><g class="YnJva2Vy brown"><g class="shape" ><rect x="374.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#cfb098" fill="#ffe0c9" style="stroke-width:2;" /></g><text x="424.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Broker</text></g><g class="c2VydmVy"><g class="shape" ><rect x="736.000000" y="52.000000" width="100.000000" height="66.000000" stroke="#336699" fill="#e0f0ff" class=" stroke-B1 fill-B5" style="stroke-width:2;" /></g><text x="786.000000" y="90.500000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">Server</text></g><g class="KGNsaWVudCAtLSApWzBd"><path d="M 62.000000 120.000000 L 62.000000 2036.000000" stroke="#6699cc" fill="none" class="connection stroke-B2" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3815173987)" /></g><g class="KGJyb2tlciAtLSApWzBd"><path d="M 424.000000 120.000000 L 424.000000 2036.000000" stroke="#cfb098" fill="none" class="connection" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3815173987)" /></g><g class="KHNlcnZlciAtLSApWzBd"><path d="M 786.000000 120.000000 L 786.000000 2036.000000" stroke="#6699cc" fill="none" class="connection stroke-B2" style="stroke-width:2;stroke-dasharray:12.000000,11.838767;" mask="url(#d2-3815173987)" /></g><g class="JiMzOTtwcm92aXNpb24oJiMzNDtmb28vYmFyJiMzNDspJiMzOTs="><g class="shape blend" ><rect x="384.000000" y="175.000000" width="442.000000" height="198.000000" stroke="#336699" fill="#e0e0e0" class=" stroke-B1 fill-N5" style="stroke-width:0;" /></g><rect x="389.000000" y="180.000000" width="135.000000" height="21.000000" fill="#e0e0e0" class=" fill-N5" /><text x="456.500000" y="196.000000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">provision("foo/bar")</text></g><g class="JiMzOTtwdXNoKCYjMzQ7Zm9vL2JhciYjMzQ7KSYjMzk7"><g class="shape blend" ><rect x="22.000000" y="418.000000" width="804.000000" height="718.000000" stroke="#336699" fill="#e0e0e0" class=" stroke-B1 fill-N5" style="stroke-width:0;" /></g><rect x="27.000000" y="423.000000" width="105.000000" height="21.000000" fill="#e0e0e0" class=" fill-N5" /><text x="79.500000" y="439.000000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">push("foo/bar")</text></g><g class="JiMzOTtmZXRjaCgmIzM0O2Zvby9iYXImIzM0OykmIzM5Ow=="><g class="shape blend" ><rect x="22.000000" y="1181.000000" width="804.000000" height="824.000000" stroke="#336699" fill="#e0e0e0" class=" stroke-B1 fill-N5" style="stroke-width:0;" /></g><rect x="27.000000" y="1186.000000" width="107.000000" height="21.000000" fill="#e0e0e0" class=" fill-N5" /><text x="80.500000" y="1202.000000" fill="#303030" class="text fill-N1" style="text-anchor:middle;font-size:16px">fetch("foo/bar")</text></g><g class="KHNlcnZlciAtJmd0OyBicm9rZXIpWzBd"><marker id="mk-d2-3815173987-3488378134" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" fill="#336699" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 784.000000 237.000000 L 428.000000 237.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.500000" y="235.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.500000" dy="0.000000">op: subscribe</tspan><tspan x="605.500000" dy="18.500000">topic: foo/bar/resource-transfer-request/any</tspan></text></g><g class="KHNlcnZlciAtJmd0OyBicm9rZXIpWzFd"><path d="M 784.000000 343.000000 L 428.000000 343.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.000000" y="341.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: subscribe</tspan><tspan x="605.000000" dy="18.500000">topic: foo/bar/resource-transfer-response/any</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzBd"><path d="M 64.000000 488.000000 L 420.000000 488.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="243.000000" y="478.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: publish</tspan><tspan x="243.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="243.000000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGJyb2tlciAtJmd0OyBzZXJ2ZXIpWzBd"><path d="M 426.000000 610.000000 L 782.000000 610.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.000000" y="600.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: publish</tspan><tspan x="605.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="605.000000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzFd"><path d="M 64.000000 732.000000 L 420.000000 732.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="243.000000" y="722.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: publish</tspan><tspan x="243.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="243.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><g class="KGJyb2tlciAtJmd0OyBzZXJ2ZXIpWzFd"><path d="M 426.000000 854.000000 L 782.000000 854.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.000000" y="844.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: publish</tspan><tspan x="605.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="605.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzJd"><path d="M 64.000000 976.000000 L 420.000000 976.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="243.000000" y="966.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: publish</tspan><tspan x="243.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="243.000000" dy="17.666667">data: Resource-Transfer-Response EoS</tspan></text></g><g class="KGJyb2tlciAtJmd0OyBzZXJ2ZXIpWzJd"><path d="M 426.000000 1098.000000 L 782.000000 1098.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.000000" y="1088.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: publish</tspan><tspan x="605.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/any</tspan><tspan x="605.000000" dy="17.666667">data: Resource-Transfer-Response EoS</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzNd"><path d="M 64.000000 1243.000000 L 420.000000 1243.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="243.000000" y="1241.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: subscribe</tspan><tspan x="243.000000" dy="18.500000">topic: foo/bar/resource-transfer-response/XXX</tspan></text></g><g class="KGNsaWVudCAtJmd0OyBicm9rZXIpWzRd"><path d="M 64.000000 1357.000000 L 420.000000 1357.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="243.500000" y="1347.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.500000" dy="0.000000">op: publish</tspan><tspan x="243.500000" dy="17.666667">topic: foo/bar/resource-transfer-request/any</tspan><tspan x="243.500000" dy="17.666667">data: Resource-Transfer-Request</tspan></text></g><g class="KGJyb2tlciAtJmd0OyBzZXJ2ZXIpWzNd"><path d="M 426.000000 1479.000000 L 782.000000 1479.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-d2-3815173987-3488378134)" mask="url(#d2-3815173987)" /><text x="605.500000" y="1469.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.500000" dy="0.000000">op: publish</tspan><tspan x="605.500000" dy="17.666667">topic: foo/bar/resource-transfer-request/any</tspan><tspan x="605.500000" dy="17.666667">data: Resource-Transfer-Request</tspan></text></g><g class="KGJyb2tlciAmbHQ7LSBzZXJ2ZXIpWzBd"><marker id="mk-d2-3815173987-2451250203" markerWidth="10.000000" markerHeight="12.000000" refX="3.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="10.000000,0.000000 0.000000,6.000000 10.000000,12.000000" fill="#336699" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 428.000000 1601.000000 L 784.000000 1601.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3815173987-2451250203)" mask="url(#d2-3815173987)" /><text x="605.000000" y="1591.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: publish</tspan><tspan x="605.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/XXX</tspan><tspan x="605.000000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGNsaWVudCAmbHQ7LSBicm9rZXIpWzBd"><path d="M 66.000000 1723.000000 L 422.000000 1723.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3815173987-2451250203)" mask="url(#d2-3815173987)" /><text x="243.000000" y="1713.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: publish</tspan><tspan x="243.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/XXX</tspan><tspan x="243.000000" dy="17.666667">data: Resource-Transfer-Response #1</tspan></text></g><g class="KGJyb2tlciAmbHQ7LSBzZXJ2ZXIpWzFd"><path d="M 428.000000 1845.000000 L 784.000000 1845.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3815173987-2451250203)" mask="url(#d2-3815173987)" /><text x="605.000000" y="1835.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="605.000000" dy="0.000000">op: publish</tspan><tspan x="605.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/XXX</tspan><tspan x="605.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><g class="KGNsaWVudCAmbHQ7LSBicm9rZXIpWzFd"><path d="M 66.000000 1967.000000 L 422.000000 1967.000000" stroke="#336699" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-start="url(#mk-d2-3815173987-2451250203)" mask="url(#d2-3815173987)" /><text x="243.000000" y="1957.000000" fill="#606060" class="text-italic fill-N2" style="text-anchor:middle;font-size:16px"><tspan x="243.000000" dy="0.000000">op: publish</tspan><tspan x="243.000000" dy="17.666667">topic: foo/bar/resource-transfer-response/XXX</tspan><tspan x="243.000000" dy="17.666667">data: Resource-Transfer-Response #N</tspan></text></g><mask id="d2-3815173987" maskUnits="userSpaceOnUse" x="11" y="51" width="826" height="1987">
|
|
100
|
+
<rect x="11" y="51" width="826" height="1987" fill="white"></rect>
|
|
101
|
+
<rect x="457.000000" y="219.000000" width="297" height="37" fill="black"></rect>
|
|
102
|
+
<rect x="452.000000" y="325.000000" width="306" height="37" fill="black"></rect>
|
|
103
|
+
<rect x="90.000000" y="462.000000" width="306" height="53" fill="black"></rect>
|
|
104
|
+
<rect x="452.000000" y="584.000000" width="306" height="53" fill="black"></rect>
|
|
105
|
+
<rect x="90.000000" y="706.000000" width="306" height="53" fill="black"></rect>
|
|
106
|
+
<rect x="452.000000" y="828.000000" width="306" height="53" fill="black"></rect>
|
|
107
|
+
<rect x="90.000000" y="950.000000" width="306" height="53" fill="black"></rect>
|
|
108
|
+
<rect x="452.000000" y="1072.000000" width="306" height="53" fill="black"></rect>
|
|
109
|
+
<rect x="90.000000" y="1225.000000" width="306" height="37" fill="black"></rect>
|
|
110
|
+
<rect x="95.000000" y="1331.000000" width="297" height="53" fill="black"></rect>
|
|
111
|
+
<rect x="457.000000" y="1453.000000" width="297" height="53" fill="black"></rect>
|
|
112
|
+
<rect x="452.000000" y="1575.000000" width="306" height="53" fill="black"></rect>
|
|
113
|
+
<rect x="90.000000" y="1697.000000" width="306" height="53" fill="black"></rect>
|
|
114
|
+
<rect x="452.000000" y="1819.000000" width="306" height="53" fill="black"></rect>
|
|
115
|
+
<rect x="90.000000" y="1941.000000" width="306" height="53" fill="black"></rect>
|
|
109
116
|
</mask></svg></svg>
|
|
@@ -15,6 +15,8 @@ export declare class ResourceTrait<T extends APISchema = APISchema> extends Serv
|
|
|
15
15
|
provision<K extends ResourceKeys<T> & string>(resource: K, options: Partial<IClientSubscribeOptions>, callback: WithInfo<T[K], InfoResource>): Promise<Provisioning>;
|
|
16
16
|
private _collectStreamToBuffer;
|
|
17
17
|
private _chunkToBuffer;
|
|
18
|
+
private _sendBufferAsChunks;
|
|
19
|
+
private _sendStreamAsChunks;
|
|
18
20
|
push<K extends ResourceKeys<T> & string>(resource: K, stream: Readable, ...params: Parameters<T[K]>): Promise<void>;
|
|
19
21
|
push<K extends ResourceKeys<T> & string>(resource: K, stream: Readable, receiver: Receiver, ...params: Parameters<T[K]>): Promise<void>;
|
|
20
22
|
push<K extends ResourceKeys<T> & string>(resource: K, stream: Readable, options: IClientPublishOptions, ...params: Parameters<T[K]>): Promise<void>;
|
|
@@ -113,6 +113,51 @@ export class ResourceTrait extends ServiceTrait {
|
|
|
113
113
|
buffer = Buffer.from(String(chunk));
|
|
114
114
|
return buffer;
|
|
115
115
|
}
|
|
116
|
+
/* utility function for sending a Buffer as chunks */
|
|
117
|
+
_sendBufferAsChunks(buffer, requestId, resource, params, receiver, topic, options) {
|
|
118
|
+
const chunkSize = this.options.chunkSize;
|
|
119
|
+
if (buffer.byteLength === 0) {
|
|
120
|
+
/* handle empty buffer by sending final chunk */
|
|
121
|
+
const request = this.msg.makeResourceTransferResponse(requestId, resource, params, undefined, undefined, true, this.options.id, receiver);
|
|
122
|
+
const message = this.codec.encode(request);
|
|
123
|
+
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
for (let i = 0; i < buffer.byteLength; i += chunkSize) {
|
|
127
|
+
const size = Math.min(buffer.byteLength - i, chunkSize);
|
|
128
|
+
const chunk = buffer.subarray(i, i + size);
|
|
129
|
+
const final = (i + size >= buffer.byteLength);
|
|
130
|
+
const request = this.msg.makeResourceTransferResponse(requestId, resource, params, chunk, undefined, final, this.options.id, receiver);
|
|
131
|
+
const message = this.codec.encode(request);
|
|
132
|
+
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/* utility function for sending a Readable stream as chunks */
|
|
137
|
+
_sendStreamAsChunks(readable, requestId, resource, params, receiver, topic, options, onEnd, onError) {
|
|
138
|
+
const chunkSize = this.options.chunkSize;
|
|
139
|
+
readable.on("readable", () => {
|
|
140
|
+
let chunk;
|
|
141
|
+
while ((chunk = readable.read(chunkSize)) !== null) {
|
|
142
|
+
const buffer = this._chunkToBuffer(chunk);
|
|
143
|
+
const request = this.msg.makeResourceTransferResponse(requestId, resource, params, buffer, undefined, false, this.options.id, receiver);
|
|
144
|
+
const message = this.codec.encode(request);
|
|
145
|
+
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
readable.on("end", () => {
|
|
149
|
+
const request = this.msg.makeResourceTransferResponse(requestId, resource, params, undefined, undefined, true, this.options.id, receiver);
|
|
150
|
+
const message = this.codec.encode(request);
|
|
151
|
+
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
152
|
+
onEnd();
|
|
153
|
+
});
|
|
154
|
+
readable.on("error", (err) => {
|
|
155
|
+
const request = this.msg.makeResourceTransferResponse(requestId, resource, params, undefined, err.message, true, this.options.id, receiver);
|
|
156
|
+
const message = this.codec.encode(request);
|
|
157
|
+
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
158
|
+
onError(err);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
116
161
|
push(resource, streamOrBuffer, ...args) {
|
|
117
162
|
/* determine actual parameters */
|
|
118
163
|
const { receiver, options, params } = this._parseCallArgs(args);
|
|
@@ -122,57 +167,13 @@ export class ResourceTrait extends ServiceTrait {
|
|
|
122
167
|
const topic = this.options.topicMake(resource, "resource-transfer-response", receiver);
|
|
123
168
|
/* iterate over all chunks of the buffer */
|
|
124
169
|
return new Promise((resolve, reject) => {
|
|
125
|
-
const chunkSize = this.options.chunkSize;
|
|
126
170
|
if (streamOrBuffer instanceof Readable) {
|
|
127
171
|
/* attach to the readable */
|
|
128
|
-
|
|
129
|
-
readable.on("readable", () => {
|
|
130
|
-
let chunk;
|
|
131
|
-
while ((chunk = readable.read(chunkSize)) !== null) {
|
|
132
|
-
/* ensure data is a Buffer */
|
|
133
|
-
const buffer = this._chunkToBuffer(chunk);
|
|
134
|
-
/* generate encoded message */
|
|
135
|
-
const request = this.msg.makeResourceTransferResponse(rid, resource, params, buffer, undefined, false, this.options.id, receiver);
|
|
136
|
-
const message = this.codec.encode(request);
|
|
137
|
-
/* publish message to MQTT topic */
|
|
138
|
-
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
readable.on("end", () => {
|
|
142
|
-
/* send final chunk to signal end of stream */
|
|
143
|
-
const request = this.msg.makeResourceTransferResponse(rid, resource, params, undefined, undefined, true, this.options.id, receiver);
|
|
144
|
-
const message = this.codec.encode(request);
|
|
145
|
-
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
146
|
-
resolve();
|
|
147
|
-
});
|
|
148
|
-
readable.on("error", (err) => {
|
|
149
|
-
const request = this.msg.makeResourceTransferResponse(rid, resource, params, undefined, err.message, true, this.options.id, receiver);
|
|
150
|
-
const message = this.codec.encode(request);
|
|
151
|
-
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
152
|
-
reject(err);
|
|
153
|
-
});
|
|
172
|
+
this._sendStreamAsChunks(streamOrBuffer, rid, resource, params, receiver, topic, options, () => resolve(), (err) => reject(err));
|
|
154
173
|
}
|
|
155
174
|
else if (streamOrBuffer instanceof Buffer) {
|
|
156
175
|
/* split buffer into chunks and send them */
|
|
157
|
-
|
|
158
|
-
if (buffer.byteLength === 0) {
|
|
159
|
-
/* handle empty buffer by sending final chunk */
|
|
160
|
-
const request = this.msg.makeResourceTransferResponse(rid, resource, params, undefined, undefined, true, this.options.id, receiver);
|
|
161
|
-
const message = this.codec.encode(request);
|
|
162
|
-
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
for (let i = 0; i < buffer.byteLength; i += chunkSize) {
|
|
166
|
-
const size = Math.min(buffer.byteLength - i, chunkSize);
|
|
167
|
-
const chunk = buffer.subarray(i, i + size);
|
|
168
|
-
const final = (i + size >= buffer.byteLength);
|
|
169
|
-
/* generate encoded message */
|
|
170
|
-
const request = this.msg.makeResourceTransferResponse(rid, resource, params, chunk, undefined, final, this.options.id, receiver);
|
|
171
|
-
const message = this.codec.encode(request);
|
|
172
|
-
/* publish message to MQTT topic */
|
|
173
|
-
this.mqtt.publish(topic, message, { qos: 2, ...options });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
+
this._sendBufferAsChunks(streamOrBuffer, rid, resource, params, receiver, topic, options);
|
|
176
177
|
resolve();
|
|
177
178
|
}
|
|
178
179
|
});
|
|
@@ -252,8 +253,7 @@ export class ResourceTrait extends ServiceTrait {
|
|
|
252
253
|
const receiver = parsed.receiver;
|
|
253
254
|
const info = { sender, receiver, resource: null };
|
|
254
255
|
/* generate corresponding MQTT topic */
|
|
255
|
-
const
|
|
256
|
-
const chunkSize = this.options.chunkSize;
|
|
256
|
+
const responseTopic = this.options.topicMake(resource, "resource-transfer-response", sender);
|
|
257
257
|
/* call the handler callback */
|
|
258
258
|
Promise.resolve()
|
|
259
259
|
.then(() => handler(...params, info))
|
|
@@ -263,54 +263,17 @@ export class ResourceTrait extends ServiceTrait {
|
|
|
263
263
|
throw new Error("received no data in info \"resource\" field");
|
|
264
264
|
/* handle Readable stream result */
|
|
265
265
|
if (info.resource instanceof Readable) {
|
|
266
|
-
|
|
267
|
-
readable.on("readable", () => {
|
|
268
|
-
let chunk;
|
|
269
|
-
while ((chunk = readable.read(chunkSize)) !== null) {
|
|
270
|
-
const buffer = this._chunkToBuffer(chunk);
|
|
271
|
-
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, buffer, undefined, false, this.options.id, sender);
|
|
272
|
-
const message = this.codec.encode(request);
|
|
273
|
-
this.mqtt.publish(topic, message, { qos: 2 });
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
readable.on("end", () => {
|
|
277
|
-
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, undefined, undefined, true, this.options.id, sender);
|
|
278
|
-
const message = this.codec.encode(request);
|
|
279
|
-
this.mqtt.publish(topic, message, { qos: 2 });
|
|
280
|
-
});
|
|
281
|
-
readable.on("error", (err) => {
|
|
282
|
-
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, undefined, err.message, true, this.options.id, sender);
|
|
283
|
-
const message = this.codec.encode(request);
|
|
284
|
-
this.mqtt.publish(topic, message, { qos: 2 });
|
|
285
|
-
});
|
|
266
|
+
this._sendStreamAsChunks(info.resource, requestId, resource, undefined, sender, responseTopic, {}, () => { }, () => { });
|
|
286
267
|
}
|
|
287
268
|
/* handle Buffer result */
|
|
288
|
-
else if (info.resource instanceof Buffer)
|
|
289
|
-
|
|
290
|
-
/* split Buffer into chunks and send them back */
|
|
291
|
-
if (buffer.byteLength === 0) {
|
|
292
|
-
/* handle empty buffer by sending final chunk */
|
|
293
|
-
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, undefined, undefined, true, this.options.id, sender);
|
|
294
|
-
const message = this.codec.encode(request);
|
|
295
|
-
this.mqtt.publish(topic, message, { qos: 2 });
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
for (let i = 0; i < buffer.byteLength; i += chunkSize) {
|
|
299
|
-
const size = Math.min(buffer.byteLength - i, chunkSize);
|
|
300
|
-
const chunk = buffer.subarray(i, i + size);
|
|
301
|
-
const final = (i + size >= buffer.byteLength);
|
|
302
|
-
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, chunk, undefined, final, this.options.id, sender);
|
|
303
|
-
const message = this.codec.encode(request);
|
|
304
|
-
this.mqtt.publish(topic, message, { qos: 2 });
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
269
|
+
else if (info.resource instanceof Buffer)
|
|
270
|
+
this._sendBufferAsChunks(info.resource, requestId, resource, undefined, sender, responseTopic, {});
|
|
308
271
|
})
|
|
309
272
|
.catch((err) => {
|
|
310
273
|
/* send error */
|
|
311
274
|
const request = this.msg.makeResourceTransferResponse(requestId, resource, undefined, undefined, err.message, true, this.options.id, sender);
|
|
312
275
|
const message = this.codec.encode(request);
|
|
313
|
-
this.mqtt.publish(
|
|
276
|
+
this.mqtt.publish(responseTopic, message, { qos: 2 });
|
|
314
277
|
});
|
|
315
278
|
}
|
|
316
279
|
}
|