@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">18.18% </span>
26
+ <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>4/22</span>
28
+ <span class='fraction'>19/19</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/12</span>
35
+ <span class='fraction'>8/8</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/7</span>
42
+ <span class='fraction'>7/7</span>
43
43
  </div>
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">14.29% </span>
47
+ <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>3/21</span>
49
+ <span class='fraction'>18/18</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>
@@ -137,35 +137,7 @@
137
137
  <a name='L78'></a><a href='#L78'>78</a>
138
138
  <a name='L79'></a><a href='#L79'>79</a>
139
139
  <a name='L80'></a><a href='#L80'>80</a>
140
- <a name='L81'></a><a href='#L81'>81</a>
141
- <a name='L82'></a><a href='#L82'>82</a>
142
- <a name='L83'></a><a href='#L83'>83</a>
143
- <a name='L84'></a><a href='#L84'>84</a>
144
- <a name='L85'></a><a href='#L85'>85</a>
145
- <a name='L86'></a><a href='#L86'>86</a>
146
- <a name='L87'></a><a href='#L87'>87</a>
147
- <a name='L88'></a><a href='#L88'>88</a>
148
- <a name='L89'></a><a href='#L89'>89</a>
149
- <a name='L90'></a><a href='#L90'>90</a>
150
- <a name='L91'></a><a href='#L91'>91</a>
151
- <a name='L92'></a><a href='#L92'>92</a>
152
- <a name='L93'></a><a href='#L93'>93</a>
153
- <a name='L94'></a><a href='#L94'>94</a>
154
- <a name='L95'></a><a href='#L95'>95</a>
155
- <a name='L96'></a><a href='#L96'>96</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
156
- <span class="cline-any cline-neutral">&nbsp;</span>
157
- <span class="cline-any cline-neutral">&nbsp;</span>
158
- <span class="cline-any cline-neutral">&nbsp;</span>
159
- <span class="cline-any cline-neutral">&nbsp;</span>
160
- <span class="cline-any cline-neutral">&nbsp;</span>
161
- <span class="cline-any cline-neutral">&nbsp;</span>
162
- <span class="cline-any cline-neutral">&nbsp;</span>
163
- <span class="cline-any cline-neutral">&nbsp;</span>
164
- <span class="cline-any cline-neutral">&nbsp;</span>
165
- <span class="cline-any cline-neutral">&nbsp;</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">1x</span>
140
+ <a name='L81'></a><a href='#L81'>81</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
169
141
  <span class="cline-any cline-neutral">&nbsp;</span>
170
142
  <span class="cline-any cline-neutral">&nbsp;</span>
171
143
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -178,6 +150,7 @@
178
150
  <span class="cline-any cline-neutral">&nbsp;</span>
179
151
  <span class="cline-any cline-neutral">&nbsp;</span>
180
152
  <span class="cline-any cline-neutral">&nbsp;</span>
153
+ <span class="cline-any cline-yes">4x</span>
181
154
  <span class="cline-any cline-neutral">&nbsp;</span>
182
155
  <span class="cline-any cline-neutral">&nbsp;</span>
183
156
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -190,16 +163,11 @@
190
163
  <span class="cline-any cline-neutral">&nbsp;</span>
191
164
  <span class="cline-any cline-neutral">&nbsp;</span>
192
165
  <span class="cline-any cline-neutral">&nbsp;</span>
193
- <span class="cline-any cline-yes">1x</span>
194
166
  <span class="cline-any cline-neutral">&nbsp;</span>
195
167
  <span class="cline-any cline-neutral">&nbsp;</span>
196
168
  <span class="cline-any cline-neutral">&nbsp;</span>
197
169
  <span class="cline-any cline-neutral">&nbsp;</span>
198
- <span class="cline-any cline-yes">1x</span>
199
- <span class="cline-any cline-no">&nbsp;</span>
200
170
  <span class="cline-any cline-neutral">&nbsp;</span>
