humanbehavior-js 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/api.js +312 -0
  2. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/api.js.map +1 -0
  3. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/index.js +19 -0
  4. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/index.js.map +1 -0
  5. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/react/index.js +222 -0
  6. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/react/index.js.map +1 -0
  7. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/redact.js +416 -0
  8. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/redact.js.map +1 -0
  9. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/tracker.js +950 -0
  10. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/tracker.js.map +1 -0
  11. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/utils/logger.js +117 -0
  12. package/.rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist/utils/logger.js.map +1 -0
  13. package/dist/cjs/index.js +2 -6
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/react/index.js +26 -451
  16. package/dist/cjs/react/index.js.map +1 -1
  17. package/dist/esm/index.js +2 -6
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/react/index.js +5 -430
  20. package/dist/esm/react/index.js.map +1 -1
  21. package/dist/index.min.js +15 -1
  22. package/dist/index.min.js.map +1 -1
  23. package/dist/types/index.d.ts +0 -4
  24. package/dist/types/react/index.d.ts +2 -3
  25. package/package.json +10 -32
  26. package/rollup.config.js +106 -0
  27. package/simple-demo.html +26 -0
  28. package/simple-spa.html +658 -0
  29. package/src/index.ts +2 -2
  30. package/tsconfig.json +24 -0
  31. /package/{dist → .rollup.cache/Users/hudsonch/Desktop/HumanBehaviorInternship/humanbehavior-js/dist}/.tsbuildinfo +0 -0
