diff --git a/.DS_Store b/.DS_Store index bb9402f..48da477 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.eslintrc.js b/.eslintrc.js index 098a2a8..397eff0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,24 +1,6 @@ module.exports = { - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" - ], - "overrides": [ - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "react", - "@typescript-eslint" - ], - "rules": { - } -} + 'extends': [ + '@jitsi/eslint-config', + '@jitsi/eslint-config/typescript' + ] +}; diff --git a/.gitignore b/.gitignore index 3c3629e..0e30a66 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +/lib +.DS_Store \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ed35695..bdd70ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "meet-hour-react-web-sdk", - "version": "1.3.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "meet-hour-react-web-sdk", - "version": "1.3.0", + "version": "1.0.1", "license": "Apache-2.0", "devDependencies": { "@babel/core": "^7.15.8", @@ -17,8 +17,8 @@ "@types/node": "^16.11.7", "@types/react": "^17.0.33", "@types/react-dom": "^17.0.10", - "@typescript-eslint/eslint-plugin": "^5.44.0", - "@typescript-eslint/parser": "^5.44.0", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", "babel-eslint": "^10.1.0", "babel-jest": "^27.3.1", "babel-loader": "^8.2.3", @@ -27,7 +27,6 @@ "enzyme-to-json": "^3.6.2", "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.2", - "eslint-plugin-react": "^7.31.11", "jest": "^27.3.1", "jest-cli": "^27.3.1", "ts-jest": "^27.0.7", @@ -2348,37 +2347,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.tosorted": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", - "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3424,15 +3392,6 @@ "dev": true, "peer": true }, - "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - } - }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -3777,73 +3736,6 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/eslint-plugin-react": { - "version": "7.31.11", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.11.tgz", - "integrity": "sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==", - "dev": true, - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "array.prototype.tosorted": "^1.1.1", - "doctrine": "^2.1.0", - "estraverse": "^5.3.0", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "object.hasown": "^1.1.2", - "object.values": "^1.1.6", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.3", - "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.8" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" - } - }, - "node_modules/eslint-plugin-react/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-react/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", - "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -7012,19 +6904,6 @@ "node": ">=6" } }, - "node_modules/jsx-ast-utils": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", - "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", - "dev": true, - "dependencies": { - "array-includes": "^3.1.5", - "object.assign": "^4.1.3" - }, - "engines": { - "node": ">=4.0" - } - }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -7473,19 +7352,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.hasown": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.2.tgz", - "integrity": "sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object.values": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", @@ -8268,25 +8134,6 @@ "node": ">=8" } }, - "node_modules/string.prototype.matchall": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", - "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.4.3", - "side-channel": "^1.0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz", @@ -8420,18 +8267,6 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -11015,31 +10850,6 @@ "es-abstract": "^1.19.0" } }, - "array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0" - } - }, - "array.prototype.tosorted": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", - "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" - } - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -11851,15 +11661,6 @@ "dev": true, "peer": true }, - "es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -12258,57 +12059,6 @@ } } }, - "eslint-plugin-react": { - "version": "7.31.11", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.11.tgz", - "integrity": "sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==", - "dev": true, - "requires": { - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "array.prototype.tosorted": "^1.1.1", - "doctrine": "^2.1.0", - "estraverse": "^5.3.0", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "object.hasown": "^1.1.2", - "object.values": "^1.1.6", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.3", - "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.8" - }, - "dependencies": { - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - } - } - }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -14523,16 +14273,6 @@ "minimist": "^1.2.5" } }, - "jsx-ast-utils": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", - "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", - "dev": true, - "requires": { - "array-includes": "^3.1.5", - "object.assign": "^4.1.3" - } - }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -14880,16 +14620,6 @@ "es-abstract": "^1.20.4" } }, - "object.hasown": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.2.tgz", - "integrity": "sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==", - "dev": true, - "requires": { - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - } - }, "object.values": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", @@ -15480,22 +15210,6 @@ "strip-ansi": "^6.0.1" } }, - "string.prototype.matchall": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", - "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.4.3", - "side-channel": "^1.0.4" - } - }, "string.prototype.trim": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.5.tgz", @@ -15592,12 +15306,6 @@ } } }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", diff --git a/package.json b/package.json index 2f7e596..3ed7f6a 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "@types/node": "^16.11.7", "@types/react": "^17.0.33", "@types/react-dom": "^17.0.10", - "@typescript-eslint/eslint-plugin": "^5.44.0", - "@typescript-eslint/parser": "^5.44.0", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", "babel-eslint": "^10.1.0", "babel-jest": "^27.3.1", "babel-loader": "^8.2.3", @@ -45,7 +45,6 @@ "enzyme-to-json": "^3.6.2", "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.2", - "eslint-plugin-react": "^7.31.11", "jest": "^27.3.1", "jest-cli": "^27.3.1", "ts-jest": "^27.0.7", diff --git a/src/__tests__/Init.test.ts b/src/__tests__/Init.test.ts index 99fb405..322a290 100644 --- a/src/__tests__/Init.test.ts +++ b/src/__tests__/Init.test.ts @@ -1,6 +1,6 @@ import { fetchExternalApi } from '../init'; -const SUCCESS_DOMAIN = 'meet.jit.si'; +const SUCCESS_DOMAIN = 'meethour.io'; const ERROR_DOMAIN = 'error'; /* eslint-disable no-undef */ diff --git a/src/__tests__/MeetHourMeeting.test.tsx b/src/__tests__/MeetHourMeeting.test.tsx index dc624ab..c007b92 100644 --- a/src/__tests__/MeetHourMeeting.test.tsx +++ b/src/__tests__/MeetHourMeeting.test.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { DEFAULT_DOMAIN } from '../constants'; import { MeetHourMeeting } from '../index'; -import { IMeetHourExternalAPI } from '../types'; +import { IMeetHourExternalApi } from '../types'; /* eslint-disable no-undef */ @@ -13,7 +13,7 @@ describe('MeetHourMeeting component', () => { const props = { domain: DEFAULT_DOMAIN, roomName: 'TestingMeetHourMeetingComponent', - onApiReady: (externalApi: IMeetHourExternalAPI) => { + onApiReady: (externalApi: IMeetHourExternalApi) => { console.log(externalApi); } }; @@ -31,8 +31,8 @@ describe('MeetHourMeeting component', () => { it('should render iframe', () => { const props = { domain: DEFAULT_DOMAIN, - roomName: 'TestingMeetHourIFrame', - onApiReady: (externalApi: IMeetHourExternalAPI) => { + roomName: 'TestingMeetIFrame', + onApiReady: (externalApi: IMeetHourExternalApi) => { console.log(externalApi); } }; diff --git a/src/components/MeetHourMeeting.tsx b/src/components/MeetHourMeeting.tsx index b970943..4d01bd6 100644 --- a/src/components/MeetHourMeeting.tsx +++ b/src/components/MeetHourMeeting.tsx @@ -9,7 +9,7 @@ import React, { import { DEFAULT_DOMAIN } from '../constants'; import { fetchExternalApi } from '../init'; -import { IMeetHourExternalAPI, IMeetHourMeetingProps, MeetHourExternalAPI } from '../types'; +import { IMeetHourExternalApi, IMeetHourMeetingProps, MeetHourExternalAPI } from '../types'; import { generateComponentId, getAppId } from '../utils'; /** @@ -46,7 +46,7 @@ const MeetHourMeeting = ({ const [ loading, setLoading ] = useState(true); const [ apiLoaded, setApiLoaded ] = useState(false); const externalApi = useRef(); - const apiRef = useRef(); + const apiRef = useRef(); const meetingRef = useRef(null); const componentId = useMemo(() => generateComponentId('MeetHourMeeting') @@ -61,6 +61,7 @@ const MeetHourMeeting = ({ .catch((e: Error) => console.error(e.message)); }, []); + // eslint-disable-next-line @typescript-eslint/no-shadow const loadIFrame = useCallback((MeetHourExternalAPI: MeetHourExternalAPI) => { apiRef.current = new MeetHourExternalAPI(domain, { roomName, diff --git a/src/constants/index.ts b/src/constants/index.ts index 850c374..4624cb1 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1 +1 @@ -export const DEFAULT_DOMAIN = 'meethour.io'; \ No newline at end of file +export const DEFAULT_DOMAIN = 'meethour.io'; diff --git a/src/init.ts b/src/init.ts index 2c45a7c..8c486fe 100644 --- a/src/init.ts +++ b/src/init.ts @@ -11,11 +11,12 @@ const loadExternalApi = async ( } const script: HTMLScriptElement = document.createElement('script'); - const releaseParam: string = release ? `?release=${release}` : ''; - const appIdPath: string = appId ? `${appId}/` : ''; + const APIURL: string = domain ? `api.${domain}` : 'api.meethour.io'; + const releaseParam: string = release ? `?release=${release}` : 'v2.4.3'; + const appIdPath: string = appId ? `${appId}/` : 'libs'; script.async = true; - script.src = `https://${domain}/${appIdPath}external_api.js${releaseParam}`; + script.src = `https:/${APIURL}/${appIdPath}/${releaseParam}/external_api.min.js`; script.onload = () => resolve(window.MeetHourExternalAPI); script.onerror = () => reject(new Error(`Script load error: ${script.src}`)); document.head.appendChild(script as Node); diff --git a/src/test-helpers/setupTests.js b/src/test-helpers/setupTests.js index 82edfc9..bf9443b 100644 --- a/src/test-helpers/setupTests.js +++ b/src/test-helpers/setupTests.js @@ -1,4 +1,4 @@ -import { configure } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; +const enzyme = require('enzyme'); +const Adapter = require('enzyme-adapter-react-16'); -configure({ adapter: new Adapter() }); +enzyme.configure({ adapter: new Adapter() }); diff --git a/src/types/IMeetHourExternalApi.ts b/src/types/IMeetHourExternalApi.ts index 249dba4..a60b047 100644 --- a/src/types/IMeetHourExternalApi.ts +++ b/src/types/IMeetHourExternalApi.ts @@ -1,6 +1,6 @@ import EventEmitter from 'events'; -export default interface IMeetHourExternalAPI extends EventEmitter { +export default interface IMeetHourExternalApi extends EventEmitter { /** * Adds an event listener to the Meet Hour External API. diff --git a/src/types/IMeetingProps.ts b/src/types/IMeetingProps.ts index 088e1d1..74da59b 100644 --- a/src/types/IMeetingProps.ts +++ b/src/types/IMeetingProps.ts @@ -1,6 +1,6 @@ import React from 'react'; -import IMeetHourExternalAPI from './IMeetHourExternalAPI'; +import IMeetHourExternalApi from './IMeetHourExternalApi'; /** * The the base props for React {@code Components} that load the Meet Hour IFrame. @@ -85,7 +85,7 @@ export default interface IMeetingProps { /** * The external API reference for events and commands. */ - onApiReady?: (api: IMeetHourExternalAPI) => void; + onApiReady?: (api: IMeetHourExternalApi) => void; /** * The callback for when the meeting is ready to be closed. diff --git a/src/types/MeetHourExternalApi.ts b/src/types/MeetHourExternalAPI.ts similarity index 97% rename from src/types/MeetHourExternalApi.ts rename to src/types/MeetHourExternalAPI.ts index 95e7e97..bdf052c 100644 --- a/src/types/MeetHourExternalApi.ts +++ b/src/types/MeetHourExternalAPI.ts @@ -1,4 +1,4 @@ -import { IMeetHourExternalAPI } from '.'; +import { IMeetHourExternalApi } from '.'; export type MeetHourExternalAPI = { new ( @@ -103,5 +103,5 @@ export type MeetHourExternalAPI = { */ parentNode?: HTMLDivElement | null } - ): IMeetHourExternalAPI + ): IMeetHourExternalApi }; diff --git a/src/types/index.ts b/src/types/index.ts index c23b99a..635c535 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -7,5 +7,5 @@ declare global { export { MeetHourExternalAPI } from './MeetHourExternalAPI'; export { default as IMeetHourMeetingProps } from './IMeetHourMeetingProps'; -export { default as IMeetHourExternalAPI } from './IMeetHourExternalAPI'; +export { default as IMeetHourExternalApi } from './IMeetHourExternalApi';