@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
@@ -0,0 +1,104 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/components/context/index.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../../prettify.css" />
9
+ <link rel="stylesheet" href="../../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/context</a> index.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">100% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>8/8</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/0</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">100% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>0/0</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">100% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>8/8</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
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
+ </p>
57
+ </div>
58
+ <div class='status-line high'></div>
59
+ <pre><table class="coverage">
60
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61
+ <a name='L2'></a><a href='#L2'>2</a>
62
+ <a name='L3'></a><a href='#L3'>3</a>
63
+ <a name='L4'></a><a href='#L4'>4</a>
64
+ <a name='L5'></a><a href='#L5'>5</a>
65
+ <a name='L6'></a><a href='#L6'>6</a>
66
+ <a name='L7'></a><a href='#L7'>7</a>
67
+ <a name='L8'></a><a href='#L8'>8</a>
68
+ <a name='L9'></a><a href='#L9'>9</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
69
+ <span class="cline-any cline-yes">3x</span>
70
+ <span class="cline-any cline-yes">3x</span>
71
+ <span class="cline-any cline-yes">3x</span>
72
+ <span class="cline-any cline-yes">3x</span>
73
+ <span class="cline-any cline-yes">3x</span>
74
+ <span class="cline-any cline-yes">3x</span>
75
+ <span class="cline-any cline-yes">3x</span>
76
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export * from './ChannelsContext'
77
+ export * from './OrganizationSubscriptionsContext'
78
+ export * from './PurchasesWithVideosContext'
79
+ export * from './ScreensContext'
80
+ export * from './SectionsContext'
81
+ export * from './UserContext'
82
+ export * from './VideosContext'
83
+ export * from './RowItemsContext'
84
+ &nbsp;</pre></td></tr></table></pre>
85
+
86
+ <div class='push'></div><!-- for sticky footer -->
87
+ </div><!-- /wrapper -->
88
+ <div class='footer quiet pad2 space-top1 center small'>
89
+ Code coverage generated by
90
+ <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
91
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
92
+ </div>
93
+ </div>
94
+ <script src="../../../prettify.js"></script>
95
+ <script>
96
+ window.onload = function () {
97
+ prettyPrint();
98
+ };
99
+ </script>
100
+ <script src="../../../sorter.js"></script>
101
+ <script src="../../../block-navigation.js"></script>
102
+ </body>
103
+ </html>
104
+
@@ -23,30 +23,30 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">65% </span>
26
+ <span class="strong">85% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>26/40</span>
28
+ <span class='fraction'>34/40</span>
29
29
  </div>
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">33.33% </span>
33
+ <span class="strong">50% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>5/15</span>
35
+ <span class='fraction'>5/10</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
- <span class="strong">20% </span>
40
+ <span class="strong">57.14% </span>
41
41
  <span class="quiet">Functions</span>
42
- <span class='fraction'>1/5</span>
42
+ <span class='fraction'>4/7</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">61.11% </span>
47
+ <span class="strong">82.86% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>22/36</span>
49
+ <span class='fraction'>29/35</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>
@@ -73,33 +73,33 @@
73
73
  </tr>
74
74
  </thead>
75
75
  <tbody><tr>
76
- <td class="file medium" data-value="TivioProvider.tsx"><a href="TivioProvider.tsx.html">TivioProvider.tsx</a></td>
77
- <td data-value="52.94" class="pic medium">
78
- <div class="chart"><div class="cover-fill" style="width: 52%"></div><div class="cover-empty" style="width: 48%"></div></div>
76
+ <td class="file high" data-value="ContextProvider.tsx"><a href="ContextProvider.tsx.html">ContextProvider.tsx</a></td>
77
+ <td data-value="100" class="pic high">
78
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
79
79
  </td>
80
- <td data-value="52.94" class="pct medium">52.94%</td>
81
- <td data-value="17" class="abs medium">9/17</td>
82
- <td data-value="0" class="pct low">0%</td>
83
- <td data-value="6" class="abs low">0/6</td>
84
- <td data-value="0" class="pct low">0%</td>
85
- <td data-value="2" class="abs low">0/2</td>
86
- <td data-value="46.67" class="pct low">46.67%</td>
87
- <td data-value="15" class="abs low">7/15</td>
80
+ <td data-value="100" class="pct high">100%</td>
81
+ <td data-value="5" class="abs high">5/5</td>
82
+ <td data-value="100" class="pct high">100%</td>
83
+ <td data-value="0" class="abs high">0/0</td>
84
+ <td data-value="100" class="pct high">100%</td>
85
+ <td data-value="1" class="abs high">1/1</td>
86
+ <td data-value="100" class="pct high">100%</td>
87
+ <td data-value="5" class="abs high">5/5</td>
88
88
  </tr>
89
89
 
90
90
  <tr>
91
- <td class="file medium" data-value="TivioWidget.tsx"><a href="TivioWidget.tsx.html">TivioWidget.tsx</a></td>
92
- <td data-value="73.33" class="pic medium">
93
- <div class="chart"><div class="cover-fill" style="width: 73%"></div><div class="cover-empty" style="width: 27%"></div></div>
91
+ <td class="file high" data-value="TivioProvider.tsx"><a href="TivioProvider.tsx.html">TivioProvider.tsx</a></td>
92
+ <td data-value="85.19" class="pic high">
93
+ <div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
94
94
  </td>
