Socket
Socket
Sign inDemoInstall

instabug-cordova

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instabug-cordova - npm Package Compare versions

Comparing version 11.0.1 to 11.2.0

src/modules/ArgsRegistry.ts

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 11.2.0 (2022-09-25)
* Bumps Instabug Android SDK to v11.4.1
* Bumps Instabug iOS SDK to v11.2.0
* Adds TypeScript support
## v11.0.1 (2022-08-24)

@@ -2,0 +8,0 @@

13

package.json
{
"name": "instabug-cordova",
"description": "Cordova plugin for integrating the Instabug SDK.",
"version": "11.0.1",
"version": "11.2.0",
"author": "Instabug (https://instabug.com)",

@@ -11,2 +11,3 @@ "repository": "github:Instabug/Instabug-Cordova",

"main": "www/index.js",
"types": "www/index.d.ts",
"keywords": [

@@ -22,3 +23,11 @@ "ecosystem:cordova",

"logging"
]
],
"scripts": {
"build": "tsc",
"prepack": "yarn build"
},
"devDependencies": {
"@types/cordova": "^0.0.34",
"typescript": "^4.8.2"
}
}

222

www/ArgsRegistry.js

@@ -1,96 +0,126 @@

module.exports.position = {
topLeft: "topLeft",
topRight: "topRight",
bottomLeft: "bottomLeft",
bottomRight: "bottomRight",
};
module.exports.welcomeMessageMode = {
live: "welcomeMessageModeLive",
beta: "welcomeMessageModeBeta",
disabled: "welcomeMessageModeDisabled",
};
module.exports.floatingButtonEdge = {
left: "left",
right: "right",
};
module.exports.colorTheme = {
light: "light",
dark: "dark",
};
module.exports.strings = {
shakeHint: "shakeHint",
swipeHint: "swipeHint",
edgeSwipeStartHint: "edgeSwipeStartHint",
startAlertText: "startAlertText",
invalidEmailMessage: "invalidEmailMessage",
invalidEmailTitle: "invalidEmailTitle",
invalidCommentMessage: "invalidCommentMessage",
invalidCommentTitle: "invalidCommentTitle",
invocationHeader: "invocationHeader",
reportQuestion: "reportQuestion",
reportBug: "reportBug",
reportFeedback: "reportFeedback",
emailFieldHint: "emailFieldHint",
commentFieldHintForBugReport: "commentFieldHintForBugReport",
commentFieldHintForFeedback: "commentFieldHintForFeedback",
commentFieldHintForQuestion: "commentFieldHintForQuestion",
videoPressRecord: "videoPressRecord",
addVideoMessage: "addVideoMessage",
addVoiceMessage: "addVoiceMessage",
addImageFromGallery: "addImageFromGallery",
addExtraScreenshot: "addExtraScreenshot",
audioRecordingPermissionDeniedTitle: "audioRecordingPermissionDeniedTitle",
audioRecordingPermissionDeniedMessage:
"audioRecordingPermissionDeniedMessage",
microphonePermissionAlertSettingsButtonText:
"microphonePermissionAlertSettingsButtonTitle",
recordingMessageToHoldText: "recordingMessageToHoldText",
recordingMessageToReleaseText: "recordingMessageToReleaseText",
conversationsHeaderTitle: "conversationsHeaderTitle",
screenshotHeaderTitle: "screenshotHeaderTitle",
doneButtonText: "doneButtonText",
okButtonText: "okButtonTitle",
cancelButtonText: "cancelButtonTitle",
thankYouText: "thankYouText",
audio: "audio",
video: "video",
image: "image",
team: "team",
messagesNotification: "messagesNotification",
messagesNotificationAndOthers: "messagesNotificationAndOthers",
conversationTextFieldHint: "conversationTextFieldHint",
collectingDataText: "collectingDataText",
thankYouAlertText: "thankYouAlertText",
welcomeMessageBetaWelcomeStepTitle: "welcomeMessageBetaWelcomeStepTitle",
welcomeMessageBetaWelcomeStepContent: "welcomeMessageBetaWelcomeStepContent",
welcomeMessageBetaHowToReportStepTitle:
"welcomeMessageBetaHowToReportStepTitle",
welcomeMessageBetaHowToReportStepContent:
"welcomeMessageBetaHowToReportStepContent",
welcomeMessageBetaFinishStepTitle: "welcomeMessageBetaFinishStepTitle",
welcomeMessageBetaFinishStepContent: "welcomeMessageBetaFinishStepContent",
welcomeMessageLiveWelcomeStepTitle: "welcomeMessageLiveWelcomeStepTitle",
welcomeMessageLiveWelcomeStepContent: "welcomeMessageLiveWelcomeStepContent",
surveysStoreRatingThanksTitle: "surveysStoreRatingThanksTitle",
surveysStoreRatingThanksSubtitle: "surveysStoreRatingThanksSubtitle",
reportBugDescription: "reportBugDescription",
reportFeedbackDescription: "reportFeedbackDescription",
reportQuestionDescription: "reportQuestionDescription",
requestFeatureDescription: "requestFeatureDescription",
discardAlertTitle: "discardAlertTitle",
discardAlertMessage: "discardAlertMessage",
discardAlertCancel: "discardAlertCancel",
discardAlertAction: "discardAlertAction",
addAttachmentButtonTitleStringName: "addAttachmentButtonTitleStringName",
reportReproStepsDisclaimerBody: "reportReproStepsDisclaimerBody",
reportReproStepsDisclaimerLink: "reportReproStepsDisclaimerLink",
reproStepsProgressDialogBody: "reproStepsProgressDialogBody",
reproStepsListHeader: "reproStepsListHeader",
reproStepsListDescription: "reproStepsListDescription",
reproStepsListEmptyStateDescription: "reproStepsListEmptyStateDescription",
reproStepsListItemTitle: "reproStepsListItemTitle",
};
"use strict";
var ArgsRegistry;
(function (ArgsRegistry) {
var position;
(function (position) {
position["topLeft"] = "topLeft";
position["topRight"] = "topRight";
position["bottomLeft"] = "bottomLeft";
position["bottomRight"] = "bottomRight";
})(position = ArgsRegistry.position || (ArgsRegistry.position = {}));
var welcomeMessageMode;
(function (welcomeMessageMode) {
welcomeMessageMode["live"] = "welcomeMessageModeLive";
welcomeMessageMode["beta"] = "welcomeMessageModeBeta";
welcomeMessageMode["disabled"] = "welcomeMessageModeDisabled";
})(welcomeMessageMode = ArgsRegistry.welcomeMessageMode || (ArgsRegistry.welcomeMessageMode = {}));
var floatingButtonEdge;
(function (floatingButtonEdge) {
floatingButtonEdge["left"] = "left";
floatingButtonEdge["right"] = "right";
})(floatingButtonEdge = ArgsRegistry.floatingButtonEdge || (ArgsRegistry.floatingButtonEdge = {}));
var colorTheme;
(function (colorTheme) {
colorTheme["light"] = "light";
colorTheme["dark"] = "dark";
})(colorTheme = ArgsRegistry.colorTheme || (ArgsRegistry.colorTheme = {}));
var strings;
(function (strings) {
strings["shakeHint"] = "shakeHint";
strings["swipeHint"] = "swipeHint";
strings["edgeSwipeStartHint"] = "edgeSwipeStartHint";
strings["startAlertText"] = "startAlertText";
strings["invalidEmailMessage"] = "invalidEmailMessage";
strings["invalidEmailTitle"] = "invalidEmailTitle";
strings["invalidCommentMessage"] = "invalidCommentMessage";
strings["invalidCommentTitle"] = "invalidCommentTitle";
strings["invocationHeader"] = "invocationHeader";
strings["reportQuestion"] = "reportQuestion";
strings["reportBug"] = "reportBug";
strings["reportFeedback"] = "reportFeedback";
strings["emailFieldHint"] = "emailFieldHint";
strings["commentFieldHintForBugReport"] = "commentFieldHintForBugReport";
strings["commentFieldHintForFeedback"] = "commentFieldHintForFeedback";
strings["commentFieldHintForQuestion"] = "commentFieldHintForQuestion";
strings["videoPressRecord"] = "videoPressRecord";
strings["addVideoMessage"] = "addVideoMessage";
strings["addVoiceMessage"] = "addVoiceMessage";
strings["addImageFromGallery"] = "addImageFromGallery";
strings["addExtraScreenshot"] = "addExtraScreenshot";
strings["audioRecordingPermissionDeniedTitle"] = "audioRecordingPermissionDeniedTitle";
strings["audioRecordingPermissionDeniedMessage"] = "audioRecordingPermissionDeniedMessage";
strings["microphonePermissionAlertSettingsButtonText"] = "microphonePermissionAlertSettingsButtonTitle";
strings["recordingMessageToHoldText"] = "recordingMessageToHoldText";
strings["recordingMessageToReleaseText"] = "recordingMessageToReleaseText";
strings["conversationsHeaderTitle"] = "conversationsHeaderTitle";
strings["screenshotHeaderTitle"] = "screenshotHeaderTitle";
strings["doneButtonText"] = "doneButtonText";
strings["okButtonText"] = "okButtonTitle";
strings["cancelButtonText"] = "cancelButtonTitle";
strings["thankYouText"] = "thankYouText";
strings["audio"] = "audio";
strings["video"] = "video";
strings["image"] = "image";
strings["team"] = "team";
strings["messagesNotification"] = "messagesNotification";
strings["messagesNotificationAndOthers"] = "messagesNotificationAndOthers";
strings["conversationTextFieldHint"] = "conversationTextFieldHint";
strings["collectingDataText"] = "collectingDataText";
strings["thankYouAlertText"] = "thankYouAlertText";
strings["welcomeMessageBetaWelcomeStepTitle"] = "welcomeMessageBetaWelcomeStepTitle";
strings["welcomeMessageBetaWelcomeStepContent"] = "welcomeMessageBetaWelcomeStepContent";
strings["welcomeMessageBetaHowToReportStepTitle"] = "welcomeMessageBetaHowToReportStepTitle";
strings["welcomeMessageBetaHowToReportStepContent"] = "welcomeMessageBetaHowToReportStepContent";
strings["welcomeMessageBetaFinishStepTitle"] = "welcomeMessageBetaFinishStepTitle";
strings["welcomeMessageBetaFinishStepContent"] = "welcomeMessageBetaFinishStepContent";
strings["welcomeMessageLiveWelcomeStepTitle"] = "welcomeMessageLiveWelcomeStepTitle";
strings["welcomeMessageLiveWelcomeStepContent"] = "welcomeMessageLiveWelcomeStepContent";
strings["surveysStoreRatingThanksTitle"] = "surveysStoreRatingThanksTitle";
strings["surveysStoreRatingThanksSubtitle"] = "surveysStoreRatingThanksSubtitle";
strings["reportBugDescription"] = "reportBugDescription";
strings["reportFeedbackDescription"] = "reportFeedbackDescription";
strings["reportQuestionDescription"] = "reportQuestionDescription";
strings["requestFeatureDescription"] = "requestFeatureDescription";
strings["discardAlertTitle"] = "discardAlertTitle";
strings["discardAlertMessage"] = "discardAlertMessage";
strings["discardAlertCancel"] = "discardAlertCancel";
strings["discardAlertAction"] = "discardAlertAction";
strings["addAttachmentButtonTitleStringName"] = "addAttachmentButtonTitleStringName";
strings["reportReproStepsDisclaimerBody"] = "reportReproStepsDisclaimerBody";
strings["reportReproStepsDisclaimerLink"] = "reportReproStepsDisclaimerLink";
strings["reproStepsProgressDialogBody"] = "reproStepsProgressDialogBody";
strings["reproStepsListHeader"] = "reproStepsListHeader";
strings["reproStepsListDescription"] = "reproStepsListDescription";
strings["reproStepsListEmptyStateDescription"] = "reproStepsListEmptyStateDescription";
strings["reproStepsListItemTitle"] = "reproStepsListItemTitle";
})(strings = ArgsRegistry.strings || (ArgsRegistry.strings = {}));
var reproStepsMode;
(function (reproStepsMode) {
reproStepsMode["enabled"] = "enabled";
reproStepsMode["disabled"] = "disabled";
reproStepsMode["enabledWithNoScreenshots"] = "enabledWithNoScreenshots";
})(reproStepsMode = ArgsRegistry.reproStepsMode || (ArgsRegistry.reproStepsMode = {}));
var locale;
(function (locale) {
locale["arabic"] = "arabic";
locale["azerbaijani"] = "azerbaijani";
locale["chineseSimplified"] = "chineseSimplified";
locale["chineseTraditional"] = "chineseTraditional";
locale["danish"] = "danish";
locale["dutch"] = "dutch";
locale["english"] = "english";
locale["french"] = "french";
locale["german"] = "german";
locale["italian"] = "italian";
locale["japanese"] = "japanese";
locale["korean"] = "korean";
locale["polish"] = "polish";
locale["portugueseBrazil"] = "portugueseBrazil";
locale["russian"] = "russian";
locale["spanish"] = "spanish";
locale["swedish"] = "swedish";
locale["turkish"] = "turkish";
locale["czech"] = "czech";
})(locale = ArgsRegistry.locale || (ArgsRegistry.locale = {}));
})(ArgsRegistry || (ArgsRegistry = {}));
module.exports = ArgsRegistry;

