@tivio/sdk-js 1.0.0-alpha → 1.0.0-alpha5

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,8 +73,14 @@ declare type AdMetadata = {
73
73
  type: 'ad';
74
74
  subType: 'inserted' | 'original';
75
75
  secondsToEnd: number;
76
+ /**
77
+ * null when ad is not skippable
78
+ */
76
79
  secondsToSkippable: number | null;
77
80
  canTriggerSkip: boolean;
81
+ isSkippable: boolean;
82
+ order: number | null;
83
+ totalCount: number | null;
78
84
  skip: () => void;
79
85
  } | null;
80
86
  declare enum PlayerWrapperEventType {
@@ -82,7 +88,7 @@ declare enum PlayerWrapperEventType {
82
88
  }
83
89
  declare type TivioPlayerWrapper = {
84
90
  addEventListener: (eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void) => void;
85
- reportLoadError: (error: Error) => void;
91
+ reportError: (error: Error) => void;
86
92
  reportPlaybackEnded: () => void;
87
93
  reportTimeProgress: (ms: number) => void;
88
94
  seekTo: (ms: number) => void;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx")):"function"==typeof define&&define.amd?define("@tivio/sdk-js",["@sentry/browser","firebase/app","firebase/auth","firebase/firestore","mobx"],t):"object"==typeof exports?exports["@tivio/sdk-js"]=t(require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx")):e["@tivio/sdk-js"]=t(e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.mobx)}(this,(function(e,t,r,n,o){return i={992:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerWrapperEventType=void 0,function(e){e.adMetadata="adMetadata"}(r||(r={})),t.PlayerWrapperEventType=r},958:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=r(782),i=r(373);t.defaultConf={resolverUrl:"https://tivio-resolver.firebaseapp.com/resolver.js",fetchPackage:i.fetchPackage},t.createInternalConf=function(e){return n(n(n({},t.defaultConf),e),{logger:void 0!==e.logger?e.logger:(0,o.createLogger)({isConsoleEnabled:!0}),sdkVersion:"1.0.0-alpha"})}},920:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(643),t),o(r(173),t),o(r(992),t)},643:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTivio=t.createRemotePackageLoader=t.fetchResolver=void 0;var i=r(958),a=r(229),s=r(614);t.fetchResolver=function(e){return n(void 0,void 0,void 0,(function(){var t;return o(this,(function(r){return t=e.resolverUrl,[2,(0,e.fetchPackage)(t).then((function(t){var r,n={},o={exports:n};try{new Function("require","module","exports",t)(a.resolveShared,o,n)}catch(e){throw new Error("Cannot load Tivio Resolver "+e)}if("function"!=typeof(null===(r=o.exports.tivio)||void 0===r?void 0:r.fetch))throw new Error("Invalid Tivio Resolver export");return o.exports.tivio.fetch(e.secret,e.sdkVersion)}))]}))}))},t.createRemotePackageLoader=function(){return function(e){return(0,t.fetchResolver)(e).then((function(e){var t={},r={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,r,t)}catch(e){throw new Error("Cannot load module "+e)}if("object"!=typeof r.exports.Tivio)throw new Error('Tivio package does not export "Tivio" namespace');if("function"!=typeof r.exports.Tivio.setUser)throw new Error('Tivio namespace does not export "setUser" member');if("function"!=typeof r.exports.Tivio.init)throw new Error('Tivio namespace does not export "init" member');return r.exports.Tivio}))}},t.createTivio=function(){var e=(0,t.createRemotePackageLoader)(),r=!1;return function(t){return n(void 0,void 0,void 0,(function(){var a,u;return o(this,(function(c){return a=(0,i.createInternalConf)(t),u=(0,s.createSettings)(a),[2,e(a).then((function(e){return n(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return r?[3,2]:[4,e.init(a)];case 1:t.sent(),r=!0,t.label=2;case 2:return u.onSetUser(e.setUser),[2,{state:"ready",error:null,settings:u,conf:a,AdSource:e.AdSource,ChannelSource:e.ChannelSource,VodTivioSource:e.VodTivioSource,getChannelById:e.getChannelById,getPlayer:e.getPlayer,getSectionById:e.getSectionById,getVideoById:e.getVideoById,getWidgetById:e.getWidgetById,setLanguage:e.setLanguage,setUser:e.setUser,subscribeToWidget:e.subscribeToWidget,subscribeToChannel:e.subscribeToChannel,subscribeToSection:e.subscribeToSection,subscribeToVideo:e.subscribeToVideo,subscribeToVideosInSection:e.subscribeToVideosInSection,subscribeToSectionsInChannel:e.subscribeToSectionsInChannel,subscribeToChannelsInWidget:e.subscribeToChannelsInWidget,subscribeToScreen:e.subscribeToScreen,subscribeToItemsInRow:e.subscribeToItemsInRow,createUserWithEmailAndPassword:e.createUserWithEmailAndPassword,signInWithEmailAndPassword:e.signInWithEmailAndPassword,createPlayerWrapper:e.createPlayerWrapper}]}}))}))})).catch((function(e){var t;return null===(t=a.logger)||void 0===t||t.exception(e),{state:"error",error:""+e,conf:a,settings:u}}))]}))}))}}},229:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var s=a(r(937));r(703),r(462);var u=i(r(259)),c=i(r(970)),l={mobx:u,firebase:s.default,"firebase/app":s.default,"firebase/auth":null,"firebase/firestore":null,timers:c};t.resolveShared=function(e){if(!(e in l))throw new Error("Could not resolve shared dependency "+e);return l[e]}},782:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var a=i(r(356));t.createLogger=function(e){var t=!1!==e.isSentryEnabled&&!0;t&&(a.init({dsn:"https://f318b29129f84c459ea756907bc1a2e6@o507550.ingest.sentry.io/5600272",release:"@tivio/sdk-js@1.0.0-alpha",tracesSampleRate:1}),window.sentry=a),console.info("Sentry "+(t?"on":"off"));var r=function(r,n){e.isConsoleEnabled&&console[r]("Tivio sdk-js "+n.join(" ")),t&&a.captureMessage(""+n,a.Severity.fromString(r))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("debug",e)},exception:function(r){e.isConsoleEnabled&&console.error(r),t&&a.captureException(r)}}}},373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},a=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){return[2,fetch(e,o).then(i).catch(a)]}))}))}},614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,r=null;return{onSetUser:function(n){var o;"function"!=typeof n?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=n,null!==r&&n(r.userId,r.userPayload))},setUser:function(e,n){"function"==typeof t?(r=null,t(e,n)):r={userId:e,userPayload:n}}}}},173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},356:t=>{"use strict";t.exports=e},937:e=>{"use strict";e.exports=t},703:e=>{"use strict";e.exports=r},462:e=>{"use strict";e.exports=n},259:e=>{"use strict";e.exports=o},970:()=>{}},a={},function e(t){var r=a[t];if(void 0!==r)return r.exports;var n=a[t]={exports:{}};return i[t].call(n.exports,n,n.exports,e),n.exports}(920);var i,a}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx")):"function"==typeof define&&define.amd?define("@tivio/sdk-js",["@sentry/browser","firebase/app","firebase/auth","firebase/firestore","mobx"],t):"object"==typeof exports?exports["@tivio/sdk-js"]=t(require("@sentry/browser"),require("firebase/app"),require("firebase/auth"),require("firebase/firestore"),require("mobx")):e["@tivio/sdk-js"]=t(e["@sentry/browser"],e["firebase/app"],e["firebase/auth"],e["firebase/firestore"],e.mobx)}(this,(function(e,t,r,n,o){return i={992:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerWrapperEventType=void 0,function(e){e.adMetadata="adMetadata"}(r||(r={})),t.PlayerWrapperEventType=r},958:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createInternalConf=t.defaultConf=void 0;var o=r(782),i=r(373);t.defaultConf={resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",fetchPackage:i.fetchPackage},t.createInternalConf=function(e){return n(n(n({},t.defaultConf),e),{logger:void 0!==e.logger?e.logger:(0,o.createLogger)({isConsoleEnabled:!0}),sdkVersion:"1.0.0-alpha5"})}},920:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(643),t),o(r(173),t),o(r(992),t)},643:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTivio=t.createRemotePackageLoader=t.fetchResolver=void 0;var i=r(958),a=r(229),s=r(614);t.fetchResolver=function(e){return n(void 0,void 0,void 0,(function(){var t;return o(this,(function(r){return t=e.resolverUrl,[2,(0,e.fetchPackage)(t).then((function(t){var r,n={},o={exports:n};try{new Function("require","module","exports",t)(a.resolveShared,o,n)}catch(e){throw new Error("Cannot load Tivio Resolver "+e)}if("function"!=typeof(null===(r=o.exports.tivio)||void 0===r?void 0:r.fetch))throw new Error("Invalid Tivio Resolver export");return o.exports.tivio.fetch(e.secret,e.sdkVersion)}))]}))}))},t.createRemotePackageLoader=function(){return function(e){return(0,t.fetchResolver)(e).then((function(e){var t={},r={exports:t};try{new Function("require","module","exports",e)(a.resolveShared,r,t)}catch(e){throw new Error("Cannot load module "+e)}if("object"!=typeof r.exports.Tivio)throw new Error('Tivio package does not export "Tivio" namespace');if("function"!=typeof r.exports.Tivio.setUser)throw new Error('Tivio namespace does not export "setUser" member');if("function"!=typeof r.exports.Tivio.init)throw new Error('Tivio namespace does not export "init" member');return r.exports.Tivio}))}},t.createTivio=function(){var e=(0,t.createRemotePackageLoader)(),r=!1;return function(t){return n(void 0,void 0,void 0,(function(){var a,u;return o(this,(function(c){return a=(0,i.createInternalConf)(t),u=(0,s.createSettings)(a),[2,e(a).then((function(e){return n(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return r?[3,2]:[4,e.init(a)];case 1:t.sent(),r=!0,t.label=2;case 2:return u.onSetUser(e.setUser),[2,{state:"ready",error:null,settings:u,conf:a,AdSource:e.AdSource,ChannelSource:e.ChannelSource,VodTivioSource:e.VodTivioSource,getChannelById:e.getChannelById,getPlayer:e.getPlayer,getSectionById:e.getSectionById,getVideoById:e.getVideoById,getWidgetById:e.getWidgetById,setLanguage:e.setLanguage,setUser:e.setUser,subscribeToWidget:e.subscribeToWidget,subscribeToChannel:e.subscribeToChannel,subscribeToSection:e.subscribeToSection,subscribeToVideo:e.subscribeToVideo,subscribeToVideosInSection:e.subscribeToVideosInSection,subscribeToSectionsInChannel:e.subscribeToSectionsInChannel,subscribeToChannelsInWidget:e.subscribeToChannelsInWidget,subscribeToScreen:e.subscribeToScreen,subscribeToItemsInRow:e.subscribeToItemsInRow,createUserWithEmailAndPassword:e.createUserWithEmailAndPassword,signInWithEmailAndPassword:e.signInWithEmailAndPassword,createPlayerWrapper:e.createPlayerWrapper}]}}))}))})).catch((function(e){var t;return null===(t=a.logger)||void 0===t||t.exception(e),{state:"error",error:""+e,conf:a,settings:u}}))]}))}))}}},229:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveShared=void 0;var s=a(r(937));r(703),r(462);var u=i(r(259)),c=i(r(970)),l={mobx:u,firebase:s.default,"firebase/app":s.default,"firebase/auth":null,"firebase/firestore":null,timers:c};t.resolveShared=function(e){if(!(e in l))throw new Error("Could not resolve shared dependency "+e);return l[e]}},782:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createLogger=void 0;var a=i(r(356));t.createLogger=function(e){var t=!1!==e.isSentryEnabled&&!0;t&&(a.init({dsn:"https://f318b29129f84c459ea756907bc1a2e6@o507550.ingest.sentry.io/5600272",release:"@tivio/sdk-js@1.0.0-alpha5",tracesSampleRate:1}),window.sentry=a),console.info("Sentry "+(t?"on":"off"));var r=function(r,n){e.isConsoleEnabled&&console[r]("Tivio sdk-js "+n.join(" ")),t&&a.captureMessage(""+n,a.Severity.fromString(r))};return{error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("error",e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("info",e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("warn",e)},debug:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r("debug",e)},exception:function(r){e.isConsoleEnabled&&console.error(r),t&&a.captureException(r)}}}},373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPackage=void 0;var o={cache:"no-store"},i=function(e){var t=e.headers.get("content-type");return 200!==e.status?Promise.reject('Incorrect status "'+e.status+'" was obtained while fetching the module.'):t&&(t.includes("application/javascript")||t.includes("text/javascript"))?e.text():Promise.reject('Incorrect content "'+t+'" was obtained while fetching the module.')},a=function(e){return Promise.reject("Network failure: "+e)};t.fetchPackage=function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){return[2,fetch(e,o).then(i).catch(a)]}))}))}},614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSettings=void 0,t.createSettings=function(e){var t=null,r=null;return{onSetUser:function(n){var o;"function"!=typeof n?null===(o=e.logger)||void 0===o||o.exception("Tivio Bundle setUser handler must be a function"):(t=n,null!==r&&n(r.userId,r.userPayload))},setUser:function(e,n){"function"==typeof t?(r=null,t(e,n)):r={userId:e,userPayload:n}}}}},173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},356:t=>{"use strict";t.exports=e},937:e=>{"use strict";e.exports=t},703:e=>{"use strict";e.exports=r},462:e=>{"use strict";e.exports=n},259:e=>{"use strict";e.exports=o},970:()=>{}},a={},function e(t){var r=a[t];if(void 0!==r)return r.exports;var n=a[t]={exports:{}};return i[t].call(n.exports,n,n.exports,e),n.exports}(920);var i,a}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-js",
3
- "version": "1.0.0-alpha",
3
+ "version": "1.0.0-alpha5",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -31,11 +31,9 @@
31
31
  "dotenv": "^8.2.0",
32
32
  "dotenv-webpack": "^7.0.3",
33
33
  "eslint": "^7.19.0",
34
- "firebase": "^8.2.3",
35
34
  "jest": "^26.6.3",
36
35
  "jest-cli": "^26.6.3",
37
36
  "jest-fetch-mock": "^3.0.3",
38
- "mobx": "^6.0.4",
39
37
  "node-fetch": "^2.6.1",
40
38
  "stream-browserify": "^3.0.0",
41
39
  "timers-browserify": "^2.0.12",