95
- <td data-value="73.33" class="pct medium">73.33%</td>
96
- <td data-value="15" class="abs medium">11/15</td>
97
- <td data-value="55.56" class="pct medium">55.56%</td>
98
- <td data-value="9" class="abs medium">5/9</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="73.33" class="pct medium">73.33%</td>
102
- <td data-value="15" class="abs medium">11/15</td>
95
+ <td data-value="85.19" class="pct high">85.19%</td>
96
+ <td data-value="27" class="abs high">23/27</td>
97
+ <td data-value="50" class="pct medium">50%</td>
98
+ <td data-value="10" class="abs medium">5/10</td>
99
+ <td data-value="75" class="pct medium">75%</td>
100
+ <td data-value="4" class="abs medium">3/4</td>
101
+ <td data-value="83.33" class="pct high">83.33%</td>
102
+ <td data-value="24" class="abs high">20/24</td>
103
103
  </tr>
104
104
 
105
105
  <tr>
@@ -140,7 +140,7 @@
140
140
  <div class='footer quiet pad2 space-top1 center small'>
141
141
  Code coverage generated by
142
142
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
143
- at Fri Apr 30 2021 12:16:39 GMT+0200 (Central European Summer Time)
143
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
144
144
  </div>
145
145
  </div>
146
146
  <script src="../../prettify.js"></script>
@@ -30,9 +30,9 @@
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">50% </span>
33
+ <span class="strong">75% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>1/2</span>
35
+ <span class='fraction'>3/4</span>
36
36
  </div>
37
37
 
38
38
 
@@ -110,19 +110,21 @@
110
110
  <a name='L51'></a><a href='#L51'>51</a>
111
111
  <a name='L52'></a><a href='#L52'>52</a>
112
112
  <a name='L53'></a><a href='#L53'>53</a>
113
- <a name='L54'></a><a href='#L54'>54</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
113
+ <a name='L54'></a><a href='#L54'>54</a>
114
+ <a name='L55'></a><a href='#L55'>55</a>
115
+ <a name='L56'></a><a href='#L56'>56</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
114
116
  <span class="cline-any cline-neutral">&nbsp;</span>
115
117
  <span class="cline-any cline-neutral">&nbsp;</span>
116
118
  <span class="cline-any cline-neutral">&nbsp;</span>
117
119
  <span class="cline-any cline-neutral">&nbsp;</span>
118
120
  <span class="cline-any cline-neutral">&nbsp;</span>
119
121
  <span class="cline-any cline-neutral">&nbsp;</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">4x</span>
123
+ <span class="cline-any cline-yes">4x</span>
122
124
  <span class="cline-any cline-neutral">&nbsp;</span>
123
- <span class="cline-any cline-yes">1x</span>
124
- <span class="cline-any cline-yes">1x</span>
125
- <span class="cline-any cline-yes">1x</span>
125
+ <span class="cline-any cline-yes">4x</span>
126
+ <span class="cline-any cline-yes">4x</span>
127
+ <span class="cline-any cline-yes">4x</span>
126
128
  <span class="cline-any cline-neutral">&nbsp;</span>
127
129
  <span class="cline-any cline-neutral">&nbsp;</span>
128
130
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -139,20 +141,20 @@
139
141
  <span class="cline-any cline-neutral">&nbsp;</span>
140
142
  <span class="cline-any cline-neutral">&nbsp;</span>
141
143
  <span class="cline-any cline-neutral">&nbsp;</span>
142
- <span class="cline-any cline-yes">1x</span>
143
144
  <span class="cline-any cline-neutral">&nbsp;</span>
144
145
  <span class="cline-any cline-neutral">&nbsp;</span>
146
+ <span class="cline-any cline-yes">4x</span>
145
147
  <span class="cline-any cline-neutral">&nbsp;</span>
146
148
  <span class="cline-any cline-neutral">&nbsp;</span>
147
149
  <span class="cline-any cline-neutral">&nbsp;</span>
148
150
  <span class="cline-any cline-neutral">&nbsp;</span>
149
151
  <span class="cline-any cline-neutral">&nbsp;</span>
150
152
  <span class="cline-any cline-neutral">&nbsp;</span>
151
- <span class="cline-any cline-yes">1x</span>
152
- <span class="cline-any cline-yes">1x</span>
153
153
  <span class="cline-any cline-neutral">&nbsp;</span>
154
154
  <span class="cline-any cline-neutral">&nbsp;</span>
155
155
  <span class="cline-any cline-neutral">&nbsp;</span>
156
+ <span class="cline-any cline-yes">4x</span>
157
+ <span class="cline-any cline-yes">8x</span>
156
158
  <span class="cline-any cline-neutral">&nbsp;</span>
157
159
  <span class="cline-any cline-neutral">&nbsp;</span>
158
160
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -161,7 +163,9 @@
161
163
  <span class="cline-any cline-neutral">&nbsp;</span>
