@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.
- package/README.md +8 -0
- package/coverage/clover.xml +356 -95
- package/coverage/lcov-report/index.html +55 -25
- package/coverage/lcov-report/src/components/ContextProvider.tsx.html +194 -0
- package/coverage/lcov-report/src/components/TivioProvider.tsx.html +109 -37
- package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +3 -3
- package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +3 -3
- package/coverage/lcov-report/src/components/context/ChannelsContext.tsx.html +197 -0
- package/coverage/lcov-report/src/components/context/OrganizationSubscriptionsContext.tsx.html +179 -0
- package/coverage/lcov-report/src/components/context/PurchasesWithVideosContext.tsx.html +179 -0
- package/coverage/lcov-report/src/components/context/RowItemsContext.tsx.html +191 -0
- package/coverage/lcov-report/src/components/context/ScreensContext.tsx.html +185 -0
- package/coverage/lcov-report/src/components/context/SectionsContext.tsx.html +200 -0
- package/coverage/lcov-report/src/components/context/UserContext.tsx.html +176 -0
- package/coverage/lcov-report/src/components/context/VideosContext.tsx.html +200 -0
- package/coverage/lcov-report/src/components/context/index.html +231 -0
- package/coverage/lcov-report/src/components/context/index.ts.html +104 -0
- package/coverage/lcov-report/src/components/index.html +32 -32
- package/coverage/lcov-report/src/conf.ts.html +27 -21
- package/coverage/lcov-report/src/index.html +21 -6
- package/coverage/lcov-report/src/services/bundleLoader.ts.html +127 -157
- package/coverage/lcov-report/src/services/dependencyResolver.ts.html +36 -30
- package/coverage/lcov-report/src/services/index.html +102 -42
- package/coverage/lcov-report/src/services/logger.ts.html +53 -98
- package/coverage/lcov-report/src/services/packageLoader.ts.html +31 -31
- package/coverage/lcov-report/src/services/pubSub.ts.html +9 -9
- package/coverage/lcov-report/src/services/sentry.ts.html +170 -0
- package/coverage/lcov-report/src/services/settings.ts.html +34 -34
- package/coverage/lcov-report/src/setupTests.ts.html +9 -9
- package/coverage/lcov.info +641 -141
- package/dist/components/TivioProvider.d.ts +3 -0
- package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
- package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
- package/dist/conf.d.ts +1 -0
- package/dist/index.js +1 -2
- package/dist/services/dependencyResolver.d.ts +2 -1
- package/dist/services/sentry.d.ts +2 -5
- package/dist/types.d.ts +5 -13
- package/env +0 -0
- package/package.json +12 -12
- package/scripts/build_dev.sh +3 -0
- package/scripts/build_prod.sh +3 -0
- package/scripts/postpublish.ts +10 -0
- package/scripts/start.sh +3 -0
- 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">
|
26
|
+
<span class="strong">100% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
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">
|
33
|
+
<span class="strong">100% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
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">
|
40
|
+
<span class="strong">100% </span>
|
41
41
|
<span class="quiet">Functions</span>
|
42
|
-
<span class='fraction'>
|
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">
|
47
|
+
<span class="strong">100% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
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
|
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"> </span>
|
156
|
-
<span class="cline-any cline-neutral"> </span>
|
157
|
-
<span class="cline-any cline-neutral"> </span>
|
158
|
-
<span class="cline-any cline-neutral"> </span>
|
159
|
-
<span class="cline-any cline-neutral"> </span>
|
160
|
-
<span class="cline-any cline-neutral"> </span>
|
161
|
-
<span class="cline-any cline-neutral"> </span>
|
162
|
-
<span class="cline-any cline-neutral"> </span>
|
163
|
-
<span class="cline-any cline-neutral"> </span>
|
164
|
-
<span class="cline-any cline-neutral"> </span>
|
165
|
-
<span class="cline-any cline-neutral"> </span>
|
166
|
-
<span class="cline-any cline-neutral"> </span>
|
167
|
-
<span class="cline-any cline-neutral"> </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"> </span>
|
169
141
|
<span class="cline-any cline-neutral"> </span>
|
170
142
|
<span class="cline-any cline-neutral"> </span>
|
171
143
|
<span class="cline-any cline-neutral"> </span>
|
@@ -178,6 +150,7 @@
|
|
178
150
|
<span class="cline-any cline-neutral"> </span>
|
179
151
|
<span class="cline-any cline-neutral"> </span>
|
180
152
|
<span class="cline-any cline-neutral"> </span>
|
153
|
+
<span class="cline-any cline-yes">4x</span>
|
181
154
|
<span class="cline-any cline-neutral"> </span>
|
182
155
|
<span class="cline-any cline-neutral"> </span>
|
183
156
|
<span class="cline-any cline-neutral"> </span>
|
@@ -190,16 +163,11 @@
|
|
190
163
|
<span class="cline-any cline-neutral"> </span>
|
191
164
|
<span class="cline-any cline-neutral"> </span>
|
192
165
|
<span class="cline-any cline-neutral"> </span>
|
193
|
-
<span class="cline-any cline-yes">1x</span>
|
194
166
|
<span class="cline-any cline-neutral"> </span>
|
195
167
|
<span class="cline-any cline-neutral"> </span>
|
196
168
|
<span class="cline-any cline-neutral"> </span>
|
197
169
|
<span class="cline-any cline-neutral"> </span>
|
198
|
-
<span class="cline-any cline-yes">1x</span>
|
199
|
-
<span class="cline-any cline-no"> </span>
|
200
170
|
<span class="cline-any cline-neutral"> </span>
|
201
|
-
<span class="cline-any cline-no"> </span>
|
202
|
-
<span class="cline-any cline-no"> </span>
|
203
171
|
<span class="cline-any cline-neutral"> </span>
|
204
172
|
<span class="cline-any cline-neutral"> </span>
|
205
173
|
<span class="cline-any cline-neutral"> </span>
|
@@ -210,39 +178,41 @@
|
|
210
178
|
<span class="cline-any cline-neutral"> </span>
|
211
179
|
<span class="cline-any cline-neutral"> </span>
|
212
180
|
<span class="cline-any cline-neutral"> </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"> </span>
|
214
|
-
<span class="cline-any cline-
|
215
|
-
<span class="cline-any cline-
|
216
|
-
<span class="cline-any cline-
|
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"> </span>
|
218
188
|
<span class="cline-any cline-neutral"> </span>
|
219
|
-
<span class="cline-any cline-
|
220
|
-
<span class="cline-any cline-
|
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"> </span>
|
222
192
|
<span class="cline-any cline-neutral"> </span>
|
223
193
|
<span class="cline-any cline-neutral"> </span>
|
224
|
-
<span class="cline-any cline-
|
225
|
-
<span class="cline-any cline-
|
226
|
-
<span class="cline-any cline-
|
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"> </span>
|
228
198
|
<span class="cline-any cline-neutral"> </span>
|
229
|
-
<span class="cline-any cline-
|
230
|
-
<span class="cline-any cline-
|
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"> </span>
|
232
202
|
<span class="cline-any cline-neutral"> </span>
|
233
203
|
<span class="cline-any cline-neutral"> </span>
|
234
|
-
<span class="cline-any cline-
|
204
|
+
<span class="cline-any cline-yes">9x</span>
|
235
205
|
<span class="cline-any cline-neutral"> </span>
|
236
|
-
<span class="cline-any cline-
|
206
|
+
<span class="cline-any cline-yes">2x</span>
|
237
207
|
<span class="cline-any cline-neutral"> </span>
|
238
208
|
<span class="cline-any cline-neutral"> </span>
|
239
|
-
<span class="cline-any cline-
|
209
|
+
<span class="cline-any cline-yes">1x</span>
|
240
210
|
<span class="cline-any cline-neutral"> </span>
|
241
211
|
<span class="cline-any cline-neutral"> </span>
|
242
|
-
<span class="cline-any cline-
|
212
|
+
<span class="cline-any cline-yes">1x</span>
|
243
213
|
<span class="cline-any cline-neutral"> </span>
|
244
214
|
<span class="cline-any cline-neutral"> </span>
|
245
|
-
<span class="cline-any cline-
|
215
|
+
<span class="cline-any cline-yes">1x</span>
|
246
216
|
<span class="cline-any cline-neutral"> </span>
|
247
217
|
<span class="cline-any cline-neutral"> </span>
|
248
218
|
<span class="cline-any cline-neutral"> </span>
|
@@ -260,7 +230,7 @@
|
|
260
230
|
* The purpose is tracking of important events with Sentry service.
|
261
231
|
*/
|
262
232
|
|
263
|
-
import
|
233
|
+
import { Sentry } from './sentry'
|
264
234
|
|
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
|
|
281
251
|
export type LoggerConf = {
|
282
252
|
isConsoleEnabled: boolean
|
283
|
-
isSentryEnabled
|
253
|
+
isSentryEnabled?: boolean
|
284
254
|
}
|
285
255
|
|
286
|
-
export type Severity = 'warn' | 'error' | '
|
287
|
-
|
288
|
-
const SENTRY_DNS = process.env.SENTRY_DNS
|
256
|
+
export type Severity = 'warn' | 'error' | 'info' | 'debug'
|
289
257
|
|
290
258
|
/**
|
291
259
|
* Factory
|
292
260
|
**/
|
293
|
-
export const createLogger =
|
294
|
-
const isSentryAvailable =
|
295
|
-
|
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
|
-
|
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
|
-
|
306
|
-
})
|
307
|
-
}
|
261
|
+
export const createLogger = (conf: LoggerConf): Logger => {
|
262
|
+
const isSentryAvailable = conf.isSentryEnabled !== false
|
308
263
|
|
309
|
-
const log =
|
310
|
-
|
311
|
-
|
264
|
+
const log = (severity: Severity, messages: LoggerArgs) => {
|
265
|
+
if (conf.isConsoleEnabled) {
|
266
|
+
console[severity]('Tivio SDK ', ...messages)
|
312
267
|
}
|
313
268
|
|
314
|
-
|
315
|
-
|
269
|
+
if (isSentryAvailable) {
|
270
|
+
Sentry.captureMessage(`${messages}`, Sentry.Severity.fromString(severity))
|
316
271
|
}
|
317
272
|
}
|
318
273
|
|
319
|
-
const exception =
|
320
|
-
|
321
|
-
|
274
|
+
const exception = (error: Error) => {
|
275
|
+
if (conf.isConsoleEnabled) {
|
276
|
+
console.error(error)
|
322
277
|
}
|
323
278
|
|
324
|
-
|
325
|
-
|
279
|
+
if (isSentryAvailable) {
|
280
|
+
Sentry.captureException(error)
|
326
281
|
}
|
327
282
|
}
|
328
283
|
|
329
|
-
|
330
|
-
error:
|
331
|
-
|
284
|
+
return {
|
285
|
+
error: (...args: LoggerArgs) => {
|
286
|
+
log('error', args)
|
332
287
|
},
|
333
|
-
info:
|
334
|
-
|
288
|
+
info: (...args: LoggerArgs) => {
|
289
|
+
log('info', args)
|
335
290
|
},
|
336
|
-
warn:
|
337
|
-
|
291
|
+
warn: (...args: LoggerArgs) => {
|
292
|
+
log('warn', args)
|
338
293
|
},
|
339
|
-
debug:
|
340
|
-
|
294
|
+
debug: (...args: LoggerArgs) => {
|
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
|
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">
|
26
|
+
<span class="strong">100% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
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">
|
33
|
+
<span class="strong">100% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
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">
|
40
|
+
<span class="strong">100% </span>
|
41
41
|
<span class="quiet">Functions</span>
|
42
|
-
<span class='fraction'>
|
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">
|
47
|
+
<span class="strong">100% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
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
|
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"> </span>
|
107
107
|
<span class="cline-any cline-neutral"> </span>
|
108
108
|
<span class="cline-any cline-neutral"> </span>
|
109
|
-
<span class="cline-any cline-yes">
|
109
|
+
<span class="cline-any cline-yes">5x</span>
|
110
110
|
<span class="cline-any cline-neutral"> </span>
|
111
111
|
<span class="cline-any cline-neutral"> </span>
|
112
112
|
<span class="cline-any cline-neutral"> </span>
|
113
|
-
<span class="cline-any cline-yes">
|
114
|
-
<span class="cline-any cline-
|
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"> </span>
|
116
|
-
<span class="cline-any cline-
|
117
|
-
<span class="cline-any cline-
|
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"> </span>
|
119
119
|
<span class="cline-any cline-neutral"> </span>
|
120
|
-
<span class="cline-any cline-
|
120
|
+
<span class="cline-any cline-yes">3x</span>
|
121
121
|
<span class="cline-any cline-neutral"> </span>
|
122
122
|
<span class="cline-any cline-neutral"> </span>
|
123
|
-
<span class="cline-any cline-
|
123
|
+
<span class="cline-any cline-yes">1x</span>
|
124
124
|
<span class="cline-any cline-neutral"> </span>
|
125
125
|
<span class="cline-any cline-neutral"> </span>
|
126
|
-
<span class="cline-any cline-
|
126
|
+
<span class="cline-any cline-yes">2x</span>
|
127
127
|
<span class="cline-any cline-neutral"> </span>
|
128
128
|
<span class="cline-any cline-neutral"> </span>
|
129
|
-
<span class="cline-any cline-yes">
|
130
|
-
<span class="cline-any cline-
|
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"> </span>
|
132
132
|
<span class="cline-any cline-neutral"> </span>
|
133
|
-
<span class="cline-any cline-yes">
|
133
|
+
<span class="cline-any cline-yes">5x</span>
|
134
134
|
<span class="cline-any cline-neutral"> </span>
|
135
135
|
<span class="cline-any cline-neutral"> </span>
|
136
136
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
@@ -148,27 +148,27 @@ const FETCH_OPT = { cache: 'no-store' as const }
|
|
148
148
|
|
149
149
|
export type FetchPackage = (url: string) => Promise<string>
|
150
150
|
|
151
|
-
const packageResponseHandler =
|
152
|
-
const contentType =
|
151
|
+
const packageResponseHandler = (response: Response): Promise<string> => {
|
152
|
+
const contentType = response.headers.get('content-type')
|
153
153
|
|
154
|
-
|
155
|
-
|
154
|
+
if (response.status !== 200) {
|
155
|
+
return Promise.reject(`Incorrect status "${response.status}" was obtained while fetching the module.`)
|
156
156
|
}
|
157
157
|
|
158
|
-
|
158
|
+
if (!contentType ||
|
159
159
|
(!contentType.includes('application/javascript') && !contentType.includes('text/javascript'))
|
160
160
|
) {
|
161
|
-
|
161
|
+
return Promise.reject(`Incorrect content "${contentType}" was obtained while fetching the module.`)
|
162
162
|
}
|
163
163
|
|
164
|
-
|
164
|
+
return response.text()
|
165
165
|
}
|
166
166
|
|
167
|
-
const packageResponseErrorHandler =
|
168
|
-
|
167
|
+
const packageResponseErrorHandler = (error: Error): Promise<never> => {
|
168
|
+
return Promise.reject(`Network failure: ${error}`)
|
169
169
|
}
|
170
170
|
|
171
|
-
export const fetchPackage: FetchPackage =
|
171
|
+
export const fetchPackage: FetchPackage = async (url: string): Promise<string> => fetch(url, FETCH_OPT)
|
172
172
|
.then(packageResponseHandler)
|
173
173
|
.catch(packageResponseErrorHandler)
|
174
174
|
</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
|
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"> </span>
|
124
124
|
<span class="cline-any cline-neutral"> </span>
|
125
125
|
<span class="cline-any cline-neutral"> </span>
|
126
|
-
<span class="cline-any cline-yes">
|
127
|
-
<span class="cline-any cline-yes">
|
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"> </span>
|
129
|
-
<span class="cline-any cline-yes">
|
129
|
+
<span class="cline-any cline-yes">4x</span>
|
130
130
|
<span class="cline-any cline-neutral"> </span>
|
131
131
|
<span class="cline-any cline-no"> </span>
|
132
132
|
<span class="cline-any cline-no"> </span>
|
@@ -153,17 +153,17 @@
|
|
153
153
|
<span class="cline-any cline-neutral"> </span>
|
154
154
|
<span class="cline-any cline-neutral"> </span>
|
155
155
|
<span class="cline-any cline-neutral"> </span>
|
156
|
-
<span class="cline-any cline-yes">
|
156
|
+
<span class="cline-any cline-yes">4x</span>
|
157
157
|
<span class="cline-any cline-neutral"> </span>
|
158
158
|
<span class="cline-any cline-neutral"> </span>
|
159
159
|
<span class="cline-any cline-neutral"> </span>
|
160
160
|
<span class="cline-any cline-neutral"> </span>
|
161
|
-
<span class="cline-any cline-yes">
|
162
|
-
<span class="cline-any cline-yes">
|
163
|
-
<span class="cline-any cline-yes">
|
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"> </span>
|
165
165
|
<span class="cline-any cline-neutral"> </span>
|
166
|
-
<span class="cline-any cline-yes">
|
166
|
+
<span class="cline-any cline-yes">4x</span>
|
167
167
|
<span class="cline-any cline-neutral"> </span>
|
168
168
|
<span class="cline-any cline-neutral"> </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 = () => {
|
|
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
|
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"> </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"> </span>
|
95
|
+
<span class="cline-any cline-yes">4x</span>
|
96
|
+
<span class="cline-any cline-neutral"> </span>
|
97
|
+
<span class="cline-any cline-yes">4x</span>
|
98
|
+
<span class="cline-any cline-no"> </span>
|
99
|
+
<span class="cline-any cline-neutral"> </span>
|
100
|
+
<span class="cline-any cline-neutral"> </span>
|
101
|
+
<span class="cline-any cline-neutral"> </span>
|
102
|
+
<span class="cline-any cline-neutral"> </span>
|
103
|
+
<span class="cline-any cline-neutral"> </span>
|
104
|
+
<span class="cline-any cline-neutral"> </span>
|
105
|
+
<span class="cline-any cline-neutral"> </span>
|
106
|
+
<span class="cline-any cline-neutral"> </span>
|
107
|
+
<span class="cline-any cline-neutral"> </span>
|
108
|
+
<span class="cline-any cline-no"> </span>
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
111
|
+
<span class="cline-any cline-neutral"> </span>
|
112
|
+
<span class="cline-any cline-neutral"> </span>
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
114
|
+
<span class="cline-any cline-yes">4x</span>
|
115
|
+
<span class="cline-any cline-neutral"> </span>
|
116
|
+
<span class="cline-any cline-yes">2x</span>
|
117
|
+
<span class="cline-any cline-neutral"> </span>
|
118
|
+
<span class="cline-any cline-yes">2x</span>
|
119
|
+
<span class="cline-any cline-neutral"> </span>
|
120
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import * as _Sentry from '@sentry/browser'
|
121
|
+
|
122
|
+
const SENTRY_DSN = process.env.SENTRY_DSN
|
123
|
+
const VERSION = process.env.VERSION
|
124
|
+
|
125
|
+
export const Sentry = _Sentry
|
126
|
+
|
127
|
+
export const initSentry = <span class="fstat-no" title="function not covered" >() =</span>> {
|
128
|
+
<span class="cstat-no" title="statement not covered" > Sentry.init({</span>
|
129
|
+
dsn: SENTRY_DSN,
|
130
|
+
release: `@tivio/sdk-react@${VERSION}`,
|
131
|
+
|
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
|
+
|
138
|
+
<span class="cstat-no" title="statement not covered" > console.info('@tivio: Sentry enabled')</span>
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Inject Sentry to window in order to use it inside core-js, core-react, etc.
|
143
|
+
*/
|
144
|
+
export const injectSentryToWindow = () => {
|
145
|
+
// @ts-ignore
|
146
|
+
window.sentry = Sentry
|
147
|
+
|
148
|
+
console.info('@tivio: Sentry added to window')
|
149
|
+
}
|
150
|
+
</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
|
+
|