diff --git a/.huskyrc.json b/.huskyrc.json new file mode 100644 index 0000000..49347df --- /dev/null +++ b/.huskyrc.json @@ -0,0 +1,6 @@ +{ + "hooks": { + "pre-commit": "yarn lint && yarn test", + "commitmsg": "commitlint -e $GIT_PARAMS" + } +} diff --git a/dist/src/endpoints.d.ts b/dist/endpoints.d.ts similarity index 100% rename from dist/src/endpoints.d.ts rename to dist/endpoints.d.ts diff --git a/dist/src/index.d.ts b/dist/index.d.ts similarity index 71% rename from dist/src/index.d.ts rename to dist/index.d.ts index 657f1b8..7bd5ee9 100644 --- a/dist/src/index.d.ts +++ b/dist/index.d.ts @@ -39,10 +39,11 @@ declare class LinkSDK { private domains; private params; private oauthParams; - init(config: IConfig): void; - authorize(options?: IMyAccountOptions): void; - openVault(options?: IVaultOptions): void; - openSettings(options?: IMyAccountOptions): void; + private isInitialized; + init({ clientId, scope, isTestEnvironment, redirectUri, continueTo, responseType, locale, state }: IConfig): void; + authorize({ newTab, email, authPage, backTo, showAuthToggle }?: IMyAccountOptions): void; + openVault({ newTab, backTo }?: IVaultOptions): void; + openSettings({ newTab, backTo }?: IMyAccountOptions): void; } declare const _default: LinkSDK; export default _default; diff --git a/dist/index.js b/dist/index.js index 0cd6cda..aee837f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mtLinkSdk",[],t):"object"==typeof exports?exports.mtLinkSdk=t():e.mtLinkSdk=t()}(window,function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";var o=Object.prototype.hasOwnProperty,n=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o1;){var t=e.pop(),r=t.obj[t.prop];if(n(r)){for(var o=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?n+=o.charAt(a):c<128?n+=i[c]:c<2048?n+=i[192|c>>6]+i[128|63&c]:c<55296||c>=57344?n+=i[224|c>>12]+i[128|c>>6&63]+i[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(a)),n+=i[240|c>>18]+i[128|c>>12&63]+i[128|c>>6&63]+i[128|63&c])}return n},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,i){if(!r)return t;if("object"!=typeof r){if(n(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var c=t;return n(t)&&!n(r)&&(c=a(t,i)),n(t)&&n(r)?(r.forEach(function(r,n){if(o.call(t,n)){var a=t[n];a&&"object"==typeof a&&r&&"object"==typeof r?t[n]=e(a,r,i):t.push(r)}else t[n]=r}),t):Object.keys(r).reduce(function(t,n){var a=r[n];return o.call(t,n)?t[n]=e(t[n],a,i):t[n]=a,t},c)}}},function(e,t,r){"use strict";var o=String.prototype.replace,n=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0?v+b:""}},function(e,t,r){"use strict";var o=r(0),n=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},c=function(e,t,r){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,l=[];if(c){if(!r.plainObjects&&n.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var s=0;null!==(a=i.exec(o))&&s=0;--n){var i,a=e[n];if("[]"===a&&r.parseArrays)i=[].concat(o);else{i=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=o:i[c]=o:i={0:o}}o=i}return o}(l,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth?e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,u=l.split(t.delimiter,s),f=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(y=y.split(",")),n.call(c,d)?c[d]=o.combine(c[d],y):c[d]=y}return c}(e,r):e,s=r.plainObjects?Object.create(null):{},u=Object.keys(l),f=0;f1;){var t=e.pop(),r=t.obj[t.prop];if(n(r)){for(var o=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?n+=o.charAt(a):c<128?n+=i[c]:c<2048?n+=i[192|c>>6]+i[128|63&c]:c<55296||c>=57344?n+=i[224|c>>12]+i[128|c>>6&63]+i[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(a)),n+=i[240|c>>18]+i[128|c>>12&63]+i[128|c>>6&63]+i[128|63&c])}return n},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,i){if(!r)return t;if("object"!=typeof r){if(n(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var c=t;return n(t)&&!n(r)&&(c=a(t,i)),n(t)&&n(r)?(r.forEach((function(r,n){if(o.call(t,n)){var a=t[n];a&&"object"==typeof a&&r&&"object"==typeof r?t[n]=e(a,r,i):t.push(r)}else t[n]=r})),t):Object.keys(r).reduce((function(t,n){var a=r[n];return o.call(t,n)?t[n]=e(t[n],a,i):t[n]=a,t}),c)}}},function(e,t,r){"use strict";var o=String.prototype.replace,n=/%20/g,i=r(0),a={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=i.assign({default:a.RFC3986,formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return String(e)}}},a)},function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0?v+b:""}},function(e,t,r){"use strict";var o=r(0),n=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t,r){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,l=[];if(c){if(!r.plainObjects&&n.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var s=0;r.depth>0&&null!==(a=i.exec(o))&&s=0;--n){var i,a=e[n];if("[]"===a&&r.parseArrays)i=[].concat(o);else{i=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=o:i[c]=o:i={0:o}}o=i}return o}(l,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){var r,l={},s=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,u=t.parameterLimit===1/0?void 0:t.parameterLimit,f=s.split(t.delimiter,u),p=-1,d=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(h=h.split(",")),m.indexOf("[]=")>-1&&(h=i(h)?[h]:h),n.call(l,y)?l[y]=o.combine(l[y],h):l[y]=h}return l}(e,r):e,u=r.plainObjects?Object.create(null):{},f=Object.keys(s),p=0;p/jest/coverage', - coveragePathIgnorePatterns: [ - '/__tests__/' - ], + coveragePathIgnorePatterns: ['/__tests__/'], + errorOnDeprecated: true, globals: { VERSION: packageJSON.version } diff --git a/package.json b/package.json index 717b9f1..01b193e 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,6 @@ "prepareRelease": "npm run build && git add dist", "createChangelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md", "version": "npm run prepareRelease && npm run createChangelog", - "precommit": "yarn lint && yarn test", - "commitmsg": "commitlint -e $GIT_PARAMS", "test": "jest", "lint": "tslint --project tsconfig.json" }, @@ -30,11 +28,11 @@ "@types/jest": "^24.0.23", "@types/node-fetch": "^2.5.4", "@types/qs": "^6.9.0", - "awesome-typescript-loader": "^5.2.0", "husky": "^3.1.0", "jest": "^24.9.0", "node-fetch": "^2.5.0", "ts-jest": "^24.2.0", + "ts-loader": "^6.2.1", "tslint": "^5.20.1", "typescript": "^3.7.3", "webpack": "^4.41.2", diff --git a/src/@types/constants.d.ts b/src/@types/constants.d.ts index 53f2697..861fd2d 100644 --- a/src/@types/constants.d.ts +++ b/src/@types/constants.d.ts @@ -1 +1 @@ -declare const VERSION: string; \ No newline at end of file +declare const VERSION: string; diff --git a/src/__tests__/index.ts b/src/__tests__/index.ts index 98745ac..392160c 100644 --- a/src/__tests__/index.ts +++ b/src/__tests__/index.ts @@ -2,21 +2,15 @@ import linkSDK, { IParams, IDomains, IOauthParams } from '..'; import { DOMAIN, VAULT, MY_ACCOUNT } from '../endpoints'; import * as packageJSON from '../../package.json'; -describe('LinkSDK', () => { - const value = 'test'; - const mockValue = {} as { params: IParams; domains: IDomains, oauthParams: IOauthParams }; +const value = 'test'; +const mockValue = {} as { params: IParams; domains: IDomains; oauthParams: IOauthParams }; +describe('LinkSDK', () => { describe('init', () => { test('no clientId', async () => { - const errorTracker = jest.fn(); - - try { + expect(() => { linkSDK.init({ clientId: '' }); - } catch (error) { - errorTracker(error); - } - - expect(errorTracker).toBeCalled(); + }).toThrow('Need a clientId to initialize'); }); test('default', async () => { @@ -109,14 +103,10 @@ describe('LinkSDK', () => { }); describe('authorize', () => { - test('Calling "authorize" method before an init will failed', async () => { - try { + test('Calling "authorize" method before an init will fail', async () => { + expect(() => { linkSDK.authorize(); - - throw new Error('failed'); - } catch (error) { - expect(error.message).not.toBe('failed'); - } + }).toThrow('SDK not initialized'); }); test('default params', async () => { @@ -125,12 +115,12 @@ describe('LinkSDK', () => { linkSDK.init.call(mockValue, { clientId: value }); + // @ts-ignore Ignores missing arguments to test user passing no arguments linkSDK.authorize.call(mockValue); expect(open).toBeCalled(); - const url = open.mock.calls[0][0]; - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] const host = `https://${mockValue.domains.myaccount}/${MY_ACCOUNT.PATHS.OAUTH}`; expect(url).toContain(host); @@ -162,17 +152,16 @@ describe('LinkSDK', () => { expect(open).toBeCalled(); - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] expect(isNewTab).toBe('_blank'); - const url = open.mock.calls[0][0]; const { params, domains, oauthParams } = mockValue; const host = `https://${domains.myaccount}/${MY_ACCOUNT.PATHS.OAUTH}`; const qs = `client_id=${params.client_id}&redirect_uri=${encodeURIComponent(oauthParams.redirect_uri)}` + `&response_type=token&scope=${value}`; const configs = encodeURIComponent( - `email=${email};sdk_platform=js;sdk_version=${packageJSON.version};auth_action=${authPage}` + `sdk_platform=js;sdk_version=${packageJSON.version};email=${email};auth_action=${authPage}` ); expect(url).toBe(`${host}?${qs}&configs=${configs}`); @@ -180,14 +169,10 @@ describe('LinkSDK', () => { }); describe('openVault', () => { - test('Calling "openVault" method before an init will failed', async () => { - try { + test('Calling "openVault" method before an init will fail', async () => { + expect(() => { linkSDK.openVault(); - - throw new Error('failed'); - } catch (error) { - expect(error.message).not.toBe('failed'); - } + }).toThrow('SDK not initialized'); }); test('default params', async () => { @@ -197,12 +182,12 @@ describe('LinkSDK', () => { clientId: value, scope: [value] }); + // @ts-ignore Ignores missing arguments to test user passing no arguments linkSDK.openVault.call(mockValue); expect(open).toBeCalled(); - const url = open.mock.calls[0][0]; - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] const host = `https://${mockValue.domains.vault}`; expect(url).toContain(host); @@ -231,10 +216,9 @@ describe('LinkSDK', () => { expect(open).toBeCalled(); - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] expect(isNewTab).toBe('_blank'); - const url = open.mock.calls[0][0]; const { params, domains } = mockValue; const host = `https://${domains.vault}`; const qs = `client_id=${params.client_id}`; @@ -246,13 +230,10 @@ describe('LinkSDK', () => { describe('openSettings', () => { test('Calling "openSettings" method before an init will failed', async () => { - try { + expect(() => { + // @ts-ignore Ignores missing arguments to test user passing no arguments linkSDK.openSettings(); - - throw new Error('failed'); - } catch (error) { - expect(error.message).not.toBe('failed'); - } + }).toThrow('SDK not initialized'); }); test('default params', async () => { @@ -262,12 +243,12 @@ describe('LinkSDK', () => { clientId: value, scope: [value] }); + // @ts-ignore Ignores missing arguments to test user passing no arguments linkSDK.openSettings.call(mockValue); expect(open).toBeCalled(); - const url = open.mock.calls[0][0]; - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] const host = `https://${mockValue.domains.myaccount}/${MY_ACCOUNT.PATHS.SETTINGS}`; expect(url).toContain(host); @@ -296,10 +277,9 @@ describe('LinkSDK', () => { expect(open).toBeCalled(); - const isNewTab = open.mock.calls[0][1]; + const [[url, isNewTab]] = open.mock.calls; // [0][1] expect(isNewTab).toBe('_blank'); - const url = open.mock.calls[0][0]; const { params, domains } = mockValue; const host = `https://${domains.myaccount}/${MY_ACCOUNT.PATHS.SETTINGS}`; const qs = `client_id=${params.client_id}`; diff --git a/src/index.ts b/src/index.ts index 0697ea3..dfdd57b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import * as qs from 'qs'; +import { stringify } from 'qs'; import { DOMAIN, MY_ACCOUNT, VAULT } from './endpoints'; @@ -45,9 +45,22 @@ interface IMyAccountOptions { showAuthToggle?: boolean; } -function encodeConfigWithParams(params: any, configs: { [k: string]: string | boolean | undefined }) { - const endcodedConfigs = qs.stringify(configs, { delimiter: ';', encode: false }); - return qs.stringify({ ...params, configs: endcodedConfigs }); +interface IUrlConfig { + email?: string; + auth_action?: string; + show_auth_toggle?: boolean; +} + +const commonUrlConfig = { + sdk_platform: 'js', + sdk_version: VERSION +}; + +type ICommonUrlConfig = typeof commonUrlConfig & { back_to?: string }; + +function encodeConfigWithParams(params: Params, configs: Configs) { + const encodedConfigs = stringify(configs, { delimiter: ';', encode: false }); + return stringify({ ...params, configs: encodedConfigs }, { addQueryPrefix: true }); } class LinkSDK { @@ -55,21 +68,22 @@ class LinkSDK { private params: IParams; private oauthParams: IOauthParams; - public init(config: IConfig): void { - if (!config.clientId) { - throw new Error('Need a clientId to initialise'); + private isInitialized: boolean = false; + + public init({ + clientId, + scope = [], + isTestEnvironment, + redirectUri = `${location.protocol}//${location.host}/callback`, + continueTo, + responseType = 'token', + locale, + state + }: IConfig): void { + if (!clientId) { + throw new Error('Need a clientId to initialize'); } - const { - clientId, - redirectUri = `${location.protocol}//${location.host}/callback`, - responseType = 'token', - scope = [], - locale, - state, - continueTo - } = config; - this.params = { client_id: clientId, locale, @@ -84,59 +98,63 @@ class LinkSDK { state }; - const subdomain = config.isTestEnvironment ? 'TEST_SUBDOMAIN' : 'SUBDOMAIN'; + const subdomain = isTestEnvironment ? 'TEST_SUBDOMAIN' : 'SUBDOMAIN'; this.domains = { vault: `${VAULT[subdomain]}.${DOMAIN}`, myaccount: `${MY_ACCOUNT[subdomain]}.${DOMAIN}` }; + + this.isInitialized = true; } // Open My Account to authorize application to use MtLink API - public authorize(options: IMyAccountOptions = {}): void { - const { newTab = false, email, authPage, backTo, showAuthToggle } = options; + public authorize({ newTab = false, email, authPage, backTo, showAuthToggle }: IMyAccountOptions = {}): void { + if (!this.isInitialized) { + throw new Error('SDK not initialized'); + } - const params = encodeConfigWithParams( + const params = encodeConfigWithParams( { ...this.oauthParams, ...this.params }, { + ...commonUrlConfig, email, - sdk_platform: 'js', - sdk_version: VERSION, auth_action: authPage, back_to: backTo, show_auth_toggle: showAuthToggle } ); - window.open(`https://${this.domains.myaccount}/${MY_ACCOUNT.PATHS.OAUTH}?${params}`, newTab ? '_blank' : '_self'); + window.open(`https://${this.domains.myaccount}/${MY_ACCOUNT.PATHS.OAUTH}${params}`, newTab ? '_blank' : '_self'); } // Open the Vault page - public openVault(options: IVaultOptions = {}): void { - const { newTab = false, backTo = location.href } = options; - const params = encodeConfigWithParams(this.params, { - sdk_platform: 'js', - sdk_version: VERSION, + public openVault({ newTab = false, backTo = location.href }: IVaultOptions = {}): void { + if (!this.isInitialized) { + throw new Error('SDK not initialized'); + } + + const params = encodeConfigWithParams(this.params, { + ...commonUrlConfig, back_to: backTo }); - window.open(`https://${this.domains.vault}?${params}`, newTab ? '_blank' : '_self'); + window.open(`https://${this.domains.vault}${params}`, newTab ? '_blank' : '_self'); } // Open the Guest settings page - public openSettings(options: IMyAccountOptions = {}): void { - const { newTab = false, backTo = location.href } = options; + public openSettings({ newTab = false, backTo = location.href }: IMyAccountOptions = {}): void { + if (!this.isInitialized) { + throw new Error('SDK not initialized'); + } - const params = encodeConfigWithParams(this.params, { - sdk_platform: 'js', - sdk_version: VERSION, + const params = encodeConfigWithParams(this.params, { + ...commonUrlConfig, back_to: backTo }); - window.open( - `https://${this.domains.myaccount}/${MY_ACCOUNT.PATHS.SETTINGS}?${params}`, - newTab ? '_blank' : '_self' - ); + window.open(`https://${this.domains.myaccount}/${MY_ACCOUNT.PATHS.SETTINGS}${params}`, newTab ? '_blank' : '_self'); } } +// Probably there is no need for this to be a class if initialized here. export default new LinkSDK(); diff --git a/tsconfig.json b/tsconfig.json index 60237c6..4982cb5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,6 @@ "strictNullChecks": true, "lib": ["es2015", "dom"] }, - "include": ["src/**/*"] + "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.json"], + "exclude": ["./dist", "./node_modules", "*/**/__tests__"] } diff --git a/webpack.config.js b/webpack.config.js index b9a6937..4882f63 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,7 +20,7 @@ module.exports = { rules: [ { test: /\.tsx?$/, - loader: 'awesome-typescript-loader' + loader: 'ts-loader' } ] }, diff --git a/yarn.lock b/yarn.lock index 6d03e90..329a50d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -976,20 +976,6 @@ atob@^2.1.1: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -awesome-typescript-loader@^5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/awesome-typescript-loader/-/awesome-typescript-loader-5.2.1.tgz#a41daf7847515f4925cdbaa3075d61f289e913fc" - integrity sha512-slv66OAJB8orL+UUaTI3pKlLorwIvS4ARZzYR9iJJyGsEgOqueMfOMdKySWzZ73vIkEe3fcwFgsKMg4d8zyb1g== - dependencies: - chalk "^2.4.1" - enhanced-resolve "^4.0.0" - loader-utils "^1.1.0" - lodash "^4.17.5" - micromatch "^3.1.9" - mkdirp "^0.5.1" - source-map-support "^0.5.3" - webpack-log "^1.2.0" - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -1128,6 +1114,13 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -1351,7 +1344,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1824,13 +1817,6 @@ cyclist@~0.2.2: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - integrity sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8= - dependencies: - es5-ext "^0.10.9" - dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" @@ -2069,7 +2055,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@4.1.0, enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: +enhanced-resolve@4.1.0, enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== @@ -2078,6 +2064,15 @@ enhanced-resolve@4.1.0, enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: memory-fs "^0.4.0" tapable "^1.0.0" +enhanced-resolve@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz#2937e2b8066cd0fe7ce0990a98f0d71a35189f66" + integrity sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.5.0" + tapable "^1.0.0" + errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" @@ -2113,32 +2108,6 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.50" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.50.tgz#6d0e23a0abdb27018e5ac4fd09b412bc5517a778" - integrity sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.1" - next-tick "^1.0.0" - -es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= - dependencies: - d "1" - es5-ext "~0.10.14" - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -2345,6 +2314,13 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" @@ -3090,6 +3066,11 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -3786,7 +3767,7 @@ loader-runner@^2.4.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== -loader-utils@1.2.3, loader-utils@^1.1.0, loader-utils@^1.2.3: +loader-utils@1.2.3, loader-utils@^1.0.2, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== @@ -3858,7 +3839,7 @@ lodash@4.17.14: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -lodash@^4.17.11, lodash@^4.17.5, lodash@^4.2.1: +lodash@^4.17.11, lodash@^4.2.1: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -3868,21 +3849,6 @@ lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -log-symbols@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -loglevelnext@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.5.tgz#36fc4f5996d6640f539ff203ba819641680d75a2" - integrity sha512-V/73qkPuJmx4BcBF19xPBr+0ZRVBhc4POxvZTZdMeXpJ4NItXSJ/MSwuFT0kQJlCbXvdlZoQQ/418bS1y9Jh6A== - dependencies: - es6-symbol "^3.1.1" - object.assign "^4.1.0" - loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -3985,6 +3951,14 @@ memory-fs@^0.4.0, memory-fs@^0.4.1: errno "^0.1.3" readable-stream "^2.0.1" +memory-fs@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" + integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + meow@5.0.0, meow@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" @@ -4043,7 +4017,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.9: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -4062,6 +4036,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.9: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -4241,11 +4223,6 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== -next-tick@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -4411,7 +4388,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12: +object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -4423,16 +4400,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -4743,6 +4710,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picomatch@^2.0.5: + version "2.1.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.1.1.tgz#ecdfbea7704adb5fe6fb47f9866c4c0e15e905c5" + integrity sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5459,7 +5431,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.3, source-map-support@^0.5.6: +source-map-support@^0.5.6: version "0.5.12" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== @@ -5868,6 +5840,13 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" @@ -5937,6 +5916,17 @@ ts-jest@^24.2.0: semver "^5.5" yargs-parser "10.x" +ts-loader@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef" + integrity sha512-Dd9FekWuABGgjE1g0TlQJ+4dFUfYGbYcs52/HQObE0ZmUNjQlmLAS7xXsSzy23AMaMwipsx5sNHvoEpT2CZq1g== + dependencies: + chalk "^2.3.0" + enhanced-resolve "^4.0.0" + loader-utils "^1.0.2" + micromatch "^4.0.0" + semver "^6.0.0" + tslib@1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" @@ -6134,7 +6124,7 @@ util@^0.11.0: dependencies: inherits "2.0.3" -uuid@^3.1.0, uuid@^3.3.2: +uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== @@ -6211,16 +6201,6 @@ webpack-cli@^3.3.10: v8-compile-cache "2.0.3" yargs "13.2.4" -webpack-log@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-1.2.0.tgz#a4b34cda6b22b518dbb0ab32e567962d5c72a43d" - integrity sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqT4lwWwoMHdQWwEKw736fCHEekokTEKHA== - dependencies: - chalk "^2.1.0" - log-symbols "^2.1.0" - loglevelnext "^1.0.1" - uuid "^3.1.0" - webpack-sources@^1.4.0, webpack-sources@^1.4.1: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"