162
164
  <span class="cline-any cline-neutral">&nbsp;</span>
163
165
  <span class="cline-any cline-neutral">&nbsp;</span>
164
- <span class="cline-any cline-yes">1x</span>
166
+ <span class="cline-any cline-neutral">&nbsp;</span>
167
+ <span class="cline-any cline-neutral">&nbsp;</span>
168
+ <span class="cline-any cline-yes">8x</span>
165
169
  <span class="cline-any cline-neutral">&nbsp;</span>
166
170
  <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
167
171
  * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
@@ -179,10 +183,12 @@ import { getPubSub } from './services/pubSub'
179
183
  import type { Conf as ExternalConf } from './types'
180
184
  &nbsp;
181
185
  export type InternalConf = {
182
- secret: string
186
+ enable?: boolean
187
+ secret: string | null
183
188
  verbose?: boolean
184
189
  resolverUrl: string
185
- disabledUnmounting: boolean
190
+ bundleUrlOverride?: string
191
+ disableUnmounting?: boolean
186
192
  logger?: Logger | null
187
193
  fetchPackage: FetchPackage
188
194
  pubSub: PubSub
@@ -193,23 +199,23 @@ export type InternalConf = {
193
199
  }
194
200
  &nbsp;
195
201
  export const defaultConf = {
202
+ secret: null,
196
203
  resolverUrl: process.env.RESOLVER_URL,
197
- disabledUnmounting: false,
204
+ disableUnmounting: false,
198
205
  fetchPackage,
199
206
  pubSub: getPubSub(),
200
207
  LoaderComponent: TivioWidgetLoader,
201
208
  ErrorComponent: TivioWidgetError,
202
209
  }
203
210
  &nbsp;
204
- export const createInternalConf = (conf: ExternalConf): InternalConf =&gt; {
211
+ export const createInternalConf = (conf: ExternalConf | null): InternalConf =&gt; {
205
212
  const internalConf = {
206
213
  ...defaultConf,
207
- ...conf,
208
- logger: typeof conf.logger !== 'undefined' ?
214
+ ...conf ?? <span class="branch-1 cbranch-no" title="branch not covered" >{},</span>
215
+ logger: typeof conf?.logger !== 'undefined' ?
209
216
  conf.logger :
210
- <span class="branch-1 cbranch-no" title="branch not covered" > createLogger({</span>
217
+ createLogger({
211
218
  isConsoleEnabled: true,
212
- isSentryEnabled: !!process.env.SENTRY_DNS,
213
219
  }),
214
220
  sdkVersion: process.env.VERSION,
215
221
  }
@@ -223,7 +229,7 @@ export const createInternalConf = (conf: ExternalConf): InternalConf =&gt; {
223
229
  <div class='footer quiet pad2 space-top1 center small'>
224
230
  Code coverage generated by
225
231
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
226
- at Fri Apr 30 2021 12:16:39 GMT+0200 (Central European Summer Time)
232
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
227
233
  </div>
228
234
  </div>
229
235
  <script src="../prettify.js"></script>
@@ -25,28 +25,28 @@
25
25
  <div class='fl pad1y space-right2'>
26
26
  <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>8/8</span>
28
+ <span class='fraction'>18/18</span>
29
29
  </div>
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">100% </span>
33
+ <span class="strong">75% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>0/0</span>
35
+ <span class='fraction'>3/4</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
40
  <span class="strong">100% </span>
41
41
  <span class="quiet">Functions</span>
42
- <span class='fraction'>0/0</span>
42
+ <span class='fraction'>1/1</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
47
  <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>8/8</span>
49
+ <span class='fraction'>17/17</span>
50
50
  </div>
51
51
 
52
52
 
@@ -73,6 +73,21 @@
73
73
  </tr>
74
74
  </thead>
75
75
  <tbody><tr>
76
+ <td class="file high" data-value="conf.ts"><a href="conf.ts.html">conf.ts</a></td>
77
+ <td data-value="100" class="pic high">
78
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
79
+ </td>
80
+ <td data-value="100" class="pct high">100%</td>
81
+ <td data-value="10" class="abs high">10/10</td>
82
+ <td data-value="75" class="pct medium">75%</td>
83
+ <td data-value="4" class="abs medium">3/4</td>
84
+ <td data-value="100" class="pct high">100%</td>
85
+ <td data-value="1" class="abs high">1/1</td>
86
+ <td data-value="100" class="pct high">100%</td>
87
+ <td data-value="9" class="abs high">9/9</td>
88
+ </tr>
89
+
90
+ <tr>
76
91
  <td class="file high" data-value="setupTests.ts"><a href="setupTests.ts.html">setupTests.ts</a></td>
77
92
  <td data-value="100" class="pic high">
78
93
  <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
@@ -95,7 +110,7 @@
95
110
  <div class='footer quiet pad2 space-top1 center small'>
96
111
  Code coverage generated by
97
112
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
98
- at Thu May 06 2021 13:19:37 GMT+0200 (Central European Summer Time)
113
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
99
114
  </div>
100
115
  </div>
101
116
  <script src="../prettify.js"></script>