capacitor-gleap-plugin 17.0.0 → 18.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorGleapPlugin.podspec +2 -2
- package/README.md +218 -3
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/gleapplugins/capacitor/GleapPlugin.java +157 -0
- package/dist/docs.json +189 -0
- package/dist/esm/definitions.d.ts +95 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +45 -0
- package/dist/esm/web.js +58 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +58 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +58 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/GleapPlugin.m +9 -0
- package/ios/Plugin/GleapPlugin.swift +126 -0
- package/package.json +11 -4
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Gleap = registerPlugin('Gleap', {\n web: () => import('./web').then(m => new m.GleapWeb()),\n});\nconst registeredAgentTools = {};\nlet agentToolListenerAttached = false;\n/**\n * Registers the handler for a Frontend tool defined on your AI agent in the\n * Gleap dashboard. The agent calls the handler with the configured parameters\n * and waits for the returned result (string or object, which gets\n * stringified).\n */\nconst registerAgentTool = async (name, handler) => {\n if (!name || typeof handler !== 'function') {\n return;\n }\n registeredAgentTools[name] = handler;\n if (!agentToolListenerAttached) {\n agentToolListenerAttached = true;\n await Gleap.addListener('agentToolExecution', async (data) => {\n var _a;\n try {\n const { executionId, name: toolName, params } = data !== null && data !== void 0 ? data : {};\n if (!executionId || !toolName) {\n return;\n }\n let result;\n const toolHandler = registeredAgentTools[toolName];\n if (!toolHandler) {\n result = `No handler registered for tool '${toolName}' in the app. Register one via Gleap.registerAgentTool('${toolName}', handler).`;\n }\n else {\n try {\n const handlerResult = await toolHandler(params !== null && params !== void 0 ? params : {});\n result =\n typeof handlerResult === 'string'\n ? handlerResult\n : JSON.stringify(handlerResult !== null && handlerResult !== void 0 ? handlerResult : '');\n if (!result) {\n result = 'The action completed without returning a result.';\n }\n }\n catch (error) {\n result = `Tool execution failed: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'unknown error'}`;\n }\n }\n await Gleap.sendAgentToolResult({ executionId, result });\n }\n catch (exp) {\n // Ignore.\n }\n });\n }\n await Gleap.registerAgentTool({ name });\n};\nexport * from './definitions';\nexport { Gleap, registerAgentTool };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport Gleap from 'gleap';\nexport class GleapWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pendingAgentToolExecutions = {};\n }\n async initialize(options) {\n if (GleapWeb.initialized) {\n return { initialized: true };\n }\n Gleap.initialize(options.API_KEY);\n GleapWeb.initialized = true;\n this.registerCallbackListeners();\n return { initialized: true };\n }\n registerCallbackListeners() {\n Gleap.on('open', () => {\n this.notifyCallbacks('open', {});\n });\n Gleap.on('initialized', () => {\n this.notifyCallbacks('initialized', {});\n });\n Gleap.on('close', () => {\n this.notifyCallbacks('close', {});\n });\n Gleap.on('feedback-sent', formData => {\n this.notifyCallbacks('feedback-sent', formData);\n });\n Gleap.on('outbound-sent', formData => {\n this.notifyCallbacks('outbound-sent', formData);\n });\n Gleap.on('tool-execution', toolExecution => {\n this.notifyCallbacks('tool-execution', toolExecution);\n });\n Gleap.on('flow-started', flow => {\n this.notifyCallbacks('flow-started', flow);\n });\n Gleap.on('error-while-sending', () => {\n this.notifyCallbacks('error-while-sending', {});\n });\n Gleap.on('unregister-pushmessage-group', groupName => {\n this.notifyCallbacks('unregister-pushmessage-group', groupName);\n });\n Gleap.on('register-pushmessage-group', groupName => {\n this.notifyCallbacks('register-pushmessage-group', groupName);\n });\n Gleap.on('unread-count-changed', groupName => {\n this.notifyCallbacks('notification-count-updated', groupName);\n });\n Gleap.registerCustomAction(customAction => {\n this.notifyCallbacks('custom-action-called', customAction);\n });\n }\n async registerAgentTool(options) {\n const gleapSdk = Gleap;\n if (typeof gleapSdk.registerAgentTool !== 'function') {\n console.warn('Gleap: registerAgentTool requires a newer version of the Gleap JS SDK.');\n return;\n }\n gleapSdk.registerAgentTool(options.name, (params) => new Promise(resolve => {\n const executionId = `web-${++GleapWeb.agentToolExecutionCounter}`;\n this.pendingAgentToolExecutions[executionId] = resolve;\n this.notifyListeners('agentToolExecution', {\n executionId,\n name: options.name,\n params: params !== null && params !== void 0 ? params : {},\n });\n }));\n }\n async sendAgentToolResult(options) {\n const resolve = this.pendingAgentToolExecutions[options.executionId];\n if (resolve) {\n delete this.pendingAgentToolExecutions[options.executionId];\n resolve(options.result);\n }\n }\n async setTicketAttribute(options) {\n Gleap.setTicketAttribute(options.key, options.value);\n return { setTicketAttribute: true };\n }\n async unsetTicketAttribute(options) {\n Gleap.unsetTicketAttribute(options.key);\n return { unsetTicketAttribute: true };\n }\n async clearTicketAttributes() {\n Gleap.clearTicketAttributes();\n return { clearTicketAttributes: true };\n }\n notifyCallbacks(event, data) {\n if (!GleapWeb.callbacks) {\n return;\n }\n for (var callbackId in GleapWeb.callbacks) {\n GleapWeb.callbacks[callbackId]({\n name: event,\n data,\n });\n }\n }\n async startClassicForm(options) {\n var _a;\n Gleap.startClassicForm((_a = options.formId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { classicFormStarted: true };\n }\n async startConversation(options) {\n Gleap.startConversation(options.showBackButton);\n return { conversationStarted: true };\n }\n async openConversation(options) {\n Gleap.openConversations(options.showBackButton);\n return { conversationsOpened: true };\n }\n async showSurvey(options) {\n Gleap.showSurvey(options.surveyId, options.format);\n return { opened: true };\n }\n async showFeedbackButton(options) {\n Gleap.showFeedbackButton(options.show ? true : false);\n return { feedbackButtonShown: true };\n }\n async setDisableInAppNotifications(options) {\n var _a;\n Gleap.setDisableInAppNotifications((_a = options.disableInAppNotifications) !== null && _a !== void 0 ? _a : false);\n return { inAppNotificationsDisabled: true };\n }\n async identify(options) {\n var userData = {\n name: options.name,\n email: options.email,\n phone: options.phone,\n companyId: options.companyId,\n companyName: options.companyName,\n avatar: options.avatar,\n sla: options.sla,\n plan: options.plan,\n value: options.value,\n customData: options.customData,\n };\n if (options.userHash) {\n Gleap.identify(options.userId, userData, options.userHash);\n }\n else {\n Gleap.identify(options.userId, userData);\n }\n return { identify: true };\n }\n async updateContact(options) {\n Gleap.updateContact(options);\n return { identify: true };\n }\n async setNetworkLogsBlacklist(options) {\n Gleap.setNetworkLogsBlacklist(options.blacklist);\n return { blacklistSet: true };\n }\n async setNetworkLogPropsToIgnore(options) {\n Gleap.setNetworkLogPropsToIgnore(options.propsToIgnore);\n return { propsToIgnoreSet: true };\n }\n async setTags(options) {\n Gleap.setTags(options.tags);\n return { tagsSet: true };\n }\n async clearIdentity() {\n Gleap.clearIdentity();\n return { clearIdentity: true };\n }\n async getIdentity() {\n return { identity: Gleap.getIdentity() };\n }\n async isUserIdentified() {\n return { isUserIdentified: Gleap.isUserIdentified() };\n }\n async attachCustomData(options) {\n Gleap.attachCustomData(options.data);\n return { attachedCustomData: true };\n }\n async setCustomData(options) {\n Gleap.setCustomData(options.key, options.value);\n return { setCustomData: true };\n }\n async removeCustomData(options) {\n Gleap.removeCustomData(options.key);\n return { removedCustomData: true };\n }\n async clearCustomData() {\n Gleap.clearCustomData();\n return { clearedCustomData: true };\n }\n async trackEvent(options) {\n Gleap.trackEvent(options.name, options.data);\n return { loggedEvent: true };\n }\n async trackPage(options) {\n Gleap.trackEvent('pageView', {\n page: options.pageName,\n });\n return { trackedPage: true };\n }\n async startFeedbackFlow(options) {\n var _a;\n if (!options.feedbackFlow) {\n }\n Gleap.startFeedbackFlow((_a = options.feedbackFlow) !== null && _a !== void 0 ? _a : 'bugreporting', options.showBackButton);\n return { startedFeedbackFlow: true };\n }\n async startBot(options) {\n var _a;\n if (!options.botId) {\n }\n Gleap.startBot((_a = options.botId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { startedBot: true };\n }\n async setLanguage(options) {\n Gleap.setLanguage(options.languageCode);\n return { setLanguage: options.languageCode };\n }\n async log(options) {\n Gleap.log(options.message, options.logLevel);\n return { logged: true };\n }\n async setEventCallback(callback) {\n var callbackId = this.makeid(10);\n GleapWeb.callbacks[callbackId] = callback;\n return callbackId;\n }\n async sendSilentCrashReport(options) {\n Gleap.sendSilentCrashReport(options.description, options.severity, options.dataExclusion);\n return { sentSilentBugReport: true };\n }\n async open() {\n Gleap.open();\n return { openedWidget: true };\n }\n async openFeatureRequests(options) {\n Gleap.openFeatureRequests(options.showBackButton);\n return { openedFeatureRequests: true };\n }\n async openNews(options) {\n Gleap.openNews(options.showBackButton);\n return { openedNews: true };\n }\n async openNewsArticle(options) {\n Gleap.openNewsArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenter(options) {\n Gleap.openHelpCenter(options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterArticle(options) {\n Gleap.openHelpCenterArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async askAI(options) {\n Gleap.askAI(options.question, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterCollection(options) {\n Gleap.openHelpCenterCollection(options.collectionId, options.showBackButton);\n return { opened: true };\n }\n async searchHelpCenter(options) {\n Gleap.searchHelpCenter(options.term, options.showBackButton);\n return { opened: true };\n }\n async close() {\n Gleap.close();\n return { closedWidget: true };\n }\n async isOpened() {\n return { isOpened: Gleap.isOpened() };\n }\n async disableConsoleLogOverwrite() {\n Gleap.disableConsoleLogOverwrite();\n return { consoleLogDisabled: true };\n }\n async enableDebugConsoleLog() {\n return { debugConsoleLogEnabled: true };\n }\n async preFillForm(options) {\n Gleap.preFillForm(options.data);\n return { preFilledForm: true };\n }\n async addAttachment(_options) {\n throw this.unavailable('addAttachment not available for browsers');\n }\n async removeAllAttachments() {\n throw this.unavailable('removeAllAttachments not available for browsers');\n }\n async setNotificationContainerOffset(_options) {\n return { notificationContainerOffsetSet: true };\n }\n makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }\n}\nGleapWeb.callbacks = {};\nGleapWeb.initialized = false;\nGleapWeb.agentToolExecutionCounter = 0;\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Gleap"],"mappings":";;;;;AACK,MAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;AACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1D,CAAC;AACD,MAAM,oBAAoB,GAAG,EAAE;AAC/B,IAAI,yBAAyB,GAAG,KAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACK,MAAC,iBAAiB,GAAG,OAAO,IAAI,EAAE,OAAO,KAAK;AACnD,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAChD,QAAQ;AACR,IAAI;AACJ,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,OAAO;AACxC,IAAI,IAAI,CAAC,yBAAyB,EAAE;AACpC,QAAQ,yBAAyB,GAAG,IAAI;AACxC,QAAQ,MAAM,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,OAAO,IAAI,KAAK;AACtE,YAAY,IAAI,EAAE;AAClB,YAAY,IAAI;AAChB,gBAAgB,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;AAC5G,gBAAgB,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,EA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EAAE;AAClC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,0CAA0C,CAAC;AAC1E,IAAI;AACJ,IAAI,MAAM,oBAAoB,GAAG;AACjC,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,iDAAiD,CAAC;AACjF,IAAI;AACJ,IAAI,MAAM,8BAA8B,CAAC,QAAQ,EAAE;AACnD,QAAQ,OAAO,EAAE,8BAA8B,EAAE,IAAI,EAAE;AACvD,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,IAAI,MAAM,GAAG,EAAE;AACvB,QAAQ,IAAI,UAAU,GAAG,gEAAgE;AACzF,QAAQ,IAAI,gBAAgB,GAAG,UAAU,CAAC,MAAM;AAChD,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACzC,YAAY,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC;AACrF,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;AACA,QAAQ,CAAC,SAAS,GAAG,EAAE;AACvB,QAAQ,CAAC,WAAW,GAAG,KAAK;AAC5B,QAAQ,CAAC,yBAAyB,GAAG,CAAC;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Gleap = registerPlugin('Gleap', {\n web: () => import('./web').then(m => new m.GleapWeb()),\n});\nconst registeredAgentTools = {};\nlet agentToolListenerAttached = false;\n/**\n * Registers the handler for a Frontend tool defined on your AI agent in the\n * Gleap dashboard. The agent calls the handler with the configured parameters\n * and waits for the returned result (string or object, which gets\n * stringified).\n */\nconst registerAgentTool = async (name, handler) => {\n if (!name || typeof handler !== 'function') {\n return;\n }\n registeredAgentTools[name] = handler;\n if (!agentToolListenerAttached) {\n agentToolListenerAttached = true;\n await Gleap.addListener('agentToolExecution', async (data) => {\n var _a;\n try {\n const { executionId, name: toolName, params } = data !== null && data !== void 0 ? data : {};\n if (!executionId || !toolName) {\n return;\n }\n let result;\n const toolHandler = registeredAgentTools[toolName];\n if (!toolHandler) {\n result = `No handler registered for tool '${toolName}' in the app. Register one via Gleap.registerAgentTool('${toolName}', handler).`;\n }\n else {\n try {\n const handlerResult = await toolHandler(params !== null && params !== void 0 ? params : {});\n result =\n typeof handlerResult === 'string'\n ? handlerResult\n : JSON.stringify(handlerResult !== null && handlerResult !== void 0 ? handlerResult : '');\n if (!result) {\n result = 'The action completed without returning a result.';\n }\n }\n catch (error) {\n result = `Tool execution failed: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'unknown error'}`;\n }\n }\n await Gleap.sendAgentToolResult({ executionId, result });\n }\n catch (exp) {\n // Ignore.\n }\n });\n }\n await Gleap.registerAgentTool({ name });\n};\nexport * from './definitions';\nexport { Gleap, registerAgentTool };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport Gleap from 'gleap';\nexport class GleapWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pendingAgentToolExecutions = {};\n }\n async initialize(options) {\n if (GleapWeb.initialized) {\n return { initialized: true };\n }\n Gleap.initialize(options.API_KEY);\n GleapWeb.initialized = true;\n this.registerCallbackListeners();\n return { initialized: true };\n }\n async setRegion(options) {\n if (!(options === null || options === void 0 ? void 0 : options.region)) {\n throw new Error('No region provided');\n }\n Gleap.setRegion(options.region);\n return { region: options.region };\n }\n async setApiUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setApiUrl(options.url);\n return { url: options.url };\n }\n async setWSApiUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setWSApiUrl(options.url);\n return { url: options.url };\n }\n async setRealtimeHost(options) {\n if (!(options === null || options === void 0 ? void 0 : options.host)) {\n throw new Error('No host provided');\n }\n Gleap.setRealtimeHost(options.host);\n return { host: options.host };\n }\n async setFrameUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setFrameUrl(options.url);\n return { url: options.url };\n }\n async setBannerUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setBannerUrl(options.url);\n return { url: options.url };\n }\n async setModalUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setModalUrl(options.url);\n return { url: options.url };\n }\n registerCallbackListeners() {\n Gleap.on('open', () => {\n this.notifyCallbacks('open', {});\n });\n Gleap.on('initialized', () => {\n this.notifyCallbacks('initialized', {});\n });\n Gleap.on('close', () => {\n this.notifyCallbacks('close', {});\n });\n Gleap.on('feedback-sent', formData => {\n this.notifyCallbacks('feedback-sent', formData);\n });\n Gleap.on('outbound-sent', formData => {\n this.notifyCallbacks('outbound-sent', formData);\n });\n Gleap.on('tool-execution', toolExecution => {\n this.notifyCallbacks('tool-execution', toolExecution);\n });\n Gleap.on('flow-started', flow => {\n this.notifyCallbacks('flow-started', flow);\n });\n Gleap.on('error-while-sending', () => {\n this.notifyCallbacks('error-while-sending', {});\n });\n Gleap.on('unregister-pushmessage-group', groupName => {\n this.notifyCallbacks('unregister-pushmessage-group', groupName);\n });\n Gleap.on('register-pushmessage-group', groupName => {\n this.notifyCallbacks('register-pushmessage-group', groupName);\n });\n Gleap.on('unread-count-changed', groupName => {\n this.notifyCallbacks('notification-count-updated', groupName);\n });\n Gleap.registerCustomAction(customAction => {\n this.notifyCallbacks('custom-action-called', customAction);\n });\n }\n async registerAgentTool(options) {\n const gleapSdk = Gleap;\n if (typeof gleapSdk.registerAgentTool !== 'function') {\n console.warn('Gleap: registerAgentTool requires a newer version of the Gleap JS SDK.');\n return;\n }\n gleapSdk.registerAgentTool(options.name, (params) => new Promise(resolve => {\n const executionId = `web-${++GleapWeb.agentToolExecutionCounter}`;\n this.pendingAgentToolExecutions[executionId] = resolve;\n this.notifyListeners('agentToolExecution', {\n executionId,\n name: options.name,\n params: params !== null && params !== void 0 ? params : {},\n });\n }));\n }\n async sendAgentToolResult(options) {\n const resolve = this.pendingAgentToolExecutions[options.executionId];\n if (resolve) {\n delete this.pendingAgentToolExecutions[options.executionId];\n resolve(options.result);\n }\n }\n async setTicketAttribute(options) {\n Gleap.setTicketAttribute(options.key, options.value);\n return { setTicketAttribute: true };\n }\n async unsetTicketAttribute(options) {\n Gleap.unsetTicketAttribute(options.key);\n return { unsetTicketAttribute: true };\n }\n async clearTicketAttributes() {\n Gleap.clearTicketAttributes();\n return { clearTicketAttributes: true };\n }\n notifyCallbacks(event, data) {\n if (!GleapWeb.callbacks) {\n return;\n }\n for (var callbackId in GleapWeb.callbacks) {\n GleapWeb.callbacks[callbackId]({\n name: event,\n data,\n });\n }\n }\n async startClassicForm(options) {\n var _a;\n Gleap.startClassicForm((_a = options.formId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { classicFormStarted: true };\n }\n async startConversation(options) {\n Gleap.startConversation(options.showBackButton);\n return { conversationStarted: true };\n }\n async openConversation(options) {\n Gleap.openConversations(options.showBackButton);\n return { conversationsOpened: true };\n }\n async showSurvey(options) {\n Gleap.showSurvey(options.surveyId, options.format);\n return { opened: true };\n }\n async showFeedbackButton(options) {\n Gleap.showFeedbackButton(options.show ? true : false);\n return { feedbackButtonShown: true };\n }\n async setDisableInAppNotifications(options) {\n var _a;\n Gleap.setDisableInAppNotifications((_a = options.disableInAppNotifications) !== null && _a !== void 0 ? _a : false);\n return { inAppNotificationsDisabled: true };\n }\n async setDisableEnvData(options) {\n var _a;\n Gleap.setDisableEnvData((_a = options.disableEnvData) !== null && _a !== void 0 ? _a : false);\n return { envDataDisabled: true };\n }\n async identify(options) {\n var userData = {\n name: options.name,\n email: options.email,\n phone: options.phone,\n companyId: options.companyId,\n companyName: options.companyName,\n avatar: options.avatar,\n sla: options.sla,\n plan: options.plan,\n value: options.value,\n customData: options.customData,\n };\n if (options.userHash) {\n Gleap.identify(options.userId, userData, options.userHash);\n }\n else {\n Gleap.identify(options.userId, userData);\n }\n return { identify: true };\n }\n async updateContact(options) {\n Gleap.updateContact(options);\n return { identify: true };\n }\n async setNetworkLogsBlacklist(options) {\n Gleap.setNetworkLogsBlacklist(options.blacklist);\n return { blacklistSet: true };\n }\n async setNetworkLogPropsToIgnore(options) {\n Gleap.setNetworkLogPropsToIgnore(options.propsToIgnore);\n return { propsToIgnoreSet: true };\n }\n async setEnvDataPropsToIgnore(options) {\n Gleap.setEnvDataPropsToIgnore(options.propsToIgnore);\n return { envDataPropsToIgnoreSet: true };\n }\n async setTags(options) {\n Gleap.setTags(options.tags);\n return { tagsSet: true };\n }\n async clearIdentity() {\n Gleap.clearIdentity();\n return { clearIdentity: true };\n }\n async getIdentity() {\n return { identity: Gleap.getIdentity() };\n }\n async isUserIdentified() {\n return { isUserIdentified: Gleap.isUserIdentified() };\n }\n async attachCustomData(options) {\n Gleap.attachCustomData(options.data);\n return { attachedCustomData: true };\n }\n async setCustomData(options) {\n Gleap.setCustomData(options.key, options.value);\n return { setCustomData: true };\n }\n async removeCustomData(options) {\n Gleap.removeCustomData(options.key);\n return { removedCustomData: true };\n }\n async clearCustomData() {\n Gleap.clearCustomData();\n return { clearedCustomData: true };\n }\n async trackEvent(options) {\n Gleap.trackEvent(options.name, options.data);\n return { loggedEvent: true };\n }\n async trackPage(options) {\n Gleap.trackEvent('pageView', {\n page: options.pageName,\n });\n return { trackedPage: true };\n }\n async startFeedbackFlow(options) {\n var _a;\n if (!options.feedbackFlow) {\n }\n Gleap.startFeedbackFlow((_a = options.feedbackFlow) !== null && _a !== void 0 ? _a : 'bugreporting', options.showBackButton);\n return { startedFeedbackFlow: true };\n }\n async startBot(options) {\n var _a;\n if (!options.botId) {\n }\n Gleap.startBot((_a = options.botId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { startedBot: true };\n }\n async setLanguage(options) {\n Gleap.setLanguage(options.languageCode);\n return { setLanguage: options.languageCode };\n }\n async log(options) {\n Gleap.log(options.message, options.logLevel);\n return { logged: true };\n }\n async setEventCallback(callback) {\n var callbackId = this.makeid(10);\n GleapWeb.callbacks[callbackId] = callback;\n return callbackId;\n }\n async sendSilentCrashReport(options) {\n Gleap.sendSilentCrashReport(options.description, options.severity, options.dataExclusion);\n return { sentSilentBugReport: true };\n }\n async open() {\n Gleap.open();\n return { openedWidget: true };\n }\n async openFeatureRequests(options) {\n Gleap.openFeatureRequests(options.showBackButton);\n return { openedFeatureRequests: true };\n }\n async openNews(options) {\n Gleap.openNews(options.showBackButton);\n return { openedNews: true };\n }\n async openNewsArticle(options) {\n Gleap.openNewsArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenter(options) {\n Gleap.openHelpCenter(options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterArticle(options) {\n Gleap.openHelpCenterArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async askAI(options) {\n Gleap.askAI(options.question, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterCollection(options) {\n Gleap.openHelpCenterCollection(options.collectionId, options.showBackButton);\n return { opened: true };\n }\n async searchHelpCenter(options) {\n Gleap.searchHelpCenter(options.term, options.showBackButton);\n return { opened: true };\n }\n async close() {\n Gleap.close();\n return { closedWidget: true };\n }\n async isOpened() {\n return { isOpened: Gleap.isOpened() };\n }\n async disableConsoleLogOverwrite() {\n Gleap.disableConsoleLogOverwrite();\n return { consoleLogDisabled: true };\n }\n async enableDebugConsoleLog() {\n return { debugConsoleLogEnabled: true };\n }\n async preFillForm(options) {\n Gleap.preFillForm(options.data);\n return { preFilledForm: true };\n }\n async addAttachment(_options) {\n throw this.unavailable('addAttachment not available for browsers');\n }\n async removeAllAttachments() {\n throw this.unavailable('removeAllAttachments not available for browsers');\n }\n async setNotificationContainerOffset(_options) {\n return { notificationContainerOffsetSet: true };\n }\n makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }\n}\nGleapWeb.callbacks = {};\nGleapWeb.initialized = false;\nGleapWeb.agentToolExecutionCounter = 0;\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Gleap"],"mappings":";;;;;AACK,MAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;AACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1D,CAAC;AACD,MAAM,oBAAoB,GAAG,EAAE;AAC/B,IAAI,yBAAyB,GAAG,KAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACK,MAAC,iBAAiB,GAAG,OAAO,IAAI,EAAE,OAAO,KAAK;AACnD,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAChD,QAAQ;AACR,IAAI;AACJ,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,OAAO;AACxC,IAAI,IAAI,CAAC,yBAAyB,EAAE;AACpC,QAAQ,yBAAyB,GAAG,IAAI;AACxC,QAAQ,MAAM,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,OAAO,IAAI,KAAK;AACtE,YAAY,IAAI,EAAE;AAClB,YAAY,IAAI;AAChB,gBAAgB,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;AAC5G,gBAAgB,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,EAAE;AAC/C,oBAAoB;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B,QAAQ,CAAC,WAAW,GAAG,KAAK;AAC5B,QAAQ,CAAC,yBAAyB,GAAG,CAAC;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -70,6 +70,55 @@ var capacitorGleap = (function (exports, core, Gleap$1) {
|
|
|
70
70
|
this.registerCallbackListeners();
|
|
71
71
|
return { initialized: true };
|
|
72
72
|
}
|
|
73
|
+
async setRegion(options) {
|
|
74
|
+
if (!(options === null || options === void 0 ? void 0 : options.region)) {
|
|
75
|
+
throw new Error('No region provided');
|
|
76
|
+
}
|
|
77
|
+
Gleap$1.setRegion(options.region);
|
|
78
|
+
return { region: options.region };
|
|
79
|
+
}
|
|
80
|
+
async setApiUrl(options) {
|
|
81
|
+
if (!(options === null || options === void 0 ? void 0 : options.url)) {
|
|
82
|
+
throw new Error('No url provided');
|
|
83
|
+
}
|
|
84
|
+
Gleap$1.setApiUrl(options.url);
|
|
85
|
+
return { url: options.url };
|
|
86
|
+
}
|
|
87
|
+
async setWSApiUrl(options) {
|
|
88
|
+
if (!(options === null || options === void 0 ? void 0 : options.url)) {
|
|
89
|
+
throw new Error('No url provided');
|
|
90
|
+
}
|
|
91
|
+
Gleap$1.setWSApiUrl(options.url);
|
|
92
|
+
return { url: options.url };
|
|
93
|
+
}
|
|
94
|
+
async setRealtimeHost(options) {
|
|
95
|
+
if (!(options === null || options === void 0 ? void 0 : options.host)) {
|
|
96
|
+
throw new Error('No host provided');
|
|
97
|
+
}
|
|
98
|
+
Gleap$1.setRealtimeHost(options.host);
|
|
99
|
+
return { host: options.host };
|
|
100
|
+
}
|
|
101
|
+
async setFrameUrl(options) {
|
|
102
|
+
if (!(options === null || options === void 0 ? void 0 : options.url)) {
|
|
103
|
+
throw new Error('No url provided');
|
|
104
|
+
}
|
|
105
|
+
Gleap$1.setFrameUrl(options.url);
|
|
106
|
+
return { url: options.url };
|
|
107
|
+
}
|
|
108
|
+
async setBannerUrl(options) {
|
|
109
|
+
if (!(options === null || options === void 0 ? void 0 : options.url)) {
|
|
110
|
+
throw new Error('No url provided');
|
|
111
|
+
}
|
|
112
|
+
Gleap$1.setBannerUrl(options.url);
|
|
113
|
+
return { url: options.url };
|
|
114
|
+
}
|
|
115
|
+
async setModalUrl(options) {
|
|
116
|
+
if (!(options === null || options === void 0 ? void 0 : options.url)) {
|
|
117
|
+
throw new Error('No url provided');
|
|
118
|
+
}
|
|
119
|
+
Gleap$1.setModalUrl(options.url);
|
|
120
|
+
return { url: options.url };
|
|
121
|
+
}
|
|
73
122
|
registerCallbackListeners() {
|
|
74
123
|
Gleap$1.on('open', () => {
|
|
75
124
|
this.notifyCallbacks('open', {});
|
|
@@ -180,6 +229,11 @@ var capacitorGleap = (function (exports, core, Gleap$1) {
|
|
|
180
229
|
Gleap$1.setDisableInAppNotifications((_a = options.disableInAppNotifications) !== null && _a !== void 0 ? _a : false);
|
|
181
230
|
return { inAppNotificationsDisabled: true };
|
|
182
231
|
}
|
|
232
|
+
async setDisableEnvData(options) {
|
|
233
|
+
var _a;
|
|
234
|
+
Gleap$1.setDisableEnvData((_a = options.disableEnvData) !== null && _a !== void 0 ? _a : false);
|
|
235
|
+
return { envDataDisabled: true };
|
|
236
|
+
}
|
|
183
237
|
async identify(options) {
|
|
184
238
|
var userData = {
|
|
185
239
|
name: options.name,
|
|
@@ -213,6 +267,10 @@ var capacitorGleap = (function (exports, core, Gleap$1) {
|
|
|
213
267
|
Gleap$1.setNetworkLogPropsToIgnore(options.propsToIgnore);
|
|
214
268
|
return { propsToIgnoreSet: true };
|
|
215
269
|
}
|
|
270
|
+
async setEnvDataPropsToIgnore(options) {
|
|
271
|
+
Gleap$1.setEnvDataPropsToIgnore(options.propsToIgnore);
|
|
272
|
+
return { envDataPropsToIgnoreSet: true };
|
|
273
|
+
}
|
|
216
274
|
async setTags(options) {
|
|
217
275
|
Gleap$1.setTags(options.tags);
|
|
218
276
|
return { tagsSet: true };
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Gleap = registerPlugin('Gleap', {\n web: () => import('./web').then(m => new m.GleapWeb()),\n});\nconst registeredAgentTools = {};\nlet agentToolListenerAttached = false;\n/**\n * Registers the handler for a Frontend tool defined on your AI agent in the\n * Gleap dashboard. The agent calls the handler with the configured parameters\n * and waits for the returned result (string or object, which gets\n * stringified).\n */\nconst registerAgentTool = async (name, handler) => {\n if (!name || typeof handler !== 'function') {\n return;\n }\n registeredAgentTools[name] = handler;\n if (!agentToolListenerAttached) {\n agentToolListenerAttached = true;\n await Gleap.addListener('agentToolExecution', async (data) => {\n var _a;\n try {\n const { executionId, name: toolName, params } = data !== null && data !== void 0 ? data : {};\n if (!executionId || !toolName) {\n return;\n }\n let result;\n const toolHandler = registeredAgentTools[toolName];\n if (!toolHandler) {\n result = `No handler registered for tool '${toolName}' in the app. Register one via Gleap.registerAgentTool('${toolName}', handler).`;\n }\n else {\n try {\n const handlerResult = await toolHandler(params !== null && params !== void 0 ? params : {});\n result =\n typeof handlerResult === 'string'\n ? handlerResult\n : JSON.stringify(handlerResult !== null && handlerResult !== void 0 ? handlerResult : '');\n if (!result) {\n result = 'The action completed without returning a result.';\n }\n }\n catch (error) {\n result = `Tool execution failed: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'unknown error'}`;\n }\n }\n await Gleap.sendAgentToolResult({ executionId, result });\n }\n catch (exp) {\n // Ignore.\n }\n });\n }\n await Gleap.registerAgentTool({ name });\n};\nexport * from './definitions';\nexport { Gleap, registerAgentTool };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport Gleap from 'gleap';\nexport class GleapWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pendingAgentToolExecutions = {};\n }\n async initialize(options) {\n if (GleapWeb.initialized) {\n return { initialized: true };\n }\n Gleap.initialize(options.API_KEY);\n GleapWeb.initialized = true;\n this.registerCallbackListeners();\n return { initialized: true };\n }\n registerCallbackListeners() {\n Gleap.on('open', () => {\n this.notifyCallbacks('open', {});\n });\n Gleap.on('initialized', () => {\n this.notifyCallbacks('initialized', {});\n });\n Gleap.on('close', () => {\n this.notifyCallbacks('close', {});\n });\n Gleap.on('feedback-sent', formData => {\n this.notifyCallbacks('feedback-sent', formData);\n });\n Gleap.on('outbound-sent', formData => {\n this.notifyCallbacks('outbound-sent', formData);\n });\n Gleap.on('tool-execution', toolExecution => {\n this.notifyCallbacks('tool-execution', toolExecution);\n });\n Gleap.on('flow-started', flow => {\n this.notifyCallbacks('flow-started', flow);\n });\n Gleap.on('error-while-sending', () => {\n this.notifyCallbacks('error-while-sending', {});\n });\n Gleap.on('unregister-pushmessage-group', groupName => {\n this.notifyCallbacks('unregister-pushmessage-group', groupName);\n });\n Gleap.on('register-pushmessage-group', groupName => {\n this.notifyCallbacks('register-pushmessage-group', groupName);\n });\n Gleap.on('unread-count-changed', groupName => {\n this.notifyCallbacks('notification-count-updated', groupName);\n });\n Gleap.registerCustomAction(customAction => {\n this.notifyCallbacks('custom-action-called', customAction);\n });\n }\n async registerAgentTool(options) {\n const gleapSdk = Gleap;\n if (typeof gleapSdk.registerAgentTool !== 'function') {\n console.warn('Gleap: registerAgentTool requires a newer version of the Gleap JS SDK.');\n return;\n }\n gleapSdk.registerAgentTool(options.name, (params) => new Promise(resolve => {\n const executionId = `web-${++GleapWeb.agentToolExecutionCounter}`;\n this.pendingAgentToolExecutions[executionId] = resolve;\n this.notifyListeners('agentToolExecution', {\n executionId,\n name: options.name,\n params: params !== null && params !== void 0 ? params : {},\n });\n }));\n }\n async sendAgentToolResult(options) {\n const resolve = this.pendingAgentToolExecutions[options.executionId];\n if (resolve) {\n delete this.pendingAgentToolExecutions[options.executionId];\n resolve(options.result);\n }\n }\n async setTicketAttribute(options) {\n Gleap.setTicketAttribute(options.key, options.value);\n return { setTicketAttribute: true };\n }\n async unsetTicketAttribute(options) {\n Gleap.unsetTicketAttribute(options.key);\n return { unsetTicketAttribute: true };\n }\n async clearTicketAttributes() {\n Gleap.clearTicketAttributes();\n return { clearTicketAttributes: true };\n }\n notifyCallbacks(event, data) {\n if (!GleapWeb.callbacks) {\n return;\n }\n for (var callbackId in GleapWeb.callbacks) {\n GleapWeb.callbacks[callbackId]({\n name: event,\n data,\n });\n }\n }\n async startClassicForm(options) {\n var _a;\n Gleap.startClassicForm((_a = options.formId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { classicFormStarted: true };\n }\n async startConversation(options) {\n Gleap.startConversation(options.showBackButton);\n return { conversationStarted: true };\n }\n async openConversation(options) {\n Gleap.openConversations(options.showBackButton);\n return { conversationsOpened: true };\n }\n async showSurvey(options) {\n Gleap.showSurvey(options.surveyId, options.format);\n return { opened: true };\n }\n async showFeedbackButton(options) {\n Gleap.showFeedbackButton(options.show ? true : false);\n return { feedbackButtonShown: true };\n }\n async setDisableInAppNotifications(options) {\n var _a;\n Gleap.setDisableInAppNotifications((_a = options.disableInAppNotifications) !== null && _a !== void 0 ? _a : false);\n return { inAppNotificationsDisabled: true };\n }\n async identify(options) {\n var userData = {\n name: options.name,\n email: options.email,\n phone: options.phone,\n companyId: options.companyId,\n companyName: options.companyName,\n avatar: options.avatar,\n sla: options.sla,\n plan: options.plan,\n value: options.value,\n customData: options.customData,\n };\n if (options.userHash) {\n Gleap.identify(options.userId, userData, options.userHash);\n }\n else {\n Gleap.identify(options.userId, userData);\n }\n return { identify: true };\n }\n async updateContact(options) {\n Gleap.updateContact(options);\n return { identify: true };\n }\n async setNetworkLogsBlacklist(options) {\n Gleap.setNetworkLogsBlacklist(options.blacklist);\n return { blacklistSet: true };\n }\n async setNetworkLogPropsToIgnore(options) {\n Gleap.setNetworkLogPropsToIgnore(options.propsToIgnore);\n return { propsToIgnoreSet: true };\n }\n async setTags(options) {\n Gleap.setTags(options.tags);\n return { tagsSet: true };\n }\n async clearIdentity() {\n Gleap.clearIdentity();\n return { clearIdentity: true };\n }\n async getIdentity() {\n return { identity: Gleap.getIdentity() };\n }\n async isUserIdentified() {\n return { isUserIdentified: Gleap.isUserIdentified() };\n }\n async attachCustomData(options) {\n Gleap.attachCustomData(options.data);\n return { attachedCustomData: true };\n }\n async setCustomData(options) {\n Gleap.setCustomData(options.key, options.value);\n return { setCustomData: true };\n }\n async removeCustomData(options) {\n Gleap.removeCustomData(options.key);\n return { removedCustomData: true };\n }\n async clearCustomData() {\n Gleap.clearCustomData();\n return { clearedCustomData: true };\n }\n async trackEvent(options) {\n Gleap.trackEvent(options.name, options.data);\n return { loggedEvent: true };\n }\n async trackPage(options) {\n Gleap.trackEvent('pageView', {\n page: options.pageName,\n });\n return { trackedPage: true };\n }\n async startFeedbackFlow(options) {\n var _a;\n if (!options.feedbackFlow) {\n }\n Gleap.startFeedbackFlow((_a = options.feedbackFlow) !== null && _a !== void 0 ? _a : 'bugreporting', options.showBackButton);\n return { startedFeedbackFlow: true };\n }\n async startBot(options) {\n var _a;\n if (!options.botId) {\n }\n Gleap.startBot((_a = options.botId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { startedBot: true };\n }\n async setLanguage(options) {\n Gleap.setLanguage(options.languageCode);\n return { setLanguage: options.languageCode };\n }\n async log(options) {\n Gleap.log(options.message, options.logLevel);\n return { logged: true };\n }\n async setEventCallback(callback) {\n var callbackId = this.makeid(10);\n GleapWeb.callbacks[callbackId] = callback;\n return callbackId;\n }\n async sendSilentCrashReport(options) {\n Gleap.sendSilentCrashReport(options.description, options.severity, options.dataExclusion);\n return { sentSilentBugReport: true };\n }\n async open() {\n Gleap.open();\n return { openedWidget: true };\n }\n async openFeatureRequests(options) {\n Gleap.openFeatureRequests(options.showBackButton);\n return { openedFeatureRequests: true };\n }\n async openNews(options) {\n Gleap.openNews(options.showBackButton);\n return { openedNews: true };\n }\n async openNewsArticle(options) {\n Gleap.openNewsArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenter(options) {\n Gleap.openHelpCenter(options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterArticle(options) {\n Gleap.openHelpCenterArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async askAI(options) {\n Gleap.askAI(options.question, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterCollection(options) {\n Gleap.openHelpCenterCollection(options.collectionId, options.showBackButton);\n return { opened: true };\n }\n async searchHelpCenter(options) {\n Gleap.searchHelpCenter(options.term, options.showBackButton);\n return { opened: true };\n }\n async close() {\n Gleap.close();\n return { closedWidget: true };\n }\n async isOpened() {\n return { isOpened: Gleap.isOpened() };\n }\n async disableConsoleLogOverwrite() {\n Gleap.disableConsoleLogOverwrite();\n return { consoleLogDisabled: true };\n }\n async enableDebugConsoleLog() {\n return { debugConsoleLogEnabled: true };\n }\n async preFillForm(options) {\n Gleap.preFillForm(options.data);\n return { preFilledForm: true };\n }\n async addAttachment(_options) {\n throw this.unavailable('addAttachment not available for browsers');\n }\n async removeAllAttachments() {\n throw this.unavailable('removeAllAttachments not available for browsers');\n }\n async setNotificationContainerOffset(_options) {\n return { notificationContainerOffsetSet: true };\n }\n makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }\n}\nGleapWeb.callbacks = {};\nGleapWeb.initialized = false;\nGleapWeb.agentToolExecutionCounter = 0;\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Gleap"],"mappings":";;;AACK,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;IACD,MAAM,oBAAoB,GAAG,EAAE;IAC/B,IAAI,yBAAyB,GAAG,KAAK;IACrC;IAC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C,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC;IACrF,QAAQ;IACR,QAAQ,OAAO,MAAM;IACrB,IAAI;IACJ;IACA,QAAQ,CAAC,SAAS,GAAG,EAAE;IACvB,QAAQ,CAAC,WAAW,GAAG,KAAK;IAC5B,QAAQ,CAAC,yBAAyB,GAAG,CAAC;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Gleap = registerPlugin('Gleap', {\n web: () => import('./web').then(m => new m.GleapWeb()),\n});\nconst registeredAgentTools = {};\nlet agentToolListenerAttached = false;\n/**\n * Registers the handler for a Frontend tool defined on your AI agent in the\n * Gleap dashboard. The agent calls the handler with the configured parameters\n * and waits for the returned result (string or object, which gets\n * stringified).\n */\nconst registerAgentTool = async (name, handler) => {\n if (!name || typeof handler !== 'function') {\n return;\n }\n registeredAgentTools[name] = handler;\n if (!agentToolListenerAttached) {\n agentToolListenerAttached = true;\n await Gleap.addListener('agentToolExecution', async (data) => {\n var _a;\n try {\n const { executionId, name: toolName, params } = data !== null && data !== void 0 ? data : {};\n if (!executionId || !toolName) {\n return;\n }\n let result;\n const toolHandler = registeredAgentTools[toolName];\n if (!toolHandler) {\n result = `No handler registered for tool '${toolName}' in the app. Register one via Gleap.registerAgentTool('${toolName}', handler).`;\n }\n else {\n try {\n const handlerResult = await toolHandler(params !== null && params !== void 0 ? params : {});\n result =\n typeof handlerResult === 'string'\n ? handlerResult\n : JSON.stringify(handlerResult !== null && handlerResult !== void 0 ? handlerResult : '');\n if (!result) {\n result = 'The action completed without returning a result.';\n }\n }\n catch (error) {\n result = `Tool execution failed: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : 'unknown error'}`;\n }\n }\n await Gleap.sendAgentToolResult({ executionId, result });\n }\n catch (exp) {\n // Ignore.\n }\n });\n }\n await Gleap.registerAgentTool({ name });\n};\nexport * from './definitions';\nexport { Gleap, registerAgentTool };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport Gleap from 'gleap';\nexport class GleapWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pendingAgentToolExecutions = {};\n }\n async initialize(options) {\n if (GleapWeb.initialized) {\n return { initialized: true };\n }\n Gleap.initialize(options.API_KEY);\n GleapWeb.initialized = true;\n this.registerCallbackListeners();\n return { initialized: true };\n }\n async setRegion(options) {\n if (!(options === null || options === void 0 ? void 0 : options.region)) {\n throw new Error('No region provided');\n }\n Gleap.setRegion(options.region);\n return { region: options.region };\n }\n async setApiUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setApiUrl(options.url);\n return { url: options.url };\n }\n async setWSApiUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setWSApiUrl(options.url);\n return { url: options.url };\n }\n async setRealtimeHost(options) {\n if (!(options === null || options === void 0 ? void 0 : options.host)) {\n throw new Error('No host provided');\n }\n Gleap.setRealtimeHost(options.host);\n return { host: options.host };\n }\n async setFrameUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setFrameUrl(options.url);\n return { url: options.url };\n }\n async setBannerUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setBannerUrl(options.url);\n return { url: options.url };\n }\n async setModalUrl(options) {\n if (!(options === null || options === void 0 ? void 0 : options.url)) {\n throw new Error('No url provided');\n }\n Gleap.setModalUrl(options.url);\n return { url: options.url };\n }\n registerCallbackListeners() {\n Gleap.on('open', () => {\n this.notifyCallbacks('open', {});\n });\n Gleap.on('initialized', () => {\n this.notifyCallbacks('initialized', {});\n });\n Gleap.on('close', () => {\n this.notifyCallbacks('close', {});\n });\n Gleap.on('feedback-sent', formData => {\n this.notifyCallbacks('feedback-sent', formData);\n });\n Gleap.on('outbound-sent', formData => {\n this.notifyCallbacks('outbound-sent', formData);\n });\n Gleap.on('tool-execution', toolExecution => {\n this.notifyCallbacks('tool-execution', toolExecution);\n });\n Gleap.on('flow-started', flow => {\n this.notifyCallbacks('flow-started', flow);\n });\n Gleap.on('error-while-sending', () => {\n this.notifyCallbacks('error-while-sending', {});\n });\n Gleap.on('unregister-pushmessage-group', groupName => {\n this.notifyCallbacks('unregister-pushmessage-group', groupName);\n });\n Gleap.on('register-pushmessage-group', groupName => {\n this.notifyCallbacks('register-pushmessage-group', groupName);\n });\n Gleap.on('unread-count-changed', groupName => {\n this.notifyCallbacks('notification-count-updated', groupName);\n });\n Gleap.registerCustomAction(customAction => {\n this.notifyCallbacks('custom-action-called', customAction);\n });\n }\n async registerAgentTool(options) {\n const gleapSdk = Gleap;\n if (typeof gleapSdk.registerAgentTool !== 'function') {\n console.warn('Gleap: registerAgentTool requires a newer version of the Gleap JS SDK.');\n return;\n }\n gleapSdk.registerAgentTool(options.name, (params) => new Promise(resolve => {\n const executionId = `web-${++GleapWeb.agentToolExecutionCounter}`;\n this.pendingAgentToolExecutions[executionId] = resolve;\n this.notifyListeners('agentToolExecution', {\n executionId,\n name: options.name,\n params: params !== null && params !== void 0 ? params : {},\n });\n }));\n }\n async sendAgentToolResult(options) {\n const resolve = this.pendingAgentToolExecutions[options.executionId];\n if (resolve) {\n delete this.pendingAgentToolExecutions[options.executionId];\n resolve(options.result);\n }\n }\n async setTicketAttribute(options) {\n Gleap.setTicketAttribute(options.key, options.value);\n return { setTicketAttribute: true };\n }\n async unsetTicketAttribute(options) {\n Gleap.unsetTicketAttribute(options.key);\n return { unsetTicketAttribute: true };\n }\n async clearTicketAttributes() {\n Gleap.clearTicketAttributes();\n return { clearTicketAttributes: true };\n }\n notifyCallbacks(event, data) {\n if (!GleapWeb.callbacks) {\n return;\n }\n for (var callbackId in GleapWeb.callbacks) {\n GleapWeb.callbacks[callbackId]({\n name: event,\n data,\n });\n }\n }\n async startClassicForm(options) {\n var _a;\n Gleap.startClassicForm((_a = options.formId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { classicFormStarted: true };\n }\n async startConversation(options) {\n Gleap.startConversation(options.showBackButton);\n return { conversationStarted: true };\n }\n async openConversation(options) {\n Gleap.openConversations(options.showBackButton);\n return { conversationsOpened: true };\n }\n async showSurvey(options) {\n Gleap.showSurvey(options.surveyId, options.format);\n return { opened: true };\n }\n async showFeedbackButton(options) {\n Gleap.showFeedbackButton(options.show ? true : false);\n return { feedbackButtonShown: true };\n }\n async setDisableInAppNotifications(options) {\n var _a;\n Gleap.setDisableInAppNotifications((_a = options.disableInAppNotifications) !== null && _a !== void 0 ? _a : false);\n return { inAppNotificationsDisabled: true };\n }\n async setDisableEnvData(options) {\n var _a;\n Gleap.setDisableEnvData((_a = options.disableEnvData) !== null && _a !== void 0 ? _a : false);\n return { envDataDisabled: true };\n }\n async identify(options) {\n var userData = {\n name: options.name,\n email: options.email,\n phone: options.phone,\n companyId: options.companyId,\n companyName: options.companyName,\n avatar: options.avatar,\n sla: options.sla,\n plan: options.plan,\n value: options.value,\n customData: options.customData,\n };\n if (options.userHash) {\n Gleap.identify(options.userId, userData, options.userHash);\n }\n else {\n Gleap.identify(options.userId, userData);\n }\n return { identify: true };\n }\n async updateContact(options) {\n Gleap.updateContact(options);\n return { identify: true };\n }\n async setNetworkLogsBlacklist(options) {\n Gleap.setNetworkLogsBlacklist(options.blacklist);\n return { blacklistSet: true };\n }\n async setNetworkLogPropsToIgnore(options) {\n Gleap.setNetworkLogPropsToIgnore(options.propsToIgnore);\n return { propsToIgnoreSet: true };\n }\n async setEnvDataPropsToIgnore(options) {\n Gleap.setEnvDataPropsToIgnore(options.propsToIgnore);\n return { envDataPropsToIgnoreSet: true };\n }\n async setTags(options) {\n Gleap.setTags(options.tags);\n return { tagsSet: true };\n }\n async clearIdentity() {\n Gleap.clearIdentity();\n return { clearIdentity: true };\n }\n async getIdentity() {\n return { identity: Gleap.getIdentity() };\n }\n async isUserIdentified() {\n return { isUserIdentified: Gleap.isUserIdentified() };\n }\n async attachCustomData(options) {\n Gleap.attachCustomData(options.data);\n return { attachedCustomData: true };\n }\n async setCustomData(options) {\n Gleap.setCustomData(options.key, options.value);\n return { setCustomData: true };\n }\n async removeCustomData(options) {\n Gleap.removeCustomData(options.key);\n return { removedCustomData: true };\n }\n async clearCustomData() {\n Gleap.clearCustomData();\n return { clearedCustomData: true };\n }\n async trackEvent(options) {\n Gleap.trackEvent(options.name, options.data);\n return { loggedEvent: true };\n }\n async trackPage(options) {\n Gleap.trackEvent('pageView', {\n page: options.pageName,\n });\n return { trackedPage: true };\n }\n async startFeedbackFlow(options) {\n var _a;\n if (!options.feedbackFlow) {\n }\n Gleap.startFeedbackFlow((_a = options.feedbackFlow) !== null && _a !== void 0 ? _a : 'bugreporting', options.showBackButton);\n return { startedFeedbackFlow: true };\n }\n async startBot(options) {\n var _a;\n if (!options.botId) {\n }\n Gleap.startBot((_a = options.botId) !== null && _a !== void 0 ? _a : '', options.showBackButton);\n return { startedBot: true };\n }\n async setLanguage(options) {\n Gleap.setLanguage(options.languageCode);\n return { setLanguage: options.languageCode };\n }\n async log(options) {\n Gleap.log(options.message, options.logLevel);\n return { logged: true };\n }\n async setEventCallback(callback) {\n var callbackId = this.makeid(10);\n GleapWeb.callbacks[callbackId] = callback;\n return callbackId;\n }\n async sendSilentCrashReport(options) {\n Gleap.sendSilentCrashReport(options.description, options.severity, options.dataExclusion);\n return { sentSilentBugReport: true };\n }\n async open() {\n Gleap.open();\n return { openedWidget: true };\n }\n async openFeatureRequests(options) {\n Gleap.openFeatureRequests(options.showBackButton);\n return { openedFeatureRequests: true };\n }\n async openNews(options) {\n Gleap.openNews(options.showBackButton);\n return { openedNews: true };\n }\n async openNewsArticle(options) {\n Gleap.openNewsArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenter(options) {\n Gleap.openHelpCenter(options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterArticle(options) {\n Gleap.openHelpCenterArticle(options.articleId, options.showBackButton);\n return { opened: true };\n }\n async askAI(options) {\n Gleap.askAI(options.question, options.showBackButton);\n return { opened: true };\n }\n async openHelpCenterCollection(options) {\n Gleap.openHelpCenterCollection(options.collectionId, options.showBackButton);\n return { opened: true };\n }\n async searchHelpCenter(options) {\n Gleap.searchHelpCenter(options.term, options.showBackButton);\n return { opened: true };\n }\n async close() {\n Gleap.close();\n return { closedWidget: true };\n }\n async isOpened() {\n return { isOpened: Gleap.isOpened() };\n }\n async disableConsoleLogOverwrite() {\n Gleap.disableConsoleLogOverwrite();\n return { consoleLogDisabled: true };\n }\n async enableDebugConsoleLog() {\n return { debugConsoleLogEnabled: true };\n }\n async preFillForm(options) {\n Gleap.preFillForm(options.data);\n return { preFilledForm: true };\n }\n async addAttachment(_options) {\n throw this.unavailable('addAttachment not available for browsers');\n }\n async removeAllAttachments() {\n throw this.unavailable('removeAllAttachments not available for browsers');\n }\n async setNotificationContainerOffset(_options) {\n return { notificationContainerOffsetSet: true };\n }\n makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }\n}\nGleapWeb.callbacks = {};\nGleapWeb.initialized = false;\nGleapWeb.agentToolExecutionCounter = 0;\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Gleap"],"mappings":";;;AACK,UAAC,KAAK,GAAGA,mBAAc,CAAC,OAAO,EAAE;IACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;IACD,MAAM,oBAAoB,GAAG,EAAE;IAC/B,IAAI,yBAAyB,GAAG,KAAK;IACrC;IACA;IACA;IACA;IACA;IAC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,CAAC,iDAAiD,CAAC;IACjF,IAAI;IACJ,IAAI,MAAM,8BAA8B,CAAC,QAAQ,EAAE;IACnD,QAAQ,OAAO,EAAE,8BAA8B,EAAE,IAAI,EAAE;IACvD,IAAI;IACJ,IAAI,MAAM,CAAC,MAAM,EAAE;IACnB,QAAQ,IAAI,MAAM,GAAG,EAAE;IACvB,QAAQ,IAAI,UAAU,GAAG,gEAAgE;IACzF,QAAQ,IAAI,gBAAgB,GAAG,UAAU,CAAC,MAAM;IAChD,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;IACzC,YAAY,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC;IACrF,QAAQ;IACR,QAAQ,OAAO,MAAM;IACrB,IAAI;IACJ;IACA,QAAQ,CAAC,SAAS,GAAG,EAAE;IACvB,QAAQ,CAAC,WAAW,GAAG,KAAK;IAC5B,QAAQ,CAAC,yBAAyB,GAAG,CAAC;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/GleapPlugin.m
CHANGED
|
@@ -5,11 +5,19 @@
|
|
|
5
5
|
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
6
|
CAP_PLUGIN(GleapPlugin, "Gleap",
|
|
7
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);
|
|
8
15
|
CAP_PLUGIN_METHOD(identify, CAPPluginReturnPromise);
|
|
9
16
|
CAP_PLUGIN_METHOD(updateContact, CAPPluginReturnPromise);
|
|
10
17
|
CAP_PLUGIN_METHOD(clearIdentity, CAPPluginReturnPromise);
|
|
11
18
|
CAP_PLUGIN_METHOD(setNetworkLogsBlacklist, CAPPluginReturnPromise);
|
|
12
19
|
CAP_PLUGIN_METHOD(setNetworkLogPropsToIgnore, CAPPluginReturnPromise);
|
|
20
|
+
CAP_PLUGIN_METHOD(setEnvDataPropsToIgnore, CAPPluginReturnPromise);
|
|
13
21
|
CAP_PLUGIN_METHOD(attachCustomData, CAPPluginReturnPromise);
|
|
14
22
|
CAP_PLUGIN_METHOD(setCustomData, CAPPluginReturnPromise);
|
|
15
23
|
CAP_PLUGIN_METHOD(removeCustomData, CAPPluginReturnPromise);
|
|
@@ -52,6 +60,7 @@ CAP_PLUGIN(GleapPlugin, "Gleap",
|
|
|
52
60
|
CAP_PLUGIN_METHOD(isUserIdentified, CAPPluginReturnPromise);
|
|
53
61
|
CAP_PLUGIN_METHOD(setTags, CAPPluginReturnPromise);
|
|
54
62
|
CAP_PLUGIN_METHOD(setDisableInAppNotifications, CAPPluginReturnPromise);
|
|
63
|
+
CAP_PLUGIN_METHOD(setDisableEnvData, CAPPluginReturnPromise);
|
|
55
64
|
CAP_PLUGIN_METHOD(startClassicForm, CAPPluginReturnPromise);
|
|
56
65
|
CAP_PLUGIN_METHOD(startConversation, CAPPluginReturnPromise);
|
|
57
66
|
CAP_PLUGIN_METHOD(openConversations, CAPPluginReturnPromise);
|
|
@@ -32,6 +32,105 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
32
32
|
])
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
// Data region & host overrides. All of them must be called before initialize.
|
|
36
|
+
@objc func setRegion(_ call: CAPPluginCall) {
|
|
37
|
+
guard let region = call.options["region"] as? String else {
|
|
38
|
+
call.reject("No region provided")
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Gleap.setRegion(region)
|
|
43
|
+
|
|
44
|
+
// Provide feedback that it has been success
|
|
45
|
+
call.resolve([
|
|
46
|
+
"region": region
|
|
47
|
+
])
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@objc func setApiUrl(_ call: CAPPluginCall) {
|
|
51
|
+
guard let url = call.options["url"] as? String else {
|
|
52
|
+
call.reject("No url provided")
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Gleap.setApiUrl(url)
|
|
57
|
+
|
|
58
|
+
// Provide feedback that it has been success
|
|
59
|
+
call.resolve([
|
|
60
|
+
"url": url
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@objc func setWSApiUrl(_ call: CAPPluginCall) {
|
|
65
|
+
guard let url = call.options["url"] as? String else {
|
|
66
|
+
call.reject("No url provided")
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
Gleap.setWSApiUrl(url)
|
|
71
|
+
|
|
72
|
+
// Provide feedback that it has been success
|
|
73
|
+
call.resolve([
|
|
74
|
+
"url": url
|
|
75
|
+
])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@objc func setRealtimeHost(_ call: CAPPluginCall) {
|
|
79
|
+
guard let host = call.options["host"] as? String else {
|
|
80
|
+
call.reject("No host provided")
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
Gleap.setRealtimeHost(host)
|
|
85
|
+
|
|
86
|
+
// Provide feedback that it has been success
|
|
87
|
+
call.resolve([
|
|
88
|
+
"host": host
|
|
89
|
+
])
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@objc func setFrameUrl(_ call: CAPPluginCall) {
|
|
93
|
+
guard let url = call.options["url"] as? String else {
|
|
94
|
+
call.reject("No url provided")
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Gleap.setFrameUrl(url)
|
|
99
|
+
|
|
100
|
+
// Provide feedback that it has been success
|
|
101
|
+
call.resolve([
|
|
102
|
+
"url": url
|
|
103
|
+
])
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@objc func setBannerUrl(_ call: CAPPluginCall) {
|
|
107
|
+
guard let url = call.options["url"] as? String else {
|
|
108
|
+
call.reject("No url provided")
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
Gleap.setBannerUrl(url)
|
|
113
|
+
|
|
114
|
+
// Provide feedback that it has been success
|
|
115
|
+
call.resolve([
|
|
116
|
+
"url": url
|
|
117
|
+
])
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@objc func setModalUrl(_ call: CAPPluginCall) {
|
|
121
|
+
guard let url = call.options["url"] as? String else {
|
|
122
|
+
call.reject("No url provided")
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
Gleap.setModalUrl(url)
|
|
127
|
+
|
|
128
|
+
// Provide feedback that it has been success
|
|
129
|
+
call.resolve([
|
|
130
|
+
"url": url
|
|
131
|
+
])
|
|
132
|
+
}
|
|
133
|
+
|
|
35
134
|
@objc func identify(_ call: CAPPluginCall) {
|
|
36
135
|
// If userId is empty, then pass back error
|
|
37
136
|
guard let userId = call.options["userId"] as? String else {
|
|
@@ -228,6 +327,22 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
228
327
|
])
|
|
229
328
|
}
|
|
230
329
|
|
|
330
|
+
@objc func setEnvDataPropsToIgnore(_ call: CAPPluginCall) {
|
|
331
|
+
// If value is empty, then pass back error
|
|
332
|
+
guard let propsToIgnore = call.options["propsToIgnore"] as? [String] else {
|
|
333
|
+
call.reject("Must provide a propsToIgnore array")
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Remove these env data keys before a ticket is sent
|
|
338
|
+
Gleap.setEnvDataPropsToIgnore(propsToIgnore)
|
|
339
|
+
|
|
340
|
+
// Provide feedback that it has been success
|
|
341
|
+
call.resolve([
|
|
342
|
+
"envDataPropsToIgnoreSet": true
|
|
343
|
+
])
|
|
344
|
+
}
|
|
345
|
+
|
|
231
346
|
@objc func setTags(_ call: CAPPluginCall) {
|
|
232
347
|
// If value is empty, then pass back error
|
|
233
348
|
guard let tags = call.options["tags"] as? [String] else {
|
|
@@ -468,6 +583,17 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
468
583
|
])
|
|
469
584
|
}
|
|
470
585
|
|
|
586
|
+
@objc func setDisableEnvData(_ call: CAPPluginCall) {
|
|
587
|
+
let disableEnvData = call.getBool("disableEnvData") ?? false
|
|
588
|
+
|
|
589
|
+
Gleap.setDisableEnvData(disableEnvData)
|
|
590
|
+
|
|
591
|
+
// Provide feedback that it has been success
|
|
592
|
+
call.resolve([
|
|
593
|
+
"envDataDisabled": true
|
|
594
|
+
])
|
|
595
|
+
}
|
|
596
|
+
|
|
471
597
|
@objc func showFeedbackButton(_ call: CAPPluginCall) {
|
|
472
598
|
let showFeedbackButton = call.getBool("show") ?? false
|
|
473
599
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"homepage": "https://www.gleap.ai",
|
|
2
3
|
"name": "capacitor-gleap-plugin",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Gleap SDK for Capacitor
|
|
4
|
+
"version": "18.1.0",
|
|
5
|
+
"description": "Gleap SDK for Capacitor and Ionic: AI customer support, live chat, in-app bug reporting and customer feedback.",
|
|
5
6
|
"main": "dist/plugin.cjs.js",
|
|
6
7
|
"module": "dist/esm/index.js",
|
|
7
8
|
"types": "dist/esm/index.d.ts",
|
|
@@ -25,7 +26,13 @@
|
|
|
25
26
|
"keywords": [
|
|
26
27
|
"capacitor",
|
|
27
28
|
"plugin",
|
|
28
|
-
"native"
|
|
29
|
+
"native",
|
|
30
|
+
"gleap",
|
|
31
|
+
"ionic",
|
|
32
|
+
"customer-support",
|
|
33
|
+
"bug-reporting",
|
|
34
|
+
"customer-feedback",
|
|
35
|
+
"intercom-alternative"
|
|
29
36
|
],
|
|
30
37
|
"scripts": {
|
|
31
38
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
@@ -76,6 +83,6 @@
|
|
|
76
83
|
}
|
|
77
84
|
},
|
|
78
85
|
"dependencies": {
|
|
79
|
-
"gleap": "
|
|
86
|
+
"gleap": "^18.1.0"
|
|
80
87
|
}
|
|
81
88
|
}
|