@tivio/sdk-react 2.1.4 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/README.md +8 -0
  2. package/coverage/clover.xml +356 -95
  3. package/coverage/lcov-report/index.html +55 -25
  4. package/coverage/lcov-report/src/components/ContextProvider.tsx.html +194 -0
  5. package/coverage/lcov-report/src/components/TivioProvider.tsx.html +109 -37
  6. package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +3 -3
  7. package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +3 -3
  8. package/coverage/lcov-report/src/components/context/ChannelsContext.tsx.html +197 -0
  9. package/coverage/lcov-report/src/components/context/OrganizationSubscriptionsContext.tsx.html +179 -0
  10. package/coverage/lcov-report/src/components/context/PurchasesWithVideosContext.tsx.html +179 -0
  11. package/coverage/lcov-report/src/components/context/RowItemsContext.tsx.html +191 -0
  12. package/coverage/lcov-report/src/components/context/ScreensContext.tsx.html +185 -0
  13. package/coverage/lcov-report/src/components/context/SectionsContext.tsx.html +200 -0
  14. package/coverage/lcov-report/src/components/context/UserContext.tsx.html +176 -0
  15. package/coverage/lcov-report/src/components/context/VideosContext.tsx.html +200 -0
  16. package/coverage/lcov-report/src/components/context/index.html +231 -0
  17. package/coverage/lcov-report/src/components/context/index.ts.html +104 -0
  18. package/coverage/lcov-report/src/components/index.html +32 -32
  19. package/coverage/lcov-report/src/conf.ts.html +27 -21
  20. package/coverage/lcov-report/src/index.html +21 -6
  21. package/coverage/lcov-report/src/services/bundleLoader.ts.html +127 -157
  22. package/coverage/lcov-report/src/services/dependencyResolver.ts.html +36 -30
  23. package/coverage/lcov-report/src/services/index.html +102 -42
  24. package/coverage/lcov-report/src/services/logger.ts.html +53 -98
  25. package/coverage/lcov-report/src/services/packageLoader.ts.html +31 -31
  26. package/coverage/lcov-report/src/services/pubSub.ts.html +9 -9
  27. package/coverage/lcov-report/src/services/sentry.ts.html +170 -0
  28. package/coverage/lcov-report/src/services/settings.ts.html +34 -34
  29. package/coverage/lcov-report/src/setupTests.ts.html +9 -9
  30. package/coverage/lcov.info +641 -141
  31. package/dist/components/TivioProvider.d.ts +3 -0
  32. package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
  33. package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
  34. package/dist/conf.d.ts +1 -0
  35. package/dist/index.js +1 -2
  36. package/dist/services/dependencyResolver.d.ts +2 -1
  37. package/dist/services/sentry.d.ts +2 -5
  38. package/dist/types.d.ts +5 -13
  39. package/env +0 -0
  40. package/package.json +12 -12
  41. package/scripts/build_dev.sh +3 -0
  42. package/scripts/build_prod.sh +3 -0
  43. package/scripts/postpublish.ts +10 -0
  44. package/scripts/start.sh +3 -0
  45. package/dist/index.js.LICENSE.txt +0 -114
@@ -23,30 +23,30 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">78.57% </span>
26
+ <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>11/14</span>
28
+ <span class='fraction'>13/13</span>
29
29
  </div>
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">0% </span>
33
+ <span class="strong">100% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>0/2</span>
35
+ <span class='fraction'>2/2</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
- <span class="strong">0% </span>
40
+ <span class="strong">100% </span>
41
41
  <span class="quiet">Functions</span>
42
- <span class='fraction'>0/1</span>
42
+ <span class='fraction'>1/1</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">76.92% </span>
47
+ <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>10/13</span>
49
+ <span class='fraction'>12/12</span>
50
50
  </div>
51
51
 
52
52
 
@@ -55,7 +55,7 @@
55
55
  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.
56
56
  </p>
57
57
  </div>
58
- <div class='status-line medium'></div>
58
+ <div class='status-line high'></div>
59
59
  <pre><table class="coverage">