@@ -0,310 +1,184 @@

"use strict";
/*
* Instabug Bug Reporting module.
* @file bugReporting.js
*/
var exec = require('cordova/exec');
var registry = require("./ArgsRegistry");
/**
* The event used to invoke the feedback form
* @readonly
* @enum {string} InvocationEvent
*/
var getInvocationEvents = function() {
return {
shake: 'shake',
button: 'button',
screenshot: 'screenshot',
swipe: 'swipe',
none: 'none'
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
/**
* The options used upon invoking the SDK
* @readonly
* @enum {string} InvocationOption
*/
var getOptions = function() {
return {
emailFieldHidden: 'emailFieldHidden',
emailFieldOptional: 'emailFieldOptional',
commentFieldRequired: 'commentFieldRequired',
disablePostSendingDialog: 'disablePostSendingDialog'
};
};
/**
* The extended bug report mode.
* @readonly
* @enum {string} ExtendedBugReportMode
*/
var getExtendedBugReportMode = function() {
return {
enabledWithRequiredFields: 'enabledWithRequiredFields',
enabledWithOptionalFields: 'enabledWithOptionalFields',
disabled: 'disabled'
};
};
var getReportType = function() {
return {
bug: 'bug',
feedback: 'feedback',
question: 'question'
};
};
/**
* BugReporting module
* @exports BugReporting
*/
var BugReporting = function() {};
BugReporting.invocationEvents = getInvocationEvents();
BugReporting.option = getOptions();
BugReporting.extendedBugReportMode = getExtendedBugReportMode();
BugReporting.reportType = getReportType();
BugReporting.position = registry.position;
/**
* Enables or disables all bug reporting functionalities.
* @param {boolean} isEnabled
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
BugReporting.setEnabled = function(isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setBugReportingEnabled', [isEnabled]);
};
/**
* Sets report type either bug, feedback or both.
* @param {enum} reportType Array of reportType
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
BugReporting.setReportTypes = function(reportTypes, success, error) {
var validatedTypes = [];
for (var i = 0; i < reportTypes.length; i++) {
var validatedType = getReportType()[reportTypes[i]];
if (validatedType) {
validatedTypes.push(validatedType);
}
}
if (validatedTypes !== undefined || validatedTypes.length != 0) {
exec(success, error, 'IBGPlugin', 'setReportTypes', [reportTypes]);
}
};
/**
* Shows report view with specified options.
* @param {enum} reportType reportType
* @param {array} options array of Invocation options
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
BugReporting.showWithOptions = function(reportType, options, success, error) {
if (reportType && options) {
exec(
success,
error,
'IBGPlugin',
'showBugReportingWithReportTypeAndOptions',
[reportType, options]
);
}
};
/**
* Sets the invocation options.
* Default is set by `Instabug.start`.
* @param {enum} options Array of Option
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
BugReporting.setOptions = function(options, success, error) {
var i;
var validatedOptions = [];
for (i = 0; i < options.length; i++) {
var validatedOption = getOptions()[options[i]];
if (validatedOption) {
validatedOptions.push(validatedOption);
}
}
if (validatedOptions !== undefined || validatedOptions.length != 0) {
exec(success, error, 'IBGPlugin', 'setInvocationOptions', [
validatedOptions
]);
} else {
console.log(
'Could not change invocation option - "' +
validatedOptions +
'" is empty.'
);
}
}
/**
* Sets a block of code to be executed just before the SDK's UI is presented.
* This block is executed on the UI thread. Could be used for performing any
* UI changes before the SDK's UI is shown.
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
BugReporting.setOnInvokeHandler = function(success, error) {
exec(success, error, 'IBGPlugin', 'setPreInvocationHandler', []);
};
/**
* Sets a block of code to be executed right after the SDK's UI is dismissed.
* This block is executed on the UI thread. Could be used for performing any
* UI changes after the SDK's UI is dismissed.
* @param {function(Object):void} success callback on function success; param includes dismissType and reportType
* @param {function(void):void} error callback on function error
*/
BugReporting.setOnDismissHandler = function(success, error) {
exec(success, error, 'IBGPlugin', 'setPostInvocationHandler', []);
};
/**
* Sets the events that will invoke the SDK.
* @param {enum} events Array of InvocationEvent
* @param {function(void):void} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setInvocationEvents = function(events, success, error) {
var i;
var validatedEvents = [];
for (i = 0; i < events.length; i++) {
var validatedEvent = getInvocationEvents()[events[i]];
if (validatedEvent) {
validatedEvents.push(validatedEvent);
}
}
if (validatedEvents !== undefined || validatedEvents.length != 0) {
exec(success, error, 'IBGPlugin', 'setInvocationEvents', [validatedEvents]);
} else {
console.log(
'Could not change invocation event - "' + event + '" is not valid.'
);
}
};
/**
* Sets enabled types of attachments for bug reporting.
* @param {boolean} screenshot
* @param {boolean} extraScreenshot
* @param {boolean} galleryImage
* @param {boolean} screenRecording
* @param {function(void):void} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setEnabledAttachmentTypes = function(
screenshot,
extraScreenshot,
galleryImage,
screenRecording,
success,
error
) {
exec(success, error, 'IBGPlugin', 'setAttachmentTypesEnabled', [
screenshot,
extraScreenshot,
galleryImage,
screenRecording
]);
};
/**
*
* @param {enum} extendedBugReportMode ExtendedBugReportMode
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setExtendedBugReportMode = function(
extendedBugReportMode,
success,
error
) {
var validatedExtendedBugReportMode = getExtendedBugReportMode()[
extendedBugReportMode
];
if (validatedExtendedBugReportMode) {
exec(success, error, 'IBGPlugin', 'setExtendedBugReportMode', [
validatedExtendedBugReportMode
]);
} else {
console.log(
'Could not set extended bug report mode - "' +
validatedExtendedBugReportMode +
'" is not valid.'
);
}
};
/**
* Sets the default edge and offset from the top at which the floating button
* will be shown. Different orientations are already handled.
*
* @param {keyof Instabug.floatingButtonEdge} edge - The position of the edge, the default is right.
* @param {number} offset From the top edge, default is left.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setFloatingButtonEdge = function(edge, offset, success, error) {
exec(success, error, 'IBGPlugin', 'setFloatingButtonEdge', [edge, offset]);
};
/**
* Sets the threshold value of the shake gesture for iPhone/iPod Touch
* Default for iPhone is 2.5.
* @param {number} threshold Threshold for iPhone.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setShakingThresholdForiPhone = function(threshold, success, error) {
exec(success, error, 'IBGPlugin', 'setShakingThresholdForiPhone', [threshold]);
};
/**
* Sets the threshold value of the shake gesture for iPad.
* Default for iPad is 0.6.
* @param {number} threshold Threshold for iPad.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setShakingThresholdForiPad = function(threshold, success, error) {
exec(success, error, 'IBGPlugin', 'setShakingThresholdForiPad', [threshold]);
};
/**
* Sets the threshold value of the shake gesture for android devices.
* Default for android is an integer value equals 350.
* you could increase the shaking difficulty level by
* increasing the `350` value and vice versa
* @param {number} threshold Threshold for android devices.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setShakingThresholdForAndroid = function(threshold, success, error) {
exec(success, error, 'IBGPlugin', 'setShakingThreshold', [threshold]);
};
/**
* Sets the default position at which the Instabug screen recording button will be shown.
* Different orientations are already handled.
* (Default for `position` is `bottomRight`)
*
* @param {keyof BugReporting.position} position is of type position `topLeft`
* to show on the top left of screen, or `bottomRight` to show on the bottom right of screen.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
BugReporting.setVideoRecordingFloatingButtonPosition = function (position, success, error) {
exec(success, error, 'IBGPlugin', 'setVideoRecordingFloatingButtonPosition', [position]);
};
var IBGCordova_1 = require("./IBGCordova");
var ArgsRegistry_1 = __importDefault(require("./ArgsRegistry"));
var BugReporting;
(function (BugReporting) {
var reportType;
(function (reportType) {
reportType["bug"] = "bug";
reportType["feedback"] = "feedback";
reportType["question"] = "question";
})(reportType = BugReporting.reportType || (BugReporting.reportType = {}));
var option;
(function (option) {
option["emailFieldHidden"] = "emailFieldHidden";
option["emailFieldOptional"] = "emailFieldOptional";
option["commentFieldRequired"] = "commentFieldRequired";
option["disablePostSendingDialog"] = "disablePostSendingDialog";
})(option = BugReporting.option || (BugReporting.option = {}));
var invocationEvents;
(function (invocationEvents) {
invocationEvents["shake"] = "shake";
invocationEvents["button"] = "button";
invocationEvents["screenshot"] = "screenshot";
invocationEvents["swipe"] = "swipe";
invocationEvents["none"] = "none";
})(invocationEvents = BugReporting.invocationEvents || (BugReporting.invocationEvents = {}));
var extendedBugReportMode;
(function (extendedBugReportMode) {
extendedBugReportMode["enabledWithRequiredFields"] = "enabledWithRequiredFields";
extendedBugReportMode["enabledWithOptionalFields"] = "enabledWithOptionalFields";
extendedBugReportMode["disabled"] = "disabled";
})(extendedBugReportMode = BugReporting.extendedBugReportMode || (BugReporting.extendedBugReportMode = {}));
BugReporting.position = ArgsRegistry_1.default.position;
/**
* Enables or disables all bug reporting functionalities.
* @param isEnabled a boolean to enable or disable the feature.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setEnabled = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setBugReportingEnabled", [isEnabled], success, error);
};
/**
* Sets report type either bug, feedback or both.
* @param reportTypes an array of reportType.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setReportTypes = function (reportTypes, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setReportTypes", [reportTypes], success, error);
};
/**
* Shows report view with specified options.
* @param reportType an enum of reportType.
* @param options an array of invocation option.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.showWithOptions = function (reportType, options, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showBugReportingWithReportTypeAndOptions", [reportType, options], success, error);
};
/**
* Sets the invocation options.
* Default is set by `Instabug.start`.
* @param options an array of invocation option.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setOptions = function (options, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setInvocationOptions", [options], success, error);
};
/**
* Sets a block of code to be executed just before the SDK's UI is presented.
* This block is executed on the UI thread. Could be used for performing any
* UI changes before the SDK's UI is shown.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setOnInvokeHandler = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setPreInvocationHandler", [], success, error);
};
/**
* Sets a block of code to be executed right after the SDK's UI is dismissed.
* This block is executed on the UI thread. Could be used for performing any
* UI changes after the SDK's UI is dismissed.
* @param success callback on function success; param includes reportType and dismissType.
* @param error callback on function error.
*/
BugReporting.setOnDismissHandler = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setPostInvocationHandler", [], success, error);
};
/**
* Sets the events that will invoke the SDK.
* @param events an array of invocationEvents.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setInvocationEvents = function (events, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setInvocationEvents", [events], success, error);
};
/**
* Sets enabled types of attachments for bug reporting.
* @param screenshot a boolean to enable/disable screenshot attachment.
* @param extraScreenshot a boolean to enable/disable extra screenshot attachment.
* @param galleryImage a boolean to enable/disable gallery image attachment.
* @param screenRecording a boolean to enable/disable screen recording attachment.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setEnabledAttachmentTypes = function (screenshot, extraScreenshot, galleryImage, screenRecording, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setAttachmentTypesEnabled", [screenshot, extraScreenshot, galleryImage, screenRecording], success, error);
};
/**
*
* @param extendedBugReportMode an enum of extendedBugReportMode.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setExtendedBugReportMode = function (extendedBugReportMode, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setExtendedBugReportMode", [extendedBugReportMode], success, error);
};
/**
* Sets the default edge and offset from the top at which the floating button
* will be shown. Different orientations are already handled.
* @param edge the position of the edge; the default is right.
* @param offset the offset value from the top edge.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setFloatingButtonEdge = function (edge, offset, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setFloatingButtonEdge", [edge, offset], success, error);
};
/**
* Sets the threshold value of the shake gesture for iPhone/iPod Touch
* Default for iPhone is 2.5.
* @param threshold the shaking threshold for iPhone.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setShakingThresholdForiPhone = function (threshold, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setShakingThresholdForiPhone", [threshold], success, error);
};
/**
* Sets the threshold value of the shake gesture for iPad.
* Default for iPad is 0.6.
* @param threshold the shaking threshold for iPad.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setShakingThresholdForiPad = function (threshold, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setShakingThresholdForiPad", [threshold], success, error);
};
/**
* Sets the threshold value of the shake gesture for android devices.
* Default for android is an integer value equals 350.
* you could increase the shaking difficulty level by
* increasing the `350` value and vice versa
* @param threshold the shaking threshold for android devices.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setShakingThresholdForAndroid = function (threshold, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setShakingThreshold", [threshold], success, error);
};
/**
* Sets the default position at which the Instabug screen recording button will be shown.
* Different orientations are already handled.
* (Default for `position` is `bottomRight`)
*
* @param position an enum of position to control the video recording button position on the screen.
* @param success callback on function success.
* @param error callback on function error.
*/
BugReporting.setVideoRecordingFloatingButtonPosition = function (position, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setVideoRecordingFloatingButtonPosition", [position], success, error);
};
})(BugReporting || (BugReporting = {}));
module.exports = BugReporting;

