cuoral-ionic 0.0.6 → 0.0.7
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/android/build/.transforms/bb54161301273cf9b5b94a21c0fb3f23/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$1.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$2.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$3.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$4.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$5.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$6.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$InitiateCallback.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin$UploadCallback.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/debug_dex/com/cuoral/ionic/CuoralPlugin.dex +0 -0
- package/android/build/.transforms/f1aabffcd8b03aa664e77a79b3e1de5d/transformed/debug/desugar_graph.bin +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$6.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$InitiateCallback.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin$UploadCallback.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/cuoral/ionic/CuoralPlugin.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$InitiateCallback.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin$UploadCallback.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/cuoral/ionic/CuoralPlugin.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +1 -0
- package/android/src/main/java/com/cuoral/ionic/CuoralPlugin.java +205 -5
- package/dist/cuoral.d.ts +15 -1
- package/dist/cuoral.d.ts.map +1 -1
- package/dist/cuoral.js +113 -9
- package/dist/index.esm.js +159 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +159 -19
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +4 -0
- package/dist/intelligence.d.ts.map +1 -1
- package/dist/intelligence.js +19 -0
- package/dist/plugin.d.ts +15 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +23 -10
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/ios/Plugin/CuoralPlugin.swift +249 -13
- package/package.json +1 -1
- package/src/cuoral.ts +128 -11
- package/src/intelligence.ts +23 -0
- package/src/plugin.ts +39 -11
- package/src/types.ts +4 -0
package/src/intelligence.ts
CHANGED
|
@@ -117,6 +117,27 @@ export class CuoralIntelligence {
|
|
|
117
117
|
this.sessionId = sessionId;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Update the session ID (e.g., when user logs in)
|
|
122
|
+
*/
|
|
123
|
+
public updateSessionId(newSessionId: string): void {
|
|
124
|
+
console.log('[Cuoral Intelligence] Updating session ID from', this.sessionId, 'to', newSessionId);
|
|
125
|
+
this.sessionId = newSessionId;
|
|
126
|
+
|
|
127
|
+
// Flush any pending events with the old session before switching
|
|
128
|
+
this.flush();
|
|
129
|
+
|
|
130
|
+
// Update native error capture with new session ID
|
|
131
|
+
if (Capacitor.isNativePlatform()) {
|
|
132
|
+
CuoralPlugin.setupNativeErrorCapture({
|
|
133
|
+
backendUrl: this.config.consoleErrorBackendUrl,
|
|
134
|
+
sessionId: newSessionId
|
|
135
|
+
}).catch(error => {
|
|
136
|
+
console.warn('[Cuoral Intelligence] Failed to update native error capture:', error);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
120
141
|
/**
|
|
121
142
|
* Initialize intelligence tracking
|
|
122
143
|
*/
|
|
@@ -482,6 +503,7 @@ export class CuoralIntelligence {
|
|
|
482
503
|
data,
|
|
483
504
|
};
|
|
484
505
|
|
|
506
|
+
console.log(`[Intelligence] Enqueuing ${type} event with session:`, this.sessionId);
|
|
485
507
|
queue.push(event);
|
|
486
508
|
|
|
487
509
|
// Flush immediately for critical errors
|
|
@@ -506,6 +528,7 @@ export class CuoralIntelligence {
|
|
|
506
528
|
return;
|
|
507
529
|
}
|
|
508
530
|
|
|
531
|
+
|
|
509
532
|
// Clear timer
|
|
510
533
|
if (this.batchTimers[eventType]) {
|
|
511
534
|
clearTimeout(this.batchTimers[eventType]);
|
package/src/plugin.ts
CHANGED
|
@@ -19,7 +19,18 @@ export interface CuoralPluginInterface {
|
|
|
19
19
|
/**
|
|
20
20
|
* Stop screen recording
|
|
21
21
|
*/
|
|
22
|
-
stopRecording(
|
|
22
|
+
stopRecording(options?: {
|
|
23
|
+
autoUpload?: boolean;
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
publicKey?: string;
|
|
26
|
+
customerId?: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
filePath?: string;
|
|
30
|
+
duration?: number;
|
|
31
|
+
uploaded?: boolean;
|
|
32
|
+
uploadError?: string;
|
|
33
|
+
}>;
|
|
23
34
|
|
|
24
35
|
/**
|
|
25
36
|
* Get recording state
|
|
@@ -119,7 +130,12 @@ export class CuoralRecorder {
|
|
|
119
130
|
/**
|
|
120
131
|
* Stop recording
|
|
121
132
|
*/
|
|
122
|
-
async stopRecording(
|
|
133
|
+
async stopRecording(options?: {
|
|
134
|
+
autoUpload?: boolean;
|
|
135
|
+
sessionId?: string;
|
|
136
|
+
publicKey?: string;
|
|
137
|
+
customerId?: string;
|
|
138
|
+
}): Promise<{ filePath?: string; duration?: number; uploaded?: boolean } | null> {
|
|
123
139
|
try {
|
|
124
140
|
if (!this.isRecording) {
|
|
125
141
|
// Send error message to widget so it can exit "stopping" state
|
|
@@ -130,25 +146,37 @@ export class CuoralRecorder {
|
|
|
130
146
|
return null;
|
|
131
147
|
}
|
|
132
148
|
|
|
133
|
-
const result = await CuoralPlugin.stopRecording();
|
|
149
|
+
const result = await CuoralPlugin.stopRecording(options);
|
|
134
150
|
if (result.success) {
|
|
135
151
|
this.isRecording = false;
|
|
136
152
|
const duration = this.recordingStartTime
|
|
137
153
|
? Math.floor((Date.now() - this.recordingStartTime) / 1000)
|
|
138
154
|
: 0;
|
|
139
155
|
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
// If uploaded, notify widget differently
|
|
157
|
+
if (result.uploaded) {
|
|
158
|
+
this.postMessage({
|
|
159
|
+
type: CuoralMessageType.RECORDING_UPLOADED,
|
|
160
|
+
payload: {
|
|
161
|
+
duration: result.duration || duration,
|
|
162
|
+
uploaded: true
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
} else {
|
|
166
|
+
// Post message to widget (old behavior)
|
|
167
|
+
this.postMessage({
|
|
168
|
+
type: CuoralMessageType.RECORDING_STOPPED,
|
|
169
|
+
payload: {
|
|
170
|
+
filePath: result.filePath,
|
|
171
|
+
duration: result.duration || duration,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
148
175
|
|
|
149
176
|
return {
|
|
150
177
|
filePath: result.filePath,
|
|
151
178
|
duration: result.duration || duration,
|
|
179
|
+
uploaded: result.uploaded,
|
|
152
180
|
};
|
|
153
181
|
}
|
|
154
182
|
|
package/src/types.ts
CHANGED
|
@@ -7,6 +7,7 @@ export enum CuoralMessageType {
|
|
|
7
7
|
STOP_RECORDING = 'CUORAL_STOP_RECORDING',
|
|
8
8
|
RECORDING_STARTED = 'CUORAL_RECORDING_STARTED',
|
|
9
9
|
RECORDING_STOPPED = 'CUORAL_RECORDING_STOPPED',
|
|
10
|
+
RECORDING_UPLOADED = 'CUORAL_RECORDING_UPLOADED',
|
|
10
11
|
RECORDING_ERROR = 'CUORAL_RECORDING_ERROR',
|
|
11
12
|
|
|
12
13
|
// Screenshot
|
|
@@ -17,6 +18,9 @@ export enum CuoralMessageType {
|
|
|
17
18
|
// Widget Communication
|
|
18
19
|
WIDGET_READY = 'CUORAL_WIDGET_READY',
|
|
19
20
|
WIDGET_CLOSED = 'CUORAL_WIDGET_CLOSED',
|
|
21
|
+
SESSION_UPDATED = 'CUORAL_SESSION_UPDATED',
|
|
22
|
+
REQUEST_SESSION_ID = 'CUORAL_REQUEST_SESSION_ID',
|
|
23
|
+
SESSION_ID_RESPONSE = 'CUORAL_SESSION_ID_RESPONSE',
|
|
20
24
|
|
|
21
25
|
// File Upload
|
|
22
26
|
UPLOAD_FILE = 'CUORAL_UPLOAD_FILE',
|