capacitor-gleap-plugin 18.1.0 → 19.0.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 +7 -2
- package/Package.swift +31 -0
- package/README.md +247 -759
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/gleapplugins/capacitor/GleapPlugin.java +184 -37
- package/dist/docs.json +267 -3893
- package/dist/esm/definitions.d.ts +145 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logs/body.d.ts +58 -0
- package/dist/esm/logs/body.js +303 -0
- package/dist/esm/logs/body.js.map +1 -0
- package/dist/esm/logs/consoleCapture.d.ts +29 -0
- package/dist/esm/logs/consoleCapture.js +189 -0
- package/dist/esm/logs/consoleCapture.js.map +1 -0
- package/dist/esm/logs/format.d.ts +16 -0
- package/dist/esm/logs/format.js +394 -0
- package/dist/esm/logs/format.js.map +1 -0
- package/dist/esm/logs/networkCapture.d.ts +65 -0
- package/dist/esm/logs/networkCapture.js +654 -0
- package/dist/esm/logs/networkCapture.js.map +1 -0
- package/dist/esm/logs/redaction.d.ts +54 -0
- package/dist/esm/logs/redaction.js +388 -0
- package/dist/esm/logs/redaction.js.map +1 -0
- package/dist/esm/logs/webViewLogs.d.ts +70 -0
- package/dist/esm/logs/webViewLogs.js +297 -0
- package/dist/esm/logs/webViewLogs.js.map +1 -0
- package/dist/esm/logs/zone.d.ts +5 -0
- package/dist/esm/logs/zone.js +15 -0
- package/dist/esm/logs/zone.js.map +1 -0
- package/dist/esm/web.d.ts +37 -2
- package/dist/esm/web.js +34 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2254 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2254 -1
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/GleapPlugin}/GleapPlugin.swift +195 -12
- package/package.json +18 -4
- package/ios/Plugin/GleapPlugin.h +0 -10
- package/ios/Plugin/GleapPlugin.m +0 -68
- package/ios/Plugin/Info.plist +0 -24
|
@@ -7,13 +7,89 @@ import Gleap
|
|
|
7
7
|
* here: https://capacitorjs.com/docs/plugins/ios
|
|
8
8
|
*/
|
|
9
9
|
@objc(GleapPlugin)
|
|
10
|
-
public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
10
|
+
public class GleapPlugin: CAPPlugin, CAPBridgedPlugin, GleapDelegate {
|
|
11
|
+
// Registers the plugin with Capacitor (replaces the CAP_PLUGIN macros of the former GleapPlugin.m,
|
|
12
|
+
// which Swift Package Manager cannot build next to Swift in one target).
|
|
13
|
+
public let identifier = "GleapPlugin"
|
|
14
|
+
public let jsName = "Gleap"
|
|
15
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
16
|
+
CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
|
|
17
|
+
CAPPluginMethod(name: "setRegion", returnType: CAPPluginReturnPromise),
|
|
18
|
+
CAPPluginMethod(name: "setApiUrl", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "setWSApiUrl", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "setRealtimeHost", returnType: CAPPluginReturnPromise),
|
|
21
|
+
CAPPluginMethod(name: "setFrameUrl", returnType: CAPPluginReturnPromise),
|
|
22
|
+
CAPPluginMethod(name: "setBannerUrl", returnType: CAPPluginReturnPromise),
|
|
23
|
+
CAPPluginMethod(name: "setModalUrl", returnType: CAPPluginReturnPromise),
|
|
24
|
+
CAPPluginMethod(name: "identify", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "updateContact", returnType: CAPPluginReturnPromise),
|
|
26
|
+
CAPPluginMethod(name: "clearIdentity", returnType: CAPPluginReturnPromise),
|
|
27
|
+
CAPPluginMethod(name: "setNetworkLogsBlacklist", returnType: CAPPluginReturnPromise),
|
|
28
|
+
CAPPluginMethod(name: "setNetworkLogPropsToIgnore", returnType: CAPPluginReturnPromise),
|
|
29
|
+
CAPPluginMethod(name: "setEnvDataPropsToIgnore", returnType: CAPPluginReturnPromise),
|
|
30
|
+
CAPPluginMethod(name: "attachNetworkLogs", returnType: CAPPluginReturnPromise),
|
|
31
|
+
CAPPluginMethod(name: "attachConsoleLogs", returnType: CAPPluginReturnPromise),
|
|
32
|
+
CAPPluginMethod(name: "attachCustomData", returnType: CAPPluginReturnPromise),
|
|
33
|
+
CAPPluginMethod(name: "setCustomData", returnType: CAPPluginReturnPromise),
|
|
34
|
+
CAPPluginMethod(name: "removeCustomData", returnType: CAPPluginReturnPromise),
|
|
35
|
+
CAPPluginMethod(name: "clearCustomData", returnType: CAPPluginReturnPromise),
|
|
36
|
+
CAPPluginMethod(name: "setTicketAttribute", returnType: CAPPluginReturnPromise),
|
|
37
|
+
CAPPluginMethod(name: "unsetTicketAttribute", returnType: CAPPluginReturnPromise),
|
|
38
|
+
CAPPluginMethod(name: "clearTicketAttributes", returnType: CAPPluginReturnPromise),
|
|
39
|
+
CAPPluginMethod(name: "registerAgentTool", returnType: CAPPluginReturnPromise),
|
|
40
|
+
CAPPluginMethod(name: "sendAgentToolResult", returnType: CAPPluginReturnPromise),
|
|
41
|
+
CAPPluginMethod(name: "trackEvent", returnType: CAPPluginReturnPromise),
|
|
42
|
+
CAPPluginMethod(name: "trackPage", returnType: CAPPluginReturnPromise),
|
|
43
|
+
CAPPluginMethod(name: "sendSilentCrashReport", returnType: CAPPluginReturnPromise),
|
|
44
|
+
CAPPluginMethod(name: "openChecklists", returnType: CAPPluginReturnPromise),
|
|
45
|
+
CAPPluginMethod(name: "openChecklist", returnType: CAPPluginReturnPromise),
|
|
46
|
+
CAPPluginMethod(name: "startChecklist", returnType: CAPPluginReturnPromise),
|
|
47
|
+
CAPPluginMethod(name: "open", returnType: CAPPluginReturnPromise),
|
|
48
|
+
CAPPluginMethod(name: "openNews", returnType: CAPPluginReturnPromise),
|
|
49
|
+
CAPPluginMethod(name: "showSurvey", returnType: CAPPluginReturnPromise),
|
|
50
|
+
CAPPluginMethod(name: "openNewsArticle", returnType: CAPPluginReturnPromise),
|
|
51
|
+
CAPPluginMethod(name: "openHelpCenter", returnType: CAPPluginReturnPromise),
|
|
52
|
+
CAPPluginMethod(name: "openHelpCenterArticle", returnType: CAPPluginReturnPromise),
|
|
53
|
+
CAPPluginMethod(name: "askAI", returnType: CAPPluginReturnPromise),
|
|
54
|
+
CAPPluginMethod(name: "openHelpCenterCollection", returnType: CAPPluginReturnPromise),
|
|
55
|
+
CAPPluginMethod(name: "searchHelpCenter", returnType: CAPPluginReturnPromise),
|
|
56
|
+
CAPPluginMethod(name: "openFeatureRequests", returnType: CAPPluginReturnPromise),
|
|
57
|
+
CAPPluginMethod(name: "close", returnType: CAPPluginReturnPromise),
|
|
58
|
+
CAPPluginMethod(name: "isOpened", returnType: CAPPluginReturnPromise),
|
|
59
|
+
CAPPluginMethod(name: "showFeedbackButton", returnType: CAPPluginReturnPromise),
|
|
60
|
+
CAPPluginMethod(name: "enableDebugConsoleLog", returnType: CAPPluginReturnPromise),
|
|
61
|
+
CAPPluginMethod(name: "log", returnType: CAPPluginReturnPromise),
|
|
62
|
+
CAPPluginMethod(name: "disableConsoleLogOverwrite", returnType: CAPPluginReturnPromise),
|
|
63
|
+
CAPPluginMethod(name: "startFeedbackFlow", returnType: CAPPluginReturnPromise),
|
|
64
|
+
CAPPluginMethod(name: "startBot", returnType: CAPPluginReturnPromise),
|
|
65
|
+
CAPPluginMethod(name: "setLanguage", returnType: CAPPluginReturnPromise),
|
|
66
|
+
CAPPluginMethod(name: "setEventCallback", returnType: CAPPluginReturnCallback),
|
|
67
|
+
CAPPluginMethod(name: "preFillForm", returnType: CAPPluginReturnPromise),
|
|
68
|
+
CAPPluginMethod(name: "addAttachment", returnType: CAPPluginReturnPromise),
|
|
69
|
+
CAPPluginMethod(name: "removeAllAttachments", returnType: CAPPluginReturnPromise),
|
|
70
|
+
CAPPluginMethod(name: "getIdentity", returnType: CAPPluginReturnPromise),
|
|
71
|
+
CAPPluginMethod(name: "isUserIdentified", returnType: CAPPluginReturnPromise),
|
|
72
|
+
CAPPluginMethod(name: "setTags", returnType: CAPPluginReturnPromise),
|
|
73
|
+
CAPPluginMethod(name: "setDisableInAppNotifications", returnType: CAPPluginReturnPromise),
|
|
74
|
+
CAPPluginMethod(name: "setDisableEnvData", returnType: CAPPluginReturnPromise),
|
|
75
|
+
CAPPluginMethod(name: "setColorScheme", returnType: CAPPluginReturnPromise),
|
|
76
|
+
CAPPluginMethod(name: "startClassicForm", returnType: CAPPluginReturnPromise),
|
|
77
|
+
CAPPluginMethod(name: "startConversation", returnType: CAPPluginReturnPromise),
|
|
78
|
+
CAPPluginMethod(name: "openConversations", returnType: CAPPluginReturnPromise),
|
|
79
|
+
CAPPluginMethod(name: "openConversation", returnType: CAPPluginReturnPromise),
|
|
80
|
+
CAPPluginMethod(name: "setNotificationContainerOffset", returnType: CAPPluginReturnPromise)
|
|
81
|
+
]
|
|
82
|
+
|
|
11
83
|
enum CallType {
|
|
12
84
|
case event
|
|
13
85
|
}
|
|
14
86
|
|
|
15
87
|
private var callQueue: [String: CallType] = [:]
|
|
16
88
|
private var pendingAgentToolExecutions: [String: GleapAgentToolCompletion] = [:]
|
|
89
|
+
// Network log settings from the last loaded config, for the WebView log capture (main queue only).
|
|
90
|
+
private var lastLogConfig: [String: Any]?
|
|
91
|
+
// Set by disableConsoleLogOverwrite: WebView console logs are no longer attached.
|
|
92
|
+
private var webViewConsoleLogsDisabled = false
|
|
17
93
|
|
|
18
94
|
@objc func initialize(_ call: CAPPluginCall) {
|
|
19
95
|
// Check if key is present
|
|
@@ -22,9 +98,25 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
22
98
|
return;
|
|
23
99
|
}
|
|
24
100
|
|
|
101
|
+
// Receive configLoaded, which carries the network log settings for the WebView log capture.
|
|
102
|
+
// A delegate the app set natively is kept.
|
|
103
|
+
if Gleap.sharedInstance().delegate == nil {
|
|
104
|
+
Gleap.sharedInstance().delegate = self
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Before initialize: the SDK starts reading stdout there and skips Capacitor's own
|
|
108
|
+
// console copies only once it knows it runs inside Capacitor.
|
|
109
|
+
Gleap.setApplicationType(CAPACITOR)
|
|
110
|
+
|
|
25
111
|
// Initialize Gleap with API key
|
|
26
112
|
Gleap.initialize(withToken: api_key)
|
|
27
|
-
|
|
113
|
+
|
|
114
|
+
// A reloaded WebView calls initialize again: hand it the config that was already loaded.
|
|
115
|
+
DispatchQueue.main.async {
|
|
116
|
+
if let logConfig = self.lastLogConfig {
|
|
117
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
28
120
|
|
|
29
121
|
// Provide feedback that it has been success
|
|
30
122
|
call.resolve([
|
|
@@ -248,11 +340,43 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
248
340
|
}
|
|
249
341
|
|
|
250
342
|
@objc func disableConsoleLogOverwrite(_ call: CAPPluginCall) {
|
|
343
|
+
// The plugin's JavaScript restores the WebView console; drop what it attached so far.
|
|
344
|
+
webViewConsoleLogsDisabled = true
|
|
345
|
+
Gleap.attachExternalData(["consoleLog": [Any]()])
|
|
346
|
+
|
|
251
347
|
call.resolve([
|
|
252
348
|
"consoleLogDisabled": true
|
|
253
349
|
])
|
|
254
350
|
}
|
|
255
351
|
|
|
352
|
+
// Network requests made inside the WebView (fetch / XMLHttpRequest), recorded by the plugin's
|
|
353
|
+
// JavaScript. Each call replaces the previous list; the SDK merges and sanitizes them.
|
|
354
|
+
@objc func attachNetworkLogs(_ call: CAPPluginCall) {
|
|
355
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
356
|
+
Gleap.attachExternalData(["networkLogs": logs])
|
|
357
|
+
|
|
358
|
+
call.resolve([
|
|
359
|
+
"networkLogsAttached": true
|
|
360
|
+
])
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Console output of the WebView, recorded by the plugin's JavaScript. Each call replaces the previous list.
|
|
364
|
+
@objc func attachConsoleLogs(_ call: CAPPluginCall) {
|
|
365
|
+
if webViewConsoleLogsDisabled {
|
|
366
|
+
call.resolve([
|
|
367
|
+
"consoleLogsAttached": false
|
|
368
|
+
])
|
|
369
|
+
return
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
373
|
+
Gleap.attachExternalData(["consoleLog": logs])
|
|
374
|
+
|
|
375
|
+
call.resolve([
|
|
376
|
+
"consoleLogsAttached": true
|
|
377
|
+
])
|
|
378
|
+
}
|
|
379
|
+
|
|
256
380
|
@objc func enableDebugConsoleLog(_ call: CAPPluginCall) {
|
|
257
381
|
Gleap.enableDebugConsoleLog()
|
|
258
382
|
|
|
@@ -261,6 +385,30 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
261
385
|
])
|
|
262
386
|
}
|
|
263
387
|
|
|
388
|
+
@objc func log(_ call: CAPPluginCall) {
|
|
389
|
+
guard let message = call.options["message"] as? String else {
|
|
390
|
+
call.reject("Must provide a log message")
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
var logLevel = INFO
|
|
395
|
+
switch call.getString("logLevel") ?? "INFO" {
|
|
396
|
+
case "WARNING":
|
|
397
|
+
logLevel = WARNING
|
|
398
|
+
case "ERROR":
|
|
399
|
+
logLevel = ERROR
|
|
400
|
+
default:
|
|
401
|
+
logLevel = INFO
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
Gleap.log(message, with: logLevel)
|
|
405
|
+
|
|
406
|
+
// Provide feedback that it has been success
|
|
407
|
+
call.resolve([
|
|
408
|
+
"logged": true
|
|
409
|
+
])
|
|
410
|
+
}
|
|
411
|
+
|
|
264
412
|
@objc func showSurvey(_ call: CAPPluginCall) {
|
|
265
413
|
guard let surveyId = call.options["surveyId"] as? String else {
|
|
266
414
|
call.reject("Must provide a surveyId")
|
|
@@ -268,7 +416,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
268
416
|
}
|
|
269
417
|
|
|
270
418
|
var surveyFormat = SURVEY
|
|
271
|
-
if (call.getString("format")
|
|
419
|
+
if (call.getString("format") == "survey_full") {
|
|
272
420
|
surveyFormat = SURVEY_FULL
|
|
273
421
|
}
|
|
274
422
|
|
|
@@ -291,7 +439,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
291
439
|
|
|
292
440
|
// Provide feedback that it has been success
|
|
293
441
|
call.resolve([
|
|
294
|
-
"
|
|
442
|
+
"attachedCustomData": true
|
|
295
443
|
])
|
|
296
444
|
}
|
|
297
445
|
|
|
@@ -528,7 +676,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
528
676
|
|
|
529
677
|
// Provide feedback that it has been success
|
|
530
678
|
call.resolve([
|
|
531
|
-
"
|
|
679
|
+
"loggedEvent": true
|
|
532
680
|
])
|
|
533
681
|
}
|
|
534
682
|
|
|
@@ -594,6 +742,21 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
594
742
|
])
|
|
595
743
|
}
|
|
596
744
|
|
|
745
|
+
@objc func setColorScheme(_ call: CAPPluginCall) {
|
|
746
|
+
guard let colorScheme = call.options["colorScheme"] as? String else {
|
|
747
|
+
call.reject("No colorScheme provided")
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// Missing colors fall back to the dashboard setting / the SDK defaults
|
|
752
|
+
Gleap.setColorScheme(colorScheme, lightBackgroundColor: call.getString("lightBackgroundColor"), darkBackgroundColor: call.getString("darkBackgroundColor"))
|
|
753
|
+
|
|
754
|
+
// Provide feedback that it has been success
|
|
755
|
+
call.resolve([
|
|
756
|
+
"colorScheme": colorScheme
|
|
757
|
+
])
|
|
758
|
+
}
|
|
759
|
+
|
|
597
760
|
@objc func showFeedbackButton(_ call: CAPPluginCall) {
|
|
598
761
|
let showFeedbackButton = call.getBool("show") ?? false
|
|
599
762
|
|
|
@@ -675,8 +838,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
675
838
|
let checklistId = call.getString("checklistId") ?? ""
|
|
676
839
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
677
840
|
|
|
678
|
-
|
|
679
|
-
Gleap.openNewsArticle(checklistId, andShowBackButton: showBackButton)
|
|
841
|
+
Gleap.openChecklist(checklistId, andShowBackButton: showBackButton)
|
|
680
842
|
|
|
681
843
|
// Provide feedback that it has been success
|
|
682
844
|
call.resolve([
|
|
@@ -688,8 +850,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
688
850
|
let outboundId = call.getString("outboundId") ?? ""
|
|
689
851
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
690
852
|
|
|
691
|
-
|
|
692
|
-
Gleap.openNewsArticle(outboundId, andShowBackButton: showBackButton)
|
|
853
|
+
Gleap.startChecklist(outboundId, andShowBackButton: showBackButton)
|
|
693
854
|
|
|
694
855
|
// Provide feedback that it has been success
|
|
695
856
|
call.resolve([
|
|
@@ -698,12 +859,14 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
698
859
|
}
|
|
699
860
|
|
|
700
861
|
@objc func openNews(_ call: CAPPluginCall) {
|
|
862
|
+
let showBackButton = call.getBool("showBackButton") ?? true
|
|
863
|
+
|
|
701
864
|
// Open news
|
|
702
|
-
Gleap.openNews()
|
|
865
|
+
Gleap.openNews(showBackButton)
|
|
703
866
|
|
|
704
867
|
// Provide feedback that it has been success
|
|
705
868
|
call.resolve([
|
|
706
|
-
"
|
|
869
|
+
"openedNews": true
|
|
707
870
|
])
|
|
708
871
|
}
|
|
709
872
|
|
|
@@ -859,6 +1022,11 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
859
1022
|
])
|
|
860
1023
|
}
|
|
861
1024
|
|
|
1025
|
+
// The name the plugin's TypeScript API uses for opening the conversations tab.
|
|
1026
|
+
@objc func openConversation(_ call: CAPPluginCall) {
|
|
1027
|
+
openConversations(call)
|
|
1028
|
+
}
|
|
1029
|
+
|
|
862
1030
|
@objc func startFeedbackFlow(_ call: CAPPluginCall) {
|
|
863
1031
|
let feedbackFlow = call.getString("feedbackFlow") ?? "bugreporting"
|
|
864
1032
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
@@ -932,6 +1100,19 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
932
1100
|
notifyEventUpdate(name: "initialized", data: nil)
|
|
933
1101
|
}
|
|
934
1102
|
|
|
1103
|
+
public func configLoaded(_ config: [AnyHashable : Any]) {
|
|
1104
|
+
// Only what the WebView log capture needs: whether network logs are on, and the redaction rules.
|
|
1105
|
+
let logConfig: [String: Any] = [
|
|
1106
|
+
"enableNetworkLogs": (config["enableNetworkLogs"] as? Bool) ?? false,
|
|
1107
|
+
"networkLogPropsToIgnore": (config["networkLogPropsToIgnore"] as? [String]) ?? [],
|
|
1108
|
+
"networkLogBlacklist": (config["networkLogBlacklist"] as? [String]) ?? []
|
|
1109
|
+
]
|
|
1110
|
+
DispatchQueue.main.async {
|
|
1111
|
+
self.lastLogConfig = logConfig
|
|
1112
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
935
1116
|
public func widgetOpened() {
|
|
936
1117
|
notifyEventUpdate(name: "widget-opened", data: nil)
|
|
937
1118
|
}
|
|
@@ -956,7 +1137,9 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
956
1137
|
notifyEventUpdate(name: "outbound-sent", data: data)
|
|
957
1138
|
}
|
|
958
1139
|
|
|
959
|
-
|
|
1140
|
+
// GleapDelegate declares feedbackSendingFailed: with the error data; the SDK never calls a
|
|
1141
|
+
// variant without it.
|
|
1142
|
+
public func feedbackSendingFailed(_ data: [AnyHashable : Any]) {
|
|
960
1143
|
notifyEventUpdate(name: "error-while-sending", data: nil)
|
|
961
1144
|
}
|
|
962
1145
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"homepage": "https://www.gleap.ai",
|
|
3
3
|
"name": "capacitor-gleap-plugin",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "19.0.0",
|
|
5
5
|
"description": "Gleap SDK for Capacitor and Ionic: AI customer support, live chat, in-app bug reporting and customer feedback.",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"android/src/main/",
|
|
12
12
|
"android/build.gradle",
|
|
13
13
|
"dist/",
|
|
14
|
-
"ios/
|
|
14
|
+
"ios/Sources",
|
|
15
|
+
"Package.swift",
|
|
15
16
|
"CapacitorGleapPlugin.podspec"
|
|
16
17
|
],
|
|
17
18
|
"author": "Gleap GmbH",
|
|
@@ -36,9 +37,10 @@
|
|
|
36
37
|
],
|
|
37
38
|
"scripts": {
|
|
38
39
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
39
|
-
"verify:ios": "
|
|
40
|
+
"verify:ios": "xcodebuild build -scheme CapacitorGleapPlugin -destination generic/platform=iOS",
|
|
40
41
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
41
42
|
"verify:web": "npm run build",
|
|
43
|
+
"test": "jest",
|
|
42
44
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
43
45
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
44
46
|
"eslint": "eslint . --ext ts",
|
|
@@ -58,7 +60,10 @@
|
|
|
58
60
|
"@ionic/eslint-config": "^0.4.0",
|
|
59
61
|
"@ionic/prettier-config": "^4.0.0",
|
|
60
62
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
63
|
+
"@swc/core": "^1.16.2",
|
|
64
|
+
"@swc/jest": "^0.2.39",
|
|
61
65
|
"eslint": "^8.57.0",
|
|
66
|
+
"jest": "^30.5.2",
|
|
62
67
|
"prettier": "^3.4.2",
|
|
63
68
|
"prettier-plugin-java": "^2.6.6",
|
|
64
69
|
"rimraf": "^6.0.1",
|
|
@@ -74,6 +79,15 @@
|
|
|
74
79
|
"eslintConfig": {
|
|
75
80
|
"extends": "@ionic/eslint-config/recommended"
|
|
76
81
|
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"testEnvironment": "node",
|
|
84
|
+
"roots": [
|
|
85
|
+
"<rootDir>/src"
|
|
86
|
+
],
|
|
87
|
+
"transform": {
|
|
88
|
+
"^.+\\.ts$": "@swc/jest"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
77
91
|
"capacitor": {
|
|
78
92
|
"ios": {
|
|
79
93
|
"src": "ios"
|
|
@@ -83,6 +97,6 @@
|
|
|
83
97
|
}
|
|
84
98
|
},
|
|
85
99
|
"dependencies": {
|
|
86
|
-
"gleap": "^
|
|
100
|
+
"gleap": "^19.0.0"
|
|
87
101
|
}
|
|
88
102
|
}
|
package/ios/Plugin/GleapPlugin.h
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for Plugin.
|
|
4
|
-
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for Plugin.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
-
|
package/ios/Plugin/GleapPlugin.m
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <Capacitor/Capacitor.h>
|
|
3
|
-
|
|
4
|
-
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
-
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
-
CAP_PLUGIN(GleapPlugin, "Gleap",
|
|
7
|
-
CAP_PLUGIN_METHOD(initialize, CAPPluginReturnPromise);
|
|
8
|
-
CAP_PLUGIN_METHOD(setRegion, CAPPluginReturnPromise);
|
|
9
|
-
CAP_PLUGIN_METHOD(setApiUrl, CAPPluginReturnPromise);
|
|
10
|
-
CAP_PLUGIN_METHOD(setWSApiUrl, CAPPluginReturnPromise);
|
|
11
|
-
CAP_PLUGIN_METHOD(setRealtimeHost, CAPPluginReturnPromise);
|
|
12
|
-
CAP_PLUGIN_METHOD(setFrameUrl, CAPPluginReturnPromise);
|
|
13
|
-
CAP_PLUGIN_METHOD(setBannerUrl, CAPPluginReturnPromise);
|
|
14
|
-
CAP_PLUGIN_METHOD(setModalUrl, CAPPluginReturnPromise);
|
|
15
|
-
CAP_PLUGIN_METHOD(identify, CAPPluginReturnPromise);
|
|
16
|
-
CAP_PLUGIN_METHOD(updateContact, CAPPluginReturnPromise);
|
|
17
|
-
CAP_PLUGIN_METHOD(clearIdentity, CAPPluginReturnPromise);
|
|
18
|
-
CAP_PLUGIN_METHOD(setNetworkLogsBlacklist, CAPPluginReturnPromise);
|
|
19
|
-
CAP_PLUGIN_METHOD(setNetworkLogPropsToIgnore, CAPPluginReturnPromise);
|
|
20
|
-
CAP_PLUGIN_METHOD(setEnvDataPropsToIgnore, CAPPluginReturnPromise);
|
|
21
|
-
CAP_PLUGIN_METHOD(attachCustomData, CAPPluginReturnPromise);
|
|
22
|
-
CAP_PLUGIN_METHOD(setCustomData, CAPPluginReturnPromise);
|
|
23
|
-
CAP_PLUGIN_METHOD(removeCustomData, CAPPluginReturnPromise);
|
|
24
|
-
CAP_PLUGIN_METHOD(clearCustomData, CAPPluginReturnPromise);
|
|
25
|
-
CAP_PLUGIN_METHOD(setTicketAttribute, CAPPluginReturnPromise);
|
|
26
|
-
CAP_PLUGIN_METHOD(unsetTicketAttribute, CAPPluginReturnPromise);
|
|
27
|
-
CAP_PLUGIN_METHOD(clearTicketAttributes, CAPPluginReturnPromise);
|
|
28
|
-
CAP_PLUGIN_METHOD(registerAgentTool, CAPPluginReturnPromise);
|
|
29
|
-
CAP_PLUGIN_METHOD(sendAgentToolResult, CAPPluginReturnPromise);
|
|
30
|
-
CAP_PLUGIN_METHOD(trackEvent, CAPPluginReturnPromise);
|
|
31
|
-
CAP_PLUGIN_METHOD(trackPage, CAPPluginReturnPromise);
|
|
32
|
-
CAP_PLUGIN_METHOD(sendSilentCrashReport, CAPPluginReturnPromise);
|
|
33
|
-
CAP_PLUGIN_METHOD(openChecklists, CAPPluginReturnPromise);
|
|
34
|
-
CAP_PLUGIN_METHOD(openChecklist, CAPPluginReturnPromise);
|
|
35
|
-
CAP_PLUGIN_METHOD(startChecklist, CAPPluginReturnPromise);
|
|
36
|
-
CAP_PLUGIN_METHOD(open, CAPPluginReturnPromise);
|
|
37
|
-
CAP_PLUGIN_METHOD(openNews, CAPPluginReturnPromise);
|
|
38
|
-
CAP_PLUGIN_METHOD(showSurvey, CAPPluginReturnPromise);
|
|
39
|
-
CAP_PLUGIN_METHOD(openNewsArticle, CAPPluginReturnPromise);
|
|
40
|
-
CAP_PLUGIN_METHOD(openHelpCenter, CAPPluginReturnPromise);
|
|
41
|
-
CAP_PLUGIN_METHOD(openHelpCenterArticle, CAPPluginReturnPromise);
|
|
42
|
-
CAP_PLUGIN_METHOD(askAI, CAPPluginReturnPromise);
|
|
43
|
-
CAP_PLUGIN_METHOD(openHelpCenterCollection, CAPPluginReturnPromise);
|
|
44
|
-
CAP_PLUGIN_METHOD(searchHelpCenter, CAPPluginReturnPromise);
|
|
45
|
-
CAP_PLUGIN_METHOD(openFeatureRequests, CAPPluginReturnPromise);
|
|
46
|
-
CAP_PLUGIN_METHOD(close, CAPPluginReturnPromise);
|
|
47
|
-
CAP_PLUGIN_METHOD(isOpened, CAPPluginReturnPromise);
|
|
48
|
-
CAP_PLUGIN_METHOD(showFeedbackButton, CAPPluginReturnPromise);
|
|
49
|
-
CAP_PLUGIN_METHOD(enableDebugConsoleLog, CAPPluginReturnPromise);
|
|
50
|
-
CAP_PLUGIN_METHOD(log, CAPPluginReturnPromise);
|
|
51
|
-
CAP_PLUGIN_METHOD(disableConsoleLogOverwrite, CAPPluginReturnPromise);
|
|
52
|
-
CAP_PLUGIN_METHOD(startFeedbackFlow, CAPPluginReturnPromise);
|
|
53
|
-
CAP_PLUGIN_METHOD(startBot, CAPPluginReturnPromise);
|
|
54
|
-
CAP_PLUGIN_METHOD(setLanguage, CAPPluginReturnPromise);
|
|
55
|
-
CAP_PLUGIN_METHOD(setEventCallback, CAPPluginReturnCallback);
|
|
56
|
-
CAP_PLUGIN_METHOD(preFillForm, CAPPluginReturnPromise);
|
|
57
|
-
CAP_PLUGIN_METHOD(addAttachment, CAPPluginReturnPromise);
|
|
58
|
-
CAP_PLUGIN_METHOD(removeAllAttachments, CAPPluginReturnPromise);
|
|
59
|
-
CAP_PLUGIN_METHOD(getIdentity, CAPPluginReturnPromise);
|
|
60
|
-
CAP_PLUGIN_METHOD(isUserIdentified, CAPPluginReturnPromise);
|
|
61
|
-
CAP_PLUGIN_METHOD(setTags, CAPPluginReturnPromise);
|
|
62
|
-
CAP_PLUGIN_METHOD(setDisableInAppNotifications, CAPPluginReturnPromise);
|
|
63
|
-
CAP_PLUGIN_METHOD(setDisableEnvData, CAPPluginReturnPromise);
|
|
64
|
-
CAP_PLUGIN_METHOD(startClassicForm, CAPPluginReturnPromise);
|
|
65
|
-
CAP_PLUGIN_METHOD(startConversation, CAPPluginReturnPromise);
|
|
66
|
-
CAP_PLUGIN_METHOD(openConversations, CAPPluginReturnPromise);
|
|
67
|
-
CAP_PLUGIN_METHOD(setNotificationContainerOffset, CAPPluginReturnPromise);
|
|
68
|
-
)
|
package/ios/Plugin/Info.plist
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|