@@ -0,63 +1,34 @@

"use strict";
/*
* Instabug Feature Requests module.
* @file featureRequests.js
*/
var exec = require('cordova/exec');
/**
* Types of actions on feature requests.
* @readonly
* @enum {string}
*/
var getActionTypes = function () {
return {
requestNewFeature: 'requestNewFeature',
addCommentToFeature: 'addCommentToFeature'
var IBGCordova_1 = require("./IBGCordova");
var FeatureRequests;
(function (FeatureRequests) {
var actionTypes;
(function (actionTypes) {
actionTypes["requestNewFeature"] = "requestNewFeature";
actionTypes["addCommentToFeature"] = "addCommentToFeature";
})(actionTypes = FeatureRequests.actionTypes || (FeatureRequests.actionTypes = {}));
/**
* Shows the UI for feature requests list.
* @param success callback on function success.
* @param error callback on function error.
*/
FeatureRequests.show = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showFeatureRequests", [], success, error);
};
};
/**
* FeatureRequests module
* @exports FeatureRequests
*/
var FeatureRequests = function() {};
FeatureRequests.actionTypes = getActionTypes();
/**
* Shows the UI for feature requests list.
* @param {function(void):void} success
* @param {function(void):void} error
*/
FeatureRequests.show = function (success, error) {
exec(success, error, 'IBGPlugin', 'showFeatureRequests', []);
};
/**
* Sets whether users are required to enter an email address or not when
* sending reports.
* Defaults to YES.
* @param {boolean} isRequired indicates if email field is required
* @param {enum} actionTypes array of ActionType
* @param {function(void):void} success
* @param {function(string):void} error
*/
FeatureRequests.setEmailFieldRequired = function (isRequired, actionTypes, success, error) {
var i;
var validatedActionTypes = [];
for (i = 0; i < actionTypes.length; i++) {
var validatedActionType = getActionTypes()[actionTypes[i]];
if(validatedActionType) {
validatedActionTypes.push(validatedActionType);
}
}
if (validatedActionTypes !== undefined || validatedActionTypes.length != 0) {
exec(success, error, 'IBGPlugin', 'setEmailFieldRequiredForFeatureRequests', [isRequired, validatedActionTypes]);
} else {
console.log('Could not set email field - "' + validatedActionTypes + '" is incorrect.');
}
};
/**
* Sets whether users are required to enter an email address or not when
* sending reports.
* Defaults to YES.
* @param isRequired a boolean to indicate if email field is required.
* @param actionTypes array of actionTypes.
* @param success callback on function success.
* @param error callback on function error.
*/
FeatureRequests.setEmailFieldRequired = function (isRequired, actionTypes, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setEmailFieldRequiredForFeatureRequests", [isRequired, actionTypes], success, error);
};
})(FeatureRequests || (FeatureRequests = {}));
module.exports = FeatureRequests;

