cyperful 0.1.4 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,72 +0,0 @@
1
- <svg width="237" height="239" viewBox="0 0 237 239" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g filter="url(#filter0_d_208_72)">
3
- <path
4
- d="M172.902 127.562C170.237 146.148 157.831 162.767 139.043 169.927C111.486 180.427 80.6342 166.599 70.1341 139.042C59.6339 111.485 73.4612 80.6341 101.018 70.134C119.807 62.9748 140.127 67.1248 154.484 79.2248"
5
- stroke="#E92727" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
6
- </g>
7
- <g filter="url(#filter1_d_208_72)">
8
- <path
9
- d="M178.662 88.1006C166.19 65.2225 140.86 50.8365 113.31 53.6248C76.6349 57.3366 49.9131 90.0763 53.6249 126.751C57.3367 163.426 90.0764 190.147 126.751 186.436C154.302 183.647 176.236 164.478 183.871 139.565"
10
- stroke="#EE7823" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
11
- </g>
12
- <g filter="url(#filter2_d_208_72)">
13
- <path
14
- d="M198.817 105.502C192.777 72.7277 166.52 45.9247 131.712 40.7931C87.9504 34.3416 47.2447 64.5872 40.7931 108.349C34.3416 152.11 64.5873 192.816 108.349 199.267C143.157 204.399 176.032 186.313 191.273 156.676"
15
- stroke="#FFCF00" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
16
- </g>
17
- <g filter="url(#filter3_d_208_72)">
18
- <path
19
- d="M213.245 126.888C216.244 86.3927 192.399 47.1475 152.406 32.3757C103.996 14.4951 50.2564 39.2443 32.3757 87.6546C14.4951 136.065 39.2443 189.804 87.6546 207.685C127.648 222.457 171.278 208.134 195.323 175.411"
20
- stroke="#009154" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
21
- </g>
22
- <defs>
23
- <filter id="filter0_d_208_72" x="49.618" y="55.6187" width="140.285" height="140.824"
24
- filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
25
- <feFlood flood-opacity="0" result="BackgroundImageFix" />
26
- <feColorMatrix in="SourceAlpha" type="matrix"
27
- values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
28
- <feOffset dy="6" />
29
- <feGaussianBlur stdDeviation="4.5" />
30
- <feComposite in2="hardAlpha" operator="out" />
31
- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
32
- <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_208_72" />
33
- <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_208_72" result="shape" />
34
- </filter>
35
- <filter id="filter1_d_208_72" x="36.28" y="42.2799" width="164.593" height="167.501"
36
- filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
37
- <feFlood flood-opacity="0" result="BackgroundImageFix" />
38
- <feColorMatrix in="SourceAlpha" type="matrix"
39
- values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
40
- <feOffset dy="6" />
41
- <feGaussianBlur stdDeviation="4.5" />
42
- <feComposite in2="hardAlpha" operator="out" />
43
- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
44
- <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_208_72" />
45
- <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_208_72" result="shape" />
46
- </filter>
47
- <filter id="filter2_d_208_72" x="22.925" y="28.9249" width="192.894" height="194.211"
48
- filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
49
- <feFlood flood-opacity="0" result="BackgroundImageFix" />
50
- <feColorMatrix in="SourceAlpha" type="matrix"
51
- values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
52
- <feOffset dy="6" />
53
- <feGaussianBlur stdDeviation="4.5" />
54
- <feComposite in2="hardAlpha" operator="out" />
55
- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
56
- <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_208_72" />
57
- <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_208_72" result="shape" />
58
- </filter>
59
- <filter id="filter3_d_208_72" x="9.56018" y="15.5602" width="220.938" height="220.941"
60
- filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
61
- <feFlood flood-opacity="0" result="BackgroundImageFix" />
62
- <feColorMatrix in="SourceAlpha" type="matrix"
63
- values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
64
- <feOffset dy="6" />
65
- <feGaussianBlur stdDeviation="4.5" />
66
- <feComposite in2="hardAlpha" operator="out" />
67
- <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
68
- <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_208_72" />
69
- <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_208_72" result="shape" />
70
- </filter>
71
- </defs>
72
- </svg>
data/watcher.js DELETED
@@ -1,151 +0,0 @@
1
- (() => {
2
- const log = console.log;
3
-
4
- log('Cyperful watcher loading...');
5
-
6
- const CYPERFUL_ORIGIN = 'http://localhost:3004';
7
-
8
- let idCounter = 0;
9
- const notify = (type, data, startEvent = null) => {
10
- let evt;
11
- try {
12
- const timestamp = Date.now();
13
- const id = `${timestamp}-${idCounter++}`;
14
-
15
- if (data.url != null) {
16
- try {
17
- const url = new URL(data.url, window.location.origin);
18
-
19
- // don't show our own requests
20
- if (url.origin === CYPERFUL_ORIGIN) return null;
21
-
22
- if (url.origin === window.location.origin) {
23
- data.url = url.pathname + url.search + url.hash;
24
- }
25
- } catch (_err) {
26
- // e.g. invalid URL
27
- }
28
- }
29
-
30
- evt = {
31
- type,
32
- data,
33
- id,
34
- timestamp,
35
- start_id: startEvent ? startEvent.id : undefined,
36
- };
37
-
38
- window.parent.postMessage(evt, CYPERFUL_ORIGIN);
39
- } catch (_err) {
40
- // e.g. blocked by CORS
41
- // e.g. invalid payload
42
- }
43
- return evt || {};
44
- };
45
-
46
- // capture console logs
47
- for (const level of ['log', 'error', 'warn', 'info', 'dir', 'debug']) {
48
- const original = console[level];
49
- if (!original) continue;
50
- console[level] = (...args) => {
51
- original.apply(console, args);
52
- notify('log', { level, args });
53
- };
54
- }
55
-
56
- // capture global errors
57
- window.addEventListener('error', (event) => {
58
- notify('global_error', { message: event.error.toString() });
59
- });
60
- window.addEventListener('unhandledrejection', (event) => {
61
- notify('unhandledrejection', { message: event.reason.toString() });
62
- });
63
-
64
- // capture XHR network requests
65
- const OriginalXHR = window.XMLHttpRequest;
66
- function XHR() {
67
- const xhr = new OriginalXHR();
68
- const originalOpen = xhr.open;
69
- xhr.open = (...args) => {
70
- const start = notify('xhr', {
71
- method: args[0],
72
- url: args[1],
73
- // body: args[2],
74
- });
75
- xhr.addEventListener('load', () => {
76
- if (start)
77
- notify(
78
- 'xhr:finished',
79
- { status: xhr.status, response: xhr.response },
80
- start,
81
- );
82
- });
83
- return originalOpen.apply(this, args);
84
- };
85
- return xhr;
86
- }
87
- window.XMLHttpRequest = XHR;
88
-
89
- // capture fetch network requests
90
- const originalFetch = window.fetch;
91
- window.fetch = (...args) => {
92
- const [url, options] =
93
- typeof args[0] === 'string' ? args : [args[0].url, args[0]];
94
- const method = options?.method ?? 'GET';
95
- const body = options?.body;
96
-
97
- const start = notify('fetch', {
98
- method,
99
- url,
100
- body,
101
- bodyType:
102
- options.headers?.['content-type'] ||
103
- options.headers?.['Content-Type'] ||
104
- null,
105
- });
106
-
107
- const promise = originalFetch(...args);
108
- promise
109
- .then(async (response) => {
110
- const ct = response.headers.get('content-type') || '';
111
- const resBody = ct.includes('application/json')
112
- ? await response.clone().json()
113
- : ct.includes('text/')
114
- ? await response.clone().text()
115
- : `[[ Unhandled content-type: ${ct || '<empty>'} ]]`;
116
-
117
- if (start)
118
- notify(
119
- 'fetch:finished',
120
- {
121
- status: response.status,
122
- responseType: ct || null,
123
- response: resBody,
124
- },
125
- start,
126
- );
127
- })
128
- .catch(() => {});
129
- return promise;
130
- };
131
-
132
- // capture client-side location changes
133
- const originalPushState = history.pushState;
134
- history.pushState = (...args) => {
135
- originalPushState.apply(history, args);
136
- notify('client_navigate', {
137
- url: location.href,
138
- replace: false,
139
- });
140
- };
141
- const originalReplaceState = history.replaceState;
142
- history.replaceState = (...args) => {
143
- originalReplaceState.apply(history, args);
144
- notify('client_navigate', {
145
- url: location.href,
146
- replace: true,
147
- });
148
- };
149
-
150
- log('Cyperful watcher loaded.');
151
- })();