@inploi/plugin-chatbot 1.0.2 → 1.0.4

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/.eslintrc.cjs CHANGED
@@ -6,5 +6,5 @@ module.exports = {
6
6
  extends: ['custom', 'plugin:react-hooks/recommended'],
7
7
  plugins: ['react-hooks'],
8
8
  env: { browser: true, es2020: true },
9
- parserOptions: { project: ['./packages/plugin-chatbot/tsconfig.json'] },
9
+ parserOptions: { project: ['./tsconfig.json'], tsconfigRootDir: __dirname },
10
10
  };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @inploi/plugin-chatbot
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @inploi/core@1.5.2
9
+ - @inploi/sdk@1.4.3
10
+
11
+ ## 1.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @inploi/core@1.5.1
17
+ - @inploi/sdk@1.4.2
18
+
3
19
  ## 1.0.2
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inploi/plugin-chatbot",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@hookform/resolvers": "^3.3.2",
@@ -19,7 +19,7 @@
19
19
  "vaul": "^0.7.8",
20
20
  "zod": "^3.22.0",
21
21
  "zustand": "^4.4.4",
22
- "@inploi/core": "1.5.0"
22
+ "@inploi/core": "1.5.2"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@inploi/sdk": "*"
@@ -42,9 +42,9 @@
42
42
  "typescript": "^5.1.6",
43
43
  "vite": "^4.4.5",
44
44
  "vite-tsconfig-paths": "^4.2.1",
45
- "@inploi/sdk": "1.4.1",
46
- "eslint-config-custom": "0.1.0",
47
- "tsconfig": "0.1.0"
45
+ "@inploi/sdk": "1.4.3",
46
+ "tsconfig": "0.1.0",
47
+ "eslint-config-custom": "0.1.0"
48
48
  },
49
49
  "msw": {
50
50
  "workerDirectory": "public"
@@ -53,6 +53,7 @@
53
53
  "dev": "vite",
54
54
  "build": "tsc && vite build",
55
55
  "setup-local": "cp -n .env.example .env || true",
56
+ "lint": "eslint src --fix --max-warnings 0",
56
57
  "preview": "vite preview"
57
58
  }
58
59
  }
package/src/chatbot.ts CHANGED
@@ -8,7 +8,6 @@ import { useChatbotStore, useLocalState } from './chatbot.state';
8
8
 
9
9
  export const chatbotPlugin = ({
10
10
  _internal_domManager: dom = createChatbotDomManager(),
11
- geolocationApiKey,
12
11
  }: {
13
12
  geolocationApiKey?: string;
14
13
  _internal_domManager?: ChatbotDomManager;
@@ -22,10 +21,10 @@ export const chatbotPlugin = ({
22
21
  prepare: async () => {
23
22
  try {
24
23
  await import('~/ui/chatbot');
25
- logger?.info('Chatbot plugin prepared');
24
+ logger.info('Chatbot plugin prepared');
26
25
  } catch (error) {
27
26
  console.error(error);
28
- logger?.error('Error preparing chatbot plugin', error);
27
+ logger.error('Error preparing chatbot plugin', error);
29
28
  }
30
29
  },
31
30
  startApplication: async ({ jobId }: { jobId: string }) => {
@@ -47,13 +46,13 @@ export const chatbotPlugin = ({
47
46
  const Chatbot = chatbotPromise.value;
48
47
  const application = dataPromise.value;
49
48
  startApplication(application);
50
- logger?.info(`Starting application for job "${application.job.id}" using flow "${application.flow.id}"`);
49
+ logger.info(`Starting application for job "${application.job.id}" using flow "${application.flow.id}"`);
51
50
  chatbotElement.innerHTML = '';
52
51
 
53
52
  render(h(Chatbot, { apiClient, logger }), chatbotElement);
54
53
  } catch (error) {
55
54
  console.error(error);
56
- logger?.error('Error starting application', error);
55
+ logger.error('Error starting application', error);
57
56
  }
58
57
  },
59
58
  closeApplication: async () => {
@@ -22,7 +22,7 @@ export const handlers = [
22
22
  };
23
23
  return new Response(JSON.stringify(mockApplication));
24
24
  }),
25
- http.post(`${import.meta.env.VITE_BASE_URL}/flow/job/:jobId`, ctx => {
25
+ http.post(`${import.meta.env.VITE_BASE_URL}/flow/job/:jobId`, () => {
26
26
  return new Response(JSON.stringify({ message: 'Success' }));
27
27
  }),
28
28
  ];