@@ -1,13 +0,10 @@

var Instabug = cordova.require("instabug-cordova.Instabug");
var BugReporting = cordova.require("instabug-cordova.BugReporting");
var FeatureRequests = cordova.require("instabug-cordova.FeatureRequests");
var Surveys = cordova.require("instabug-cordova.Surveys");
var Replies = cordova.require("instabug-cordova.Replies");
module.exports = {
Instabug,
BugReporting,
FeatureRequests,
Surveys,
Replies,
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var Instabug_1 = __importDefault(require("./Instabug"));
var BugReporting_1 = __importDefault(require("./BugReporting"));
var FeatureRequests_1 = __importDefault(require("./FeatureRequests"));
var Replies_1 = __importDefault(require("./Replies"));
var Surveys_1 = __importDefault(require("./Surveys"));
module.exports = { Instabug: Instabug_1.default, BugReporting: BugReporting_1.default, FeatureRequests: FeatureRequests_1.default, Surveys: Surveys_1.default, Replies: Replies_1.default };

@@ -1,410 +0,309 @@

var exec = require('cordova/exec');
var registry = require("./ArgsRegistry");
var getInvocationEvents = function () {
return {
shake: 'shake',
button: 'button',
screenshot: 'screenshot',
swipe: 'swipe',
none: 'none'
};
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var getReproStepsMode = function () {
return {
enabled: 'enabled',
disabled: 'disabled',
enabledWithNoScreenshots: 'enabledWithNoScreenshots'
var IBGCordova_1 = require("./IBGCordova");
var ArgsRegistry_1 = __importDefault(require("./ArgsRegistry"));
var Instabug;
(function (Instabug) {
Instabug.welcomeMessageMode = ArgsRegistry_1.default.welcomeMessageMode;
Instabug.floatingButtonEdge = ArgsRegistry_1.default.floatingButtonEdge;
Instabug.colorTheme = ArgsRegistry_1.default.colorTheme;
Instabug.strings = ArgsRegistry_1.default.strings;
Instabug.reproStepsMode = ArgsRegistry_1.default.reproStepsMode;
Instabug.locale = ArgsRegistry_1.default.locale;
/**
* Starts the SDK.
* This is the main SDK method that does all the magic. This is the only
* method that SHOULD be called.
* Should be called in constructor of the AppRegistry component
*
* @param token the token that identifies the app, you can find
* it on your dashboard.
* @param invocationEvents an array of invocationEvents that invoke
* the SDK's UI.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.start = function (token, invocationEvents, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "start", [token, invocationEvents], success, error);
};
};
var getWelcomeMessageMode = function () {
return {
welcomeMessageModeLive: 'welcomeMessageModeLive',
welcomeMessageModeBeta: 'welcomeMessageModeBeta',
welcomeMessageModeDisabled: 'welcomeMessageModeDisabled'
}
};
var getLocales = function () {
return {
arabic: 'arabic',
azerbaijani: 'azerbaijani',
chineseSimplified: 'chineseSimplified',
chineseTraditional: 'chineseTraditional',
danish: 'danish',
dutch: 'dutch',
english: 'english',
french: 'french',
german: 'german',
italian: 'italian',
japanese: 'japanese',
korean: 'korean',
polish: 'polish',
portugueseBrazil: 'portugueseBrazil',
russian: 'russian',
spanish: 'spanish',
swedish: 'swedish',
turkish: 'turkish',
czech: 'czech'
/**
* Shows default Instabug prompt.
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.show = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "show", [], success, error);
};
};
var Instabug = function () {
};
Instabug.welcomeMessageMode = registry.welcomeMessageMode;
Instabug.floatingButtonEdge = registry.floatingButtonEdge;
Instabug.colorTheme = registry.colorTheme;
Instabug.strings = registry.strings;
/**
* Starts the SDK.
* This is the main SDK method that does all the magic. This is the only
* method that SHOULD be called.
* Should be called in constructor of the AppRegistry component
*
* @param {string} token The token that identifies the app, you can find
* it on your dashboard.
* @param {keyof BugReporting.option} invocationEvents events that invokes
* the SDK's UI.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.start = function (token, invocationEvents, success, error) {
var validEvents = getInvocationEvents();
var isValid = invocationEvents.every((e) => validEvents[e]);
if (isValid && invocationEvents.length > 0) {
exec(success, error, 'IBGPlugin', 'start', [token, invocationEvents]);
} else {
console.log('Could not start Instabug - invalid invocation events');
}
};
/**
* Shows default Instabug prompt.
*
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.show = function (success, error) {
exec(success, error, 'IBGPlugin', 'show');
}
/**
* Sets the primary color of the SDK's UI.
* Sets the color of UI elements indicating interactivity or call to action.
* To use, import processColor and pass to it with argument the color hex
* as argument.
*
* @param {color} color A color to set the UI elements of the SDK to.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setPrimaryColor = function (color, success, error) {
exec(success, error, 'IBGPlugin', 'setPrimaryColor', [color]);
};
/**
* Logs a user event that happens through the lifecycle of the application.
* Logged user events are going to be sent with each report, as well as at the end of a session.
*
* @param {string} userEvent Event name.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.logUserEventWithName = function (userEvent, success, error) {
exec(success, error, 'IBGPlugin', 'logUserEventWithName', [userEvent]);
};
/**
* Sets whether user steps tracking is visual, non visual or disabled.
* User Steps tracking is enabled by default if it's available
* in your current plan.
*
* @param {reproStepsMode} reproStepsMode An enum to set user steps tracking
* to be enabled, non visual or disabled.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setReproStepsMode = function (reproStepsMode, success, error) {
var validatedReproStepsMode = getReproStepsMode()[reproStepsMode];
if (validatedReproStepsMode) {
exec(success, error, 'IBGPlugin', 'setReproStepsMode', [validatedReproStepsMode]);
} else {
console.log('Could not set user steps mode - "' + validatedReproStepsMode + '" is not valid.');
}
};
/**
* The session profiler is enabled by default and it attaches to the bug and
* crash reports the following information during the last 60 seconds before the report is sent.
* @param {boolean} isEnabled - A boolean parameter to enable or disable the feature.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setSessionProfilerEnabled = function (isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setSessionProfilerEnabled', [isEnabled]);
};
/**
* Sets the welcome message mode to live, beta or disabled.
* @param {keyof Instabug.welcomeMessageMode} mode.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setWelcomeMessageMode = function (mode, success, error) {
exec(success, error, 'IBGPlugin', 'setWelcomeMessageMode', [mode]);
};
/**
* Shows the welcome message in a specific mode.
* @param {keyof Instabug.welcomeMessageMode} mode.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.showWelcomeMessage = function (mode, success, error) {
exec(success, error, 'IBGPlugin', 'showWelcomeMessage', [mode]);
};
/**
* Attaches user data to each report being sent.
* Each call to this method overrides the user data to be attached.
* Maximum size of the string is 1,000 characters.
*
* @param {string} data A string to be attached to each report, with a
* maximum size of 1,000 characters.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setUserData = function (data, success, error) {
exec(success, error, 'IBGPlugin', 'setUserData', [data]);
};
/**
* Add file to be attached to the bug report.
*
* @param {string} filePath
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.addFile = function (filePath, success, error) {
exec(success, error, 'IBGPlugin', 'addFile', [filePath]);
}
/**
* Appends a log message to Instabug internal log
* <p>
* These logs are then sent along the next uploaded report.
* All log messages are timestamped <br/>
* Logs aren't cleared per single application run.
* If you wish to reset the logs,
* use {@link #clearLogs()} ()}
* </p>
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
*
* @param message the message
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.addLog = function (content, success, error) {
exec(success, error, 'IBGPlugin', 'addLog', [content]);
};
/**
* Clear all Instabug logs, console logs, network logs and user steps.
*
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.clearLog = function (success, error) {
exec(success, error, 'IBGPlugin', 'clearLog', []);
};
/**
* Sets whether IBGLog should also print to Xcode's console log or not.
*
* @param {boolean} isEnabled A boolean to set whether printing to
* Xcode's console is enabled or not.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setIBGLogPrintsToConsole = function (isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setIBGLogPrintsToConsole', [isEnabled]);
};
/**
* Disables all Instabug functionality
* It works on android only
*
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.disable = function (success, error) {
exec(success, error, 'IBGPlugin', 'disable', []);
};
/**
* Enables all Instabug functionality
* It works on android only
*
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.enable = function (success, error) {
exec(success, error, 'IBGPlugin', 'enable', []);
};
/**
* Gets a boolean indicating whether the SDK is enabled or not
* It works on android only
*
* @param {function(boolean):void} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.isEnabled = function (success, error) {
exec(success, error, 'IBGPlugin', 'getIsEnabled', []);
};
/**
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
*
* @param key the attribute
* @param value the value
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setUserAttribute = function (key, value, success, error) {
exec(success, error, 'IBGPlugin', 'setUserAttribute', [key, value]);
};
/**
* Removes user attribute if exists.
*
* @param key the attribute key as string
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.removeUserAttribute = function (key, success, error) {
exec(success, error, 'IBGPlugin', 'removeUserAttribute', [key]);
};
/**
* Returns all user attributes.
*
* @param {function} userAttributesCallback callback with argument A new dictionary containing
* all the currently set user attributes, or an empty dictionary if no user attributes have been set.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.getAllUserAttributes = function (success, error) {
exec(success, error, 'IBGPlugin', 'getAllUserAttributes', []);
};
/**
* Returns the user attribute associated with a given key.
*
* @param {string} key The attribute key as string
* @param {function} userAttributeCallback callback with argument as the desired user attribute value
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.getUserAttribute = function (key, success, error) {
exec(success, error, 'IBGPlugin', 'getUserAttribute', [key]);
};
/**
* Sets the default value of the user's email and hides the email field from the reporting UI
* and set the user's name to be included with all reports.
* It also reset the chats on device to that email and removes user attributes,
* user data and completed surveys.
*
* @param {string} email Email address to be set as the user's email.
* @param {string} name Name of the user to be set.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.identifyUserWithEmail = function (email, name, success, error) {
exec(success, error, 'IBGPlugin', 'identifyUserWithEmail', [email, name]);
};
Instabug.setPreSendingHandler = function (success, error) {
exec(success, error, 'IBGPlugin', 'setPreSendingHandler', []);
};
/**
* Sets the default value of the user's email to nil and show email field and remove user name
* from all reports
* It also reset the chats on device and removes user attributes, user data and completed surveys.
*
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.logOut = function (success, error) {
exec(success, error, 'IBGPlugin', 'logOut', []);
};
/**
* Enable/Disable debug logs from Instabug SDK
* Default state: disabled
*
* @param {boolean} isDebugEnabled whether debug logs should be printed or not into LogCat
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setDebugEnabled = function (isDebugEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setDebugEnabled', [isDebugEnabled]);
if(success) {
console.log("setting debug enabled to " + isDebugEnabled);
} else if(error) {
console.log("setting debug enabled not successful");
}
};
/**
* Sets the SDK's locale.
* Use to change the SDK's UI to different language.
* Defaults to the device's current locale.
*
* @param {locale} locale A locale to set the SDK to.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setLocale = function (locale, success, error) {
var validatedLocale = getLocales()[locale];
if (validatedLocale) {
exec(success, error, 'IBGPlugin', 'setLocale', [validatedLocale]);
} else {
console.log('Could not set locale - "' + locale + '" is not valid.');
}
};
/**
* Sets SDK color theme.
*
* @param {keyof Instabug.colorTheme} theme.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setColorTheme = function (theme, success, error) {
exec(success, error, 'IBGPlugin', 'setColorTheme', [theme]);
};
/**
* Overrides any of the strings shown in the SDK with custom ones.
* Allows you to customize any of the strings shown to users in the SDK.
* @param {strings} key Key of string to override.
* @param {string} value String value to override the default one.
* @param {function} success callback on function success
* @param {function(string):void} error callback on function error
*/
Instabug.setString = function (key, value, success, error) {
exec(success, error, 'IBGPlugin', 'setString', [key, value]);
};
/**
* Sets the primary color of the SDK's UI.
* Sets the color of UI elements indicating interactivity or call to action.
* To use, import processColor and pass to it with argument the color hex
* as argument.
*
* @param color a color hex to set the UI elements of the SDK to.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setPrimaryColor = function (color, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setPrimaryColor", [color], success, error);
};
/**
* Logs a user event that happens through the lifecycle of the application.
* Logged user events are going to be sent with each report, as well as at the end of a session.
*
* @param userEvent the user event name.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.logUserEventWithName = function (userEvent, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "logUserEventWithName", [userEvent], success, error);
};
/**
* Sets whether user steps tracking is visual, non visual or disabled.
* User Steps tracking is enabled by default if it's available
* in your current plan.
*
* @param reproStepsMode an enum to set user steps tracking
* to be enabled, non visual or disabled.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setReproStepsMode = function (reproStepsMode, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setReproStepsMode", [reproStepsMode], success, error);
};
/**
* The session profiler is enabled by default and it attaches to the bug and
* crash reports the following information during the last 60 seconds before the report is sent.
* @param isEnabled a boolean to enable or disable the feature.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setSessionProfilerEnabled = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setSessionProfilerEnabled", [isEnabled], success, error);
};
/**
* Sets the welcome message mode to live, beta or disabled.
* @param mode an enum to set the welcome message mode.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setWelcomeMessageMode = function (mode, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setWelcomeMessageMode", [mode], success, error);
};
/**
* Shows the welcome message in a specific mode.
* @param mode an enum to set the mode to show the welcome message with.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.showWelcomeMessage = function (mode, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showWelcomeMessage", [mode], success, error);
};
/**
* Attaches user data to each report being sent.
* Each call to this method overrides the user data to be attached.
* Maximum size of the string is 1,000 characters.
*
* @param data a string to be attached to each report, with a
* maximum size of 1,000 characters.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setUserData = function (data, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setUserData", [data], success, error);
};
/**
* Add file to be attached to the bug report.
*
* @param filePath the path of the file to be attached.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.addFile = function (filePath, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "addFile", [filePath], success, error);
};
/**
* Appends a log message to Instabug internal log
* <p>
* These logs are then sent along the next uploaded report.
* All log messages are timestamped <br/>
* Logs aren't cleared per single application run.
* If you wish to reset the logs,
* use {@link #clearLogs()} ()}
* </p>
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
*
* @param message the log message.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.addLog = function (message, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "addLog", [message], success, error);
};
/**
* Clear all Instabug logs, console logs, network logs and user steps.
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.clearLog = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "clearLog", [], success, error);
};
/**
* Sets whether IBGLog should also print to Xcode's console log or not.
*
* @param isEnabled a boolean to set whether printing to
* Xcode's console is enabled or not.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setIBGLogPrintsToConsole = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setIBGLogPrintsToConsole", [isEnabled], success, error);
};
/**
* Disables all Instabug functionality
* It works on android only
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.disable = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "disable", [], success, error);
};
/**
* Enables all Instabug functionality
* It works on android only
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.enable = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "enable", [], success, error);
};
/**
* Gets a boolean indicating whether the SDK is enabled or not
* It works on android only
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.isEnabled = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "getIsEnabled", [], success, error);
};
/**
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
*
* @param key the attribute key.
* @param value the attribute value.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setUserAttribute = function (key, value, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setUserAttribute", [key, value], success, error);
};
/**
* Removes user attribute if exists.
*
* @param key the attribute key as string.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.removeUserAttribute = function (key, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "removeUserAttribute", [key], success, error);
};
/**
* Returns all user attributes.
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.getAllUserAttributes = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "getAllUserAttributes", [], success, error);
};
/**
* Returns the user attribute associated with a given key.
*
* @param key the attribute key as string.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.getUserAttribute = function (key, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "getUserAttribute", [key], success, error);
};
/**
* Sets the default value of the user's email and hides the email field from the reporting UI
* and set the user's name to be included with all reports.
* It also reset the chats on device to that email and removes user attributes,
* user data and completed surveys.
*
* @param email the email address to be set as the user's email.
* @param name the name of the user to be set.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.identifyUserWithEmail = function (email, name, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "identifyUserWithEmail", [email, name], success, error);
};
Instabug.setPreSendingHandler = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setPreSendingHandler", [], success, error);
};
/**
* Sets the default value of the user's email to nil and show email field and remove user name
* from all reports
* It also reset the chats on device and removes user attributes, user data and completed surveys.
*
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.logOut = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "logOut", [], success, error);
};
/**
* Enable/Disable debug logs from Instabug SDK
* Default state: disabled
*
* @param isDebugEnabled a boolean to control whether debug logs should be printed or not into LogCat.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setDebugEnabled = function (isDebugEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setDebugEnabled", [isDebugEnabled], success, error);
};
/**
* Sets the SDK's locale.
* Use to change the SDK's UI to different language.
* Defaults to the device's current locale.
*
* @param locale a locale to set the SDK to.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setLocale = function (locale, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setLocale", [locale], success, error);
};
/**
* Sets SDK color theme.
*
* @param theme the color theme to set the SDK UI to.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setColorTheme = function (theme, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setColorTheme", [theme], success, error);
};
/**
* Overrides any of the strings shown in the SDK with custom ones.
* Allows you to customize any of the strings shown to users in the SDK.
* @param key the key of the string to override.
* @param value the string value to override the default one.
* @param success callback on function success.
* @param error callback on function error.
*/
Instabug.setString = function (key, value, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setString", [key, value], success, error);
};
})(Instabug || (Instabug = {}));
module.exports = Instabug;

@@ -0,61 +1,51 @@

"use strict";
/*
* Instabug Replies module.
* @file replies.js
*/
var exec = require('cordova/exec');
/**
* Replies module
* @exports Replies
*/
var Replies = function() {};
/**
* Enables or disables all replies functionalities.
* @param {boolean} isEnabled
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Replies.setEnabled = function(isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setRepliesEnabled', [isEnabled]);
};
/**
* Shows replies.
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Replies.show = function(success, error) {
exec(success, error, 'IBGPlugin', 'showReplies');
}
/**
* Calls success callback if chats exist.
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Replies.hasChats = function(success, error) {
exec(success, error, 'IBGPlugin', 'hasChats');
}
/**
* Returns the number of unread replies for the user.
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Replies.getUnreadRepliesCount = function(success, error) {
exec(success, error, 'IBGPlugin', 'getUnreadRepliesCount');
}
/**
* Enables in app notifications for any new reply received.
* @param {boolean} isEnabled
* @param {function(void):void} success callback on function success
* @param {function(void):void} error callback on function error
*/
Replies.setInAppNotificationEnabled = function (isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setChatNotificationEnabled', [isEnabled]);
};
module.exports = Replies;
var IBGCordova_1 = require("./IBGCordova");
var Replies;
(function (Replies) {
/**
* Enables or disables all replies functionalities.
* @param isEnabled a boolean to enable or disable the feature.
* @param success callback on function success.
* @param error callback on function error.
*/
Replies.setEnabled = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setRepliesEnabled", [isEnabled], success, error);
};
/**
* Shows replies.
* @param success callback on function success.
* @param error callback on function error.
*/
Replies.show = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showReplies", [], success, error);
};
/**
* Calls success callback if chats exist.
* @param success callback on function success.
* @param error callback on function error.
*/
Replies.hasChats = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "hasChats", [], success, error);
};
/**
* Returns the number of unread replies for the user.
* @param success callback on function success.
* @param error callback on function error.
*/
Replies.getUnreadRepliesCount = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "getUnreadRepliesCount", [], success, error);
};
/**
* Enables in app notifications for any new reply received.
* @param isEnabled a boolean to enable or disable in-app notifications.
* @param success callback on function success.
* @param error callback on function error.
*/
Replies.setInAppNotificationEnabled = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setChatNotificationEnabled", [isEnabled], success, error);
};
})(Replies || (Replies = {}));
module.exports = Replies;