@@ -0,0 +1,416 @@
1
+ // Redaction functionality for sensitive input fields
2
+ // This module provides methods to redact sensitive input fields in event recordings
3
+ import { logDebug, logWarn } from './utils/logger';
4
+ // Check if we're in a browser environment
5
+ const isBrowser = typeof window !== 'undefined';
6
+ export class RedactionManager {
7
+ constructor(options) {
8
+ this.redactedText = '[REDACTED]';
9
+ this.userSelectedFields = new Set(); // User-selected fields to redact
10
+ this.excludeSelectors = [
11
+ '[data-no-redact="true"]',
12
+ '.human-behavior-no-redact'
13
+ ];
14
+ if (options === null || options === void 0 ? void 0 : options.redactedText) {
15
+ this.redactedText = options.redactedText;
16
+ }
17
+ if (options === null || options === void 0 ? void 0 : options.excludeSelectors) {
18
+ this.excludeSelectors = [...this.excludeSelectors, ...options.excludeSelectors];
19
+ }
20
+ if (options === null || options === void 0 ? void 0 : options.userFields) {
21
+ this.setFieldsToRedact(options.userFields);
22
+ }
23
+ }
24
+ /**
25
+ * Set specific fields to be redacted
26
+ * @param fields Array of CSS selectors for fields to redact
27
+ */
28
+ setFieldsToRedact(fields) {
29
+ this.userSelectedFields.clear();
30
+ fields.forEach(field => this.userSelectedFields.add(field));
31
+ if (fields.length > 0) {
32
+ logDebug(`Redaction: Active for ${fields.length} field(s):`, fields);
33
+ // Debug: Check if elements exist
34
+ fields.forEach(selector => {
35
+ const elements = document.querySelectorAll(selector);
36
+ logDebug(`Redaction: Found ${elements.length} element(s) for selector '${selector}'`);
37
+ elements.forEach((el, index) => {
38
+ logDebug(`Redaction: Element ${index} for '${selector}':`, el);
39
+ });
40
+ });
41
+ }
42
+ else {
43
+ logDebug('Redaction: Disabled - no fields selected');
44
+ }
45
+ }
46
+ /**
47
+ * Check if redaction is currently active (has fields selected)
48
+ */
49
+ isActive() {
50
+ return this.userSelectedFields.size > 0;
51
+ }
52
+ /**
53
+ * Get the currently selected fields for redaction
54
+ */
55
+ getSelectedFields() {
56
+ return Array.from(this.userSelectedFields);
57
+ }
58
+ /**
59
+ * Process an event and redact sensitive data if needed
60
+ */
61
+ processEvent(event) {
62
+ // Only process if we have fields selected for redaction
63
+ if (this.userSelectedFields.size === 0) {
64
+ return event;
65
+ }
66
+ // Clone the event to avoid modifying the original
67
+ const processedEvent = JSON.parse(JSON.stringify(event));
68
+ // Handle different event types
69
+ if (processedEvent.type === 3) { // IncrementalSnapshot
70
+ if (processedEvent.data.source === 5) { // Input event
71
+ const shouldRedact = this.isFieldSelected(processedEvent.data);
72
+ if (shouldRedact) {
73
+ logDebug('Redaction: Processing input event for redaction');
74
+ this.redactInputEvent(processedEvent.data);
75
+ }
76
+ }
77
+ // Also check for other sources that might contain text changes
78
+ else if (processedEvent.data.source === 0) { // DOM mutations
79
+ this.redactDOMEvent(processedEvent.data);
80
+ }
81
+ // Handle other sources that might contain text
82
+ else if (processedEvent.data.source === 2) { // Mouse/Touch interaction
83
+ this.redactMouseEvent(processedEvent.data);
84
+ }
85
+ }
86
+ else if (processedEvent.type === 2) { // FullSnapshot
87
+ this.redactFullSnapshot(processedEvent.data);
88
+ }
89
+ return processedEvent;
90
+ }
91
+ /**
92
+ * Redact sensitive data in input events
93
+ */
94
+ redactInputEvent(inputData) {
95
+ // Check if this input event is from a field we want to redact
96
+ if (!this.isFieldSelected(inputData)) {
97
+ return;
98
+ }
99
+ logDebug('Redaction: Redacting input event with text:', inputData.text);
100
+ // Redact all text-related properties that could contain input data
101
+ const textProperties = ['text', 'value', 'content', 'data', 'input', 'textContent'];
102
+ textProperties.forEach(prop => {
103
+ if (inputData[prop] !== undefined && typeof inputData[prop] === 'string') {
104
+ inputData[prop] = this.redactedText;
105
+ logDebug(`Redaction: Redacted property '${prop}'`);
106
+ }
107
+ });
108
+ // Also check for any other string properties that might contain input data
109
+ Object.keys(inputData).forEach(key => {
110
+ if (typeof inputData[key] === 'string' && inputData[key].length > 0) {
111
+ inputData[key] = this.redactedText;
112
+ logDebug(`Redaction: Redacted additional property '${key}'`);
113
+ }
114
+ });
115
+ // Handle nested objects that might contain text data
116
+ if (inputData.attributes && typeof inputData.attributes === 'object') {
117
+ if (inputData.attributes.value && typeof inputData.attributes.value === 'string') {
118
+ inputData.attributes.value = this.redactedText;
119
+ logDebug('Redaction: Redacted nested value attribute');
120
+ }
121
+ }
122
+ logDebug('Redaction: Input event redaction complete');
123
+ }
124
+ /**
125
+ * Redact sensitive data in DOM mutation events
126
+ */
127
+ redactDOMEvent(domData) {
128
+ // Check for text changes in DOM mutations
129
+ if (domData.texts && Array.isArray(domData.texts)) {
130
+ domData.texts.forEach((textChange) => {
131
+ if (textChange.text && typeof textChange.text === 'string' &&
132
+ this.shouldRedactDOMChange(textChange)) {
133
+ textChange.text = this.redactedText;
134
+ }
135
+ });
136
+ }
137
+ // Also check for attribute changes that might contain input data
138
+ if (domData.attributes && Array.isArray(domData.attributes)) {
139
+ domData.attributes.forEach((attrChange) => {
140
+ if (attrChange.attributes && attrChange.attributes.value &&
141
+ typeof attrChange.attributes.value === 'string' &&
142
+ this.shouldRedactDOMChange(attrChange)) {
143
+ attrChange.attributes.value = this.redactedText;
144
+ }
145
+ });
146
+ }
147
+ // Check for any other properties that might contain text data
148
+ if (domData.adds && Array.isArray(domData.adds)) {
149
+ domData.adds.forEach((add) => {
150
+ if (add.node && add.node.textContent && typeof add.node.textContent === 'string' &&
151
+ this.shouldRedactDOMChange(add)) {
152
+ add.node.textContent = this.redactedText;
153
+ }
154
+ });
155
+ }
156
+ }
157
+ /**
158
+ * Check if a DOM change should be redacted based on its ID
159
+ */
160
+ shouldRedactDOMChange(changeData) {
161
+ if (!isBrowser)
162
+ return false;
163
+ try {
164
+ // Check if this change has an ID that we can use to find the element
165
+ const elementId = changeData.id;
166
+ if (elementId !== undefined) {
167
+ // Try to find the element by data-rrweb-id attribute
168
+ let element = document.querySelector(`[data-rrweb-id="${elementId}"]`);
169
+ if (element) {
170
+ return this.shouldRedactElement(element);
171
+ }
172
+ }
173
+ // Also check for nodeId which is another way rrweb identifies elements
174
+ const nodeId = changeData.nodeId;
175
+ if (nodeId !== undefined) {
176
+ const element = document.querySelector(`[data-rrweb-id="${nodeId}"]`);
177
+ if (element) {
178
+ return this.shouldRedactElement(element);
179
+ }
180
+ }
181
+ return false;
182
+ }
183
+ catch (e) {
184
+ logWarn('Error checking if DOM change should be redacted:', e);
185
+ return false;
186
+ }
187
+ }
188
+ /**
189
+ * Redact sensitive data in mouse/touch interaction events
190
+ */
191
+ redactMouseEvent(mouseData) {
192
+ // Mouse events typically don't contain text data, but check for any text properties
193
+ if (mouseData.text && typeof mouseData.text === 'string' &&
194
+ this.isFieldSelected(mouseData)) {
195
+ mouseData.text = this.redactedText;
196
+ }
197
+ }
198
+ /**
199
+ * Redact sensitive data in full snapshot events
200
+ */
201
+ redactFullSnapshot(snapshotData) {
202
+ if (snapshotData.node && snapshotData.node.type === 2) { // Element node
203
+ this.redactNode(snapshotData.node);
204
+ }
205
+ }
206
+ /**
207
+ * Recursively redact sensitive data in DOM nodes
208
+ */
209
+ redactNode(node) {
210
+ if (!node)
211
+ return;
212
+ // Check if this node should be redacted
213
+ if (node.type === 2 && node.tagName &&
214
+ (node.tagName.toLowerCase() === 'input' || node.tagName.toLowerCase() === 'textarea')) {
215
+ // Check if this input/textarea should be redacted
216
+ if (this.shouldRedactNode(node)) {
217
+ // Redact value attribute
218
+ if (node.attributes && node.attributes.value) {
219
+ node.attributes.value = this.redactedText;
220
+ }
221
+ // Redact text content
222
+ if (node.textContent) {
223
+ node.textContent = this.redactedText;
224
+ }
225
+ }
226
+ }
227
+ // Recursively process child nodes
228
+ if (node.childNodes && Array.isArray(node.childNodes)) {
229
+ node.childNodes.forEach((childNode) => {
230
+ this.redactNode(childNode);
231
+ });
232
+ }
233
+ }
234
+ /**
235
+ * Check if a node should be redacted based on its attributes
236
+ */
237
+ shouldRedactNode(node) {
238
+ if (!node.attributes)
239
+ return false;
240
+ // Check if any of our selectors would match this node
241
+ for (const selector of this.userSelectedFields) {
242
+ if (this.selectorMatchesNode(selector, node)) {
243
+ return true;
244
+ }
245
+ }
246
+ return false;
247
+ }
248
+ /**
249
+ * Check if a CSS selector would match a node based on its attributes
250
+ */
251
+ selectorMatchesNode(selector, node) {
252
+ if (!node.attributes)
253
+ return false;
254
+ // Create a temporary element to test the selector
255
+ try {
256
+ const tempElement = document.createElement(node.tagName || 'div');
257
+ // Copy attributes from the node to the temp element
258
+ if (node.attributes) {
259
+ Object.keys(node.attributes).forEach(key => {
260
+ tempElement.setAttribute(key, node.attributes[key]);
261
+ });
262
+ }
263
+ // Test if the selector matches this element
264
+ return tempElement.matches(selector);
265
+ }
266
+ catch (e) {
267
+ // If matches() is not supported or fails, fall back to basic attribute checking
268
+ return this.basicSelectorMatch(selector, node);
269
+ }
270
+ }
271
+ /**
272
+ * Basic selector matching for environments where matches() is not available
273
+ */
274
+ basicSelectorMatch(selector, node) {
275
+ if (!node.attributes)
276
+ return false;
277
+ // Handle simple selectors like 'input[type="password"]'
278
+ if (selector.includes('input[type=')) {
279
+ const typeMatch = selector.match(/input\[type="([^"]+)"\]/);
280
+ if (typeMatch && node.tagName === 'input' && node.attributes.type === typeMatch[1]) {
281
+ return true;
282
+ }
283
+ }
284
+ // Handle ID selectors like '#email'
285
+ if (selector.startsWith('#')) {
286
+ const id = selector.substring(1);
287
+ return node.attributes.id === id;
288
+ }
289
+ // Handle class selectors like '.sensitive-field'
290
+ if (selector.startsWith('.')) {
291
+ const className = selector.substring(1);
292
+ return node.attributes.class && node.attributes.class.includes(className);
293
+ }
294
+ // Handle tag selectors like 'input'
295
+ if (!selector.includes('[') && !selector.includes('.')) {
296
+ return node.tagName && node.tagName.toLowerCase() === selector.toLowerCase();
297
+ }
298
+ return false;
299
+ }
300
+ /**
301
+ * Check if an event is from a field that should be redacted
302
+ */
303
+ isFieldSelected(eventData) {
304
+ if (!isBrowser)
305
+ return false;
306
+ try {
307
+ // For input events (source 5), we need to determine if this is a sensitive field
308
+ if (eventData.source === 5) { // Input event
309
+ const elementId = eventData.id;
310
+ if (elementId !== undefined) {
311
+ // Try to find the element by data-rrweb-id attribute
312
+ let element = document.querySelector(`[data-rrweb-id="${elementId}"]`);
313
+ if (element) {
314
+ return this.shouldRedactElement(element);
315
+ }
316
+ // Fallback: Try to find by nodeId if available
317
+ if (eventData.nodeId !== undefined) {
318
+ element = document.querySelector(`[data-rrweb-id="${eventData.nodeId}"]`);
319
+ if (element) {
320
+ return this.shouldRedactElement(element);
321
+ }
322
+ }
323
+ // More aggressive approach: Check all elements that match our selectors
324
+ // and see if any of them are currently focused or have the same ID
325
+ for (const selector of this.userSelectedFields) {
326
+ const matchingElements = document.querySelectorAll(selector);
327
+ if (matchingElements.length > 0) {
328
+ // Check if any of these elements are currently focused
329
+ for (const el of matchingElements) {
330
+ if (el === document.activeElement) {
331
+ logDebug('Redaction: Found focused element matching selector:', selector);
332
+ return true;
333
+ }
334
+ }
335
+ }
336
+ }
337
+ // If we still can't find it, try a more direct approach
338
+ // Look for any input element that might be the active one
339
+ const activeElement = document.activeElement;
340
+ if (activeElement && this.shouldRedactElement(activeElement)) {
341
+ logDebug('Redaction: Active element should be redacted');
342
+ return true;
343
+ }
344
+ return false;
345
+ }
346
+ }
347
+ // For other event types, try to find the element
348
+ const elementId = eventData.id;
349
+ if (elementId !== undefined) {
350
+ // First try to find by data-rrweb-id attribute
351
+ let element = document.querySelector(`[data-rrweb-id="${elementId}"]`);
352
+ if (element) {
353
+ return this.shouldRedactElement(element);
354
+ }
355
+ }
356
+ // Also check for nodeId which is another way rrweb identifies elements
357
+ const nodeId = eventData.nodeId;
358
+ if (nodeId !== undefined) {
359
+ const element = document.querySelector(`[data-rrweb-id="${nodeId}"]`);
360
+ if (element) {
361
+ return this.shouldRedactElement(element);
362
+ }
363
+ }
364
+ // For DOM mutations, check if the target element should be redacted
365
+ if (eventData.target && eventData.target.id) {
366
+ const element = document.querySelector(`[data-rrweb-id="${eventData.target.id}"]`);
367
+ if (element) {
368
+ return this.shouldRedactElement(element);
369
+ }
370
+ }
371
+ return false;
372
+ }
373
+ catch (e) {
374
+ logWarn('Error checking if field should be redacted:', e);
375
+ return false;
376
+ }
377
+ }
378
+ /**
379
+ * Check if an element should be redacted based on user-selected fields
380
+ */
381
+ shouldRedactElement(element) {
382
+ // Check if element is excluded from redaction
383
+ for (const excludeSelector of this.excludeSelectors) {
384
+ if (element.matches(excludeSelector) || element.closest(excludeSelector)) {
385
+ return false;
386
+ }
387
+ }
388
+ // Check if element matches any of the user-selected fields
389
+ for (const selector of this.userSelectedFields) {
390
+ if (element.matches(selector)) {
391
+ return true;
392
+ }
393
+ }
394
+ return false;
395
+ }
396
+ /**
397
+ * Get the original value of a redacted element (for debugging)
398
+ */
399
+ getOriginalValue(element) {
400
+ if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
401
+ return element.value;
402
+ }
403
+ return undefined;
404
+ }
405
+ /**
406
+ * Check if an element is currently being redacted
407
+ */
408
+ isElementRedacted(element) {
409
+ return this.shouldRedactElement(element);
410
+ }
411
+ }
412
+ // Export a default instance
413
+ export const redactionManager = new RedactionManager();
414
+ // Export the class for custom instances
415
+ export default RedactionManager;
416
+ //# sourceMappingURL=redact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.js","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,oFAAoF;AAEpF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEnD,0CAA0C;AAC1C,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK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