@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">35.71% </span>
26
+ <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>5/14</span>
28
+ <span class='fraction'>14/14</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/6</span>
35
+ <span class='fraction'>6/6</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
- <span class="strong">33.33% </span>
40
+ <span class="strong">100% </span>
41
41
  <span class="quiet">Functions</span>
42
- <span class='fraction'>1/3</span>
42
+ <span class='fraction'>3/3</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">30.77% </span>
47
+ <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>4/13</span>
49
+ <span class='fraction'>13/13</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 low'></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>
@@ -120,31 +120,31 @@
120
120
  <span class="cline-any cline-neutral">&nbsp;</span>
121
121
  <span class="cline-any cline-neutral">&nbsp;</span>
122
122
  <span class="cline-any cline-neutral">&nbsp;</span>
123
- <span class="cline-any cline-yes">1x</span>
124
- <span class="cline-any cline-yes">12x</span>
123
+ <span class="cline-any cline-yes">2x</span>
124
+ <span class="cline-any cline-yes">19x</span>
125
125
  <span class="cline-any cline-neutral">&nbsp;</span>
126
126
  <span class="cline-any cline-neutral">&nbsp;</span>
127
127
  <span class="cline-any cline-neutral">&nbsp;</span>
128
- <span class="cline-any cline-yes">12x</span>
128
+ <span class="cline-any cline-yes">19x</span>
129
129
  <span class="cline-any cline-neutral">&nbsp;</span>
130
- <span class="cline-any cline-yes">12x</span>
130
+ <span class="cline-any cline-yes">19x</span>
131
131
  <span class="cline-any cline-neutral">&nbsp;</span>
132
- <span class="cline-any cline-no">&nbsp;</span>
133
- <span class="cline-any cline-no">&nbsp;</span>
132
+ <span class="cline-any cline-yes">6x</span>
133
+ <span class="cline-any cline-yes">4x</span>
134
134
  <span class="cline-any cline-neutral">&nbsp;</span>
135
- <span class="cline-any cline-no">&nbsp;</span>
135
+ <span class="cline-any cline-yes">2x</span>
136
136
  <span class="cline-any cline-neutral">&nbsp;</span>
137
- <span class="cline-any cline-no">&nbsp;</span>
138
- <span class="cline-any cline-no">&nbsp;</span>
137
+ <span class="cline-any cline-yes">2x</span>
138
+ <span class="cline-any cline-yes">1x</span>
139
139
  <span class="cline-any cline-neutral">&nbsp;</span>
140
140
  <span class="cline-any cline-neutral">&nbsp;</span>
141
141
  <span class="cline-any cline-neutral">&nbsp;</span>
142
142
  <span class="cline-any cline-neutral">&nbsp;</span>
143
- <span class="cline-any cline-no">&nbsp;</span>
144
- <span class="cline-any cline-no">&nbsp;</span>
145
- <span class="cline-any cline-no">&nbsp;</span>
143
+ <span class="cline-any cline-yes">2x</span>
144
+ <span class="cline-any cline-yes">1x</span>
145
+ <span class="cline-any cline-yes">1x</span>
146
146
  <span class="cline-any cline-neutral">&nbsp;</span>
147
- <span class="cline-any cline-no">&nbsp;</span>
147
+ <span class="cline-any cline-yes">1x</span>
148
148
  <span class="cline-any cline-neutral">&nbsp;</span>
149
149
  <span class="cline-any cline-neutral">&nbsp;</span>
150
150
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -174,23 +174,23 @@ export const createSettings = (conf: InternalConf) =&gt; {
174
174
  } | null = null
175
175
  &nbsp;
