@microsoft/applicationinsights-react-native 2.5.0-beta.2202-06 → 2.5.0-beta.2202-07
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/browser/applicationinsights-react-native.js +1 -1
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +1 -1
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +1 -1
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +1 -1
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativePlugin.js +1 -1
- package/dist-esm/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-beta.2202-
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.5.0-beta.2202-07
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
var e=this,n=function(n,t){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var a=o(t),c="function",u="object",i="undefined",r="prototype",s="hasOwnProperty",d=Object,t=d[r],x=(d.create,d.defineProperty),m=t[s],h=null;function T(e){return void 0===e&&(e=!0),h&&e||(typeof globalThis!==i&&globalThis&&(h=globalThis),typeof self!==i&&self&&(h=self),typeof window!==i&&window&&(h=window),typeof global!==i&&global&&(h=global)),h}function I(e){throw new TypeError(e)}(T()||{}).Symbol,(T()||{}).Reflect;var b=function(e,n){return(b=d.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[s](t)&&(e[t]=n[t])})(e,n)},w="constructor",p="prototype",S="function",A="_dynInstFuncs",E="_isDynProxy",F="_dynClass",P="_dynInstChk",L=P,N="_dfOpts",_="_unknown_",M="__proto__",R="useBaseInst",D="setInstFuncs",O=Object,k=O.getPrototypeOf,j=0;function v(e,n){return e&&O[p].hasOwnProperty.call(e,n)}function B(e){return e&&(e===O[p]||e===Array[p])}function z(e){return B(e)||e===Function[p]}function C(e){if(e){if(k)return k(e);e=e[M]||e[p]||(e[w]?e[w][p]:null);if(e)return e}return null}function V(e,n){var t=[],r=O.getOwnPropertyNames;if(r)t=r(e);else for(var o in e)"string"==typeof o&&v(e,o)&&t.push(o);if(t&&0<t.length)for(var i=0;i<t.length;i++)n(t[i])}function K(e,n,t){return n!==w&&typeof e[n]===S&&(t||v(e,n))}function U(e){throw new TypeError("DynamicProto: "+e)}function H(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function W(e,n){return v(e,p)?e.name||n||_:((e||{})[w]||{}).name||n||_}function q(e,r,n,t){v(e,p)||U("theClass is an invalid class definition.");var s,o,i,a,f,d,l=e[p],c=(function(e){if(k)for(var n=[],t=C(r);t&&!z(t)&&!H(n,t);){if(t===e)return 1;n.push(t),t=C(t)}}(l)||U("["+W(e)+"] is not in class hierarchy of ["+W(r)+"]"),null),e=(v(l,F)?c=l[F]:(c="_dynCls$"+W(e,"_")+"$"+j,j++,l[F]=c),q[N]),u=!!e[R],g=(u&&t&&t[R]!==undefined&&(u=!!t[R]),o={},V(s=r,function(e){!o[e]&&K(s,e,!1)&&(o[e]=s[e])}),o),u=(n(r,function(e,n,t,i){function r(e,n,t){var r,o=n[t];return o[E]&&i&&!1!==(r=e[A]||{})[L]&&(o=(r[n[F]]||{})[t]||o),function(){return o.apply(e,arguments)}}for(var o={},a=(V(t,function(e){o[e]=r(n,t,e)}),C(e)),l=[];a&&!z(a)&&!H(l,a);)V(a,function(e){!o[e]&&K(a,e,!k)&&(o[e]=r(n,a,e))}),l.push(a),a=C(a);return o}(l,r,g,u)),!!k&&!!e[D]);i=l,n=c,a=r,f=g,e=!1!==(u=u&&t?!!t[D]:u),B(i)||(l=a[A]=a[A]||{},d=l[n]=l[n]||{},!1!==l[L]&&(l[L]=!!e),V(a,function(e){var t,r,o;K(a,e,!1)&&a[e]!==f[e]&&(d[e]=a[e],delete a[e],v(i,e)&&(!i[e]||i[e][E])||(i[e]=(t=i,r=e,(o=function(){var e,n;return(function(e,n,t,s){var r=null;if(e&&v(t,F)){var o=e[A]||{};if((r=(o[t[F]]||{})[n])||U("Missing ["+n+"] "+S),!r[P]&&!1!==o[L]){for(var i=!v(e,n),a=C(e),l=[];i&&a&&!z(a)&&!H(l,a);){var c=a[n];if(c){i=c===s;break}l.push(a),a=C(a)}try{i&&(e[n]=r),r[P]=1}catch(u){o[L]=!1}}}return r}(this,r,t,o)||(typeof(n=(n=t[e=r])===o?C(t)[e]:n)!==S&&U("["+e+"] is not a "+S),n)).apply(this,arguments)})[E]=1,o)))}))}q[N]={setInstFuncs:!0,useBaseInst:!0};var G={CRITICAL:1,1:"CRITICAL",WARNING:2,2:"WARNING"},J={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105},e="toString",$="constructor",Q=x,x=d.freeze,Z=Array.isArray,X=t[e],Y=m[e],ee=Y.call(d),ne=Object.getPrototypeOf;function te(e){return e===undefined||typeof e===i}function f(e){return null===e||te(e)}function re(e){return!(!e||typeof e!==u)}function y(e){return!(!e||typeof e!==c)}var g=Z||function(e){return!(!e||"[object Array]"!==X.call(e))};function oe(e){return e&&"object"==typeof e&&(!(e=(ne||function(e){if(e){if(ne)return ne(e);e=e.__proto__||e[r]||e[$];if(e)return e}return null})(e))||typeof(e=e[$]&&m.call(e,$)?e[$]:e)===c&&Y.call(e)===ee)}function ie(e,n,t){var r=e.length;try{for(var o=0;o<r&&!(o in e&&-1===n.call(t||e,e[o],o,e));o++);}catch(i){}}var ae=x||function(e){return e};function le(){var e=Date;return e.now?e.now():(new e).getTime()}var ce="window",ue="JSON";function se(e){var n=T();return n&&n[e]?n[e]:e===ce&&typeof window===u&&window?window:null}function fe(){return typeof JSON===u&&JSON||null!==se(ue)}function de(){return fe()?JSON||se(ue):null}function ge(e){var n=Object[r].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":fe()&&(t=de().stringify(e)),n+t}var pe=null;function ve(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function Ce(e,n){var t,r=typeof console!==i?console:se("console");r&&(t="log",y(r[t=r[e]?e:t])&&r[t](n))}xe.dataType="MessageData";var ye=xe;function xe(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;t="",fe()&&(t=de().stringify(r)),e=(n?" message:"+ve(n):"")+(r?" props:"+ve(t):"");this.message+=e}var me=function je(o){this.identifier="DiagnosticLogger",this.queue=[];var l=0,c={};q(je,this,function(i){function e(e,n){e=o[e];return f(e)?n:e}function a(e,n){var t,r=(t=(t=pe)||!0===o.disableDbgExt?t:pe||(r=se("Microsoft"),pe=r?r.ApplicationInsights:pe))?t.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,n)}f(o)&&(o={}),i.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},i.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},i.throwInternal=function(e,n,t,r,o){n=new ye(n,t,o=void 0!==o&&o,r);if(i.enableDebugExceptions())throw n;t=e===G.CRITICAL?"errorToConsole":"warnToConsole";te(n.message)?a("throw"+(e===G.CRITICAL?"Critical":"Warning"),n):(r=i.consoleLoggingLevel(),o?(o=+n.messageId,!c[o]&&e<=r&&(i[t](n.message),c[o]=!0)):e<=r&&i[t](n.message),i.logInternalMessage(e,n))},i.warnToConsole=function(e){Ce("warn",e),a("warning",e)},i.errorToConsole=function(e){Ce("error",e),a("error",e)},i.resetInternalMessageCount=function(){l=0,c={}},i.logInternalMessage=function(e,n){var t,r;l>=i.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,c[t]?r=!1:c[t]=!0,r&&(e<=i.telemetryLoggingLevel()&&(i.queue.push(n),l++,a(e===G.CRITICAL?"error":"warn",n)),l===i.maxInternalMessageLimit()&&(r=new ye(J.MessageLimitPerPVExceeded,t="Internal events throttle limit per PageView reached for this app.",!1),i.queue.push(r),e===G.CRITICAL?i.errorToConsole(t):i.warnToConsole(t))))}})},he=(l.ParentContextKey="parent",l.ChildrenContextKey="childEvts",l);function l(e,o,n){var r,i=this,a=!1;i.start=le(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},y(o)&&(a=function(e){if(Q)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&y(o)&&(r=o(),o=null),r}};return Q(e,"payload",n),!0}catch(t){}return!1}(i)),i.getCtx=function(e){return e?(e===l.ParentContextKey||e===l.ChildrenContextKey?i:i.ctx||{})[e]:null},i.setCtx=function(e,n){e&&(e===l.ParentContextKey?(i[e]||(i.isChildEvt=function(){return!0}),i[e]=n):e===l.ChildrenContextKey?i[e]=n:(i.ctx=i.ctx||{})[e]=n)},i.complete=function(){var e=0,n=i.getCtx(l.ChildrenContextKey);if(g(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}i.time=le()-i.start,i.exTime=i.time-e,i.complete=function(){},!a&&y(o)&&(i.payload=o())}}var Te="CoreUtils.doPerf";function Ie(e,n,t,r,o){if(e)if(e=y(e.getPerfMgr)?e.getPerfMgr():e){var i,a=void 0,l=e.getCtx(Te);try{if(a=e.create(n(),r,o))return l&&a.setCtx&&(a.setCtx(he.ParentContextKey,l),l.getCtx&&l.setCtx&&((i=l.getCtx(he.ChildrenContextKey))||(i=[],l.setCtx(he.ChildrenContextKey,i)),i.push(a))),e.setCtx(Te,a),t(a)}catch(c){a&&a.setCtx&&a.setCtx("exception",c)}finally{a&&e.fire(a),e.setCtx(Te,l)}}return t()}var be="TelemetryPluginChain",we="_hasRun",Se="_getTelCtx",Ae=0;function Ee(e,u,t,n){var r=null,o=null,r=n?function(e,n,t,r){for(;e;){if(e.getPlugin()===r)return e;e=e.getNext()}return Fe([r],n,t)}(e,u,t,n):e,i={core:function(){return t},diagLog:function(){return(t||{}).logger||new me(u)},getCfg:function(){return u},getExtCfg:a,getConfig:function(e,n,t){void 0===t&&(t=!1);var r,e=a(e,null);return e&&!f(e[n])?r=e[n]:u&&!f(u[n])&&(r=u[n]),f(r)?t:r},hasNext:function(){return null!=r},getNext:function(){return r},setNext:function(e){r=e},processNext:function(n){l(function(e){e.processTelemetry(n,i)})},iterate:function(n){for(;r;)l(function(e){e=e.getPlugin();e&&n(e)})},createNew:function(e,n){return Ee((e=g(e=void 0===e?null:e)?Fe(e,u,t,n):e)||r,u,t,n)},onComplete:function(e){o=e}};function a(e,n,t){var r,o,i;if(void 0===n&&(n={}),void 0===t&&(t=0),!u||(o=u.extensionConfig)&&e&&(r=o[e]),r){if(re(n)&&0!==t){var a=function d(){var e=arguments,n=e[0]||{},t=e.length,r=!1,o=1;for(0<t&&"boolean"==typeof n&&(r=n,n=e[o]||{},o++),re(n)||(n={});o<t;o++){var i,a,l,c,u=e[o],s=g(u),f=re(u);for(i in u)(s&&i in u||f&&m.call(u,i))&&(a=u[i],l=void 0,r&&a&&((l=g(a))||oe(a))&&(c=n[i],l?g(c)||(c=[]):oe(c)||(c={}),a=d(r,c,a)),a!==undefined&&(n[i]=a))}return n}(!0,n,r);if(u&&2===t){var l=n;if(l)for(var c in l)m.call(l,c)&&(i=c,l[c],c=void 0,f(a[i])&&(f(c=u[i])||(a[i]=c)))}}}else r=n;return r}function l(e){var n=r;n?(r=n.getNext(),e(n)):o&&(o(),o=null)}return i}function Fe(e,n,t,r){var o,i=null,a=!r;return g(e)&&0<e.length&&(o=null,ie(e,function(e){(a=!a&&r===e||a)&&e&&y(e.processTelemetry)&&(e=Pe(e,n,t),i=i||e,o&&o._setNext(e),o=e)})),r&&!i?Fe([r],n,t):i}function Pe(c,u,s){var f=null,t=y(c.processTelemetry),r=y(c.setNextPlugin),d=c?c.identifier+"-"+c.priority+"-"+Ae++:"Unknown-0-"+Ae++,g={getPlugin:function(){return c},getNext:function(){return f},processTelemetry:function(n,e){o(e,function(e){return!!t&&(r&&c.setNextPlugin(f),c.processTelemetry(n,e),!0)},function(e){f.processTelemetry(n,e)},"processTelemetry",function(){return{item:n}},!n.sync)},_id:d,_setNext:function(e){f=e}};function o(r,o,i,a,e,n){r=(r=r||(c&&y(c[Se])?c[Se]():r))||Ee(g,u,s);var t=c?c.identifier:be,l=(l=r[we])||(r[we]={});Ie(r.core(),function(){return t+":"+a},function(){var e=!(l[d]=!0);if(r.setNext(f),c)try{var n=f?f._id:"";n&&(l[n]=!1),e=o(r)}catch(t){n=!f||l[f._id];n&&(e=!0),f&&n||r.diagLog().throwInternal(G.CRITICAL,J.PluginException,"Plugin ["+c.identifier+"] failed during "+a+" - "+ge(t)+", run flags: "+ge(l))}f&&!e&&i(r)},e,n)}return ae(g)}var Le,Ne,_e,Me="getPlugin",t=function Be(){var l,c,u,n,s=this;function t(e){var n,e=e=void 0===e?null:e;return e||(n=c||Ee(null,{},s.core),e=u&&u[Me]?n.createNew(null,u[Me]):n.createNew(null,u)),e}l=!1,s.core=null,u=c=null,n=[],q(Be,s,function(e){e.initialize=function(e,n,t,r){e&&(a="extensionConfig",i=o=[],!e||(i=e[a])!==o&&f(i)&&(e[a]=i=o)),!r&&n&&(r=n.getProcessTelContext().getNext());var o,i,a=u;u&&u[Me]&&(a=u[Me]()),s.core=n,c=Ee(r,e,n,a),l=!0},e._addHook=function(e){e&&(g(e)?n=n.concat(e):n.push(e))}}),s.diagLog=function(e){return t(e).diagLog()},s.isInitialized=function(){return l},s.setInitialized=function(e){l=e},s.setNextPlugin=function(e){u=e},s.processNext=function(e,n){n?n.processNext(e):u&&y(u.processTelemetry)&&u.processTelemetry(e,null)},s._getTelCtx=t},Re=((e=Le={})[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical",De.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),t=(t&&e.extensionConfig&&e.extensionConfig[t]&&!f(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],f(t)?r:t},De);function De(){}function Oe(){this.constructor=Ne}function ke(e){var f,r,n=_e.call(this)||this,o=(n.identifier="AppInsightsReactNativePlugin",n.priority=140,{}),d=e||g();function g(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return q(ke,n,function(u,s){u.initialize=function(e,n,t){var r,o;if(!u.isInitialized()){s.initialize(e,n,t);var i=e||{},a=g(),l=function(e,n){d[e]=Re.getConfig(i,e,u.identifier,te(d[e])?n:d[e])};if(re(a))for(var c in a)o=c,(r=a)&&m.call(r,o)&&l(c,a[c]);d.disableDeviceCollection||u._collectDeviceInfo(),t&&ie(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(f=e)}),d.disableExceptionCollection||u._setExceptionHandler()}},u.processTelemetry=function(e,n){var t=e;o&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof o.id&&(t.ext.device.localId=o.id),"string"==typeof o.model&&(t.ext.device.model=o.model),"string"==typeof o.deviceClass&&(t.ext.device.deviceClass=o.deviceClass)),u.processNext(e,n)},u.setDeviceId=function(e){o.id=e},u.setDeviceModel=function(e){o.model=e},u.setDeviceType=function(e){o.deviceClass=e},u._collectDeviceInfo=function(){try{o.deviceClass=a["default"].getDeviceType(),o.id=a["default"].getUniqueId(),o.model=a["default"].getModel()}catch(n){u.diagLog().warnToConsole("Failed to get DeviceInfo: "+((e=n)&&"[object Error]"===X.call(e)?e.name:"")+" - "+ge(n))}var e},u._setExceptionHandler=function(){var e=typeof global!==i&&global?global:T();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:Le.Error};f?f.trackException(t):u.diagLog().throwInternal(G.CRITICAL,J.TelemetryInitializerFailed,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},u._config=d,u._getDbgPlgTargets=function(){return[o]}}),n}Ne=ke,typeof(Z=_e=t)!==c&&null!==Z&&I("Class extends value "+Z+" is not a constructor or null"),b(Ne,Z),Ne[r]=(Oe[r]=Z[r],new Oe),n.ReactNativePlugin=ke,Object.defineProperty(n,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
|