capacitor-gleap-plugin 19.0.1 → 19.1.0
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/CapacitorGleapPlugin.podspec +1 -1
- package/Package.swift +1 -1
- package/README.md +93 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/gleapplugins/capacitor/GleapPlugin.java +125 -0
- package/dist/docs.json +91 -0
- package/dist/esm/definitions.d.ts +49 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/logs/webViewLogs.d.ts +18 -2
- package/dist/esm/logs/webViewLogs.js +45 -7
- package/dist/esm/logs/webViewLogs.js.map +1 -1
- package/dist/esm/web.d.ts +11 -0
- package/dist/esm/web.js +25 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +70 -7
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +70 -7
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/GleapPlugin/GleapPlugin.swift +68 -0
- package/package.json +2 -2
package/Package.swift
CHANGED
|
@@ -16,7 +16,7 @@ let package = Package(
|
|
|
16
16
|
// Capacitor rewrites this to the app's Capacitor major version during `npx cap sync`.
|
|
17
17
|
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
|
|
18
18
|
// Native Gleap iOS SDK, released together with this plugin (same version).
|
|
19
|
-
.package(url: "https://github.com/GleapSDK/Gleap-iOS-SDK.git", from: "19.
|
|
19
|
+
.package(url: "https://github.com/GleapSDK/Gleap-iOS-SDK.git", from: "19.1.0")
|
|
20
20
|
],
|
|
21
21
|
targets: [
|
|
22
22
|
.target(
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ The plugin needs Capacitor 7 or later and an iOS deployment target of **15.0** o
|
|
|
27
27
|
target 'App' do
|
|
28
28
|
capacitor_pods
|
|
29
29
|
# Add your Pods here
|
|
30
|
-
pod 'Gleap', :git => 'https://github.com/GleapSDK/Gleap-iOS-SDK.git', :tag => '19.
|
|
30
|
+
pod 'Gleap', :git => 'https://github.com/GleapSDK/Gleap-iOS-SDK.git', :tag => '19.1.0'
|
|
31
31
|
end
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -131,11 +131,13 @@ App.addListener("appUrlOpen", ({ url }) => {
|
|
|
131
131
|
* [`setNetworkLogPropsToIgnore(...)`](#setnetworklogpropstoignore)
|
|
132
132
|
* [`attachNetworkLogs(...)`](#attachnetworklogs)
|
|
133
133
|
* [`attachConsoleLogs(...)`](#attachconsolelogs)
|
|
134
|
+
* [`logsFlushed(...)`](#logsflushed)
|
|
134
135
|
* [`setEnvDataPropsToIgnore(...)`](#setenvdatapropstoignore)
|
|
135
136
|
* [`registerAgentTool(...)`](#registeragenttool)
|
|
136
137
|
* [`sendAgentToolResult(...)`](#sendagenttoolresult)
|
|
137
138
|
* [`addListener('agentToolExecution', ...)`](#addlisteneragenttoolexecution-)
|
|
138
139
|
* [`addListener('logConfigLoaded', ...)`](#addlistenerlogconfigloaded-)
|
|
140
|
+
* [`addListener('flushLogs', ...)`](#addlistenerflushlogs-)
|
|
139
141
|
* [`setTicketAttribute(...)`](#setticketattribute)
|
|
140
142
|
* [`unsetTicketAttribute(...)`](#unsetticketattribute)
|
|
141
143
|
* [`clearTicketAttributes()`](#clearticketattributes)
|
|
@@ -174,6 +176,8 @@ App.addListener("appUrlOpen", ({ url }) => {
|
|
|
174
176
|
* [`setDisableInAppNotifications(...)`](#setdisableinappnotifications)
|
|
175
177
|
* [`setDisableEnvData(...)`](#setdisableenvdata)
|
|
176
178
|
* [`setColorScheme(...)`](#setcolorscheme)
|
|
179
|
+
* [`setCaptureEnabled(...)`](#setcaptureenabled)
|
|
180
|
+
* [`setRemoteLogCollectionEnabled(...)`](#setremotelogcollectionenabled)
|
|
177
181
|
* [`setLanguage(...)`](#setlanguage)
|
|
178
182
|
* [`disableConsoleLogOverwrite()`](#disableconsolelogoverwrite)
|
|
179
183
|
* [`enableDebugConsoleLog()`](#enabledebugconsolelog)
|
|
@@ -580,6 +584,25 @@ No-op on web, where the JavaScript SDK records the console itself.
|
|
|
580
584
|
--------------------
|
|
581
585
|
|
|
582
586
|
|
|
587
|
+
### logsFlushed(...)
|
|
588
|
+
|
|
589
|
+
```typescript
|
|
590
|
+
logsFlushed(options: { flushId: string; }) => Promise<void>
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Answers a `flushLogs` event once the WebView console and network logs the plugin buffers were handed to the native
|
|
594
|
+
SDK, so it collects the logs for a capture request with them. The plugin calls this for you on iOS and Android.
|
|
595
|
+
No-op on web.
|
|
596
|
+
|
|
597
|
+
| Param | Type |
|
|
598
|
+
| ------------- | --------------------------------- |
|
|
599
|
+
| **`options`** | <code>{ flushId: string; }</code> |
|
|
600
|
+
|
|
601
|
+
**Since:** 19.1.0
|
|
602
|
+
|
|
603
|
+
--------------------
|
|
604
|
+
|
|
605
|
+
|
|
583
606
|
### setEnvDataPropsToIgnore(...)
|
|
584
607
|
|
|
585
608
|
```typescript
|
|
@@ -680,6 +703,28 @@ WebView log capture needs (network logs are only recorded when they are enabled
|
|
|
680
703
|
--------------------
|
|
681
704
|
|
|
682
705
|
|
|
706
|
+
### addListener('flushLogs', ...)
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
addListener(eventName: 'flushLogs', listenerFunc: (data: { flushId: string; }) => void) => Promise<PluginListenerHandle>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
Called on iOS and Android right before the native SDK collects the logs for a capture request: the plugin's
|
|
713
|
+
WebView log capture hands over what it buffers (it pushes at most every 500 ms otherwise) and answers with
|
|
714
|
+
`logsFlushed`. The native SDK waits at most 500 ms for the answer. The plugin listens for you.
|
|
715
|
+
|
|
716
|
+
| Param | Type |
|
|
717
|
+
| ------------------ | ---------------------------------------------------- |
|
|
718
|
+
| **`eventName`** | <code>'flushLogs'</code> |
|
|
719
|
+
| **`listenerFunc`** | <code>(data: { flushId: string; }) => void</code> |
|
|
720
|
+
|
|
721
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
722
|
+
|
|
723
|
+
**Since:** 19.1.0
|
|
724
|
+
|
|
725
|
+
--------------------
|
|
726
|
+
|
|
727
|
+
|
|
683
728
|
### setTicketAttribute(...)
|
|
684
729
|
|
|
685
730
|
```typescript
|
|
@@ -1392,6 +1437,53 @@ Can be called before or after initialize and applies live.
|
|
|
1392
1437
|
--------------------
|
|
1393
1438
|
|
|
1394
1439
|
|
|
1440
|
+
### setCaptureEnabled(...)
|
|
1441
|
+
|
|
1442
|
+
```typescript
|
|
1443
|
+
setCaptureEnabled(options: { enabled: boolean; }) => Promise<{ captureEnabled: boolean; }>
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
Enable or disable screenshots and screen recordings for capture requests: when a workflow, an AI agent or a
|
|
1447
|
+
teammate asks the user in the widget to show the issue, the widget steps aside, a small bar lets the user go to
|
|
1448
|
+
the right screen, and the SDK captures the app once they tap Capture (or records it between Start and Stop).
|
|
1449
|
+
Nothing is captured without that tap. While disabled, the widget only offers to upload a file.
|
|
1450
|
+
Enabled by default. Works on iOS, Android and web and can be called before or after initialize.
|
|
1451
|
+
|
|
1452
|
+
| Param | Type |
|
|
1453
|
+
| ------------- | ---------------------------------- |
|
|
1454
|
+
| **`options`** | <code>{ enabled: boolean; }</code> |
|
|
1455
|
+
|
|
1456
|
+
**Returns:** <code>Promise<{ captureEnabled: boolean; }></code>
|
|
1457
|
+
|
|
1458
|
+
**Since:** 19.1.0
|
|
1459
|
+
|
|
1460
|
+
--------------------
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
### setRemoteLogCollectionEnabled(...)
|
|
1464
|
+
|
|
1465
|
+
```typescript
|
|
1466
|
+
setRemoteLogCollectionEnabled(options: { enabled: boolean; }) => Promise<{ remoteLogCollectionEnabled: boolean; }>
|
|
1467
|
+
```
|
|
1468
|
+
|
|
1469
|
+
Enable or disable sending the app's logs for capture requests: a workflow or an AI agent can ask for the logs
|
|
1470
|
+
while the app runs (no user action), and screenshots and recordings can bring the logs around them. The logs are
|
|
1471
|
+
what a bug report carries (console and network logs, custom data, env data, custom events; the replay only when
|
|
1472
|
+
it is asked for and enabled in the dashboard), and the existing settings still apply (e.g. setDisableEnvData).
|
|
1473
|
+
While disabled, log requests are answered as not supported and captures are sent without logs.
|
|
1474
|
+
Enabled by default. Works on iOS, Android and web and can be called before or after initialize.
|
|
1475
|
+
|
|
1476
|
+
| Param | Type |
|
|
1477
|
+
| ------------- | ---------------------------------- |
|
|
1478
|
+
| **`options`** | <code>{ enabled: boolean; }</code> |
|
|
1479
|
+
|
|
1480
|
+
**Returns:** <code>Promise<{ remoteLogCollectionEnabled: boolean; }></code>
|
|
1481
|
+
|
|
1482
|
+
**Since:** 19.1.0
|
|
1483
|
+
|
|
1484
|
+
--------------------
|
|
1485
|
+
|
|
1486
|
+
|
|
1395
1487
|
### setLanguage(...)
|
|
1396
1488
|
|
|
1397
1489
|
```typescript
|
package/android/build.gradle
CHANGED
|
@@ -55,5 +55,5 @@ dependencies {
|
|
|
55
55
|
testImplementation "junit:junit:$junitVersion"
|
|
56
56
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
57
57
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
58
|
-
implementation group: 'io.gleap', name: 'gleap-android-sdk', version: '19.
|
|
58
|
+
implementation group: 'io.gleap', name: 'gleap-android-sdk', version: '19.1.0'
|
|
59
59
|
}
|
|
@@ -2,6 +2,8 @@ package io.gleapplugins.capacitor;
|
|
|
2
2
|
|
|
3
3
|
import android.Manifest;
|
|
4
4
|
import android.os.Build;
|
|
5
|
+
import android.os.Handler;
|
|
6
|
+
import android.os.Looper;
|
|
5
7
|
|
|
6
8
|
import com.getcapacitor.JSArray;
|
|
7
9
|
import com.getcapacitor.JSObject;
|
|
@@ -12,6 +14,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
12
14
|
import com.getcapacitor.annotation.Permission;
|
|
13
15
|
import io.gleap.APPLICATIONTYPE;
|
|
14
16
|
import io.gleap.Gleap;
|
|
17
|
+
import io.gleap.GleapLogFlushHandler;
|
|
15
18
|
import io.gleap.GleapLogLevel;
|
|
16
19
|
import io.gleap.GleapNotInitialisedException;
|
|
17
20
|
import io.gleap.GleapSessionProperties;
|
|
@@ -62,6 +65,12 @@ public class GleapPlugin extends Plugin {
|
|
|
62
65
|
private volatile JSObject lastLogConfig;
|
|
63
66
|
// Set by disableConsoleLogOverwrite: WebView console logs are no longer attached.
|
|
64
67
|
private volatile boolean webViewConsoleLogsDisabled = false;
|
|
68
|
+
// Capture requests: log flushes the native SDK waits for (at most 500 ms) until the WebView log capture handed
|
|
69
|
+
// over what it buffers, by flush id.
|
|
70
|
+
private final Map<String, Runnable> pendingLogFlushes = new ConcurrentHashMap<>();
|
|
71
|
+
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
|
72
|
+
// An unanswered flush (e.g. the page reloaded) is forgotten after this; the SDK stopped waiting long before.
|
|
73
|
+
private static final long LOG_FLUSH_FORGET_MS = 1000;
|
|
65
74
|
|
|
66
75
|
@Override
|
|
67
76
|
public void load() {
|
|
@@ -119,6 +128,8 @@ public class GleapPlugin extends Plugin {
|
|
|
119
128
|
// Set the application type
|
|
120
129
|
Gleap.getInstance().setApplicationType(APPLICATIONTYPE.CAPACITOR);
|
|
121
130
|
|
|
131
|
+
registerLogFlushHandler();
|
|
132
|
+
|
|
122
133
|
// A reloaded WebView calls initialize again: hand it the config that was already loaded.
|
|
123
134
|
JSObject logConfig = lastLogConfig;
|
|
124
135
|
if (logConfig != null) {
|
|
@@ -131,6 +142,76 @@ public class GleapPlugin extends Plugin {
|
|
|
131
142
|
call.resolve(ret);
|
|
132
143
|
}
|
|
133
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Capture requests: before the native SDK collects the logs for a request, the WebView log capture hands over
|
|
147
|
+
* what it buffers (pushed at most every 500 ms otherwise). The SDK calls this on the main thread and waits at
|
|
148
|
+
* most 500 ms for done; without a flushLogs listener it does not wait.
|
|
149
|
+
*/
|
|
150
|
+
private void registerLogFlushHandler() {
|
|
151
|
+
try {
|
|
152
|
+
implementation.setLogFlushHandler(
|
|
153
|
+
new GleapLogFlushHandler() {
|
|
154
|
+
@Override
|
|
155
|
+
public void onFlushRequested(Runnable done) {
|
|
156
|
+
requestLogFlush(done);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
} catch (Exception | LinkageError ex) {
|
|
161
|
+
System.out.println(ex);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private void requestLogFlush(Runnable done) {
|
|
166
|
+
if (done == null) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (!hasListeners("flushLogs")) {
|
|
170
|
+
done.run();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
final String flushId = UUID.randomUUID().toString();
|
|
174
|
+
pendingLogFlushes.put(flushId, done);
|
|
175
|
+
try {
|
|
176
|
+
JSObject data = new JSObject();
|
|
177
|
+
data.put("flushId", flushId);
|
|
178
|
+
notifyListeners("flushLogs", data);
|
|
179
|
+
} catch (Exception ex) {
|
|
180
|
+
finishLogFlush(flushId);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
mainHandler.postDelayed(
|
|
184
|
+
new Runnable() {
|
|
185
|
+
@Override
|
|
186
|
+
public void run() {
|
|
187
|
+
pendingLogFlushes.remove(flushId);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
LOG_FLUSH_FORGET_MS
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private void finishLogFlush(String flushId) {
|
|
195
|
+
if (flushId == null) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
Runnable done = pendingLogFlushes.remove(flushId);
|
|
199
|
+
if (done != null) {
|
|
200
|
+
try {
|
|
201
|
+
done.run();
|
|
202
|
+
} catch (Exception ignore) {}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The WebView log capture handed over what it buffered for the flush with this id.
|
|
208
|
+
*/
|
|
209
|
+
@PluginMethod
|
|
210
|
+
public void logsFlushed(PluginCall call) {
|
|
211
|
+
finishLogFlush(call.getString("flushId"));
|
|
212
|
+
call.resolve();
|
|
213
|
+
}
|
|
214
|
+
|
|
134
215
|
// Data region & host overrides. All of them must be called before initialize.
|
|
135
216
|
@PluginMethod
|
|
136
217
|
public void setRegion(PluginCall call) {
|
|
@@ -906,6 +987,50 @@ public class GleapPlugin extends Plugin {
|
|
|
906
987
|
call.resolve(ret);
|
|
907
988
|
}
|
|
908
989
|
|
|
990
|
+
/**
|
|
991
|
+
* Enables or disables screenshots and screen recordings for capture requests.
|
|
992
|
+
*/
|
|
993
|
+
@PluginMethod
|
|
994
|
+
public void setCaptureEnabled(PluginCall call) {
|
|
995
|
+
Boolean enabled = call.getBoolean("enabled");
|
|
996
|
+
if (enabled == null) {
|
|
997
|
+
call.reject("No enabled value provided");
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
try {
|
|
1002
|
+
implementation.setCaptureEnabled(enabled);
|
|
1003
|
+
} catch (Exception | LinkageError ex) {
|
|
1004
|
+
System.out.println(ex);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
JSObject ret = new JSObject();
|
|
1008
|
+
ret.put("captureEnabled", enabled);
|
|
1009
|
+
call.resolve(ret);
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Enables or disables sending the app's logs for capture requests.
|
|
1014
|
+
*/
|
|
1015
|
+
@PluginMethod
|
|
1016
|
+
public void setRemoteLogCollectionEnabled(PluginCall call) {
|
|
1017
|
+
Boolean enabled = call.getBoolean("enabled");
|
|
1018
|
+
if (enabled == null) {
|
|
1019
|
+
call.reject("No enabled value provided");
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
try {
|
|
1024
|
+
implementation.setRemoteLogCollectionEnabled(enabled);
|
|
1025
|
+
} catch (Exception | LinkageError ex) {
|
|
1026
|
+
System.out.println(ex);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
JSObject ret = new JSObject();
|
|
1030
|
+
ret.put("remoteLogCollectionEnabled", enabled);
|
|
1031
|
+
call.resolve(ret);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
909
1034
|
@PluginMethod
|
|
910
1035
|
public void showFeedbackButton(PluginCall call) {
|
|
911
1036
|
boolean show = call.getBoolean("show", false);
|
package/dist/docs.json
CHANGED
|
@@ -436,6 +436,27 @@
|
|
|
436
436
|
],
|
|
437
437
|
"slug": "attachconsolelogs"
|
|
438
438
|
},
|
|
439
|
+
{
|
|
440
|
+
"name": "logsFlushed",
|
|
441
|
+
"signature": "(options: { flushId: string; }) => Promise<void>",
|
|
442
|
+
"parameters": [
|
|
443
|
+
{
|
|
444
|
+
"name": "options",
|
|
445
|
+
"docs": "",
|
|
446
|
+
"type": "{ flushId: string; }"
|
|
447
|
+
}
|
|
448
|
+
],
|
|
449
|
+
"returns": "Promise<void>",
|
|
450
|
+
"tags": [
|
|
451
|
+
{
|
|
452
|
+
"name": "since",
|
|
453
|
+
"text": "19.1.0"
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"docs": "Answers a `flushLogs` event once the WebView console and network logs the plugin buffers were handed to the native\nSDK, so it collects the logs for a capture request with them. The plugin calls this for you on iOS and Android.\nNo-op on web.",
|
|
457
|
+
"complexTypes": [],
|
|
458
|
+
"slug": "logsflushed"
|
|
459
|
+
},
|
|
439
460
|
{
|
|
440
461
|
"name": "setEnvDataPropsToIgnore",
|
|
441
462
|
"signature": "(options: { propsToIgnore: string[]; }) => Promise<{ envDataPropsToIgnoreSet: boolean; }>",
|
|
@@ -556,6 +577,34 @@
|
|
|
556
577
|
],
|
|
557
578
|
"slug": "addlistenerlogconfigloaded-"
|
|
558
579
|
},
|
|
580
|
+
{
|
|
581
|
+
"name": "addListener",
|
|
582
|
+
"signature": "(eventName: 'flushLogs', listenerFunc: (data: { flushId: string; }) => void) => Promise<PluginListenerHandle>",
|
|
583
|
+
"parameters": [
|
|
584
|
+
{
|
|
585
|
+
"name": "eventName",
|
|
586
|
+
"docs": "",
|
|
587
|
+
"type": "'flushLogs'"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"name": "listenerFunc",
|
|
591
|
+
"docs": "",
|
|
592
|
+
"type": "(data: { flushId: string; }) => void"
|
|
593
|
+
}
|
|
594
|
+
],
|
|
595
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
596
|
+
"tags": [
|
|
597
|
+
{
|
|
598
|
+
"name": "since",
|
|
599
|
+
"text": "19.1.0"
|
|
600
|
+
}
|
|
601
|
+
],
|
|
602
|
+
"docs": "Called on iOS and Android right before the native SDK collects the logs for a capture request: the plugin's\nWebView log capture hands over what it buffers (it pushes at most every 500 ms otherwise) and answers with\n`logsFlushed`. The native SDK waits at most 500 ms for the answer. The plugin listens for you.",
|
|
603
|
+
"complexTypes": [
|
|
604
|
+
"PluginListenerHandle"
|
|
605
|
+
],
|
|
606
|
+
"slug": "addlistenerflushlogs-"
|
|
607
|
+
},
|
|
559
608
|
{
|
|
560
609
|
"name": "setTicketAttribute",
|
|
561
610
|
"signature": "(options: { key: string; value: string; }) => Promise<{ setTicketAttribute: boolean; }>",
|
|
@@ -1323,6 +1372,48 @@
|
|
|
1323
1372
|
"complexTypes": [],
|
|
1324
1373
|
"slug": "setcolorscheme"
|
|
1325
1374
|
},
|
|
1375
|
+
{
|
|
1376
|
+
"name": "setCaptureEnabled",
|
|
1377
|
+
"signature": "(options: { enabled: boolean; }) => Promise<{ captureEnabled: boolean; }>",
|
|
1378
|
+
"parameters": [
|
|
1379
|
+
{
|
|
1380
|
+
"name": "options",
|
|
1381
|
+
"docs": "",
|
|
1382
|
+
"type": "{ enabled: boolean; }"
|
|
1383
|
+
}
|
|
1384
|
+
],
|
|
1385
|
+
"returns": "Promise<{ captureEnabled: boolean; }>",
|
|
1386
|
+
"tags": [
|
|
1387
|
+
{
|
|
1388
|
+
"name": "since",
|
|
1389
|
+
"text": "19.1.0"
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
"docs": "Enable or disable screenshots and screen recordings for capture requests: when a workflow, an AI agent or a\nteammate asks the user in the widget to show the issue, the widget steps aside, a small bar lets the user go to\nthe right screen, and the SDK captures the app once they tap Capture (or records it between Start and Stop).\nNothing is captured without that tap. While disabled, the widget only offers to upload a file.\nEnabled by default. Works on iOS, Android and web and can be called before or after initialize.",
|
|
1393
|
+
"complexTypes": [],
|
|
1394
|
+
"slug": "setcaptureenabled"
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
"name": "setRemoteLogCollectionEnabled",
|
|
1398
|
+
"signature": "(options: { enabled: boolean; }) => Promise<{ remoteLogCollectionEnabled: boolean; }>",
|
|
1399
|
+
"parameters": [
|
|
1400
|
+
{
|
|
1401
|
+
"name": "options",
|
|
1402
|
+
"docs": "",
|
|
1403
|
+
"type": "{ enabled: boolean; }"
|
|
1404
|
+
}
|
|
1405
|
+
],
|
|
1406
|
+
"returns": "Promise<{ remoteLogCollectionEnabled: boolean; }>",
|
|
1407
|
+
"tags": [
|
|
1408
|
+
{
|
|
1409
|
+
"name": "since",
|
|
1410
|
+
"text": "19.1.0"
|
|
1411
|
+
}
|
|
1412
|
+
],
|
|
1413
|
+
"docs": "Enable or disable sending the app's logs for capture requests: a workflow or an AI agent can ask for the logs\nwhile the app runs (no user action), and screenshots and recordings can bring the logs around them. The logs are\nwhat a bug report carries (console and network logs, custom data, env data, custom events; the replay only when\nit is asked for and enabled in the dashboard), and the existing settings still apply (e.g. setDisableEnvData).\nWhile disabled, log requests are answered as not supported and captures are sent without logs.\nEnabled by default. Works on iOS, Android and web and can be called before or after initialize.",
|
|
1414
|
+
"complexTypes": [],
|
|
1415
|
+
"slug": "setremotelogcollectionenabled"
|
|
1416
|
+
},
|
|
1326
1417
|
{
|
|
1327
1418
|
"name": "setLanguage",
|
|
1328
1419
|
"signature": "(options: { languageCode: string; }) => Promise<{ setLanguage: string; }>",
|
|
@@ -293,6 +293,16 @@ export interface GleapPlugin {
|
|
|
293
293
|
consoleLogsAttached: boolean;
|
|
294
294
|
}>;
|
|
295
295
|
/**
|
|
296
|
+
* Answers a `flushLogs` event once the WebView console and network logs the plugin buffers were handed to the native
|
|
297
|
+
* SDK, so it collects the logs for a capture request with them. The plugin calls this for you on iOS and Android.
|
|
298
|
+
* No-op on web.
|
|
299
|
+
*
|
|
300
|
+
* @since 19.1.0
|
|
301
|
+
*/
|
|
302
|
+
logsFlushed(options: {
|
|
303
|
+
flushId: string;
|
|
304
|
+
}): Promise<void>;
|
|
305
|
+
/**
|
|
296
306
|
* Set env data props to ignore. The given env data keys (exact and case-sensitive, e.g. "deviceName" or "currentUrl")
|
|
297
307
|
* are removed before a ticket or conversation is sent. Each call replaces the previous list, an empty list resets it.
|
|
298
308
|
* Can be called before or after initialize.
|
|
@@ -343,6 +353,16 @@ export interface GleapPlugin {
|
|
|
343
353
|
*/
|
|
344
354
|
addListener(eventName: 'logConfigLoaded', listenerFunc: (config: GleapLogConfig) => void): Promise<PluginListenerHandle>;
|
|
345
355
|
/**
|
|
356
|
+
* Called on iOS and Android right before the native SDK collects the logs for a capture request: the plugin's
|
|
357
|
+
* WebView log capture hands over what it buffers (it pushes at most every 500 ms otherwise) and answers with
|
|
358
|
+
* `logsFlushed`. The native SDK waits at most 500 ms for the answer. The plugin listens for you.
|
|
359
|
+
*
|
|
360
|
+
* @since 19.1.0
|
|
361
|
+
*/
|
|
362
|
+
addListener(eventName: 'flushLogs', listenerFunc: (data: {
|
|
363
|
+
flushId: string;
|
|
364
|
+
}) => void): Promise<PluginListenerHandle>;
|
|
365
|
+
/**
|
|
346
366
|
* Sets the value of a ticket attribute
|
|
347
367
|
*
|
|
348
368
|
* @since 13.5.0
|
|
@@ -750,6 +770,35 @@ export interface GleapPlugin {
|
|
|
750
770
|
colorScheme: string;
|
|
751
771
|
}>;
|
|
752
772
|
/**
|
|
773
|
+
* Enable or disable screenshots and screen recordings for capture requests: when a workflow, an AI agent or a
|
|
774
|
+
* teammate asks the user in the widget to show the issue, the widget steps aside, a small bar lets the user go to
|
|
775
|
+
* the right screen, and the SDK captures the app once they tap Capture (or records it between Start and Stop).
|
|
776
|
+
* Nothing is captured without that tap. While disabled, the widget only offers to upload a file.
|
|
777
|
+
* Enabled by default. Works on iOS, Android and web and can be called before or after initialize.
|
|
778
|
+
*
|
|
779
|
+
* @since 19.1.0
|
|
780
|
+
*/
|
|
781
|
+
setCaptureEnabled(options: {
|
|
782
|
+
enabled: boolean;
|
|
783
|
+
}): Promise<{
|
|
784
|
+
captureEnabled: boolean;
|
|
785
|
+
}>;
|
|
786
|
+
/**
|
|
787
|
+
* Enable or disable sending the app's logs for capture requests: a workflow or an AI agent can ask for the logs
|
|
788
|
+
* while the app runs (no user action), and screenshots and recordings can bring the logs around them. The logs are
|
|
789
|
+
* what a bug report carries (console and network logs, custom data, env data, custom events; the replay only when
|
|
790
|
+
* it is asked for and enabled in the dashboard), and the existing settings still apply (e.g. setDisableEnvData).
|
|
791
|
+
* While disabled, log requests are answered as not supported and captures are sent without logs.
|
|
792
|
+
* Enabled by default. Works on iOS, Android and web and can be called before or after initialize.
|
|
793
|
+
*
|
|
794
|
+
* @since 19.1.0
|
|
795
|
+
*/
|
|
796
|
+
setRemoteLogCollectionEnabled(options: {
|
|
797
|
+
enabled: boolean;
|
|
798
|
+
}): Promise<{
|
|
799
|
+
remoteLogCollectionEnabled: boolean;
|
|
800
|
+
}>;
|
|
801
|
+
/**
|
|
753
802
|
* Set Language
|
|
754
803
|
*
|
|
755
804
|
* @since 7.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport type CallbackID = string;\n\nexport interface GleapEventMessage {\n name: string,\n data?: any,\n}\n\nexport type GleapEventCallback = (message: GleapEventMessage | null, err?: any) => void;\n\n/**\n * A console log entry as the plugin hands it to the native SDK.\n */\nexport interface GleapConsoleLogEntry {\n /** ISO-8601 UTC timestamp with milliseconds. */\n date: string;\n priority: 'ERROR' | 'WARNING' | 'INFO';\n log: string;\n}\n\n/**\n * A network log entry (fetch / XMLHttpRequest) as the plugin hands it to the native SDK.\n */\nexport interface GleapNetworkLogEntry {\n /** ISO-8601 UTC timestamp of the request start. */\n date: string;\n /** HTTP method, uppercase. */\n type: string;\n url: string;\n /** Milliseconds from the request start to the response headers (or the failure). */\n duration?: number;\n /** true when an HTTP response arrived (any status), false on a transport error, abort or timeout. */\n success?: boolean;\n request?: {\n headers?: { [name: string]: string };\n payload?: string;\n };\n response?: {\n status?: number;\n statusText?: string;\n headers?: { [name: string]: string };\n responseText?: string;\n /** Set instead of status and body when the request failed. */\n errorText?: string;\n };\n}\n\n/**\n * The network log settings of your Gleap project, sent by the native SDK once its config is loaded.\n */\nexport interface GleapLogConfig {\n enableNetworkLogs: boolean;\n networkLogPropsToIgnore: string[];\n networkLogBlacklist: string[];\n}\n\nexport interface GleapPlugin {\n /**\n * Initialize Gleap with an API key\n *\n * @since 7.0.0\n */\n initialize(options: {\n API_KEY: string;\n }): Promise<{\n initialized: boolean;\n }>;\n\n /**\n * Set the data region of your Gleap project (\"eu\" is the default).\n * Sets the API, websocket and realtime hosts at once. Must be called before initialize.\n * A manual setter (setApiUrl, setWSApiUrl, setRealtimeHost) called afterwards overrides that single host.\n *\n * @since 18.0.0\n */\n setRegion(options: {\n region: 'eu' | 'us';\n }): Promise<{\n region: string;\n }>;\n\n /**\n * Set a custom API url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setApiUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom websocket API url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setWSApiUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom realtime host (hostname only, without protocol or path). Must be called before initialize.\n *\n * @since 18.0.0\n */\n setRealtimeHost(options: {\n host: string;\n }): Promise<{\n host: string;\n }>;\n\n /**\n * Set a custom widget frame url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setFrameUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom banner url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setBannerUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom modal url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setModalUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set user identity\n *\n * @since 7.0.0\n */\n identify(options: {\n userId: string;\n userHash?: string;\n name?: string;\n email?: string;\n phone?: string;\n companyId?: string;\n companyName?: string;\n avatar?: string;\n sla?: number;\n plan?: string;\n value?: number;\n customData?: Record<string, any>;\n }): Promise<{\n identify: boolean;\n }>;\n\n /**\n * Update user properties\n *\n * @since 13.2.1\n */\n updateContact(options: {\n name?: string;\n email?: string;\n phone?: string;\n companyId?: string;\n companyName?: string;\n avatar?: string;\n sla?: number;\n plan?: string;\n value?: number;\n customData?: Record<string, any>;\n }): Promise<{\n identify: boolean;\n }>;\n\n /**\n * Clear user identity\n *\n * @since 7.0.0\n */\n clearIdentity(): Promise<{\n clearIdentity: boolean;\n }>;\n\n /**\n * Get the current user identity\n *\n * @since 8.1.0\n */\n getIdentity(): Promise<{\n identity: {\n userId: string;\n name?: string;\n email?: string;\n phone?: string;\n value?: number;\n };\n }>;\n\n /**\n * User identified status.\n *\n * @since 8.1.0\n */\n isUserIdentified(): Promise<{\n isUserIdentified: boolean;\n }>;\n\n /**\n * Submit a custom log message with the given level\n *\n * @since 7.0.0\n */\n log(options: {\n message: string;\n logLevel?: \"ERROR\" | \"WARNING\" | \"INFO\";\n }): Promise<{\n logged: boolean;\n }>;\n\n /**\n * Manually show a survey.\n *\n * @since 8.5.1\n */\n showSurvey(options: {\n surveyId: string;\n format?: \"survey\" | \"survey_full\";\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Add custom data\n *\n * @since 7.0.0\n */\n attachCustomData(options: {\n data: any;\n }): Promise<{\n attachedCustomData: boolean;\n }>;\n\n /**\n * Set tags\n *\n * @since 8.6.0\n */\n setTags(options: {\n tags: string[];\n }): Promise<{\n tagsSet: boolean;\n }>;\n\n /**\n * Set network logs blacklist\n *\n * @since 13.2.1\n */\n setNetworkLogsBlacklist(options: {\n blacklist: string[];\n }): Promise<{\n blacklistSet: boolean;\n }>;\n\n /**\n * Set network logs props to ignore\n *\n * @since 13.2.1\n */\n setNetworkLogPropsToIgnore(options: {\n propsToIgnore: string[];\n }): Promise<{\n propsToIgnoreSet: boolean;\n }>;\n\n /**\n * Hands the network requests made inside the app's WebView (fetch and XMLHttpRequest) to the native SDK, so they\n * show up in the network logs of tickets. The plugin calls this for you on iOS and Android; each call replaces\n * the previously attached WebView network logs. No-op on web, where the JavaScript SDK records requests itself.\n *\n * @since 19.0.0\n */\n attachNetworkLogs(options: {\n logs: GleapNetworkLogEntry[];\n }): Promise<{\n networkLogsAttached: boolean;\n }>;\n\n /**\n * Hands the console output of the app's WebView (console.log/info/warn/error/debug, uncaught errors and\n * unhandled promise rejections) to the native SDK, so it shows up in the console logs of tickets. The plugin\n * calls this for you on iOS and Android; each call replaces the previously attached WebView console logs.\n * No-op on web, where the JavaScript SDK records the console itself.\n *\n * @since 19.0.0\n */\n attachConsoleLogs(options: {\n logs: GleapConsoleLogEntry[];\n }): Promise<{\n consoleLogsAttached: boolean;\n }>;\n\n /**\n * Set env data props to ignore. The given env data keys (exact and case-sensitive, e.g. \"deviceName\" or \"currentUrl\")\n * are removed before a ticket or conversation is sent. Each call replaces the previous list, an empty list resets it.\n * Can be called before or after initialize.\n *\n * @since 18.1.0\n */\n setEnvDataPropsToIgnore(options: {\n propsToIgnore: string[];\n }): Promise<{\n envDataPropsToIgnoreSet: boolean;\n }>;\n\n /**\n * Registers a Frontend tool defined on your AI agent in the Gleap dashboard.\n * Prefer the `registerAgentTool(name, handler)` helper exported by this\n * package — it wires the agentToolExecution event and result round-trip for\n * you.\n *\n * @since 15.0.0\n */\n registerAgentTool(options: {\n name: string;\n }): Promise<void>;\n\n /**\n * Resolves a pending agent tool execution with the handler's result.\n * Used by the `registerAgentTool(name, handler)` helper.\n *\n * @since 15.0.0\n */\n sendAgentToolResult(options: {\n executionId: string;\n result: string;\n }): Promise<void>;\n\n /**\n * Called when a registered agent tool should execute.\n *\n * @since 15.0.0\n */\n addListener(\n eventName: 'agentToolExecution',\n listenerFunc: (data: {\n executionId: string;\n name: string;\n params: any;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Called on iOS and Android when the project config is loaded, with the network log settings the plugin's\n * WebView log capture needs (network logs are only recorded when they are enabled for your project).\n *\n * @since 19.0.0\n */\n addListener(\n eventName: 'logConfigLoaded',\n listenerFunc: (config: GleapLogConfig) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Sets the value of a ticket attribute\n *\n * @since 13.5.0\n */\n setTicketAttribute(options: {\n key: string;\n value: string;\n }): Promise<{\n setTicketAttribute: boolean;\n }>;\n\n /**\n * Unset a ticket attribute\n *\n * @since 14.1.0\n */\n unsetTicketAttribute(options: {\n key: string;\n }): Promise<{\n unsetTicketAttribute: boolean;\n }>;\n\n /**\n * Clear all ticket attributes\n *\n * @since 14.1.0\n */\n clearTicketAttributes(): Promise<{\n clearTicketAttributes: boolean;\n }>;\n\n /**\n * Set custom data\n *\n * @since 7.0.0\n */\n setCustomData(options: {\n key: string;\n value: string;\n }): Promise<{\n setCustomData: boolean;\n }>;\n\n /**\n * Remove custom data by key\n *\n * @since 7.0.0\n */\n removeCustomData(options: {\n key: string;\n }): Promise<{\n removedCustomData: boolean;\n }>;\n\n /**\n * Clear custom data\n *\n * @since 7.0.0\n */\n clearCustomData(): Promise<{\n clearedCustomData: boolean;\n }>;\n\n /**\n * Log event to Gleap\n *\n * @since 8.0.0\n */\n trackEvent(options: {\n name: string;\n data?: any;\n }): Promise<{\n loggedEvent: boolean;\n }>;\n\n /**\n * Track a page view\n *\n * @since 8.4.1\n */\n trackPage(options: {\n pageName: string;\n }): Promise<{\n trackedPage: boolean;\n }>;\n\n /**\n * \n *\n * @since 7.0.0\n */\n setEventCallback(\n callback: GleapEventCallback,\n ): Promise<CallbackID>;\n\n /**\n * Log event to Gleap\n *\n * @since 7.0.0\n */\n sendSilentCrashReport(options: {\n description: string,\n severity?: \"LOW\" | \"MEDIUM\" | \"HIGH\";\n dataExclusion?: {\n customData: Boolean;\n metaData: Boolean;\n attachments: Boolean;\n consoleLog: Boolean;\n networkLogs: Boolean;\n customEventLog: Boolean;\n screenshot: Boolean;\n replays: Boolean;\n };\n }): Promise<{\n sentSilentBugReport: boolean;\n }>;\n\n /**\n * Prefills the widget's form data\n *\n * @since 7.0.0\n */\n preFillForm(options: {\n data: any;\n }): Promise<{\n preFilledForm: boolean;\n }>;\n\n /**\n * Add attachment as bas64 string\n *\n * @since 7.0.0\n */\n addAttachment(options: {\n base64data: string;\n name: string;\n }): Promise<{\n attachmentAdded: boolean;\n }>;\n\n /**\n * All attachments removed\n *\n * @since 7.0.0\n */\n removeAllAttachments(): Promise<{\n allAttachmentsRemoved: boolean;\n }>;\n\n /**\n * Open widget\n *\n * @since 7.0.0\n */\n open(): Promise<{\n openedWidget: boolean;\n }>;\n\n /**\n * Open checklists\n *\n * @since 19.0.0\n */\n openChecklists(options: {\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open checklist\n *\n * @since 19.0.0\n */\n openChecklist(options: {\n checklistId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Start checklist\n *\n * @since 19.0.0\n */\n startChecklist(options: {\n outboundId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open news\n *\n * @since 8.4.0\n */\n openNews(options: {\n showBackButton?: boolean;\n }): Promise<{\n openedNews: boolean;\n }>;\n\n /**\n * Open news article\n *\n * @since 8.4.0\n */\n openNewsArticle(options: {\n articleId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center\n *\n * @since 8.4.0\n */\n openHelpCenter(options: {\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center article\n *\n * @since 8.4.0\n */\n openHelpCenterArticle(options: {\n articleId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Ask the AI a question\n *\n * @since 15.0.0\n */\n askAI(options: {\n question: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center collection\n *\n * @since 8.4.0\n */\n openHelpCenterCollection(options: {\n collectionId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Search help center\n *\n * @since 8.4.0\n */\n searchHelpCenter(options: {\n term: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open feature requests\n *\n * @since 8.4.0\n */\n openFeatureRequests(options: {\n showBackButton?: boolean;\n }): Promise<{\n openedFeatureRequests: boolean;\n }>;\n\n /**\n * Close widget\n *\n * @since 7.0.0\n */\n close(): Promise<{\n closedWidget: boolean;\n }>;\n\n /**\n * Check widget status code\n *\n * @since 7.0.0\n */\n isOpened(): Promise<{\n isOpened: boolean;\n }>;\n\n /**\n * Start feedback flow\n *\n * @since 7.0.0\n */\n startFeedbackFlow(options: {\n feedbackFlow?: string;\n showBackButton?: boolean;\n }): Promise<{\n startedFeedbackFlow: boolean;\n }>;\n\n /**\n * Start a classic form\n *\n * @since 13.1.0\n */\n startClassicForm(options: {\n formId?: string;\n showBackButton?: boolean;\n }): Promise<{\n classicFormStarted: boolean;\n }>;\n\n /**\n * Start a new conversation\n *\n * @since 13.1.0\n */\n startConversation(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationStarted: boolean;\n }>;\n\n /**\n * Opens the conversations tab.\n *\n * @since 13.9.0\n */\n openConversation(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationsOpened: boolean;\n }>;\n\n /**\n * Opens the conversations tab (same as openConversation).\n *\n * @since 19.0.0\n */\n openConversations(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationsOpened: boolean;\n }>;\n\n /**\n * Open the conversation of a protected file from an emailed link.\n * With \"Require authenticated file access\" enabled, email replies link attachments to your customer\n * application URL with a `gleapFile` query parameter. If that URL opens your app (for example as a\n * universal link / App Link), pass it here, e.g. from `App.addListener('appUrlOpen')` or\n * `App.getLaunchUrl()` of `@capacitor/app`. `opened` is true when the URL carries a Gleap file reference.\n * The conversation opens once the customer is identified with a user hash (`identify` with `userHash`);\n * the link alone grants nothing. On web the JavaScript SDK handles `?gleapFile=` automatically on page load,\n * so this resolves `{ opened: false }` there.\n *\n * @since 19.0.1\n */\n openProtectedFileFromUrl(options: {\n url: string;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Start bot\n *\n * @since 10.0.3\n */\n startBot(options: {\n botId?: string;\n showBackButton?: boolean;\n }): Promise<{\n startedBot: boolean;\n }>;\n\n /**\n * Show or hide the feedback button.\n *\n * @since 8.0.0\n */\n showFeedbackButton(options: {\n show?: boolean;\n }): Promise<{\n feedbackButtonShown: boolean;\n }>;\n\n /**\n* Disable in app notifications.\n*\n* @since 8.6.1\n*/\n setDisableInAppNotifications(options: {\n disableInAppNotifications?: boolean;\n }): Promise<{\n inAppNotificationsDisabled: boolean;\n }>;\n\n /**\n * Disable env data. While disabled (true), no env data (device, OS, screen size, locale, URL, ...) is collected\n * and tickets are sent without it. Pass false to collect env data again. Can be called before or after initialize.\n *\n * @since 18.1.0\n */\n setDisableEnvData(options: {\n disableEnvData: boolean;\n }): Promise<{\n envDataDisabled: boolean;\n }>;\n\n /**\n * Set the color scheme of the widget. Overrides the color scheme configured in the Gleap dashboard.\n * Only takes effect when \"Adapt to dark / light mode\" is enabled in the dashboard; otherwise the widget\n * always keeps its normal colors. Before the first call the dashboard setting applies.\n * \"auto\" follows the device appearance (dark/light mode) on iOS and Android, and the page theme on web.\n * Apps with their own in-app theme toggle should pass \"light\" / \"dark\" explicitly and call it again whenever\n * the theme changes.\n * In dark mode the widget uses the dark mode colors, logo, header image and composer glow set in the Gleap dashboard;\n * without dark colors it keeps its normal colors. lightBackgroundColor / darkBackgroundColor override the background.\n * Can be called before or after initialize and applies live.\n *\n * @since 19.0.0\n */\n setColorScheme(options: {\n colorScheme: 'auto' | 'light' | 'dark';\n lightBackgroundColor?: string;\n darkBackgroundColor?: string;\n }): Promise<{\n colorScheme: string;\n }>;\n\n /**\n * Set Language\n *\n * @since 7.0.0\n */\n setLanguage(options: {\n languageCode: string;\n }): Promise<{\n setLanguage: string;\n }>;\n\n /**\n * Disable console log overwrite: stops recording the console output of the app's WebView\n * (console methods are restored) and drops the WebView console logs recorded so far.\n *\n * @since 7.0.0\n */\n disableConsoleLogOverwrite(): Promise<{\n consoleLogDisabled: boolean;\n }>;\n\n /**\n * Enable debug console log\n *\n * @since 7.0.0\n */\n enableDebugConsoleLog(): Promise<{\n debugConsoleLogEnabled: boolean;\n }>;\n\n /**\n * Set the notification container offset\n *\n * @since 15.2.0\n */\n setNotificationContainerOffset(options: {\n x: number;\n y: number;\n }): Promise<{\n notificationContainerOffsetSet: boolean;\n }>;\n\n}"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport type CallbackID = string;\n\nexport interface GleapEventMessage {\n name: string,\n data?: any,\n}\n\nexport type GleapEventCallback = (message: GleapEventMessage | null, err?: any) => void;\n\n/**\n * A console log entry as the plugin hands it to the native SDK.\n */\nexport interface GleapConsoleLogEntry {\n /** ISO-8601 UTC timestamp with milliseconds. */\n date: string;\n priority: 'ERROR' | 'WARNING' | 'INFO';\n log: string;\n}\n\n/**\n * A network log entry (fetch / XMLHttpRequest) as the plugin hands it to the native SDK.\n */\nexport interface GleapNetworkLogEntry {\n /** ISO-8601 UTC timestamp of the request start. */\n date: string;\n /** HTTP method, uppercase. */\n type: string;\n url: string;\n /** Milliseconds from the request start to the response headers (or the failure). */\n duration?: number;\n /** true when an HTTP response arrived (any status), false on a transport error, abort or timeout. */\n success?: boolean;\n request?: {\n headers?: { [name: string]: string };\n payload?: string;\n };\n response?: {\n status?: number;\n statusText?: string;\n headers?: { [name: string]: string };\n responseText?: string;\n /** Set instead of status and body when the request failed. */\n errorText?: string;\n };\n}\n\n/**\n * The network log settings of your Gleap project, sent by the native SDK once its config is loaded.\n */\nexport interface GleapLogConfig {\n enableNetworkLogs: boolean;\n networkLogPropsToIgnore: string[];\n networkLogBlacklist: string[];\n}\n\nexport interface GleapPlugin {\n /**\n * Initialize Gleap with an API key\n *\n * @since 7.0.0\n */\n initialize(options: {\n API_KEY: string;\n }): Promise<{\n initialized: boolean;\n }>;\n\n /**\n * Set the data region of your Gleap project (\"eu\" is the default).\n * Sets the API, websocket and realtime hosts at once. Must be called before initialize.\n * A manual setter (setApiUrl, setWSApiUrl, setRealtimeHost) called afterwards overrides that single host.\n *\n * @since 18.0.0\n */\n setRegion(options: {\n region: 'eu' | 'us';\n }): Promise<{\n region: string;\n }>;\n\n /**\n * Set a custom API url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setApiUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom websocket API url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setWSApiUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom realtime host (hostname only, without protocol or path). Must be called before initialize.\n *\n * @since 18.0.0\n */\n setRealtimeHost(options: {\n host: string;\n }): Promise<{\n host: string;\n }>;\n\n /**\n * Set a custom widget frame url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setFrameUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom banner url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setBannerUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set a custom modal url. Must be called before initialize.\n *\n * @since 18.0.0\n */\n setModalUrl(options: {\n url: string;\n }): Promise<{\n url: string;\n }>;\n\n /**\n * Set user identity\n *\n * @since 7.0.0\n */\n identify(options: {\n userId: string;\n userHash?: string;\n name?: string;\n email?: string;\n phone?: string;\n companyId?: string;\n companyName?: string;\n avatar?: string;\n sla?: number;\n plan?: string;\n value?: number;\n customData?: Record<string, any>;\n }): Promise<{\n identify: boolean;\n }>;\n\n /**\n * Update user properties\n *\n * @since 13.2.1\n */\n updateContact(options: {\n name?: string;\n email?: string;\n phone?: string;\n companyId?: string;\n companyName?: string;\n avatar?: string;\n sla?: number;\n plan?: string;\n value?: number;\n customData?: Record<string, any>;\n }): Promise<{\n identify: boolean;\n }>;\n\n /**\n * Clear user identity\n *\n * @since 7.0.0\n */\n clearIdentity(): Promise<{\n clearIdentity: boolean;\n }>;\n\n /**\n * Get the current user identity\n *\n * @since 8.1.0\n */\n getIdentity(): Promise<{\n identity: {\n userId: string;\n name?: string;\n email?: string;\n phone?: string;\n value?: number;\n };\n }>;\n\n /**\n * User identified status.\n *\n * @since 8.1.0\n */\n isUserIdentified(): Promise<{\n isUserIdentified: boolean;\n }>;\n\n /**\n * Submit a custom log message with the given level\n *\n * @since 7.0.0\n */\n log(options: {\n message: string;\n logLevel?: \"ERROR\" | \"WARNING\" | \"INFO\";\n }): Promise<{\n logged: boolean;\n }>;\n\n /**\n * Manually show a survey.\n *\n * @since 8.5.1\n */\n showSurvey(options: {\n surveyId: string;\n format?: \"survey\" | \"survey_full\";\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Add custom data\n *\n * @since 7.0.0\n */\n attachCustomData(options: {\n data: any;\n }): Promise<{\n attachedCustomData: boolean;\n }>;\n\n /**\n * Set tags\n *\n * @since 8.6.0\n */\n setTags(options: {\n tags: string[];\n }): Promise<{\n tagsSet: boolean;\n }>;\n\n /**\n * Set network logs blacklist\n *\n * @since 13.2.1\n */\n setNetworkLogsBlacklist(options: {\n blacklist: string[];\n }): Promise<{\n blacklistSet: boolean;\n }>;\n\n /**\n * Set network logs props to ignore\n *\n * @since 13.2.1\n */\n setNetworkLogPropsToIgnore(options: {\n propsToIgnore: string[];\n }): Promise<{\n propsToIgnoreSet: boolean;\n }>;\n\n /**\n * Hands the network requests made inside the app's WebView (fetch and XMLHttpRequest) to the native SDK, so they\n * show up in the network logs of tickets. The plugin calls this for you on iOS and Android; each call replaces\n * the previously attached WebView network logs. No-op on web, where the JavaScript SDK records requests itself.\n *\n * @since 19.0.0\n */\n attachNetworkLogs(options: {\n logs: GleapNetworkLogEntry[];\n }): Promise<{\n networkLogsAttached: boolean;\n }>;\n\n /**\n * Hands the console output of the app's WebView (console.log/info/warn/error/debug, uncaught errors and\n * unhandled promise rejections) to the native SDK, so it shows up in the console logs of tickets. The plugin\n * calls this for you on iOS and Android; each call replaces the previously attached WebView console logs.\n * No-op on web, where the JavaScript SDK records the console itself.\n *\n * @since 19.0.0\n */\n attachConsoleLogs(options: {\n logs: GleapConsoleLogEntry[];\n }): Promise<{\n consoleLogsAttached: boolean;\n }>;\n\n /**\n * Answers a `flushLogs` event once the WebView console and network logs the plugin buffers were handed to the native\n * SDK, so it collects the logs for a capture request with them. The plugin calls this for you on iOS and Android.\n * No-op on web.\n *\n * @since 19.1.0\n */\n logsFlushed(options: {\n flushId: string;\n }): Promise<void>;\n\n /**\n * Set env data props to ignore. The given env data keys (exact and case-sensitive, e.g. \"deviceName\" or \"currentUrl\")\n * are removed before a ticket or conversation is sent. Each call replaces the previous list, an empty list resets it.\n * Can be called before or after initialize.\n *\n * @since 18.1.0\n */\n setEnvDataPropsToIgnore(options: {\n propsToIgnore: string[];\n }): Promise<{\n envDataPropsToIgnoreSet: boolean;\n }>;\n\n /**\n * Registers a Frontend tool defined on your AI agent in the Gleap dashboard.\n * Prefer the `registerAgentTool(name, handler)` helper exported by this\n * package — it wires the agentToolExecution event and result round-trip for\n * you.\n *\n * @since 15.0.0\n */\n registerAgentTool(options: {\n name: string;\n }): Promise<void>;\n\n /**\n * Resolves a pending agent tool execution with the handler's result.\n * Used by the `registerAgentTool(name, handler)` helper.\n *\n * @since 15.0.0\n */\n sendAgentToolResult(options: {\n executionId: string;\n result: string;\n }): Promise<void>;\n\n /**\n * Called when a registered agent tool should execute.\n *\n * @since 15.0.0\n */\n addListener(\n eventName: 'agentToolExecution',\n listenerFunc: (data: {\n executionId: string;\n name: string;\n params: any;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Called on iOS and Android when the project config is loaded, with the network log settings the plugin's\n * WebView log capture needs (network logs are only recorded when they are enabled for your project).\n *\n * @since 19.0.0\n */\n addListener(\n eventName: 'logConfigLoaded',\n listenerFunc: (config: GleapLogConfig) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Called on iOS and Android right before the native SDK collects the logs for a capture request: the plugin's\n * WebView log capture hands over what it buffers (it pushes at most every 500 ms otherwise) and answers with\n * `logsFlushed`. The native SDK waits at most 500 ms for the answer. The plugin listens for you.\n *\n * @since 19.1.0\n */\n addListener(\n eventName: 'flushLogs',\n listenerFunc: (data: { flushId: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Sets the value of a ticket attribute\n *\n * @since 13.5.0\n */\n setTicketAttribute(options: {\n key: string;\n value: string;\n }): Promise<{\n setTicketAttribute: boolean;\n }>;\n\n /**\n * Unset a ticket attribute\n *\n * @since 14.1.0\n */\n unsetTicketAttribute(options: {\n key: string;\n }): Promise<{\n unsetTicketAttribute: boolean;\n }>;\n\n /**\n * Clear all ticket attributes\n *\n * @since 14.1.0\n */\n clearTicketAttributes(): Promise<{\n clearTicketAttributes: boolean;\n }>;\n\n /**\n * Set custom data\n *\n * @since 7.0.0\n */\n setCustomData(options: {\n key: string;\n value: string;\n }): Promise<{\n setCustomData: boolean;\n }>;\n\n /**\n * Remove custom data by key\n *\n * @since 7.0.0\n */\n removeCustomData(options: {\n key: string;\n }): Promise<{\n removedCustomData: boolean;\n }>;\n\n /**\n * Clear custom data\n *\n * @since 7.0.0\n */\n clearCustomData(): Promise<{\n clearedCustomData: boolean;\n }>;\n\n /**\n * Log event to Gleap\n *\n * @since 8.0.0\n */\n trackEvent(options: {\n name: string;\n data?: any;\n }): Promise<{\n loggedEvent: boolean;\n }>;\n\n /**\n * Track a page view\n *\n * @since 8.4.1\n */\n trackPage(options: {\n pageName: string;\n }): Promise<{\n trackedPage: boolean;\n }>;\n\n /**\n * \n *\n * @since 7.0.0\n */\n setEventCallback(\n callback: GleapEventCallback,\n ): Promise<CallbackID>;\n\n /**\n * Log event to Gleap\n *\n * @since 7.0.0\n */\n sendSilentCrashReport(options: {\n description: string,\n severity?: \"LOW\" | \"MEDIUM\" | \"HIGH\";\n dataExclusion?: {\n customData: Boolean;\n metaData: Boolean;\n attachments: Boolean;\n consoleLog: Boolean;\n networkLogs: Boolean;\n customEventLog: Boolean;\n screenshot: Boolean;\n replays: Boolean;\n };\n }): Promise<{\n sentSilentBugReport: boolean;\n }>;\n\n /**\n * Prefills the widget's form data\n *\n * @since 7.0.0\n */\n preFillForm(options: {\n data: any;\n }): Promise<{\n preFilledForm: boolean;\n }>;\n\n /**\n * Add attachment as bas64 string\n *\n * @since 7.0.0\n */\n addAttachment(options: {\n base64data: string;\n name: string;\n }): Promise<{\n attachmentAdded: boolean;\n }>;\n\n /**\n * All attachments removed\n *\n * @since 7.0.0\n */\n removeAllAttachments(): Promise<{\n allAttachmentsRemoved: boolean;\n }>;\n\n /**\n * Open widget\n *\n * @since 7.0.0\n */\n open(): Promise<{\n openedWidget: boolean;\n }>;\n\n /**\n * Open checklists\n *\n * @since 19.0.0\n */\n openChecklists(options: {\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open checklist\n *\n * @since 19.0.0\n */\n openChecklist(options: {\n checklistId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Start checklist\n *\n * @since 19.0.0\n */\n startChecklist(options: {\n outboundId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open news\n *\n * @since 8.4.0\n */\n openNews(options: {\n showBackButton?: boolean;\n }): Promise<{\n openedNews: boolean;\n }>;\n\n /**\n * Open news article\n *\n * @since 8.4.0\n */\n openNewsArticle(options: {\n articleId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center\n *\n * @since 8.4.0\n */\n openHelpCenter(options: {\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center article\n *\n * @since 8.4.0\n */\n openHelpCenterArticle(options: {\n articleId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Ask the AI a question\n *\n * @since 15.0.0\n */\n askAI(options: {\n question: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open help center collection\n *\n * @since 8.4.0\n */\n openHelpCenterCollection(options: {\n collectionId: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Search help center\n *\n * @since 8.4.0\n */\n searchHelpCenter(options: {\n term: string;\n showBackButton?: boolean;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Open feature requests\n *\n * @since 8.4.0\n */\n openFeatureRequests(options: {\n showBackButton?: boolean;\n }): Promise<{\n openedFeatureRequests: boolean;\n }>;\n\n /**\n * Close widget\n *\n * @since 7.0.0\n */\n close(): Promise<{\n closedWidget: boolean;\n }>;\n\n /**\n * Check widget status code\n *\n * @since 7.0.0\n */\n isOpened(): Promise<{\n isOpened: boolean;\n }>;\n\n /**\n * Start feedback flow\n *\n * @since 7.0.0\n */\n startFeedbackFlow(options: {\n feedbackFlow?: string;\n showBackButton?: boolean;\n }): Promise<{\n startedFeedbackFlow: boolean;\n }>;\n\n /**\n * Start a classic form\n *\n * @since 13.1.0\n */\n startClassicForm(options: {\n formId?: string;\n showBackButton?: boolean;\n }): Promise<{\n classicFormStarted: boolean;\n }>;\n\n /**\n * Start a new conversation\n *\n * @since 13.1.0\n */\n startConversation(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationStarted: boolean;\n }>;\n\n /**\n * Opens the conversations tab.\n *\n * @since 13.9.0\n */\n openConversation(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationsOpened: boolean;\n }>;\n\n /**\n * Opens the conversations tab (same as openConversation).\n *\n * @since 19.0.0\n */\n openConversations(options: {\n showBackButton?: boolean;\n }): Promise<{\n conversationsOpened: boolean;\n }>;\n\n /**\n * Open the conversation of a protected file from an emailed link.\n * With \"Require authenticated file access\" enabled, email replies link attachments to your customer\n * application URL with a `gleapFile` query parameter. If that URL opens your app (for example as a\n * universal link / App Link), pass it here, e.g. from `App.addListener('appUrlOpen')` or\n * `App.getLaunchUrl()` of `@capacitor/app`. `opened` is true when the URL carries a Gleap file reference.\n * The conversation opens once the customer is identified with a user hash (`identify` with `userHash`);\n * the link alone grants nothing. On web the JavaScript SDK handles `?gleapFile=` automatically on page load,\n * so this resolves `{ opened: false }` there.\n *\n * @since 19.0.1\n */\n openProtectedFileFromUrl(options: {\n url: string;\n }): Promise<{\n opened: boolean;\n }>;\n\n /**\n * Start bot\n *\n * @since 10.0.3\n */\n startBot(options: {\n botId?: string;\n showBackButton?: boolean;\n }): Promise<{\n startedBot: boolean;\n }>;\n\n /**\n * Show or hide the feedback button.\n *\n * @since 8.0.0\n */\n showFeedbackButton(options: {\n show?: boolean;\n }): Promise<{\n feedbackButtonShown: boolean;\n }>;\n\n /**\n* Disable in app notifications.\n*\n* @since 8.6.1\n*/\n setDisableInAppNotifications(options: {\n disableInAppNotifications?: boolean;\n }): Promise<{\n inAppNotificationsDisabled: boolean;\n }>;\n\n /**\n * Disable env data. While disabled (true), no env data (device, OS, screen size, locale, URL, ...) is collected\n * and tickets are sent without it. Pass false to collect env data again. Can be called before or after initialize.\n *\n * @since 18.1.0\n */\n setDisableEnvData(options: {\n disableEnvData: boolean;\n }): Promise<{\n envDataDisabled: boolean;\n }>;\n\n /**\n * Set the color scheme of the widget. Overrides the color scheme configured in the Gleap dashboard.\n * Only takes effect when \"Adapt to dark / light mode\" is enabled in the dashboard; otherwise the widget\n * always keeps its normal colors. Before the first call the dashboard setting applies.\n * \"auto\" follows the device appearance (dark/light mode) on iOS and Android, and the page theme on web.\n * Apps with their own in-app theme toggle should pass \"light\" / \"dark\" explicitly and call it again whenever\n * the theme changes.\n * In dark mode the widget uses the dark mode colors, logo, header image and composer glow set in the Gleap dashboard;\n * without dark colors it keeps its normal colors. lightBackgroundColor / darkBackgroundColor override the background.\n * Can be called before or after initialize and applies live.\n *\n * @since 19.0.0\n */\n setColorScheme(options: {\n colorScheme: 'auto' | 'light' | 'dark';\n lightBackgroundColor?: string;\n darkBackgroundColor?: string;\n }): Promise<{\n colorScheme: string;\n }>;\n\n /**\n * Enable or disable screenshots and screen recordings for capture requests: when a workflow, an AI agent or a\n * teammate asks the user in the widget to show the issue, the widget steps aside, a small bar lets the user go to\n * the right screen, and the SDK captures the app once they tap Capture (or records it between Start and Stop).\n * Nothing is captured without that tap. While disabled, the widget only offers to upload a file.\n * Enabled by default. Works on iOS, Android and web and can be called before or after initialize.\n *\n * @since 19.1.0\n */\n setCaptureEnabled(options: {\n enabled: boolean;\n }): Promise<{\n captureEnabled: boolean;\n }>;\n\n /**\n * Enable or disable sending the app's logs for capture requests: a workflow or an AI agent can ask for the logs\n * while the app runs (no user action), and screenshots and recordings can bring the logs around them. The logs are\n * what a bug report carries (console and network logs, custom data, env data, custom events; the replay only when\n * it is asked for and enabled in the dashboard), and the existing settings still apply (e.g. setDisableEnvData).\n * While disabled, log requests are answered as not supported and captures are sent without logs.\n * Enabled by default. Works on iOS, Android and web and can be called before or after initialize.\n *\n * @since 19.1.0\n */\n setRemoteLogCollectionEnabled(options: {\n enabled: boolean;\n }): Promise<{\n remoteLogCollectionEnabled: boolean;\n }>;\n\n /**\n * Set Language\n *\n * @since 7.0.0\n */\n setLanguage(options: {\n languageCode: string;\n }): Promise<{\n setLanguage: string;\n }>;\n\n /**\n * Disable console log overwrite: stops recording the console output of the app's WebView\n * (console methods are restored) and drops the WebView console logs recorded so far.\n *\n * @since 7.0.0\n */\n disableConsoleLogOverwrite(): Promise<{\n consoleLogDisabled: boolean;\n }>;\n\n /**\n * Enable debug console log\n *\n * @since 7.0.0\n */\n enableDebugConsoleLog(): Promise<{\n debugConsoleLogEnabled: boolean;\n }>;\n\n /**\n * Set the notification container offset\n *\n * @since 15.2.0\n */\n setNotificationContainerOffset(options: {\n x: number;\n y: number;\n }): Promise<{\n notificationContainerOffsetSet: boolean;\n }>;\n\n}"]}
|
|
@@ -8,7 +8,13 @@ export interface LogTarget {
|
|
|
8
8
|
attachNetworkLogs(options: {
|
|
9
9
|
logs: GleapNetworkLogEntry[];
|
|
10
10
|
}): Promise<unknown>;
|
|
11
|
+
logsFlushed(options: {
|
|
12
|
+
flushId: string;
|
|
13
|
+
}): Promise<unknown>;
|
|
11
14
|
addListener(eventName: 'logConfigLoaded', listenerFunc: (config: GleapLogConfig) => void): Promise<unknown>;
|
|
15
|
+
addListener(eventName: 'flushLogs', listenerFunc: (data: {
|
|
16
|
+
flushId: string;
|
|
17
|
+
}) => void): Promise<unknown>;
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
20
|
* Captures console output and fetch/XHR traffic inside the WebView of a native (iOS / Android) app
|
|
@@ -42,17 +48,27 @@ export declare class WebViewLogCapture {
|
|
|
42
48
|
*/
|
|
43
49
|
private nativeLogsConsole;
|
|
44
50
|
private listenForConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Capture requests: right before the native SDK collects the logs for a request, it asks for what is still
|
|
53
|
+
* buffered here (pushed at most every PUSH_DELAY_MS otherwise) and waits up to 500 ms for the answer.
|
|
54
|
+
*/
|
|
55
|
+
private listenForFlush;
|
|
56
|
+
private answerFlush;
|
|
45
57
|
applyRemoteConfig(config: GleapLogConfig | null | undefined): void;
|
|
46
58
|
setLocalPropsToIgnore(props: unknown): void;
|
|
47
59
|
setLocalBlacklist(blacklist: unknown): void;
|
|
48
60
|
/** disableConsoleLogOverwrite(): restore the console and drop what was recorded (also natively). */
|
|
49
61
|
disableConsole(): void;
|
|
50
62
|
onInitialize(): void;
|
|
51
|
-
/**
|
|
52
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Pushes pending changes now (before a plugin call that can produce a report, or when the native SDK collects the
|
|
65
|
+
* logs for a capture request). Resolves once the native side took them; never rejects.
|
|
66
|
+
*/
|
|
67
|
+
flushNow(): Promise<void>;
|
|
53
68
|
private updateRules;
|
|
54
69
|
private canPush;
|
|
55
70
|
private markDirty;
|
|
71
|
+
/** Resolves once the push it started (if any) was answered; never rejects. */
|
|
56
72
|
private flushChannel;
|
|
57
73
|
private onPushFailed;
|
|
58
74
|
/** Redacted copies of the buffered entries; unchanged entries reuse their previous copy. */
|