@freshworks/react-native-freshdesk-sdk
Version:
React Native wrapper for Freshdesk Android and iOS SDKs
142 lines (141 loc) • 4.88 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UserState = exports.FreshdeskErrorCode = void 0;
/**
* Native error codes rejected on the promises returned by FreshdeskSDK methods.
* Read `error.code` (React Native's standard `NativeModule` rejection shape) and
* compare against this enum instead of matching the string literal directly.
*
* Coverage is not identical on both platforms — some codes are method-specific
* on Android and folded into a shared code on iOS, or vice versa. Codes marked
* (Android) / (iOS) are only ever rejected on that platform; unmarked codes can
* occur on either.
*/
let FreshdeskErrorCode = exports.FreshdeskErrorCode = /*#__PURE__*/function (FreshdeskErrorCode) {
/** initialize() timed out waiting for the native SDK to report ready. (Android) */
FreshdeskErrorCode["INIT_TIMEOUT"] = "FRESHDESK_INIT_TIMEOUT";
/** initialize() threw before it could start. (Android) */
FreshdeskErrorCode["INIT_ERROR"] = "FRESHDESK_INIT_ERROR";
/** initialize()'s config object was missing a required key or malformed. */
FreshdeskErrorCode["INVALID_CONFIG"] = "FRESHDESK_INVALID_CONFIG";
/** A method other than initialize() was called before initialize() resolved. */
FreshdeskErrorCode["NOT_INITIALIZED"] = "FRESHDESK_NOT_INITIALIZED";
/** initialize() resolved but the underlying native SDK isn't ready yet. (Android) */
FreshdeskErrorCode["NOT_READY"] = "FRESHDESK_NOT_READY";
/** openSupport()/openKnowledgeBase()/openTopic() had no foreground Activity to attach to. (Android) */
FreshdeskErrorCode["NO_ACTIVITY"] = "FRESHDESK_NO_ACTIVITY";
/** openSupport()/openKnowledgeBase()/openTopic() had no view controller to present from. (iOS) */
FreshdeskErrorCode["NO_VIEW_CONTROLLER"] = "FRESHDESK_NO_VIEW_CONTROLLER";
/** openSupport()/openKnowledgeBase()/openTopic() failed to present the native UI. (Android) */
FreshdeskErrorCode["OPEN_ERROR"] = "FRESHDESK_OPEN_ERROR";
/** trackEvent() failed. (Android) */
FreshdeskErrorCode["TRACK_ERROR"] = "FRESHDESK_TRACK_ERROR";
/** setUserProperties() failed. */
FreshdeskErrorCode["USER_PROPERTIES_ERROR"] = "FRESHDESK_USER_PROPERTIES_ERROR";
/** setTicketProperties() failed. (Android) */
FreshdeskErrorCode["TICKET_PROPERTIES_ERROR"] = "FRESHDESK_TICKET_PROPERTIES_ERROR";
/** authenticateAndUpdate() failed. (Android) */
FreshdeskErrorCode["AUTH_ERROR"] = "FRESHDESK_AUTH_ERROR";
/** dismiss() failed. (Android) */
FreshdeskErrorCode["DISMISS_ERROR"] = "FRESHDESK_DISMISS_ERROR";
/** getUser() failed, or its response could not be parsed. */
FreshdeskErrorCode["USER_ERROR"] = "FRESHDESK_USER_ERROR";
/** getUser()'s response could not be parsed. (iOS) */
FreshdeskErrorCode["USER_PARSE_ERROR"] = "FRESHDESK_USER_PARSE_ERROR";
/** setContentConfiguration()'s JSON payload could not be parsed. */
FreshdeskErrorCode["CONFIG_PARSE_ERROR"] = "FRESHDESK_CONFIG_PARSE_ERROR";
return FreshdeskErrorCode;
}({});
/**
* Freshdesk SDK Configuration
*/
/**
* User authentication states
*/
let UserState = exports.UserState = /*#__PURE__*/function (UserState) {
/** Default state */
UserState["UNDEFINED"] = "undefined";
/** JWT passed is successfully authenticated or restored */
UserState["AUTHENTICATED"] = "authenticated";
/** JWT passed has expired */
UserState["AUTH_EXPIRED"] = "authExpired";
/** Invalid/Expired token is passed */
UserState["NOT_AUTHENTICATED"] = "notAuthenticated";
/** Unique user identifier updated for a user */
UserState["IDENTIFIER_UPDATED"] = "identifierUpdated";
/** JWT was not passed during init for an enforced JWT SDK linked Widget */
UserState["JWT_ABSENT"] = "jwtAbsent";
return UserState;
}({});
/**
* Topic information for opening specific support topics
*/
/**
* Event payload for unread count changes
*/
/**
* Event payload for user state changes
*/
/**
* Event payload for link handler
*/
/**
* Event payload for user creation
*/
/**
* Properties for setting user details
*/
/**
* Properties for setting ticket details
*/
/**
* Event properties for tracking
*/
/**
* Result of reset user operation
*/
/**
* Channel response time configuration
*/
/**
* Channel response online configuration
*/
/**
* Channel response configuration
*/
/**
* Ticket form content configuration
*/
/**
* Header content configuration
*/
/**
* Placeholder content configuration
*/
/**
* Privacy policy content configuration
*/
/**
* Action content configuration
*/
/**
* Content configuration for customizing SDK UI text
*/
/**
* User data returned from getUser
*/
/**
* SDK version information
*/
/**
* Diagnostic check status returned by runDiagnostics
*/
/**
* A single diagnostic check from runDiagnostics
*/
/**
* Structured diagnostic report from runDiagnostics
*/
//# sourceMappingURL=types.js.map