201
- <span class="cline-any cline-no">&nbsp;</span>
202
- <span class="cline-any cline-no">&nbsp;</span>
203
171
  <span class="cline-any cline-neutral">&nbsp;</span>
204
172
  <span class="cline-any cline-neutral">&nbsp;</span>
205
173
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -210,39 +178,41 @@
210
178
  <span class="cline-any cline-neutral">&nbsp;</span>
211
179
  <span class="cline-any cline-neutral">&nbsp;</span>
212
180
  <span class="cline-any cline-neutral">&nbsp;</span>
181
+ <span class="cline-any cline-yes">4x</span>
182
+ <span class="cline-any cline-yes">9x</span>
213
183
  <span class="cline-any cline-neutral">&nbsp;</span>
214
- <span class="cline-any cline-no">&nbsp;</span>
215
- <span class="cline-any cline-no">&nbsp;</span>
216
- <span class="cline-any cline-no">&nbsp;</span>
184
+ <span class="cline-any cline-yes">9x</span>
185
+ <span class="cline-any cline-yes">5x</span>
186
+ <span class="cline-any cline-yes">4x</span>
217
187
  <span class="cline-any cline-neutral">&nbsp;</span>
218
188
  <span class="cline-any cline-neutral">&nbsp;</span>
219
- <span class="cline-any cline-no">&nbsp;</span>
220
- <span class="cline-any cline-no">&nbsp;</span>
189
+ <span class="cline-any cline-yes">5x</span>
190
+ <span class="cline-any cline-yes">1x</span>
221
191
  <span class="cline-any cline-neutral">&nbsp;</span>
222
192
  <span class="cline-any cline-neutral">&nbsp;</span>
223
193
  <span class="cline-any cline-neutral">&nbsp;</span>
224
- <span class="cline-any cline-no">&nbsp;</span>
225
- <span class="cline-any cline-no">&nbsp;</span>
226
- <span class="cline-any cline-no">&nbsp;</span>
194
+ <span class="cline-any cline-yes">9x</span>
195
+ <span class="cline-any cline-yes">2x</span>
196
+ <span class="cline-any cline-yes">1x</span>
227
197
  <span class="cline-any cline-neutral">&nbsp;</span>
228
198
  <span class="cline-any cline-neutral">&nbsp;</span>
229
- <span class="cline-any cline-no">&nbsp;</span>
230
- <span class="cline-any cline-no">&nbsp;</span>
199
+ <span class="cline-any cline-yes">2x</span>
200
+ <span class="cline-any cline-yes">1x</span>
231
201
  <span class="cline-any cline-neutral">&nbsp;</span>
232
202
  <span class="cline-any cline-neutral">&nbsp;</span>
233
203
  <span class="cline-any cline-neutral">&nbsp;</span>
234
- <span class="cline-any cline-no">&nbsp;</span>
204
+ <span class="cline-any cline-yes">9x</span>
235
205
  <span class="cline-any cline-neutral">&nbsp;</span>
236
- <span class="cline-any cline-no">&nbsp;</span>
206
+ <span class="cline-any cline-yes">2x</span>
237
207
  <span class="cline-any cline-neutral">&nbsp;</span>
238
208
  <span class="cline-any cline-neutral">&nbsp;</span>
239
- <span class="cline-any cline-no">&nbsp;</span>
209
+ <span class="cline-any cline-yes">1x</span>
240
210
  <span class="cline-any cline-neutral">&nbsp;</span>
241
211
  <span class="cline-any cline-neutral">&nbsp;</span>
242
- <span class="cline-any cline-no">&nbsp;</span>
212
+ <span class="cline-any cline-yes">1x</span>
243
213
  <span class="cline-any cline-neutral">&nbsp;</span>
244
214
  <span class="cline-any cline-neutral">&nbsp;</span>
245
- <span class="cline-any cline-no">&nbsp;</span>
215
+ <span class="cline-any cline-yes">1x</span>
246
216
  <span class="cline-any cline-neutral">&nbsp;</span>
247
217
  <span class="cline-any cline-neutral">&nbsp;</span>
