wineater-bot 4.7.0 → 4.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "4.7.0",
3
+ "version": "4.9.0",
4
4
  "description": "",
5
5
  "main": "dist/wineater-chatbot.mjs",
6
6
  "module": "src/index.js",
@@ -115,13 +115,7 @@ class WineaterApi {
115
115
  }
116
116
  }
117
117
 
118
- function getApiVersion(): string {
119
- const scriptTag = (document.currentScript as HTMLScriptElement | null)
120
- || document.querySelector('script[src*="embed.js"]');
121
- return scriptTag?.getAttribute('api-version') || '1';
122
- }
123
-
124
118
  const DEMO_TOKEN = 'HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG';
125
119
  const token = window?.wineaterData?.CLIENT_TOKEN || DEMO_TOKEN;
126
- const apiVersion = getApiVersion();
120
+ const apiVersion = String(window?.wineaterData?.apiVersion || '1');
127
121
  export const wineaterApi = new WineaterApi(token, apiVersion)