60
60
  <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61
61
  <a name='L2'></a><a href='#L2'>2</a>
@@ -101,7 +101,9 @@
101
101
  <a name='L42'></a><a href='#L42'>42</a>
102
102
  <a name='L43'></a><a href='#L43'>43</a>
103
103
  <a name='L44'></a><a href='#L44'>44</a>
104
- <a name='L45'></a><a href='#L45'>45</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
104
+ <a name='L45'></a><a href='#L45'>45</a>
105
+ <a name='L46'></a><a href='#L46'>46</a>
106
+ <a name='L47'></a><a href='#L47'>47</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
105
107
  <span class="cline-any cline-neutral">&nbsp;</span>
106
108
  <span class="cline-any cline-neutral">&nbsp;</span>
107
109
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -112,14 +114,14 @@
112
114
  <span class="cline-any cline-neutral">&nbsp;</span>
113
115
  <span class="cline-any cline-neutral">&nbsp;</span>
114
116
  <span class="cline-any cline-neutral">&nbsp;</span>
115
- <span class="cline-any cline-yes">1x</span>
116
- <span class="cline-any cline-yes">1x</span>
117
- <span class="cline-any cline-yes">1x</span>
118
- <span class="cline-any cline-yes">1x</span>
119
- <span class="cline-any cline-yes">1x</span>
120
- <span class="cline-any cline-yes">1x</span>
121
- <span class="cline-any cline-yes">1x</span>
122
- <span class="cline-any cline-yes">1x</span>
117
+ <span class="cline-any cline-yes">2x</span>
118
+ <span class="cline-any cline-yes">2x</span>
119
+ <span class="cline-any cline-yes">2x</span>
120
+ <span class="cline-any cline-yes">2x</span>
121
+ <span class="cline-any cline-yes">2x</span>
122
+ <span class="cline-any cline-yes">2x</span>
123
+ <span class="cline-any cline-yes">2x</span>
124
+ <span class="cline-any cline-neutral">&nbsp;</span>
123
125
  <span class="cline-any cline-neutral">&nbsp;</span>
124
126
  <span class="cline-any cline-neutral">&nbsp;</span>
125
127
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -128,9 +130,9 @@
128
130
  <span class="cline-any cline-neutral">&nbsp;</span>
129
131
  <span class="cline-any cline-neutral">&nbsp;</span>
130
132
  <span class="cline-any cline-neutral">&nbsp;</span>
131
- <span class="cline-any cline-yes">1x</span>
132
133
  <span class="cline-any cline-neutral">&nbsp;</span>
133
134
  <span class="cline-any cline-neutral">&nbsp;</span>
135
+ <span class="cline-any cline-yes">2x</span>
134
136
  <span class="cline-any cline-neutral">&nbsp;</span>
135
137
  <span class="cline-any cline-neutral">&nbsp;</span>
136
138
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -138,12 +140,14 @@
138
140
  <span class="cline-any cline-neutral">&nbsp;</span>
139
141
  <span class="cline-any cline-neutral">&nbsp;</span>
140
142
  <span class="cline-any cline-neutral">&nbsp;</span>
143
+ <span class="cline-any cline-neutral">&nbsp;</span>
144
+ <span class="cline-any cline-neutral">&nbsp;</span>
145
+ <span class="cline-any cline-yes">2x</span>
146
+ <span class="cline-any cline-yes">2x</span>
141
147
  <span class="cline-any cline-yes">1x</span>
142
- <span class="cline-any cline-no">&nbsp;</span>
143
- <span class="cline-any cline-no">&nbsp;</span>
144
148
  <span class="cline-any cline-neutral">&nbsp;</span>
145
149
  <span class="cline-any cline-neutral">&nbsp;</span>
146
- <span class="cline-any cline-no">&nbsp;</span>
150
+ <span class="cline-any cline-yes">1x</span>
147
151
  <span class="cline-any cline-neutral">&nbsp;</span>
148
152
  <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
149
153
  * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