248
218
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -260,7 +230,7 @@
260
230
  * The purpose is tracking of important events with Sentry service.
261
231
  */
262
232
  &nbsp;
263
- import * as Sentry from '@sentry/browser'
233
+ import { Sentry } from './sentry'
264
234
  &nbsp;
265
235
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
266
236
  export type LoggerArgs = any[]
@@ -280,64 +250,49 @@ export interface Logger {
280
250
  &nbsp;
281
251
  export type LoggerConf = {
282
252
  isConsoleEnabled: boolean
283
- isSentryEnabled: boolean
253
+ isSentryEnabled?: boolean
284
254
  }
285
255
  &nbsp;
286
- export type Severity = 'warn' | 'error' | 'exception' | 'info' | 'debug'
287
- &nbsp;
288
- const SENTRY_DNS = process.env.SENTRY_DNS
256
+ export type Severity = 'warn' | 'error' | 'info' | 'debug'
289
257
  &nbsp;
290
258
  /**
291
259
  * Factory
292
260
  **/
293
- export const createLogger = <span class="fstat-no" title="function not covered" >(c</span>onf: LoggerConf): Logger =&gt; {
294
- const isSentryAvailable = <span class="cstat-no" title="statement not covered" >conf.isSentryEnabled &amp;&amp; !!SENTRY_DNS</span>
295
- &nbsp;
296
- <span class="cstat-no" title="statement not covered" > if (isSentryAvailable) {</span>
297
- <span class="cstat-no" title="statement not covered" > Sentry.init({</span>
298
- dsn: SENTRY_DNS,
299
- release: `@tivio/sdk-react@${process.env.VERSION}`,
300
- &nbsp;
301
- // Set tracesSampleRate to 1.0 to capture 100%
302
- // of transactions for performance monitoring.
303
- // We recommend adjusting this value in production
304
- tracesSampleRate: 1.0,
305
- &nbsp;
306
- })
307
- }
261
+ export const createLogger = (conf: LoggerConf): Logger =&gt; {
262
+ const isSentryAvailable = conf.isSentryEnabled !== false
308
263
  &nbsp;
309
- const log = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(s</span>everity: Severity, messages: LoggerArgs) =&gt; {</span>
310
- <span class="cstat-no" title="statement not covered" > if (conf.isConsoleEnabled) {</span>
311
- <span class="cstat-no" title="statement not covered" > console[severity]('Tivio SDK ', ...messages)</span>
264
+ const log = (severity: Severity, messages: LoggerArgs) =&gt; {
265
+ if (conf.isConsoleEnabled) {
266
+ console[severity]('Tivio SDK ', ...messages)
312
267
  }
313
268
  &nbsp;
314
- <span class="cstat-no" title="statement not covered" > if (isSentryAvailable) {</span>
315
- <span class="cstat-no" title="statement not covered" > Sentry.captureMessage(`${messages}`, Sentry.Severity.fromString(severity))</span>
269
+ if (isSentryAvailable) {
270
+ Sentry.captureMessage(`${messages}`, Sentry.Severity.fromString(severity))
316
271
  }
317
272
  }
318
273
  &nbsp;
319
- const exception = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(e</span>rror: Error) =&gt; {</span>
320
- <span class="cstat-no" title="statement not covered" > if (conf.isConsoleEnabled) {</span>
321
- <span class="cstat-no" title="statement not covered" > console.error(error)</span>
274
+ const exception = (error: Error) =&gt; {
275
+ if (conf.isConsoleEnabled) {
276
+ console.error(error)
322
277
  }
323
278
  &nbsp;
324
- <span class="cstat-no" title="statement not covered" > if (isSentryAvailable) {</span>
325
- <span class="cstat-no" title="statement not covered" > Sentry.captureException(error)</span>
279
+ if (isSentryAvailable) {
280
+ Sentry.captureException(error)
326
281
  }
327
282
  }
328
283
  &nbsp;
329
- <span class="cstat-no" title="statement not covered" > return {</span>
330
- error: <span class="fstat-no" title="function not covered" >(.</span>..args: LoggerArgs) =&gt; {
331
- <span class="cstat-no" title="statement not covered" > log('error', args)</span>
284
+ return {
285
+ error: (...args: LoggerArgs) =&gt; {
286
+ log('error', args)
332
287
  },
333
- info: <span class="fstat-no" title="function not covered" >(.</span>..args: LoggerArgs) =&gt; {
334
- <span class="cstat-no" title="statement not covered" > log('info', args)</span>
288
+ info: (...args: LoggerArgs) =&gt; {
289
+ log('info', args)
335
290
  },
336
- warn: <span class="fstat-no" title="function not covered" >(.</span>..args: LoggerArgs) =&gt; {
337
- <span class="cstat-no" title="statement not covered" > log('warn', args)</span>
291
+ warn: (...args: LoggerArgs) =&gt; {
292
+ log('warn', args)
338
293
  },
339
- debug: <span class="fstat-no" title="function not covered" >(.</span>..args: LoggerArgs) =&gt; {
340
- <span class="cstat-no" title="statement not covered" > log('debug', args)</span>
294
+ debug: (...args: LoggerArgs) =&gt; {
295
+ log('debug', args)
341
296
  },
342
297
  exception,
343
298
  }
@@ -349,7 +304,7 @@ export const createLogger = <span class="fstat-no" title="function not covered"
349
304
  <div class='footer quiet pad2 space-top1 center small'>
350
305
  Code coverage generated by
351
306
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
352
- at Fri Apr 30 2021 12:16:39 GMT+0200 (Central European Summer Time)
307
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
353
308
  </div>
354
309
  </div>
355
310
  <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">38.46% </span>
26
+ <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>5/13</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/7</span>
35
+ <span class='fraction'>7/7</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/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">36.36% </span>
47
+ <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>4/11</span>
49
+ <span class='fraction'>11/11</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>
@@ -106,31 +106,31 @@
106
106
  <span class="cline-any cline-neutral">&nbsp;</span>
107
107
  <span class="cline-any cline-neutral">&nbsp;</span>
108
108
  <span class="cline-any cline-neutral">&nbsp;</span>
109
- <span class="cline-any cline-yes">1x</span>
109
+ <span class="cline-any cline-yes">5x</span>
110
110
  <span class="cline-any cline-neutral">&nbsp;</span>
111
111
  <span class="cline-any cline-neutral">&nbsp;</span>
112
112
  <span class="cline-any cline-neutral">&nbsp;</span>
113
- <span class="cline-any cline-yes">1x</span>
114
- <span class="cline-any cline-no">&nbsp;</span>
113
+ <span class="cline-any cline-yes">5x</span>
114
+ <span class="cline-any cline-yes">4x</span>
115
115
  <span class="cline-any cline-neutral">&nbsp;</span>
116
- <span class="cline-any cline-no">&nbsp;</span>
117
- <span class="cline-any cline-no">&nbsp;</span>
116
+ <span class="cline-any cline-yes">4x</span>
117
+ <span class="cline-any cline-yes">1x</span>
118
118
  <span class="cline-any cline-neutral">&nbsp;</span>
119
119
  <span class="cline-any cline-neutral">&nbsp;</span>
120
- <span class="cline-any cline-no">&nbsp;</span>
120
+ <span class="cline-any cline-yes">3x</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-no">&nbsp;</span>
123
+ <span class="cline-any cline-yes">1x</span>
124
124
  <span class="cline-any cline-neutral">&nbsp;</span>
125
125
  <span class="cline-any cline-neutral">&nbsp;</span>
126
- <span class="cline-any cline-no">&nbsp;</span>
126
+ <span class="cline-any cline-yes">2x</span>
127
127
  <span class="cline-any cline-neutral">&nbsp;</span>
128
128
  <span class="cline-any cline-neutral">&nbsp;</span>
129
- <span class="cline-any cline-yes">1x</span>
130
- <span class="cline-any cline-no">&nbsp;</span>
129
+ <span class="cline-any cline-yes">5x</span>
130
+ <span class="cline-any cline-yes">2x</span>
131
131
  <span class="cline-any cline-neutral">&nbsp;</span>
132
132
  <span class="cline-any cline-neutral">&nbsp;</span>
133
- <span class="cline-any cline-yes">1x</span>
133
+ <span class="cline-any cline-yes">5x</span>
134
134
  <span class="cline-any cline-neutral">&nbsp;</span>
135
135
  <span class="cline-any cline-neutral">&nbsp;</span>
136
136
  <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
@@ -148,27 +148,27 @@ const FETCH_OPT = { cache: 'no-store' as const }
148
148
  &nbsp;
149
149
  export type FetchPackage = (url: string) =&gt; Promise&lt;string&gt;
150
150
  &nbsp;
151
- const packageResponseHandler = <span class="fstat-no" title="function not covered" >(r</span>esponse: Response): Promise&lt;string&gt; =&gt; {
152
- const contentType = <span class="cstat-no" title="statement not covered" >response.headers.get('content-type')</span>
151
+ const packageResponseHandler = (response: Response): Promise&lt;string&gt; =&gt; {
152
+ const contentType = response.headers.get('content-type')
153
153
  &nbsp;
154
- <span class="cstat-no" title="statement not covered" > if (response.status !== 200) {</span>
155
- <span class="cstat-no" title="statement not covered" > return Promise.reject(`Incorrect status "${response.status}" was obtained while fetching the module.`)</span>
154
+ if (response.status !== 200) {
155
+ return Promise.reject(`Incorrect status "${response.status}" was obtained while fetching the module.`)
156
156
  }
157
157
  &nbsp;
158
- <span class="cstat-no" title="statement not covered" > if (!contentType ||</span>
158
+ if (!contentType ||
159
159
  (!contentType.includes('application/javascript') &amp;&amp; !contentType.includes('text/javascript'))
160
160
  ) {
161
- <span class="cstat-no" title="statement not covered" > return Promise.reject(`Incorrect content "${contentType}" was obtained while fetching the module.`)</span>
161
+ return Promise.reject(`Incorrect content "${contentType}" was obtained while fetching the module.`)
162
162
  }
163
163
  &nbsp;
164
- <span class="cstat-no" title="statement not covered" > return response.text()</span>
164
+ return response.text()
165
165
  }
166
166
  &nbsp;
167
- const packageResponseErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rror: Error): Promise&lt;never&gt; =&gt; {
168
- <span class="cstat-no" title="statement not covered" > return Promise.reject(`Network failure: ${error}`)</span>
167
+ const packageResponseErrorHandler = (error: Error): Promise&lt;never&gt; =&gt; {
168
+ return Promise.reject(`Network failure: ${error}`)
169
169
  }
170
170
  &nbsp;
171
- export const fetchPackage: FetchPackage = <span class="fstat-no" title="function not covered" >async </span>(url: string): Promise&lt;string&gt; =&gt; <span class="cstat-no" title="statement not covered" >fetch(url, FETCH_OPT)</span>
171
+ export const fetchPackage: FetchPackage = async (url: string): Promise&lt;string&gt; =&gt; fetch(url, FETCH_OPT)
172
172
  .then(packageResponseHandler)
173
173
  .catch(packageResponseErrorHandler)
174
174
  &nbsp;</pre></td></tr></table></pre>
@@ -178,7 +178,7 @@ export const fetchPackage: FetchPackage = <span class="fstat-no" title="function
178
178
  <div class='footer quiet pad2 space-top1 center small'>
179
179
  Code coverage generated by
180
180
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
181
- at Fri Apr 30 2021 12:16:39 GMT+0200 (Central European Summer Time)
181
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
182
182
  </div>
183
183
  </div>
184
184
  <script src="../../prettify.js"></script>
@@ -123,10 +123,10 @@
123
123
  <span class="cline-any cline-neutral">&nbsp;</span>
124
124
  <span class="cline-any cline-neutral">&nbsp;</span>
125
125
  <span class="cline-any cline-neutral">&nbsp;</span>
126
- <span class="cline-any cline-yes">1x</span>
127
- <span class="cline-any cline-yes">1x</span>
126
+ <span class="cline-any cline-yes">4x</span>
127
+ <span class="cline-any cline-yes">4x</span>
128
128
  <span class="cline-any cline-neutral">&nbsp;</span>
129
- <span class="cline-any cline-yes">1x</span>
129
+ <span class="cline-any cline-yes">4x</span>
130
130
  <span class="cline-any cline-neutral">&nbsp;</span>
131
131
  <span class="cline-any cline-no">&nbsp;</span>
132
132
  <span class="cline-any cline-no">&nbsp;</span>
@@ -153,17 +153,17 @@
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">1x</span>
156
+ <span class="cline-any cline-yes">4x</span>
157
157
  <span class="cline-any cline-neutral">&nbsp;</span>
158
158
  <span class="cline-any cline-neutral">&nbsp;</span>
159
159
  <span class="cline-any cline-neutral">&nbsp;</span>
160
160
  <span class="cline-any cline-neutral">&nbsp;</span>
161
- <span class="cline-any cline-yes">1x</span>
162
- <span class="cline-any cline-yes">1x</span>
163
- <span class="cline-any cline-yes">1x</span>
161
+ <span class="cline-any cline-yes">4x</span>
162
+ <span class="cline-any cline-yes">4x</span>
163
+ <span class="cline-any cline-yes">4x</span>
164
164
  <span class="cline-any cline-neutral">&nbsp;</span>
165
165
  <span class="cline-any cline-neutral">&nbsp;</span>
166
- <span class="cline-any cline-yes">1x</span>
166
+ <span class="cline-any cline-yes">4x</span>
167
167
  <span class="cline-any cline-neutral">&nbsp;</span>
168
168
  <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
169
169
  * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
@@ -226,7 +226,7 @@ export const getPubSub = () =&gt; {
226
226
  <div class='footer quiet pad2 space-top1 center small'>
227
227
  Code coverage generated by
228
228
  <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
229
- at Fri Apr 30 2021 12:16:39 GMT+0200 (Central European Summer Time)
229
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
230
230
  </div>
231
231
  </div>
232
232
  <script src="../../prettify.js"></script>
@@ -0,0 +1,170 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/services/sentry.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/services</a> sentry.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">83.33% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>10/12</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">50% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/2</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">80% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>8/10</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>
69
+ <a name='L10'></a><a href='#L10'>10</a>
70
+ <a name='L11'></a><a href='#L11'>11</a>
71
+ <a name='L12'></a><a href='#L12'>12</a>
72
+ <a name='L13'></a><a href='#L13'>13</a>
73
+ <a name='L14'></a><a href='#L14'>14</a>
74
+ <a name='L15'></a><a href='#L15'>15</a>
75
+ <a name='L16'></a><a href='#L16'>16</a>
76
+ <a name='L17'></a><a href='#L17'>17</a>
77
+ <a name='L18'></a><a href='#L18'>18</a>
78
+ <a name='L19'></a><a href='#L19'>19</a>
79
+ <a name='L20'></a><a href='#L20'>20</a>
80
+ <a name='L21'></a><a href='#L21'>21</a>
81
+ <a name='L22'></a><a href='#L22'>22</a>
82
+ <a name='L23'></a><a href='#L23'>23</a>
83
+ <a name='L24'></a><a href='#L24'>24</a>
84
+ <a name='L25'></a><a href='#L25'>25</a>
85
+ <a name='L26'></a><a href='#L26'>26</a>
86
+ <a name='L27'></a><a href='#L27'>27</a>
87
+ <a name='L28'></a><a href='#L28'>28</a>
88
+ <a name='L29'></a><a href='#L29'>29</a>
89
+ <a name='L30'></a><a href='#L30'>30</a>
90
+ <a name='L31'></a><a href='#L31'>31</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
91
+ <span class="cline-any cline-neutral">&nbsp;</span>
92
+ <span class="cline-any cline-yes">4x</span>
93
+ <span class="cline-any cline-yes">4x</span>
94
+ <span class="cline-any cline-neutral">&nbsp;</span>
95
+ <span class="cline-any cline-yes">4x</span>
96
+ <span class="cline-any cline-neutral">&nbsp;</span>
97
+ <span class="cline-any cline-yes">4x</span>
98
+ <span class="cline-any cline-no">&nbsp;</span>
99
+ <span class="cline-any cline-neutral">&nbsp;</span>
100
+ <span class="cline-any cline-neutral">&nbsp;</span>
101
+ <span class="cline-any cline-neutral">&nbsp;</span>
102
+ <span class="cline-any cline-neutral">&nbsp;</span>
103
+ <span class="cline-any cline-neutral">&nbsp;</span>
104
+ <span class="cline-any cline-neutral">&nbsp;</span>
105
+ <span class="cline-any cline-neutral">&nbsp;</span>
106
+ <span class="cline-any cline-neutral">&nbsp;</span>
107
+ <span class="cline-any cline-neutral">&nbsp;</span>
108
+ <span class="cline-any cline-no">&nbsp;</span>
109
+ <span class="cline-any cline-neutral">&nbsp;</span>
110
+ <span class="cline-any cline-neutral">&nbsp;</span>
111
+ <span class="cline-any cline-neutral">&nbsp;</span>
112
+ <span class="cline-any cline-neutral">&nbsp;</span>
113
+ <span class="cline-any cline-neutral">&nbsp;</span>
114
+ <span class="cline-any cline-yes">4x</span>
115
+ <span class="cline-any cline-neutral">&nbsp;</span>
116
+ <span class="cline-any cline-yes">2x</span>
117
+ <span class="cline-any cline-neutral">&nbsp;</span>
118
+ <span class="cline-any cline-yes">2x</span>
119
+ <span class="cline-any cline-neutral">&nbsp;</span>
120
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import * as _Sentry from '@sentry/browser'
121
+ &nbsp;
122
+ const SENTRY_DSN = process.env.SENTRY_DSN
123
+ const VERSION = process.env.VERSION
124
+ &nbsp;
125
+ export const Sentry = _Sentry
126
+ &nbsp;
127
+ export const initSentry = <span class="fstat-no" title="function not covered" >() =</span>&gt; {
128
+ <span class="cstat-no" title="statement not covered" > Sentry.init({</span>
129
+ dsn: SENTRY_DSN,
130
+ release: `@tivio/sdk-react@${VERSION}`,
131
+ &nbsp;
132
+ // Set tracesSampleRate to 1.0 to capture 100%
133
+ // of transactions for performance monitoring.
134
+ // We recommend adjusting this value in production
135
+ tracesSampleRate: 1.0,
136
+ })
137
+ &nbsp;
138
+ <span class="cstat-no" title="statement not covered" > console.info('@tivio: Sentry enabled')</span>
139
+ }
140
+ &nbsp;
141
+ /**
142
+ * Inject Sentry to window in order to use it inside core-js, core-react, etc.
143
+ */
144
+ export const injectSentryToWindow = () =&gt; {
145
+ // @ts-ignore
146
+ window.sentry = Sentry
147
+ &nbsp;
148
+ console.info('@tivio: Sentry added to window')
149
+ }
150
+ &nbsp;</pre></td></tr></table></pre>
151
+
152
+ <div class='push'></div><!-- for sticky footer -->
153
+ </div><!-- /wrapper -->
154
+ <div class='footer quiet pad2 space-top1 center small'>
155
+ Code coverage generated by
156
+ <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
157
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
158
+ </div>
159
+ </div>
160
+ <script src="../../prettify.js"></script>
161
+ <script>
162
+ window.onload = function () {
163
+ prettyPrint();
164
+ };
165
+ </script>
166
+ <script src="../../sorter.js"></script>
167
+ <script src="../../block-navigation.js"></script>
168
+ </body>
169
+ </html>
170
+