176
176
  return ({
177
- onSetUser: <span class="fstat-no" title="function not covered" >(h</span>andler: (userId: string, userPayload: unknown) =&gt; void) =&gt; {
178
- <span class="cstat-no" title="statement not covered" > if (typeof handler !== 'function') {</span>
179
- <span class="cstat-no" title="statement not covered" > conf.logger?.exception('Tivio Bundle setUser handler must be a function')</span>
177
+ onSetUser: (handler: (userId: string, userPayload: unknown) =&gt; void) =&gt; {
178
+ if (typeof handler !== 'function') {
179
+ conf.logger?.exception('Tivio Bundle setUser handler must be a function')
180
180
  } else {
181
- <span class="cstat-no" title="statement not covered" > setUserHandler = handler</span>
181
+ setUserHandler = handler
182
182
  &nbsp;
183
- <span class="cstat-no" title="statement not covered" > if (value !== null) {</span>
184
- <span class="cstat-no" title="statement not covered" > handler(value.userId, value.userPayload)</span>
183
+ if (value !== null) {
184
+ handler(value.userId, value.userPayload)
185
185
  }
186
186
  }
187
187
  },
188
- setUser: <span class="fstat-no" title="function not covered" >(u</span>serId: string, userPayload: unknown) =&gt; {
189
- <span class="cstat-no" title="statement not covered" > if (typeof setUserHandler === 'function') {</span>
190
- <span class="cstat-no" title="statement not covered" > value = null</span>
191
- <span class="cstat-no" title="statement not covered" > setUserHandler(userId, userPayload)</span>
188
+ setUser: (userId: string, userPayload: unknown) =&gt; {
189
+ if (typeof setUserHandler === 'function') {
190
+ value = null
191
+ setUserHandler(userId, userPayload)
192
192
  } else {
193
- <span class="cstat-no" title="statement not covered" > value = { userId, userPayload }</span>
193
+ value = { userId, userPayload }
194
194
  }
195
195
  },
196
196
  })
@@ -202,7 +202,7 @@ export const createSettings = (conf: InternalConf) =&gt; {
202
202
  <div class='footer quiet pad2 space-top1 center small'>
203
203
  Code coverage generated by
204
204
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
205
- 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)
206
206
  </div>
207
207
  </div>
208
208
  <script src="../../prettify.js"></script>
@@ -83,17 +83,17 @@
83
83
  <a name='L24'></a><a href='#L24'>24</a>
84
84
  <a name='L25'></a><a href='#L25'>25</a>
85
85
  <a name='L26'></a><a href='#L26'>26</a>
86
- <a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
86
+ <a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
87
87
  <span class="cline-any cline-neutral">&nbsp;</span>
88
88
  <span class="cline-any cline-neutral">&nbsp;</span>
89
- <span class="cline-any cline-yes">1x</span>
90
- <span class="cline-any cline-yes">1x</span>
91
- <span class="cline-any cline-yes">1x</span>
92
- <span class="cline-any cline-yes">1x</span>
89
+ <span class="cline-any cline-yes">7x</span>
90
+ <span class="cline-any cline-yes">7x</span>
91
+ <span class="cline-any cline-yes">7x</span>
92
+ <span class="cline-any cline-yes">7x</span>
93
93
  <span class="cline-any cline-neutral">&nbsp;</span>
94
- <span class="cline-any cline-yes">1x</span>
94
+ <span class="cline-any cline-yes">7x</span>
95
95
  <span class="cline-any cline-neutral">&nbsp;</span>
96
- <span class="cline-any cline-yes">1x</span>
96
+ <span class="cline-any cline-yes">7x</span>
97
97
  <span class="cline-any cline-neutral">&nbsp;</span>
98
98
  <span class="cline-any cline-neutral">&nbsp;</span>
99
99
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -105,7 +105,7 @@
105
105
  <span class="cline-any cline-neutral">&nbsp;</span>
106
106
  <span class="cline-any cline-neutral">&nbsp;</span>
107
107
  <span class="cline-any cline-neutral">&nbsp;</span>
108
- <span class="cline-any cline-yes">1x</span>
108
+ <span class="cline-any cline-yes">7x</span>
109
109
  <span class="cline-any cline-neutral">&nbsp;</span>
110
110
  <span class="cline-any cline-neutral">&nbsp;</span>
111
111
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -142,7 +142,7 @@ export const pubSubMock = {
142
142
  <div class='footer quiet pad2 space-top1 center small'>
143
143
  Code coverage generated by
144
144
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
145
- at Thu May 06 2021 13:19:37 GMT+0200 (Central European Summer Time)
145
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
146
146
  </div>
147
147
  </div>
148
148
  <script src="../prettify.js"></script>