Skip to content

Commit c25d053

Browse files
committed
v7.0.3
1 parent b8eb2b4 commit c25d053

12 files changed

+60
-104
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ setTimeout(() => {
4444
console.warn("Demo warning :)");
4545
console.log("Data will be loaded soon.");
4646

47-
xxx();
47+
// xxx();
4848
}, 4000);
4949

5050
const files = [

index.d.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,11 @@ export namespace Gleap {
22
function initialize(
33
sdkKey: string
44
): void;
5-
/**
6-
* @deprecated Please use sendSilentReport instead.
7-
*/
8-
function sendSilentBugReport(
9-
description: string,
10-
priority: "LOW" | "MEDIUM" | "HIGH"
11-
): void;
12-
function sendSilentBugReportWithType(
13-
description: string,
14-
priority: "LOW" | "MEDIUM" | "HIGH",
15-
type: string
16-
): void;
17-
function sendSilentReport(
5+
function sendSilentCrashReport(
186
formData: {
197
[key: string]: string;
208
},
219
priority?: "LOW" | "MEDIUM" | "HIGH",
22-
feedbackType?: string,
2310
excludeData?: {
2411
customData: Boolean;
2512
metaData: Boolean;
@@ -43,7 +30,6 @@ export namespace Gleap {
4330
function logEvent(name: string, data?: any): void;
4431
function setAppBuildNumber(buildNumber: string): void;
4532
function setAppVersionCode(versionCode: string): void;
46-
function attachNetworkLogs(externalConsoleLogs: any[]): void;
4733
function setStyles(styles: {
4834
primaryColor: string;
4935
headerColor: string;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "7.0.2",
3+
"version": "7.0.3",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gleap.js

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ class Gleap {
7070
}
7171
}
7272

73-
/**
74-
* Attaches external network logs that get merged with the internal network logs.
75-
* @param {*} externalConsoleLogs
76-
*/
77-
static attachNetworkLogs(externalConsoleLogs) {
78-
GleapNetworkIntercepter.getInstance().externalConsoleLogs =
79-
externalConsoleLogs;
80-
}
81-
8273
/**
8374
* Active the Gleap offline mode.
8475
* @param {*} offlineMode
@@ -228,13 +219,6 @@ class Gleap {
228219
GleapFeedbackButtonManager.getInstance().toggleFeedbackButton(show);
229220
}
230221

231-
/**
232-
* Enables the network logger.
233-
*/
234-
static setNetworkLogFilters(filters) {
235-
GleapNetworkIntercepter.getInstance().setFilters(filters);
236-
}
237-
238222
/**
239223
* Sets the app version code.
240224
* @param {string} appVersionCode
@@ -359,54 +343,15 @@ class Gleap {
359343
}
360344
}
361345

362-
/**
363-
* Reports a bug silently
364-
* @param {*} description
365-
* @param {*} priority
366-
* @param {*} type
367-
* @deprecated Please use sendSilentReport instead.
368-
*/
369-
static sendSilentBugReportWithType(
370-
description,
371-
priority = "MEDIUM",
372-
type = "BUG"
373-
) {
374-
return Gleap.sendSilentReport(
375-
{
376-
description: description,
377-
},
378-
priority,
379-
type
380-
);
381-
}
382-
383-
/**
384-
* Reports a bug silently
385-
* @param {*} description
386-
* @param {*} priority
387-
* @deprecated Please use sendSilentReport instead.
388-
*/
389-
static sendSilentBugReport(description, priority = "MEDIUM") {
390-
return Gleap.sendSilentReport(
391-
{
392-
description: description,
393-
},
394-
priority,
395-
"BUG"
396-
);
397-
}
398-
399346
/**
400347
* Sends a silent feedback report
401348
* @param {*} formData
402349
* @param {*} priority
403-
* @param {*} feedbackType
404350
* @param {*} excludeData
405351
*/
406-
static sendSilentReport(
352+
static sendSilentCrashReport(
407353
formData,
408354
priority = "MEDIUM",
409-
feedbackType = "BUG",
410355
excludeData = {}
411356
) {
412357
const sessionInstance = GleapSession.getInstance();
@@ -420,7 +365,7 @@ class Gleap {
420365
}
421366

422367
GleapEventManager.notifyEvent("sending-silent-report");
423-
const feedback = new GleapFeedback(feedbackType, priority, newFormData, true, excludeData ? excludeData : {});
368+
const feedback = new GleapFeedback("CRASH", priority, newFormData, true, excludeData ? excludeData : {});
424369
feedback.sendFeedback().then(() => {
425370
GleapEventManager.notifyEvent("silent-report-sent");
426371
}).catch((error) => {

src/GleapConfigManager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ export default class GleapConfigManager {
119119
GleapNetworkIntercepter.getInstance().setFilters(flowConfig.networkLogPropsToIgnore);
120120
}
121121

122+
if (flowConfig.networkLogBlacklist) {
123+
GleapNetworkIntercepter.getInstance().setBlacklist(flowConfig.networkLogBlacklist);
124+
}
125+
122126
if (flowConfig.customTranslations) {
123127
GleapTranslationManager.getInstance().setCustomTranslation(flowConfig.customTranslations);
124128
}

src/GleapCrashDetector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class GleapCrashDetector {
3030
const flowConfig = GleapConfigManager.getInstance().getFlowConfig();
3131
if (flowConfig && typeof flowConfig.enableCrashDetector !== "undefined" && flowConfig.enableCrashDetector) {
3232
if (flowConfig.crashDetectorIsSilent) {
33-
Gleap.sendSilentReport(
33+
Gleap.sendSilentCrashReport(
3434
{
3535
errorMessage: message,
3636
url: filename,
@@ -39,7 +39,6 @@ export default class GleapCrashDetector {
3939
stackTrace: stackTrace,
4040
},
4141
"MEDIUM",
42-
"CRASH",
4342
{
4443
screenshot: true,
4544
replays: true,

src/GleapFeedback.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ export default class GleapFeedback {
1717
screenshotData = undefined;
1818
webReplay = undefined;
1919
screenRecordingUrl = undefined;
20+
spamToken = undefined;
2021

21-
constructor(type, priority, formData, isSilent, excludeData, outboundId) {
22+
constructor(type, priority, formData, isSilent, excludeData, outboundId, spamToken) {
2223
this.type = type;
2324
this.priority = priority;
2425
this.formData = formData;
2526
this.isSilent = isSilent;
2627
this.excludeData = excludeData;
2728
this.outboundId = outboundId;
29+
this.spamToken = spamToken;
2830
}
2931

3032
takeSnapshot() {
@@ -84,7 +86,8 @@ export default class GleapFeedback {
8486
outbound: this.outboundId,
8587
screenshotData: this.screenshotData,
8688
webReplay: this.webReplay,
87-
screenRecordingUrl: this.screenRecordingUrl
89+
screenRecordingUrl: this.screenRecordingUrl,
90+
spamToken: this.spamToken,
8891
};
8992

9093
const keysToExclude = Object.keys(this.excludeData);
@@ -112,7 +115,7 @@ export default class GleapFeedback {
112115
const dataToSend = this.getData();
113116

114117
const http = new XMLHttpRequest();
115-
http.open("POST", GleapSession.getInstance().apiUrl + "/bugs");
118+
http.open("POST", GleapSession.getInstance().apiUrl + "/bugs/v2");
116119
http.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
117120
GleapSession.getInstance().injectSession(http);
118121
http.onerror = (error) => {

src/GleapFrameManager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ export default class GleapFrameManager {
228228
const formData = data.data.formData;
229229
const action = data.data.action;
230230
const outboundId = data.data.outboundId;
231+
const spamToken = data.data.spamToken;
231232

232-
const feedback = new GleapFeedback(action.feedbackType, "MEDIUM", formData, false, action.excludeData, outboundId);
233+
const feedback = new GleapFeedback(action.feedbackType, "MEDIUM", formData, false, action.excludeData, outboundId, spamToken);
233234
feedback.sendFeedback().then(() => {
234235
this.sendMessage({
235236
name: "feedback-sent"

0 commit comments

Comments
 (0)