@@ -163,14 +167,16 @@ import * as mobx from 'mobx'
163
167
  import * as react from 'react'
164
168
  import * as reactDom from 'react-dom'
165
169
  import * as styledComponents from 'styled-components'
166
- import * as timers from 'timers'
170
+ // I think this is bullshit since 'timers' is not even in package.json, but I don't want
171
+ // to delete it completely until I test it
172
+ // import * as timers from 'timers'
167
173
  &nbsp;
168
174
  export type SharedDependency = typeof react
169
175
  | typeof reactDom
170
176
  | typeof mobx
171
177
  | typeof styledComponents
172
178
  | typeof firebase
173
- | typeof timers
179
+ // | typeof timers
174
180
  &nbsp;
175
181
  const dependencies: { [key: string]: SharedDependency } = {
176
182
  mobx,
@@ -179,15 +185,15 @@ const dependencies: { [key: string]: SharedDependency } = {
179
185
  React: react,
180
186
  'react-dom': reactDom,
181
187
  'styled-components': styledComponents,
182
- timers,
188
+ // timers,
183
189
  }
184
190
  &nbsp;
185
- export const resolveShared = <span class="fstat-no" title="function not covered" >(n</span>ame: string): SharedDependency =&gt; {
186
- <span class="cstat-no" title="statement not covered" > if (!(name in dependencies)) {</span>
187
- <span class="cstat-no" title="statement not covered" > throw new Error(`Could not resolve shared dependency ${name}`)</span>
191
+ export const resolveShared = (name: string): SharedDependency =&gt; {
192
+ if (!(name in dependencies)) {
193
+ throw new Error(`Could not resolve shared dependency ${name}`)
188
194
  }
189
195
  &nbsp;
190
- <span class="cstat-no" title="statement not covered" > return dependencies[name]</span>
196
+ return dependencies[name]
191
197
  }
192
198
  &nbsp;</pre></td></tr></table></pre>
193
199
 
@@ -196,7 +202,7 @@ export const resolveShared = <span class="fstat-no" title="function not covered"
196
202
  <div class='footer quiet pad2 space-top1 center small'>
197
203
  Code coverage generated by
198
204
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
199
- at Thu May 06 2021 13:19:37 GMT+0200 (Central European Summer Time)
205
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
200
206
  </div>
201
207
  </div>
202
208
  <script src="../../prettify.js"></script>
@@ -23,30 +23,30 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">62.79% </span>
26
+ <span class="strong">80.89% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>54/86</span>
28
+ <span class='fraction'>127/157</span>
29
29
  </div>
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">22.73% </span>
33
+ <span class="strong">67.35% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>5/22</span>
35
+ <span class='fraction'>33/49</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
- <span class="strong">57.14% </span>
40
+ <span class="strong">79.41% </span>
41
41
  <span class="quiet">Functions</span>
42
- <span class='fraction'>8/14</span>
42
+ <span class='fraction'>27/34</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">60.49% </span>
47
+ <span class="strong">80.27% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>49/81</span>
49
+ <span class='fraction'>118/147</span>
50
50
  </div>
51
51
 
52
52
 
@@ -55,7 +55,7 @@
55
55
  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.
56
56
  </p>
57
57
  </div>
58
- <div class='status-line medium'></div>
58
+ <div class='status-line high'></div>
59
59
  <div class="pad1">
60
60
  <table class="coverage-summary">
61
61
  <thead>
@@ -74,47 +74,107 @@
74
74
  </thead>
75
75
  <tbody><tr>
76
76
  <td class="file medium" data-value="bundleLoader.ts"><a href="bundleLoader.ts.html">bundleLoader.ts</a></td>
77
- <td data-value="65.52" class="pic medium">
78
- <div class="chart"><div class="cover-fill" style="width: 65%"></div><div class="cover-empty" style="width: 35%"></div></div>
77
+ <td data-value="75" class="pic medium">
78
+ <div class="chart"><div class="cover-fill" style="width: 75%"></div><div class="cover-empty" style="width: 25%"></div></div>
79
79
  </td>
80
- <td data-value="65.52" class="pct medium">65.52%</td>
81
- <td data-value="58" class="abs medium">38/58</td>
82
- <td data-value="35.71" class="pct low">35.71%</td>
83
- <td data-value="14" class="abs low">5/14</td>
84
- <td data-value="70" class="pct medium">70%</td>
85
- <td data-value="10" class="abs medium">7/10</td>
86
- <td data-value="63.64" class="pct medium">63.64%</td>
87
- <td data-value="55" class="abs medium">35/55</td>
80
+ <td data-value="75" class="pct medium">75%</td>
81
+ <td data-value="64" class="abs medium">48/64</td>
82
+ <td data-value="50" class="pct medium">50%</td>
83
+ <td data-value="18" class="abs medium">9/18</td>
84
+ <td data-value="90.91" class="pct high">90.91%</td>
85
+ <td data-value="11" class="abs high">10/11</td>
86
+ <td data-value="75" class="pct medium">75%</td>
87
+ <td data-value="64" class="abs medium">48/64</td>
88
88
  </tr>
89
89
 
90
90
  <tr>
91
- <td class="file medium" data-value="dependencyResolver.ts"><a href="dependencyResolver.ts.html">dependencyResolver.ts</a></td>
92
- <td data-value="78.57" class="pic medium">
93
- <div class="chart"><div class="cover-fill" style="width: 78%"></div><div class="cover-empty" style="width: 22%"></div></div>
91
+ <td class="file high" data-value="dependencyResolver.ts"><a href="dependencyResolver.ts.html">dependencyResolver.ts</a></td>
92
+ <td data-value="100" class="pic high">
93
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
94
94
  </td>
95
- <td data-value="78.57" class="pct medium">78.57%</td>
96
- <td data-value="14" class="abs medium">11/14</td>
97
- <td data-value="0" class="pct low">0%</td>
98
- <td data-value="2" class="abs low">0/2</td>
99
- <td data-value="0" class="pct low">0%</td>
100
- <td data-value="1" class="abs low">0/1</td>
101
- <td data-value="76.92" class="pct medium">76.92%</td>
102
- <td data-value="13" class="abs medium">10/13</td>
95
+ <td data-value="100" class="pct high">100%</td>
96
+ <td data-value="13" class="abs high">13/13</td>
97
+ <td data-value="100" class="pct high">100%</td>
98
+ <td data-value="2" class="abs high">2/2</td>
99
+ <td data-value="100" class="pct high">100%</td>
100
+ <td data-value="1" class="abs high">1/1</td>
101
+ <td data-value="100" class="pct high">100%</td>
102
+ <td data-value="12" class="abs high">12/12</td>
103
103
  </tr>
104
104
 
105
105
  <tr>
106
- <td class="file low" data-value="settings.ts"><a href="settings.ts.html">settings.ts</a></td>
107
- <td data-value="35.71" class="pic low">
108
- <div class="chart"><div class="cover-fill" style="width: 35%"></div><div class="cover-empty" style="width: 65%"></div></div>
106
+ <td class="file high" data-value="logger.ts"><a href="logger.ts.html">logger.ts</a></td>
107
+ <td data-value="100" class="pic high">
108
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
109
109
  </td>
110
- <td data-value="35.71" class="pct low">35.71%</td>
111
- <td data-value="14" class="abs low">5/14</td>
112
- <td data-value="0" class="pct low">0%</td>
113
- <td data-value="6" class="abs low">0/6</td>
114
- <td data-value="33.33" class="pct low">33.33%</td>
115
- <td data-value="3" class="abs low">1/3</td>
116
- <td data-value="30.77" class="pct low">30.77%</td>
117
- <td data-value="13" class="abs low">4/13</td>
110
+ <td data-value="100" class="pct high">100%</td>
111
+ <td data-value="19" class="abs high">19/19</td>
112
+ <td data-value="100" class="pct high">100%</td>
113
+ <td data-value="8" class="abs high">8/8</td>
114
+ <td data-value="100" class="pct high">100%</td>
115
+ <td data-value="7" class="abs high">7/7</td>
116
+ <td data-value="100" class="pct high">100%</td>
117
+ <td data-value="18" class="abs high">18/18</td>
118
+ </tr>
119
+
120
+ <tr>
121
+ <td class="file high" data-value="packageLoader.ts"><a href="packageLoader.ts.html">packageLoader.ts</a></td>
122
+ <td data-value="100" class="pic high">
123
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
124
+ </td>
125
+ <td data-value="100" class="pct high">100%</td>
126
+ <td data-value="13" class="abs high">13/13</td>
127
+ <td data-value="100" class="pct high">100%</td>
128
+ <td data-value="7" class="abs high">7/7</td>
129
+ <td data-value="100" class="pct high">100%</td>
130
+ <td data-value="3" class="abs high">3/3</td>
131
+ <td data-value="100" class="pct high">100%</td>
132
+ <td data-value="11" class="abs high">11/11</td>
133
+ </tr>
134
+
135
+ <tr>
136
+ <td class="file low" data-value="pubSub.ts"><a href="pubSub.ts.html">pubSub.ts</a></td>
137
+ <td data-value="45.45" class="pic low">
138
+ <div class="chart"><div class="cover-fill" style="width: 45%"></div><div class="cover-empty" style="width: 55%"></div></div>
139
+ </td>
140
+ <td data-value="45.45" class="pct low">45.45%</td>
141
+ <td data-value="22" class="abs low">10/22</td>
142
+ <td data-value="12.5" class="pct low">12.5%</td>
143
+ <td data-value="8" class="abs low">1/8</td>
144
+ <td data-value="28.57" class="pct low">28.57%</td>
145
+ <td data-value="7" class="abs low">2/7</td>
146
+ <td data-value="42.11" class="pct low">42.11%</td>
147
+ <td data-value="19" class="abs low">8/19</td>
148
+ </tr>
149
+
150
+ <tr>
151
+ <td class="file high" data-value="sentry.ts"><a href="sentry.ts.html">sentry.ts</a></td>
152
+ <td data-value="83.33" class="pic high">
153
+ <div class="chart"><div class="cover-fill" style="width: 83%"></div><div class="cover-empty" style="width: 17%"></div></div>
154
+ </td>
155
+ <td data-value="83.33" class="pct high">83.33%</td>
156
+ <td data-value="12" class="abs high">10/12</td>
157
+ <td data-value="100" class="pct high">100%</td>
158
+ <td data-value="0" class="abs high">0/0</td>
159
+ <td data-value="50" class="pct medium">50%</td>
160
+ <td data-value="2" class="abs medium">1/2</td>
161
+ <td data-value="80" class="pct high">80%</td>
162
+ <td data-value="10" class="abs high">8/10</td>
163
+ </tr>
164
+
165
+ <tr>
166
+ <td class="file high" data-value="settings.ts"><a href="settings.ts.html">settings.ts</a></td>
167
+ <td data-value="100" class="pic high">
168
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
169
+ </td>
170
+ <td data-value="100" class="pct high">100%</td>
171
+ <td data-value="14" class="abs high">14/14</td>
172
+ <td data-value="100" class="pct high">100%</td>
173
+ <td data-value="6" class="abs high">6/6</td>
174
+ <td data-value="100" class="pct high">100%</td>
175
+ <td data-value="3" class="abs high">3/3</td>
176
+ <td data-value="100" class="pct high">100%</td>
177
+ <td data-value="13" class="abs high">13/13</td>
118
178
  </tr>
119
179
 
120
180
  </tbody>
@@ -125,7 +185,7 @@
125
185
  <div class='footer quiet pad2 space-top1 center small'>
126
186
  Code coverage generated by
127
187
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
128
- at Thu May 06 2021 13:19:37 GMT+0200 (Central European Summer Time)
188
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
129
189
  </div>
130
190
  </div>
131
191
  <script src="../../prettify.js"></script>