react-native-qalink 0.4.1 → 0.5.1
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.
- package/README.md +382 -253
- package/dist/core/ContextManager.d.ts +13 -0
- package/dist/core/ContextManager.d.ts.map +1 -0
- package/dist/core/ContextManager.js +33 -0
- package/dist/core/ContextManager.js.map +1 -0
- package/dist/core/EventManager.d.ts +12 -0
- package/dist/core/EventManager.d.ts.map +1 -0
- package/dist/core/EventManager.js +30 -0
- package/dist/core/EventManager.js.map +1 -0
- package/dist/core/Logger.d.ts +18 -0
- package/dist/core/Logger.d.ts.map +1 -0
- package/dist/core/Logger.js +78 -0
- package/dist/core/Logger.js.map +1 -0
- package/dist/core/ScreenCapture.d.ts +23 -0
- package/dist/core/ScreenCapture.d.ts.map +1 -0
- package/dist/core/ScreenCapture.js +100 -0
- package/dist/core/ScreenCapture.js.map +1 -0
- package/dist/core/crypto.d.ts +18 -0
- package/dist/core/crypto.d.ts.map +1 -0
- package/dist/core/crypto.js +135 -0
- package/dist/core/crypto.js.map +1 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +136 -10
- package/dist/index.js.map +1 -1
- package/dist/interceptors/axios.d.ts +23 -3
- package/dist/interceptors/axios.d.ts.map +1 -1
- package/dist/interceptors/axios.js +158 -63
- package/dist/interceptors/axios.js.map +1 -1
- package/dist/interceptors/fetch.d.ts +21 -3
- package/dist/interceptors/fetch.d.ts.map +1 -1
- package/dist/interceptors/fetch.js +205 -91
- package/dist/interceptors/fetch.js.map +1 -1
- package/dist/transport/websocket.d.ts +6 -1
- package/dist/transport/websocket.d.ts.map +1 -1
- package/dist/transport/websocket.js +38 -10
- package/dist/transport/websocket.js.map +1 -1
- package/dist/types/index.d.ts +114 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UserContext, CustomContext } from '../types';
|
|
2
|
+
export declare class ContextManager {
|
|
3
|
+
private userContext;
|
|
4
|
+
private customContext;
|
|
5
|
+
setUserContext(context: UserContext): void;
|
|
6
|
+
setCustomContext(context: CustomContext): void;
|
|
7
|
+
getUserContext(): UserContext;
|
|
8
|
+
getCustomContext(): CustomContext;
|
|
9
|
+
clear(): void;
|
|
10
|
+
clearUserContext(): void;
|
|
11
|
+
clearCustomContext(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ContextManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextManager.d.ts","sourceRoot":"","sources":["../../src/core/ContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,qBAAa,cAAc;IACzB,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,aAAa,CAAqB;IAEnC,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAI1C,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAI9C,cAAc,IAAI,WAAW;IAI7B,gBAAgB,IAAI,aAAa;IAIjC,KAAK,IAAI,IAAI;IAKb,gBAAgB,IAAI,IAAI;IAIxB,kBAAkB,IAAI,IAAI;CAGlC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextManager = void 0;
|
|
4
|
+
class ContextManager {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.userContext = {};
|
|
7
|
+
this.customContext = {};
|
|
8
|
+
}
|
|
9
|
+
setUserContext(context) {
|
|
10
|
+
this.userContext = Object.assign(Object.assign({}, this.userContext), context);
|
|
11
|
+
}
|
|
12
|
+
setCustomContext(context) {
|
|
13
|
+
this.customContext = Object.assign(Object.assign({}, this.customContext), context);
|
|
14
|
+
}
|
|
15
|
+
getUserContext() {
|
|
16
|
+
return Object.assign({}, this.userContext);
|
|
17
|
+
}
|
|
18
|
+
getCustomContext() {
|
|
19
|
+
return Object.assign({}, this.customContext);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
this.userContext = {};
|
|
23
|
+
this.customContext = {};
|
|
24
|
+
}
|
|
25
|
+
clearUserContext() {
|
|
26
|
+
this.userContext = {};
|
|
27
|
+
}
|
|
28
|
+
clearCustomContext() {
|
|
29
|
+
this.customContext = {};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ContextManager = ContextManager;
|
|
33
|
+
//# sourceMappingURL=ContextManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextManager.js","sourceRoot":"","sources":["../../src/core/ContextManager.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IAA3B;QACU,gBAAW,GAAgB,EAAE,CAAC;QAC9B,kBAAa,GAAkB,EAAE,CAAC;IA8B5C,CAAC;IA5BQ,cAAc,CAAC,OAAoB;QACxC,IAAI,CAAC,WAAW,mCAAQ,IAAI,CAAC,WAAW,GAAK,OAAO,CAAE,CAAC;IACzD,CAAC;IAEM,gBAAgB,CAAC,OAAsB;QAC5C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,OAAO,CAAE,CAAC;IAC7D,CAAC;IAEM,cAAc;QACnB,yBAAY,IAAI,CAAC,WAAW,EAAG;IACjC,CAAC;IAEM,gBAAgB;QACrB,yBAAY,IAAI,CAAC,aAAa,EAAG;IACnC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACvB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,CAAC;CACF;AAhCD,wCAgCC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WebSocketTransport } from '../transport/websocket';
|
|
2
|
+
import type { UserContext, CustomContext } from '../types';
|
|
3
|
+
export declare class EventManager {
|
|
4
|
+
private transport;
|
|
5
|
+
private getUserContext;
|
|
6
|
+
private getCustomContext;
|
|
7
|
+
private getScreen;
|
|
8
|
+
private getDeviceId;
|
|
9
|
+
constructor(transport: WebSocketTransport, getUserContext: () => UserContext, getCustomContext: () => CustomContext, getScreen: () => string, getDeviceId: () => string);
|
|
10
|
+
logEvent(eventName: string, data?: any): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=EventManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventManager.d.ts","sourceRoot":"","sources":["../../src/core/EventManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAsB,MAAM,UAAU,CAAC;AAG/E,qBAAa,YAAY;IAErB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,WAAW;gBAJX,SAAS,EAAE,kBAAkB,EAC7B,cAAc,EAAE,MAAM,WAAW,EACjC,gBAAgB,EAAE,MAAM,aAAa,EACrC,SAAS,EAAE,MAAM,MAAM,EACvB,WAAW,EAAE,MAAM,MAAM;IAG5B,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAgBrD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventManager = void 0;
|
|
4
|
+
const session_1 = require("./session");
|
|
5
|
+
class EventManager {
|
|
6
|
+
constructor(transport, getUserContext, getCustomContext, getScreen, getDeviceId) {
|
|
7
|
+
this.transport = transport;
|
|
8
|
+
this.getUserContext = getUserContext;
|
|
9
|
+
this.getCustomContext = getCustomContext;
|
|
10
|
+
this.getScreen = getScreen;
|
|
11
|
+
this.getDeviceId = getDeviceId;
|
|
12
|
+
}
|
|
13
|
+
logEvent(eventName, data) {
|
|
14
|
+
const event = {
|
|
15
|
+
id: (0, session_1.generateId)(),
|
|
16
|
+
type: 'custom_event',
|
|
17
|
+
eventName,
|
|
18
|
+
data,
|
|
19
|
+
timestamp: Date.now(),
|
|
20
|
+
sessionId: (0, session_1.getSessionId)(),
|
|
21
|
+
deviceId: this.getDeviceId(),
|
|
22
|
+
userContext: this.getUserContext(),
|
|
23
|
+
customContext: this.getCustomContext(),
|
|
24
|
+
screen: this.getScreen(),
|
|
25
|
+
};
|
|
26
|
+
this.transport.send(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.EventManager = EventManager;
|
|
30
|
+
//# sourceMappingURL=EventManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventManager.js","sourceRoot":"","sources":["../../src/core/EventManager.ts"],"names":[],"mappings":";;;AAEA,uCAAqD;AAErD,MAAa,YAAY;IACvB,YACU,SAA6B,EAC7B,cAAiC,EACjC,gBAAqC,EACrC,SAAuB,EACvB,WAAyB;QAJzB,cAAS,GAAT,SAAS,CAAoB;QAC7B,mBAAc,GAAd,cAAc,CAAmB;QACjC,qBAAgB,GAAhB,gBAAgB,CAAqB;QACrC,cAAS,GAAT,SAAS,CAAc;QACvB,gBAAW,GAAX,WAAW,CAAc;IAChC,CAAC;IAEG,QAAQ,CAAC,SAAiB,EAAE,IAAU;QAC3C,MAAM,KAAK,GAAuB;YAChC,EAAE,EAAE,IAAA,oBAAU,GAAE;YAChB,IAAI,EAAE,cAAc;YACpB,SAAS;YACT,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,SAAS,EAAE,IAAA,sBAAY,GAAE;YACzB,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;YAC5B,WAAW,EAAE,IAAI,CAAC,cAAc,EAAE;YAClC,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACtC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE;SACzB,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAzBD,oCAyBC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WebSocketTransport } from '../transport/websocket';
|
|
2
|
+
import type { UserContext, CustomContext } from '../types';
|
|
3
|
+
export declare class Logger {
|
|
4
|
+
private transport;
|
|
5
|
+
private getUserContext;
|
|
6
|
+
private getCustomContext;
|
|
7
|
+
private getScreen;
|
|
8
|
+
private getDeviceId;
|
|
9
|
+
private debugEnabled;
|
|
10
|
+
constructor(transport: WebSocketTransport, getUserContext: () => UserContext, getCustomContext: () => CustomContext, getScreen: () => string, getDeviceId: () => string, debugEnabled: boolean);
|
|
11
|
+
private log;
|
|
12
|
+
debug(...args: any[]): void;
|
|
13
|
+
info(...args: any[]): void;
|
|
14
|
+
warn(...args: any[]): void;
|
|
15
|
+
error(...args: any[]): void;
|
|
16
|
+
critical(...args: any[]): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/core/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAA0B,MAAM,UAAU,CAAC;AAGnF,qBAAa,MAAM;IAEf,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,YAAY;gBALZ,SAAS,EAAE,kBAAkB,EAC7B,cAAc,EAAE,MAAM,WAAW,EACjC,gBAAgB,EAAE,MAAM,aAAa,EACrC,SAAS,EAAE,MAAM,MAAM,EACvB,WAAW,EAAE,MAAM,MAAM,EACzB,YAAY,EAAE,OAAO;IAG/B,OAAO,CAAC,GAAG;IAiDJ,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI1B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI1B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI3B,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAGtC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
const session_1 = require("./session");
|
|
5
|
+
class Logger {
|
|
6
|
+
constructor(transport, getUserContext, getCustomContext, getScreen, getDeviceId, debugEnabled) {
|
|
7
|
+
this.transport = transport;
|
|
8
|
+
this.getUserContext = getUserContext;
|
|
9
|
+
this.getCustomContext = getCustomContext;
|
|
10
|
+
this.getScreen = getScreen;
|
|
11
|
+
this.getDeviceId = getDeviceId;
|
|
12
|
+
this.debugEnabled = debugEnabled;
|
|
13
|
+
}
|
|
14
|
+
log(level, ...args) {
|
|
15
|
+
// 1. Log nativo en consola (como console.log normal)
|
|
16
|
+
const consoleMethod = level === 'critical' ? 'error' : level;
|
|
17
|
+
const nativeConsole = console[`_qalink_original_${consoleMethod}`] || console[consoleMethod];
|
|
18
|
+
if (typeof nativeConsole === 'function') {
|
|
19
|
+
nativeConsole(`[QALink:${level.toUpperCase()}]`, ...args);
|
|
20
|
+
}
|
|
21
|
+
// 2. Formatear mensaje
|
|
22
|
+
const message = args
|
|
23
|
+
.map(arg => {
|
|
24
|
+
if (typeof arg === 'object') {
|
|
25
|
+
try {
|
|
26
|
+
return JSON.stringify(arg);
|
|
27
|
+
}
|
|
28
|
+
catch (_a) {
|
|
29
|
+
return String(arg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return String(arg);
|
|
33
|
+
})
|
|
34
|
+
.join(' ');
|
|
35
|
+
// 3. Enviar al servidor
|
|
36
|
+
const event = {
|
|
37
|
+
id: (0, session_1.generateId)(),
|
|
38
|
+
type: 'user_log',
|
|
39
|
+
level,
|
|
40
|
+
message,
|
|
41
|
+
args: args.map(arg => {
|
|
42
|
+
if (typeof arg === 'object') {
|
|
43
|
+
try {
|
|
44
|
+
return JSON.parse(JSON.stringify(arg)); // deep clone
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
return String(arg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return arg;
|
|
51
|
+
}),
|
|
52
|
+
timestamp: Date.now(),
|
|
53
|
+
sessionId: (0, session_1.getSessionId)(),
|
|
54
|
+
deviceId: this.getDeviceId(),
|
|
55
|
+
userContext: this.getUserContext(),
|
|
56
|
+
customContext: this.getCustomContext(),
|
|
57
|
+
screen: this.getScreen(),
|
|
58
|
+
};
|
|
59
|
+
this.transport.send(event);
|
|
60
|
+
}
|
|
61
|
+
debug(...args) {
|
|
62
|
+
this.log('debug', ...args);
|
|
63
|
+
}
|
|
64
|
+
info(...args) {
|
|
65
|
+
this.log('info', ...args);
|
|
66
|
+
}
|
|
67
|
+
warn(...args) {
|
|
68
|
+
this.log('warn', ...args);
|
|
69
|
+
}
|
|
70
|
+
error(...args) {
|
|
71
|
+
this.log('error', ...args);
|
|
72
|
+
}
|
|
73
|
+
critical(...args) {
|
|
74
|
+
this.log('critical', ...args);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.Logger = Logger;
|
|
78
|
+
//# sourceMappingURL=Logger.js.map
|
|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,CAAC,CAAC;IAC7B,CAAC;IAEM,QAAQ,CAAC,GAAG,IAAW;QAC5B,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AA9ED,wBA8EC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WebSocketTransport } from '../transport/websocket';
|
|
2
|
+
/**
|
|
3
|
+
* ScreenCapture module for React Native
|
|
4
|
+
* Requires: react-native-view-shot
|
|
5
|
+
*
|
|
6
|
+
* Installation:
|
|
7
|
+
* npm install react-native-view-shot
|
|
8
|
+
* cd ios && pod install
|
|
9
|
+
*/
|
|
10
|
+
export declare class ScreenCapture {
|
|
11
|
+
private transport;
|
|
12
|
+
private getScreen;
|
|
13
|
+
private getDeviceId;
|
|
14
|
+
private ViewShot;
|
|
15
|
+
private enabled;
|
|
16
|
+
constructor(transport: WebSocketTransport, getScreen: () => string, getDeviceId: () => string, enabled?: boolean);
|
|
17
|
+
capture(label?: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Captura un componente específico por ref
|
|
20
|
+
*/
|
|
21
|
+
captureRef(viewRef: any, label?: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ScreenCapture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenCapture.d.ts","sourceRoot":"","sources":["../../src/core/ScreenCapture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE;;;;;;;GAOG;AAEH,qBAAa,aAAa;IAKtB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,WAAW;IANrB,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,OAAO,CAAkB;gBAGvB,SAAS,EAAE,kBAAkB,EAC7B,SAAS,EAAE,MAAM,MAAM,EACvB,WAAW,EAAE,MAAM,MAAM,EACjC,OAAO,GAAE,OAAe;IAsBb,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCnD;;OAEG;IACU,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA4BrE"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScreenCapture = void 0;
|
|
4
|
+
const session_1 = require("../core/session");
|
|
5
|
+
/**
|
|
6
|
+
* ScreenCapture module for React Native
|
|
7
|
+
* Requires: react-native-view-shot
|
|
8
|
+
*
|
|
9
|
+
* Installation:
|
|
10
|
+
* npm install react-native-view-shot
|
|
11
|
+
* cd ios && pod install
|
|
12
|
+
*/
|
|
13
|
+
class ScreenCapture {
|
|
14
|
+
constructor(transport, getScreen, getDeviceId, enabled = false) {
|
|
15
|
+
this.transport = transport;
|
|
16
|
+
this.getScreen = getScreen;
|
|
17
|
+
this.getDeviceId = getDeviceId;
|
|
18
|
+
this.ViewShot = null;
|
|
19
|
+
this.enabled = false;
|
|
20
|
+
this.enabled = enabled;
|
|
21
|
+
if (enabled) {
|
|
22
|
+
try {
|
|
23
|
+
// Lazy load react-native-view-shot
|
|
24
|
+
const ViewShotModule = require('react-native-view-shot');
|
|
25
|
+
this.ViewShot = (ViewShotModule === null || ViewShotModule === void 0 ? void 0 : ViewShotModule.default) || ViewShotModule;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.warn('[QALink] Screen capture is enabled but react-native-view-shot is not installed.\n' +
|
|
29
|
+
'To use screen capture, install it with:\n' +
|
|
30
|
+
'npm install react-native-view-shot\n' +
|
|
31
|
+
'cd ios && pod install (for iOS)\n' +
|
|
32
|
+
'Error:', (error === null || error === void 0 ? void 0 : error.message) || 'Unknown error');
|
|
33
|
+
this.enabled = false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async capture(label) {
|
|
38
|
+
if (!this.enabled) {
|
|
39
|
+
console.warn('[QALink] Screen capture is disabled. Enable it in config: enableScreenCapture: true');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!this.ViewShot) {
|
|
43
|
+
console.warn('[QALink] react-native-view-shot not available');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
// Capturar toda la pantalla
|
|
48
|
+
const uri = await this.ViewShot.captureScreen({
|
|
49
|
+
format: 'jpg',
|
|
50
|
+
quality: 0.7,
|
|
51
|
+
result: 'base64',
|
|
52
|
+
});
|
|
53
|
+
const event = {
|
|
54
|
+
id: (0, session_1.generateId)(),
|
|
55
|
+
type: 'screen_capture',
|
|
56
|
+
label,
|
|
57
|
+
imageData: uri,
|
|
58
|
+
timestamp: Date.now(),
|
|
59
|
+
sessionId: (0, session_1.getSessionId)(),
|
|
60
|
+
deviceId: this.getDeviceId(),
|
|
61
|
+
screen: this.getScreen(),
|
|
62
|
+
};
|
|
63
|
+
this.transport.send(event);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error('[QALink] Failed to capture screen:', error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Captura un componente específico por ref
|
|
71
|
+
*/
|
|
72
|
+
async captureRef(viewRef, label) {
|
|
73
|
+
if (!this.enabled || !this.ViewShot) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const uri = await this.ViewShot.captureRef(viewRef, {
|
|
78
|
+
format: 'jpg',
|
|
79
|
+
quality: 0.7,
|
|
80
|
+
result: 'base64',
|
|
81
|
+
});
|
|
82
|
+
const event = {
|
|
83
|
+
id: (0, session_1.generateId)(),
|
|
84
|
+
type: 'screen_capture',
|
|
85
|
+
label,
|
|
86
|
+
imageData: uri,
|
|
87
|
+
timestamp: Date.now(),
|
|
88
|
+
sessionId: (0, session_1.getSessionId)(),
|
|
89
|
+
deviceId: this.getDeviceId(),
|
|
90
|
+
screen: this.getScreen(),
|
|
91
|
+
};
|
|
92
|
+
this.transport.send(event);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('[QALink] Failed to capture ref:', error);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.ScreenCapture = ScreenCapture;
|
|
100
|
+
//# sourceMappingURL=ScreenCapture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenCapture.js","sourceRoot":"","sources":["../../src/core/ScreenCapture.ts"],"names":[],"mappings":";;;AAEA,6CAA2D;AAE3D;;;;;;;GAOG;AAEH,MAAa,aAAa;IAIxB,YACU,SAA6B,EAC7B,SAAuB,EACvB,WAAyB,EACjC,UAAmB,KAAK;QAHhB,cAAS,GAAT,SAAS,CAAoB;QAC7B,cAAS,GAAT,SAAS,CAAc;QACvB,gBAAW,GAAX,WAAW,CAAc;QAN3B,aAAQ,GAAQ,IAAI,CAAC;QACrB,YAAO,GAAY,KAAK,CAAC;QAQ/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,mCAAmC;gBACnC,MAAM,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;gBACzD,IAAI,CAAC,QAAQ,GAAG,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,KAAI,cAAc,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,CAAC,IAAI,CACV,mFAAmF;oBACnF,2CAA2C;oBAC3C,sCAAsC;oBACtC,mCAAmC;oBACnC,QAAQ,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,eAAe,CAC5C,CAAC;gBACF,IAAI,CAAC,OAAO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,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE;gBAClD,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,GAAG;gBACZ,MAAM,EAAE,QAAQ;aACjB,CAAC,CAAC;YAEH,MAAM,KAAK,GAAuB;gBAChC,EAAE,EAAE,IAAA,oBAAU,GAAE;gBAChB,IAAI,EAAE,gBAAgB;gBACtB,KAAK;gBACL,SAAS,EAAE,GAAG;gBACd,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,SAAS,EAAE,IAAA,sBAAY,GAAE;gBACzB,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;gBAC5B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE;aACzB,CAAC;YAEF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF;AAjGD,sCAiGC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QALink E2EE - AES-256-GCM with PBKDF2 key derivation.
|
|
3
|
+
* Uses Web Crypto API (React Native / Expo compatible).
|
|
4
|
+
* No extra dependencies.
|
|
5
|
+
*/
|
|
6
|
+
import type { EncryptedPayload } from '../types';
|
|
7
|
+
export type { EncryptedPayload };
|
|
8
|
+
/**
|
|
9
|
+
* Encrypt plaintext (e.g. JSON string) with AES-256-GCM.
|
|
10
|
+
*/
|
|
11
|
+
export declare function encrypt(plaintext: string, apiKey: string): Promise<EncryptedPayload>;
|
|
12
|
+
/**
|
|
13
|
+
* Decrypt payload (used by dashboard; kept in SDK for tests).
|
|
14
|
+
*/
|
|
15
|
+
export declare function decrypt(encryptedPayload: EncryptedPayload, apiKey: string): Promise<string>;
|
|
16
|
+
/** Clear cached key (e.g. after logout / destroy). */
|
|
17
|
+
export declare function clearKeyCache(): void;
|
|
18
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/core/crypto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAajD,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAmDjC;;GAEG;AACH,wBAAsB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyB1F;AAED;;GAEG;AACH,wBAAsB,OAAO,CAC3B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED,sDAAsD;AACtD,wBAAgB,aAAa,IAAI,IAAI,CAGpC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QALink E2EE - AES-256-GCM with PBKDF2 key derivation.
|
|
4
|
+
* Uses Web Crypto API (React Native / Expo compatible).
|
|
5
|
+
* No extra dependencies.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.encrypt = encrypt;
|
|
9
|
+
exports.decrypt = decrypt;
|
|
10
|
+
exports.clearKeyCache = clearKeyCache;
|
|
11
|
+
const PBKDF2_ITERATIONS = 100000;
|
|
12
|
+
const PBKDF2_HASH = 'SHA-256';
|
|
13
|
+
const AES_ALGORITHM = 'AES-GCM';
|
|
14
|
+
const AES_KEY_LENGTH = 256;
|
|
15
|
+
const IV_LENGTH = 12; // 96 bits for GCM
|
|
16
|
+
const SALT = 'qalink-encryption-v1';
|
|
17
|
+
// Key cache: same API key → reuse derived key (avoids ~150ms per event)
|
|
18
|
+
let cachedKey = null;
|
|
19
|
+
let cachedApiKey = null;
|
|
20
|
+
function getCrypto() {
|
|
21
|
+
const c = typeof globalThis !== 'undefined' && globalThis.crypto;
|
|
22
|
+
if (!c || !c.subtle) {
|
|
23
|
+
throw new Error('[QALink] Web Crypto API (crypto.subtle) is not available. Use a secure context (e.g. HTTPS / React Native).');
|
|
24
|
+
}
|
|
25
|
+
return c;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Derive encryption key from API key using PBKDF2.
|
|
29
|
+
* Result is cached per apiKey for the process lifetime.
|
|
30
|
+
*/
|
|
31
|
+
async function deriveKey(apiKey) {
|
|
32
|
+
if (cachedApiKey === apiKey && cachedKey) {
|
|
33
|
+
return cachedKey;
|
|
34
|
+
}
|
|
35
|
+
const crypto = getCrypto();
|
|
36
|
+
const encoder = new TextEncoder();
|
|
37
|
+
const keyMaterial = await crypto.subtle.importKey('raw', encoder.encode(apiKey), 'PBKDF2', false, ['deriveBits', 'deriveKey']);
|
|
38
|
+
const derivedKey = await crypto.subtle.deriveKey({
|
|
39
|
+
name: 'PBKDF2',
|
|
40
|
+
salt: encoder.encode(SALT),
|
|
41
|
+
iterations: PBKDF2_ITERATIONS,
|
|
42
|
+
hash: PBKDF2_HASH,
|
|
43
|
+
}, keyMaterial, { name: AES_ALGORITHM, length: AES_KEY_LENGTH }, false, ['encrypt', 'decrypt']);
|
|
44
|
+
cachedApiKey = apiKey;
|
|
45
|
+
cachedKey = derivedKey;
|
|
46
|
+
return derivedKey;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Encrypt plaintext (e.g. JSON string) with AES-256-GCM.
|
|
50
|
+
*/
|
|
51
|
+
async function encrypt(plaintext, apiKey) {
|
|
52
|
+
try {
|
|
53
|
+
const key = await deriveKey(apiKey);
|
|
54
|
+
const crypto = getCrypto();
|
|
55
|
+
const iv = crypto.getRandomValues(new Uint8Array(IV_LENGTH));
|
|
56
|
+
const encoder = new TextEncoder();
|
|
57
|
+
const ciphertext = await crypto.subtle.encrypt({ name: AES_ALGORITHM, iv }, key, encoder.encode(plaintext));
|
|
58
|
+
return {
|
|
59
|
+
ciphertext: arrayBufferToBase64(ciphertext),
|
|
60
|
+
iv: arrayBufferToBase64(iv),
|
|
61
|
+
algorithm: AES_ALGORITHM,
|
|
62
|
+
keyLength: AES_KEY_LENGTH,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (typeof console !== 'undefined' && console.error) {
|
|
67
|
+
console.error('[QALink Crypto] Encryption failed:', error);
|
|
68
|
+
}
|
|
69
|
+
throw new Error('QALink: Failed to encrypt event data');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Decrypt payload (used by dashboard; kept in SDK for tests).
|
|
74
|
+
*/
|
|
75
|
+
async function decrypt(encryptedPayload, apiKey) {
|
|
76
|
+
try {
|
|
77
|
+
const key = await deriveKey(apiKey);
|
|
78
|
+
const crypto = getCrypto();
|
|
79
|
+
const ciphertext = base64ToArrayBuffer(encryptedPayload.ciphertext);
|
|
80
|
+
const iv = base64ToArrayBuffer(encryptedPayload.iv);
|
|
81
|
+
const plaintext = await crypto.subtle.decrypt({ name: AES_ALGORITHM, iv }, key, ciphertext);
|
|
82
|
+
return new TextDecoder().decode(plaintext);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (typeof console !== 'undefined' && console.error) {
|
|
86
|
+
console.error('[QALink Crypto] Decryption failed:', error);
|
|
87
|
+
}
|
|
88
|
+
throw new Error('QALink: Failed to decrypt event data');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Clear cached key (e.g. after logout / destroy). */
|
|
92
|
+
function clearKeyCache() {
|
|
93
|
+
cachedKey = null;
|
|
94
|
+
cachedApiKey = null;
|
|
95
|
+
}
|
|
96
|
+
// ─── Base64 (works in React Native where btoa/atob may be missing) ─────────────
|
|
97
|
+
const BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
98
|
+
function arrayBufferToBase64(buffer) {
|
|
99
|
+
const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
100
|
+
let result = '';
|
|
101
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
102
|
+
const a = bytes[i];
|
|
103
|
+
const b = i + 1 < bytes.length ? bytes[i + 1] : 0;
|
|
104
|
+
const c = i + 2 < bytes.length ? bytes[i + 2] : 0;
|
|
105
|
+
result += BASE64_CHARS[a >> 2];
|
|
106
|
+
result += BASE64_CHARS[((a & 3) << 4) | (b >> 4)];
|
|
107
|
+
result += i + 1 < bytes.length ? BASE64_CHARS[((b & 15) << 2) | (c >> 6)] : '=';
|
|
108
|
+
result += i + 2 < bytes.length ? BASE64_CHARS[c & 63] : '=';
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
function base64ToArrayBuffer(base64) {
|
|
113
|
+
var _a, _b, _c, _d;
|
|
114
|
+
const len = base64.replace(/=+$/, '').length;
|
|
115
|
+
const outLen = (len * 3) >> 2;
|
|
116
|
+
const bytes = new Uint8Array(outLen);
|
|
117
|
+
let j = 0;
|
|
118
|
+
const rev = {};
|
|
119
|
+
for (let i = 0; i < BASE64_CHARS.length; i++) {
|
|
120
|
+
rev[BASE64_CHARS[i]] = i;
|
|
121
|
+
}
|
|
122
|
+
for (let i = 0; i < len; i += 4) {
|
|
123
|
+
const a = (_a = rev[base64[i]]) !== null && _a !== void 0 ? _a : 0;
|
|
124
|
+
const b = (_b = rev[base64[i + 1]]) !== null && _b !== void 0 ? _b : 0;
|
|
125
|
+
const c = (_c = rev[base64[i + 2]]) !== null && _c !== void 0 ? _c : 0;
|
|
126
|
+
const d = (_d = rev[base64[i + 3]]) !== null && _d !== void 0 ? _d : 0;
|
|
127
|
+
bytes[j++] = (a << 2) | (b >> 4);
|
|
128
|
+
if (j < outLen)
|
|
129
|
+
bytes[j++] = ((b & 15) << 4) | (c >> 2);
|
|
130
|
+
if (j < outLen)
|
|
131
|
+
bytes[j++] = ((c & 3) << 6) | d;
|
|
132
|
+
}
|
|
133
|
+
return bytes.buffer;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/core/crypto.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAqEH,0BAyBC;AAKD,0BAuBC;AAGD,sCAGC;AA5HD,MAAM,iBAAiB,GAAG,MAAO,CAAC;AAClC,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,kBAAkB;AACxC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AAEpC,wEAAwE;AACxE,IAAI,SAAS,GAAqB,IAAI,CAAC;AACvC,IAAI,YAAY,GAAkB,IAAI,CAAC;AAIvC,SAAS,SAAS;IAChB,MAAM,CAAC,GACL,OAAO,UAAU,KAAK,WAAW,IAAK,UAA6C,CAAC,MAAM,CAAC;IAC7F,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,SAAS,CAAC,MAAc;IACrC,IAAI,YAAY,KAAK,MAAM,IAAI,SAAS,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAElC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CAC/C,KAAK,EACL,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EACtB,QA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ACxD,IAAI,CAAC,GAAG,MAAM;YAAE,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QALinkConfig, LogRequestOptions } from './types';
|
|
1
|
+
import { QALinkConfig, LogRequestOptions, UserContext, CustomContext, HTTPInterceptorConfig } from './types';
|
|
2
2
|
declare class QALinkSDK {
|
|
3
3
|
private transport;
|
|
4
4
|
private config;
|
|
@@ -6,8 +6,24 @@ declare class QALinkSDK {
|
|
|
6
6
|
private initialized;
|
|
7
7
|
private currentScreen;
|
|
8
8
|
private _deviceId;
|
|
9
|
+
private contextManager;
|
|
10
|
+
private logger;
|
|
11
|
+
private eventManager;
|
|
12
|
+
private screenCapture;
|
|
9
13
|
init(config: QALinkConfig): Promise<void>;
|
|
10
14
|
interceptAxios(axiosInstance: any): void;
|
|
15
|
+
setUserContext(context: UserContext): void;
|
|
16
|
+
setCustomContext(context: CustomContext): void;
|
|
17
|
+
clearContext(): void;
|
|
18
|
+
debug(...args: any[]): void;
|
|
19
|
+
info(...args: any[]): void;
|
|
20
|
+
warn(...args: any[]): void;
|
|
21
|
+
error(...args: any[]): void;
|
|
22
|
+
critical(...args: any[]): void;
|
|
23
|
+
logEvent(eventName: string, data?: any): void;
|
|
24
|
+
captureScreen(label?: string): Promise<void>;
|
|
25
|
+
captureRef(viewRef: any, label?: string): Promise<void>;
|
|
26
|
+
configureHTTP(httpConfig: Partial<HTTPInterceptorConfig>): void;
|
|
11
27
|
addBreadcrumb(action: string, data?: Record<string, unknown>): void;
|
|
12
28
|
logRequest(options: LogRequestOptions): void;
|
|
13
29
|
setScreen(screenName: string): void;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,iBAAiB,EAGjB,WAAW,EACX,aAAa,EACb,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAmBjB,cAAM,SAAS;IACb,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,SAAS,CAAqB;IAGtC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,aAAa,CAA8B;IAE7C,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA2I/C,cAAc,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI;IAwBxC,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAQ1C,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAQ9C,YAAY,IAAI,IAAI;IAMpB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAQ3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAQ1B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAQ1B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAQ3B,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAU9B,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,E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