@@ -0,118 +1,102 @@

"use strict";
/*
* Instabug Surveys module.
* @file surveys.js
*/
var exec = require('cordova/exec');
/**
* Surveys module
* @exports Surveys
*/
var Surveys = function() {};
/**
* Sets whether auto surveys showing are enabled or not.
* @param {boolean} autoShowingSurveysEnabled A boolean for whether to auto show a survey
* @param {function():void} success
* @param {function(string)} error
*/
Surveys.setAutoShowingEnabled = function (autoShowingSurveysEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setAutoShowingSurveysEnabled', [autoShowingSurveysEnabled]);
};
/**
* @summary Sets whether surveys are enabled or not.
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
* those surveys are still going to be sent to the device, but are not going to be
* shown automatically.
* To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
* Defaults to `true`.
* @param {boolean} isEnabled
* @param {function():void} success
* @param {function(string):void} error
*/
Surveys.setEnabled = function (isEnabled, success, error) {
exec(success, error, 'IBGPlugin', 'setSurveysEnabled', [isEnabled]);
};
/**
* @summary Shows one of the surveys that were not shown before, that also have conditions
* that match the current device/user.
* Does nothing if there are no available surveys or if a survey has already been shown
* in the current session.
* @param {function():void} success
* @param {function():void} error
*/
Surveys.showSurveyIfAvailable = function (success, error) {
exec(success, error, 'IBGPlugin', 'showSurveyIfAvailable', []);
};
/**
* @summary Sets a block of code to be executed just before the survey's UI is presented.
* This block is executed on the UI thread. Could be used for performing any UI changes before
* the survey's UI is shown.
* @param {function():void} success
* @param {function():void} error
*/
Surveys.setOnShowHandler = function (success, error) {
exec(success, error, 'IBGPlugin', 'willShowSurveyHandler', []);
};
/**
* @summary Sets a block of code to be executed right after the survey's UI is dismissed.
* This block is executed on the UI thread. Could be used for performing any UI
* changes after the survey's UI is dismissed.
* @param {function():void} success
* @param {function():void} error
*/
Surveys.setOnDismissHandler = function (success, error) {
exec(success, error, 'IBGPlugin', 'didDismissSurveyHandler', []);
};
/**
* Shows survey with a specific token.
* Does nothing if there are no available surveys with that specific token.
* Answered and cancelled surveys won't show up again.
* @param {string} surveyToken A String with a survey token.
* @param {function():void} success
* @param {function(string):void} error
*/
Surveys.showSurveyWithToken = function (surveyToken, success, error) {
exec(success, error, 'IBGPlugin', 'showSurveyWithToken', [surveyToken]);
};
/**
* Returns true if the survey with a specific token was answered before.
* Will return false if the token does not exist or if the survey was not answered before.
* @param {string} surveyToken a string with a survey token.
* @param {function(boolean):void} success
* @param {function(string):void} error
*/
Surveys.hasRespondedToSurveyWithToken = function (surveyToken, success, error) {
exec(success, error, 'IBGPlugin', 'hasRespondedToSurveyWithToken', [surveyToken]);
};
/**
* Returns an array containing the available surveys.
* @param {function(Object):void} success
* @param {function():void} error
*/
Surveys.getAvailableSurveys = function (success, error) {
exec(success, error, 'IBGPlugin', 'getAvailableSurveys', []);
};
/**
* Setting an option for all the surveys to show a welcome screen before
* the user starts taking the survey.
* @param {boolean} shouldShowWelcomeScreen A boolean for setting whether the
* welcome screen should show.
* @param {function():void} success
* @param {function(string):void} error
*/
Surveys.setShouldShowSurveysWelcomeScreen = function (shouldShowWelcomeScreen, success, error) {
exec(success, error, 'IBGPlugin', 'setShouldShowSurveysWelcomeScreen', [shouldShowWelcomeScreen]);
};
var IBGCordova_1 = require("./IBGCordova");
var Surveys;
(function (Surveys) {
/**
* Sets whether auto surveys showing are enabled or not.
* @param autoShowingSurveysEnabled a boolean for whether to auto show a survey.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.setAutoShowingEnabled = function (autoShowingSurveysEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setAutoShowingSurveysEnabled", [autoShowingSurveysEnabled], success, error);
};
/**
* Sets whether surveys are enabled or not.
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
* those surveys are still going to be sent to the device, but are not going to be
* shown automatically.
* To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
* Defaults to `true`.
* @param isEnabled a boolean to enable or disable the feature.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.setEnabled = function (isEnabled, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setSurveysEnabled", [isEnabled], success, error);
};
/**
* Shows one of the surveys that were not shown before, that also have conditions
* that match the current device/user.
* Does nothing if there are no available surveys or if a survey has already been shown
* in the current session.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.showSurveyIfAvailable = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showSurveyIfAvailable", [], success, error);
};
/**
* Sets a block of code to be executed just before the survey's UI is presented.
* This block is executed on the UI thread. Could be used for performing any UI changes before
* the survey's UI is shown.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.setOnShowHandler = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "willShowSurveyHandler", [], success, error);
};
/**
* Sets a block of code to be executed right after the survey's UI is dismissed.
* This block is executed on the UI thread. Could be used for performing any UI
* changes after the survey's UI is dismissed.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.setOnDismissHandler = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "didDismissSurveyHandler", [], success, error);
};
/**
* Shows survey with a specific token.
* Does nothing if there are no available surveys with that specific token.
* Answered and cancelled surveys won't show up again.
* @param surveyToken a string with a survey token.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.showSurveyWithToken = function (surveyToken, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "showSurveyWithToken", [surveyToken], success, error);
};
/**
* Returns true if the survey with a specific token was answered before.
* Will return false if the token does not exist or if the survey was not answered before.
* @param surveyToken a string with a survey token.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.hasRespondedToSurveyWithToken = function (surveyToken, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "hasRespondedToSurveyWithToken", [surveyToken], success, error);
};
/**
* Returns an array containing the available surveys.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.getAvailableSurveys = function (success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "getAvailableSurveys", [], success, error);
};
/**
* Setting an option for all the surveys to show a welcome screen before
* the user starts taking the survey.
* @param shouldShowWelcomeScreen a boolean to control whether the welcome screen should show.
* @param success callback on function success.
* @param error callback on function error.
*/
Surveys.setShouldShowSurveysWelcomeScreen = function (shouldShowWelcomeScreen, success, error) {
(0, IBGCordova_1.exec)("IBGPlugin", "setShouldShowSurveysWelcomeScreen", [shouldShowWelcomeScreen], success, error);
};
})(Surveys || (Surveys = {}));
module.exports = Surveys;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc