@cloudcare/browser-core 3.1.17 → 3.1.18
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/cjs/configuration/configuration.js +2 -0
- package/cjs/configuration/configuration.js.map +1 -1
- package/cjs/dataMap.js +2 -1
- package/cjs/dataMap.js.map +1 -1
- package/cjs/helper/serialisation/storedContextManager.js +16 -15
- package/cjs/helper/serialisation/storedContextManager.js.map +1 -1
- package/esm/configuration/configuration.js +2 -0
- package/esm/configuration/configuration.js.map +1 -1
- package/esm/dataMap.js +2 -1
- package/esm/dataMap.js.map +1 -1
- package/esm/helper/serialisation/storedContextManager.js +16 -15
- package/esm/helper/serialisation/storedContextManager.js.map +1 -1
- package/package.json +2 -2
- package/src/configuration/configuration.js +2 -0
- package/src/dataMap.js +2 -1
- package/src/helper/serialisation/storedContextManager.js +32 -21
- package/types/index.d.ts +4 -0
|
@@ -62,6 +62,8 @@ function validateAndBuildConfiguration(initConfiguration) {
|
|
|
62
62
|
messageBytesLimit: 256 * _byteUtils.ONE_KIBI_BYTE,
|
|
63
63
|
resourceUrlLimit: 5 * _byteUtils.ONE_KIBI_BYTE,
|
|
64
64
|
storeContextsToLocal: !!initConfiguration.storeContextsToLocal,
|
|
65
|
+
// 存储到localstorage key ,默认不填,自动生成
|
|
66
|
+
storeContextsKey: initConfiguration.storeContextsKey,
|
|
65
67
|
sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson
|
|
66
68
|
}, (0, _transportConfiguration.computeTransportConfiguration)(initConfiguration));
|
|
67
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","sendContentTypeByJson","computeTransportConfiguration","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","useSecureSessionCookie","usePartitionedCrossSiteSessionCookie","useCrossSiteSessionCookie","crossSite","partitioned","trackSessionAcrossSubdomains","domain","getCurrentSite"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n // cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.partitioned =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\n// function mustUseSecureCookie(initConfiguration) {\n// return (\n// !!initConfiguration.useSecureSessionCookie ||\n// !!initConfiguration.useCrossSiteSessionCookie\n// )\n// }\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AACM,SAASK,6BAA6BA,CAACC,iBAAiB,EAAE;EAC/D,IACEA,iBAAiB,CAACC,UAAU,KAAKC,SAAS,IAC1C,CAAC,IAAAC,mBAAY,EAACH,iBAAiB,CAACC,UAAU,CAAC,EAC3C;IACAG,gBAAO,CAACC,KAAK,CAAC,kDAAkD,CAAC;IACjE;EACF;EACA,IACEL,iBAAiB,CAACM,iBAAiB,KAAKJ,SAAS,IACjD,CAAC,IAAAC,mBAAY,EAACH,iBAAiB,CAACM,iBAAiB,CAAC,EAClD;IACAF,gBAAO,CAACC,KAAK,CAAC,kDAAkD,CAAC;IACjE;EACF;EACA,IACEL,iBAAiB,CAACO,mBAAmB,KAAKL,SAAS,IACnD,CAAC,IAAAC,mBAAY,EAACH,iBAAiB,CAACO,mBAAmB,CAAC,EACpD;IACAH,gBAAO,CAACC,KAAK,CAAC,4DAA4D,CAAC;IAC3E;EACF;EACA,IAAIC,iBAAiB,GACnBN,iBAAiB,CAACM,iBAAiB,IAAIN,iBAAiB,CAACC,UAAU;EACrE,OAAO,IAAAO,aAAM,EACX;IACEC,UAAU,EACRT,iBAAiB,CAACS,UAAU,IAC5B,IAAAC,gCAAe,EACbV,iBAAiB,CAACS,UAAU,EAC5B,4BACF,CAAC;IACHE,aAAa,EAAEC,kBAAkB,CAACZ,iBAAiB,CAAC;IACpDM,iBAAiB,EAAE,IAAAO,kCAA2B,EAACP,iBAAiB,EAAE,GAAG,CAAC;IACtEQ,OAAO,EAAEd,iBAAiB,CAACc,OAAO;IAClCC,OAAO,EAAEf,iBAAiB,CAACe,OAAO;IAClCC,GAAG,EAAEhB,iBAAiB,CAACgB,GAAG;IAC1BT,mBAAmB,EAAE,IAAAM,kCAA2B,EAC9Cb,iBAAiB,CAACO,mBAAmB,EACrC,GACF,CAAC;IACDU,gBAAgB,EAAE,IAAAJ,kCAA2B,EAC3Cb,iBAAiB,CAACiB,gBAAgB,EAClC,KACF,CAAC;IACDC,kBAAkB,EAAE,CAAC,CAAClB,iBAAiB,CAACkB,kBAAkB;IAE1D;AACN;AACA;AACA;IACMC,eAAe,EAAE,EAAE,GAAGC,wBAAa;IAEnCC,yBAAyB,EAAE,IAAI;IAC/BC,yBAAyB,EAAE,EAAE;IAE7B;AACN;AACA;AACA;IACMC,YAAY,EAAE,EAAE,GAAGC,iBAAU;IAE7B;AACN;AACA;IACMC,kBAAkB,EAAE,EAAE;IACtBC,iBAAiB,EAAE,GAAG,GAAGN,wBAAa;IACtCO,gBAAgB,EAAE,CAAC,GAAGP,wBAAa;IACnCQ,oBAAoB,EAAE,CAAC,CAAC5B,iBAAiB,CAAC4B,oBAAoB;
|
|
1
|
+
{"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","storeContextsKey","sendContentTypeByJson","computeTransportConfiguration","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","useSecureSessionCookie","usePartitionedCrossSiteSessionCookie","useCrossSiteSessionCookie","crossSite","partitioned","trackSessionAcrossSubdomains","domain","getCurrentSite"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n // 存储到localstorage key ,默认不填,自动生成\n storeContextsKey: initConfiguration.storeContextsKey,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n // cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.partitioned =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\n// function mustUseSecureCookie(initConfiguration) {\n// return (\n// !!initConfiguration.useSecureSessionCookie ||\n// !!initConfiguration.useCrossSiteSessionCookie\n// )\n// }\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AACM,SAASK,6BAA6BA,CAACC,iBAAiB,EAAE;EAC/D,IACEA,iBAAiB,CAACC,UAAU,KAAKC,SAAS,IAC1C,CAAC,IAAAC,mBAAY,EAACH,iBAAiB,CAACC,UAAU,CAAC,EAC3C;IACAG,gBAAO,CAACC,KAAK,CAAC,kDAAkD,CAAC;IACjE;EACF;EACA,IACEL,iBAAiB,CAACM,iBAAiB,KAAKJ,SAAS,IACjD,CAAC,IAAAC,mBAAY,EAACH,iBAAiB,CAACM,iBAAiB,CAAC,EAClD;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;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/cjs/dataMap.js
CHANGED
|
@@ -155,7 +155,8 @@ var dataMap = {
|
|
|
155
155
|
fields: {
|
|
156
156
|
error_message: ['string', 'error.message'],
|
|
157
157
|
error_stack: ['string', 'error.stack'],
|
|
158
|
-
error_causes: ['string', 'error.causes']
|
|
158
|
+
error_causes: ['string', 'error.causes'],
|
|
159
|
+
error_handling_stack: ['string', 'error.handling_stack']
|
|
159
160
|
}
|
|
160
161
|
},
|
|
161
162
|
long_task: {
|
package/cjs/dataMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","drift","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,MAAM,EAAE,eAAe;EACvBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EAAE;EACxBC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAA/B,UAAA,GAAAA,UAAA;AACM,IAAIgC,YAAY,GAAG;EACxBC,cAAc,EAAE,gBAAgB;EAChCC,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AC;MAChDkB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB;IAC/C;EACF,CAAC;EACDC,WAAW,EAAE;IACXlG,IAAI,EAAEC,mBAAY,CAACkG,MAAM;IACzBhG,IAAI,EAAE;MACJwE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxBwB,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpCtH,SAAS,EAAE,gBAAgB;MAC3B7B,OAAO,EAAE,SAAS;MAClBwI,MAAM,EAAE;IACV,CAAC;IACDxF,MAAM,EAAE;MACNyF,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAA/G,OAAA,CAAAa,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","drift","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","error_handling_stack","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes'],\n error_handling_stack: ['string', 'error.handling_stack']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,MAAM,EAAE,eAAe;EACvBC,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C,wBAAwB,EAAE,yBAAyB;MACnDC,sBAAsB,EAAE,wBAAwB;MAChDC,aAAa,EAAE,mBAAmB;MAClCC,eAAe,EAAE;IACnB;EACF,CAAC;EACDC,SAAS,EAAE;IACT/F,IAAI,EAAE,WAAW;IACjBO,MAAM,EAAE;MACNyF,MAAM,EAAE,kBAAkB;MAC1BC,OAAO,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;MACxCjG,IAAI,EAAE,gBAAgB;MACtB+E,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDmB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB;IAC/C;EACF,CAAC;EACDC,WAAW,EAAE;IACXnG,IAAI,EAAEC,mBAAY,CAACmG,MAAM;IACzBjG,IAAI,EAAE;MACJwE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxByB,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpCvH,SAAS,EAAE,gBAAgB;MAC3B7B,OAAO,EAAE,SAAS;MAClByI,MAAM,EAAE;IACV,CAAC;IACDzF,MAAM,EAAE;MACN0F,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAAhH,OAAA,CAAAa,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -4,40 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.buildStorageKey = buildStorageKey;
|
|
7
|
-
exports.createStoredContextManager = createStoredContextManager;
|
|
8
7
|
exports.removeStorageListeners = removeStorageListeners;
|
|
9
|
-
|
|
8
|
+
exports.storeContextManager = storeContextManager;
|
|
10
9
|
var _enums = require("../enums");
|
|
11
10
|
var _tools = require("../tools");
|
|
12
11
|
var _addEventListener = require("../../browser/addEventListener");
|
|
13
|
-
var _contextManager = require("./contextManager");
|
|
14
12
|
var CONTEXT_STORE_KEY_PREFIX = '_gc_s';
|
|
15
13
|
var storageListeners = [];
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
computeBytesCountImpl = _byteUtils.computeBytesCount;
|
|
19
|
-
}
|
|
20
|
-
var storageKey = buildStorageKey(productKey, customerDataType);
|
|
21
|
-
var contextManager = (0, _contextManager.createContextManager)(customerDataType, computeBytesCountImpl);
|
|
22
|
-
synchronizeWithStorage();
|
|
14
|
+
function storeContextManager(configuration, contextManager, productKey, customerDataType) {
|
|
15
|
+
var storageKey = buildStorageKey(configuration, productKey, customerDataType);
|
|
23
16
|
storageListeners.push((0, _addEventListener.addEventListener)(window, _enums.DOM_EVENT.STORAGE, function (params) {
|
|
24
17
|
if (storageKey === params.key) {
|
|
25
18
|
synchronizeWithStorage();
|
|
26
19
|
}
|
|
27
20
|
}));
|
|
28
21
|
contextManager.changeObservable.subscribe(dumpToStorage);
|
|
22
|
+
contextManager.setContext((0, _tools.extend2Lev)(getFromStorage(), contextManager.getContext()));
|
|
29
23
|
function synchronizeWithStorage() {
|
|
30
|
-
|
|
31
|
-
var context = rawContext !== null ? JSON.parse(rawContext) : {};
|
|
32
|
-
contextManager.setContext(context);
|
|
24
|
+
contextManager.setContext(getFromStorage());
|
|
33
25
|
}
|
|
34
26
|
function dumpToStorage() {
|
|
35
27
|
localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));
|
|
36
28
|
}
|
|
29
|
+
function getFromStorage() {
|
|
30
|
+
var rawContext = localStorage.getItem(storageKey);
|
|
31
|
+
return rawContext !== null ? JSON.parse(rawContext) : {};
|
|
32
|
+
}
|
|
37
33
|
return contextManager;
|
|
38
34
|
}
|
|
39
|
-
function buildStorageKey(productKey, customerDataType) {
|
|
40
|
-
|
|
35
|
+
function buildStorageKey(configuration, productKey, customerDataType) {
|
|
36
|
+
// storeContextsKey
|
|
37
|
+
if (configuration.storeContextsKey && (0, _tools.isString)(configuration.storeContextsKey)) {
|
|
38
|
+
return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType + '_' + configuration.storeContextsKey;
|
|
39
|
+
} else {
|
|
40
|
+
return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType;
|
|
41
|
+
}
|
|
41
42
|
}
|
|
42
43
|
function removeStorageListeners() {
|
|
43
44
|
(0, _tools.map)(storageListeners, function (listener) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storedContextManager.js","names":["
|
|
1
|
+
{"version":3,"file":"storedContextManager.js","names":["_enums","require","_tools","_addEventListener","CONTEXT_STORE_KEY_PREFIX","storageListeners","storeContextManager","configuration","contextManager","productKey","customerDataType","storageKey","buildStorageKey","push","addEventListener","window","DOM_EVENT","STORAGE","params","key","synchronizeWithStorage","changeObservable","subscribe","dumpToStorage","setContext","extend2Lev","getFromStorage","getContext","localStorage","setItem","JSON","stringify","rawContext","getItem","parse","storeContextsKey","isString","removeStorageListeners","map","listener","stop"],"sources":["../../../src/helper/serialisation/storedContextManager.js"],"sourcesContent":["import { DOM_EVENT } from '../enums'\nimport { map, extend2Lev, isString } from '../tools'\nimport { addEventListener } from '../../browser/addEventListener'\nvar CONTEXT_STORE_KEY_PREFIX = '_gc_s'\n\nvar storageListeners = []\n\nexport function storeContextManager(\n configuration,\n contextManager,\n productKey,\n customerDataType\n) {\n var storageKey = buildStorageKey(configuration, productKey, customerDataType)\n\n storageListeners.push(\n addEventListener(window, DOM_EVENT.STORAGE, function (params) {\n if (storageKey === params.key) {\n synchronizeWithStorage()\n }\n })\n )\n contextManager.changeObservable.subscribe(dumpToStorage)\n contextManager.setContext(\n extend2Lev(getFromStorage(), contextManager.getContext())\n )\n function synchronizeWithStorage() {\n contextManager.setContext(getFromStorage())\n }\n function dumpToStorage() {\n localStorage.setItem(\n storageKey,\n JSON.stringify(contextManager.getContext())\n )\n }\n function getFromStorage() {\n const rawContext = localStorage.getItem(storageKey)\n return rawContext !== null ? JSON.parse(rawContext) : {}\n }\n return contextManager\n}\n\nexport function buildStorageKey(configuration, productKey, customerDataType) {\n // storeContextsKey\n if (\n configuration.storeContextsKey &&\n isString(configuration.storeContextsKey)\n ) {\n return (\n CONTEXT_STORE_KEY_PREFIX +\n '_' +\n productKey +\n '_' +\n customerDataType +\n '_' +\n configuration.storeContextsKey\n )\n } else {\n return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType\n }\n}\n\nexport function removeStorageListeners() {\n map(storageListeners, function (listener) {\n listener.stop()\n })\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAIG,wBAAwB,GAAG,OAAO;AAEtC,IAAIC,gBAAgB,GAAG,EAAE;AAElB,SAASC,mBAAmBA,CACjCC,aAAa,EACbC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAChB;EACA,IAAIC,UAAU,GAAGC,eAAe,CAACL,aAAa,EAAEE,UAAU,EAAEC,gBAAgB,CAAC;EAE7EL,gBAAgB,CAACQ,IAAI,CACnB,IAAAC,kCAAgB,EAACC,MAAM,EAAEC,gBAAS,CAACC,OAAO,EAAE,UAAUC,MAAM,EAAE;IAC5D,IAAIP,UAAU,KAAKO,MAAM,CAACC,GAAG,EAAE;MAC7BC,sBAAsB,CAAC,CAAC;IAC1B;EACF,CAAC,CACH,CAAC;EACDZ,cAAc,CAACa,gBAAgB,CAACC,SAAS,CAACC,aAAa,CAAC;EACxDf,cAAc,CAACgB,UAAU,CACvB,IAAAC,iBAAU,EAACC,cAAc,CAAC,CAAC,EAAElB,cAAc,CAACmB,UAAU,CAAC,CAAC,CAC1D,CAAC;EACD,SAASP,sBAAsBA,CAAA,EAAG;IAChCZ,cAAc,CAACgB,UAAU,CAACE,cAAc,CAAC,CAAC,CAAC;EAC7C;EACA,SAASH,aAAaA,CAAA,EAAG;IACvBK,YAAY,CAACC,OAAO,CAClBlB,UAAU,EACVmB,IAAI,CAACC,SAAS,CAACvB,cAAc,CAACmB,UAAU,CAAC,CAAC,CAC5C,CAAC;EACH;EACA,SAASD,cAAcA,CAAA,EAAG;IACxB,IAAMM,UAAU,GAAGJ,YAAY,CAACK,OAAO,CAACtB,UAAU,CAAC;IACnD,OAAOqB,UAAU,KAAK,IAAI,GAAGF,IAAI,CAACI,KAAK,CAACF,UAAU,CAAC,GAAG,CAAC,CAAC;EAC1D;EACA,OAAOxB,cAAc;AACvB;AAEO,SAASI,eAAeA,CAACL,aAAa,EAAEE,UAAU,EAAEC,gBAAgB,EAAE;EAC3E;EACA,IACEH,aAAa,CAAC4B,gBAAgB,IAC9B,IAAAC,eAAQ,EAAC7B,aAAa,CAAC4B,gBAAgB,CAAC,EACxC;IACA,OACE/B,wBAAwB,GACxB,GAAG,GACHK,UAAU,GACV,GAAG,GACHC,gBAAgB,GAChB,GAAG,GACHH,aAAa,CAAC4B,gBAAgB;EAElC,CAAC,MAAM;IACL,OAAO/B,wBAAwB,GAAG,GAAG,GAAGK,UAAU,GAAG,GAAG,GAAGC,gBAAgB;EAC7E;AACF;AAEO,SAAS2B,sBAAsBA,CAAA,EAAG;EACvC,IAAAC,UAAG,EAACjC,gBAAgB,EAAE,UAAUkC,QAAQ,EAAE;IACxCA,QAAQ,CAACC,IAAI,CAAC,CAAC;EACjB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -52,6 +52,8 @@ export function validateAndBuildConfiguration(initConfiguration) {
|
|
|
52
52
|
messageBytesLimit: 256 * ONE_KIBI_BYTE,
|
|
53
53
|
resourceUrlLimit: 5 * ONE_KIBI_BYTE,
|
|
54
54
|
storeContextsToLocal: !!initConfiguration.storeContextsToLocal,
|
|
55
|
+
// 存储到localstorage key ,默认不填,自动生成
|
|
56
|
+
storeContextsKey: initConfiguration.storeContextsKey,
|
|
55
57
|
sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson
|
|
56
58
|
}, computeTransportConfiguration(initConfiguration));
|
|
57
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","names":["getCurrentSite","catchUserErrors","display","assign","isPercentage","ONE_SECOND","isNullUndefinedDefaultValue","ONE_KIBI_BYTE","computeTransportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","error","sessionSampleRate","telemetrySampleRate","beforeSend","cookieOptions","buildCookieOptions","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","sendContentTypeByJson","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","useSecureSessionCookie","usePartitionedCrossSiteSessionCookie","useCrossSiteSessionCookie","crossSite","partitioned","trackSessionAcrossSubdomains","domain"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n // cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.partitioned =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\n// function mustUseSecureCookie(initConfiguration) {\n// return (\n// !!initConfiguration.useSecureSessionCookie ||\n// !!initConfiguration.useCrossSiteSessionCookie\n// )\n// }\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAClD,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SACEC,MAAM,EACNC,YAAY,EACZC,UAAU,EACVC,2BAA2B,QACtB,iBAAiB;AACxB,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,6BAA6B,QAAQ,0BAA0B;AAExE,OAAO,IAAIC,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AACD,OAAO,SAASC,6BAA6BA,CAACC,iBAAiB,EAAE;EAC/D,IACEA,iBAAiB,CAACC,UAAU,KAAKC,SAAS,IAC1C,CAACZ,YAAY,CAACU,iBAAiB,CAACC,UAAU,CAAC,EAC3C;IACAb,OAAO,CAACe,KAAK,CAAC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AAE;IACtBC,iBAAiB,EAAE,GAAG,GAAG1B,aAAa;IACtC2B,gBAAgB,EAAE,CAAC,GAAG3B,aAAa;IACnC4B,oBAAoB,EAAE,CAAC,CAACrB,iBAAiB,CAACqB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"configuration.js","names":["getCurrentSite","catchUserErrors","display","assign","isPercentage","ONE_SECOND","isNullUndefinedDefaultValue","ONE_KIBI_BYTE","computeTransportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","error","sessionSampleRate","telemetrySampleRate","beforeSend","cookieOptions","buildCookieOptions","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","storeContextsKey","sendContentTypeByJson","validatePostRequestRequireParamsConfiguration","site","datakitOrigin","datakitUrl","clientToken","secure","useSecureSessionCookie","usePartitionedCrossSiteSessionCookie","useCrossSiteSessionCookie","crossSite","partitioned","trackSessionAcrossSubdomains","domain"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n // 存储到localstorage key ,默认不填,自动生成\n storeContextsKey: initConfiguration.storeContextsKey,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\nexport function validatePostRequestRequireParamsConfiguration(\n initConfiguration\n) {\n if (\n !initConfiguration.site &&\n !initConfiguration.datakitOrigin &&\n !initConfiguration.datakitUrl\n ) {\n display.error(\n 'datakitOrigin or site is not configured, no RUM data will be collected.'\n )\n return false\n }\n // if (!initConfiguration.datakitUrl && !initConfiguration.datakitOrigin) {\n // display.error(\n // 'datakitOrigin is not configured, no RUM data will be collected.'\n // )\n // return false\n // }\n if (initConfiguration.site && !initConfiguration.clientToken) {\n display.error(\n 'clientToken is not configured, no RUM data will be collected.'\n )\n return false\n }\n return true\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n // cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n // cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.crossSite =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n cookieOptions.partitioned =\n !!initConfiguration.usePartitionedCrossSiteSessionCookie\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\n// function mustUseSecureCookie(initConfiguration) {\n// return (\n// !!initConfiguration.useSecureSessionCookie ||\n// !!initConfiguration.useCrossSiteSessionCookie\n// )\n// }\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAClD,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SACEC,MAAM,EACNC,YAAY,EACZC,UAAU,EACVC,2BAA2B,QACtB,iBAAiB;AACxB,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,6BAA6B,QAAQ,0BAA0B;AAExE,OAAO,IAAIC,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AACD,OAAO,SAASC,6BAA6BA,CAACC,iBAAiB,EAAE;EAC/D,IACEA,iBAAiB,CAACC,UAAU,KAAKC,SAAS,IAC1C,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GACvB,CAAC,CAAClC,iBAAiB,CAAC+B,oCAAoC;EAC1D,IAAI/B,iBAAiB,CAACmC,4BAA4B,EAAE;IAClD5B,aAAa,CAAC6B,MAAM,GAAGlD,cAAc,CAAC,CAAC;EACzC;EAEA,OAAOqB,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/esm/dataMap.js
CHANGED
|
@@ -147,7 +147,8 @@ export var dataMap = {
|
|
|
147
147
|
fields: {
|
|
148
148
|
error_message: ['string', 'error.message'],
|
|
149
149
|
error_stack: ['string', 'error.stack'],
|
|
150
|
-
error_causes: ['string', 'error.causes']
|
|
150
|
+
error_causes: ['string', 'error.causes'],
|
|
151
|
+
error_handling_stack: ['string', 'error.handling_stack']
|
|
151
152
|
}
|
|
152
153
|
},
|
|
153
154
|
long_task: {
|
package/esm/dataMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,MAAM,EAAE,eAAe;EACvBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,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,EAAE,mBAAmB,CAAC;MACxC/F,IAAI,EAAE,gBAAgB;MACtB8E,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDkB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB;IAC/C;EACF,CAAC;EACDC,WAAW,EAAE;IACXjG,IAAI,EAAE9C,YAAY,CAACgJ,MAAM;IACzBhG,IAAI,EAAE;MACJwE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxBwB,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpCrH,SAAS,EAAE,gBAAgB;MAC3B5B,OAAO,EAAE,SAAS;MAClBsI,MAAM,EAAE;IACV,CAAC;IACDxF,MAAM,EAAE;MACNyF,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_decode_size","resource_transfer_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","error_handling_stack","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n source: 'source',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states',\n session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n drift: '_gc.drift'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n sampled_for_replay: 'session.sampled_for_replay',\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes'],\n error_handling_stack: ['string', 'error.handling_stack']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjC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AE,yBAAyB;MACnDC,sBAAsB,EAAE,wBAAwB;MAChDC,aAAa,EAAE,mBAAmB;MAClCC,eAAe,EAAE;IACnB;EACF,CAAC;EACDC,SAAS,EAAE;IACT9F,IAAI,EAAE,WAAW;IACjBM,MAAM,EAAE;MACNyF,MAAM,EAAE,kBAAkB;MAC1BC,OAAO,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;MACxChG,IAAI,EAAE,gBAAgB;MACtB8E,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDmB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB;IAC/C;EACF,CAAC;EACDC,WAAW,EAAE;IACXlG,IAAI,EAAE9C,YAAY,CAACiJ,MAAM;IACzBjG,IAAI,EAAE;MACJwE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxByB,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpCtH,SAAS,EAAE,gBAAgB;MAC3B5B,OAAO,EAAE,SAAS;MAClBuI,MAAM,EAAE;IACV,CAAC;IACDzF,MAAM,EAAE;MACN0F,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { computeBytesCount } from '../byteUtils';
|
|
2
1
|
import { DOM_EVENT } from '../enums';
|
|
3
|
-
import { map } from '../tools';
|
|
2
|
+
import { map, extend2Lev, isString } from '../tools';
|
|
4
3
|
import { addEventListener } from '../../browser/addEventListener';
|
|
5
|
-
import { createContextManager } from './contextManager';
|
|
6
4
|
var CONTEXT_STORE_KEY_PREFIX = '_gc_s';
|
|
7
5
|
var storageListeners = [];
|
|
8
|
-
export function
|
|
9
|
-
|
|
10
|
-
computeBytesCountImpl = computeBytesCount;
|
|
11
|
-
}
|
|
12
|
-
var storageKey = buildStorageKey(productKey, customerDataType);
|
|
13
|
-
var contextManager = createContextManager(customerDataType, computeBytesCountImpl);
|
|
14
|
-
synchronizeWithStorage();
|
|
6
|
+
export function storeContextManager(configuration, contextManager, productKey, customerDataType) {
|
|
7
|
+
var storageKey = buildStorageKey(configuration, productKey, customerDataType);
|
|
15
8
|
storageListeners.push(addEventListener(window, DOM_EVENT.STORAGE, function (params) {
|
|
16
9
|
if (storageKey === params.key) {
|
|
17
10
|
synchronizeWithStorage();
|
|
18
11
|
}
|
|
19
12
|
}));
|
|
20
13
|
contextManager.changeObservable.subscribe(dumpToStorage);
|
|
14
|
+
contextManager.setContext(extend2Lev(getFromStorage(), contextManager.getContext()));
|
|
21
15
|
function synchronizeWithStorage() {
|
|
22
|
-
|
|
23
|
-
var context = rawContext !== null ? JSON.parse(rawContext) : {};
|
|
24
|
-
contextManager.setContext(context);
|
|
16
|
+
contextManager.setContext(getFromStorage());
|
|
25
17
|
}
|
|
26
18
|
function dumpToStorage() {
|
|
27
19
|
localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));
|
|
28
20
|
}
|
|
21
|
+
function getFromStorage() {
|
|
22
|
+
var rawContext = localStorage.getItem(storageKey);
|
|
23
|
+
return rawContext !== null ? JSON.parse(rawContext) : {};
|
|
24
|
+
}
|
|
29
25
|
return contextManager;
|
|
30
26
|
}
|
|
31
|
-
export function buildStorageKey(productKey, customerDataType) {
|
|
32
|
-
|
|
27
|
+
export function buildStorageKey(configuration, productKey, customerDataType) {
|
|
28
|
+
// storeContextsKey
|
|
29
|
+
if (configuration.storeContextsKey && isString(configuration.storeContextsKey)) {
|
|
30
|
+
return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType + '_' + configuration.storeContextsKey;
|
|
31
|
+
} else {
|
|
32
|
+
return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType;
|
|
33
|
+
}
|
|
33
34
|
}
|
|
34
35
|
export function removeStorageListeners() {
|
|
35
36
|
map(storageListeners, function (listener) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storedContextManager.js","names":["
|
|
1
|
+
{"version":3,"file":"storedContextManager.js","names":["DOM_EVENT","map","extend2Lev","isString","addEventListener","CONTEXT_STORE_KEY_PREFIX","storageListeners","storeContextManager","configuration","contextManager","productKey","customerDataType","storageKey","buildStorageKey","push","window","STORAGE","params","key","synchronizeWithStorage","changeObservable","subscribe","dumpToStorage","setContext","getFromStorage","getContext","localStorage","setItem","JSON","stringify","rawContext","getItem","parse","storeContextsKey","removeStorageListeners","listener","stop"],"sources":["../../../src/helper/serialisation/storedContextManager.js"],"sourcesContent":["import { DOM_EVENT } from '../enums'\nimport { map, extend2Lev, isString } from '../tools'\nimport { addEventListener } from '../../browser/addEventListener'\nvar CONTEXT_STORE_KEY_PREFIX = '_gc_s'\n\nvar storageListeners = []\n\nexport function storeContextManager(\n configuration,\n contextManager,\n productKey,\n customerDataType\n) {\n var storageKey = buildStorageKey(configuration, productKey, customerDataType)\n\n storageListeners.push(\n addEventListener(window, DOM_EVENT.STORAGE, function (params) {\n if (storageKey === params.key) {\n synchronizeWithStorage()\n }\n })\n )\n contextManager.changeObservable.subscribe(dumpToStorage)\n contextManager.setContext(\n extend2Lev(getFromStorage(), contextManager.getContext())\n )\n function synchronizeWithStorage() {\n contextManager.setContext(getFromStorage())\n }\n function dumpToStorage() {\n localStorage.setItem(\n storageKey,\n JSON.stringify(contextManager.getContext())\n )\n }\n function getFromStorage() {\n const rawContext = localStorage.getItem(storageKey)\n return rawContext !== null ? JSON.parse(rawContext) : {}\n }\n return contextManager\n}\n\nexport function buildStorageKey(configuration, productKey, customerDataType) {\n // storeContextsKey\n if (\n configuration.storeContextsKey &&\n isString(configuration.storeContextsKey)\n ) {\n return (\n CONTEXT_STORE_KEY_PREFIX +\n '_' +\n productKey +\n '_' +\n customerDataType +\n '_' +\n configuration.storeContextsKey\n )\n } else {\n return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType\n }\n}\n\nexport function removeStorageListeners() {\n map(storageListeners, function (listener) {\n listener.stop()\n })\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,UAAU;AACpC,SAASC,GAAG,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,UAAU;AACpD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,IAAIC,wBAAwB,GAAG,OAAO;AAEtC,IAAIC,gBAAgB,GAAG,EAAE;AAEzB,OAAO,SAASC,mBAAmBA,CACjCC,aAAa,EACbC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAChB;EACA,IAAIC,UAAU,GAAGC,eAAe,CAACL,aAAa,EAAEE,UAAU,EAAEC,gBAAgB,CAAC;EAE7EL,gBAAgB,CAACQ,IAAI,CACnBV,gBAAgB,CAACW,MAAM,EAAEf,SAAS,CAACgB,OAAO,EAAE,UAAUC,MAAM,EAAE;IAC5D,IAAIL,UAAU,KAAKK,MAAM,CAACC,GAAG,EAAE;MAC7BC,sBAAsB,CAAC,CAAC;IAC1B;EACF,CAAC,CACH,CAAC;EACDV,cAAc,CAACW,gBAAgB,CAACC,SAAS,CAACC,aAAa,CAAC;EACxDb,cAAc,CAACc,UAAU,CACvBrB,UAAU,CAACsB,cAAc,CAAC,CAAC,EAAEf,cAAc,CAACgB,UAAU,CAAC,CAAC,CAC1D,CAAC;EACD,SAASN,sBAAsBA,CAAA,EAAG;IAChCV,cAAc,CAACc,UAAU,CAACC,cAAc,CAAC,CAAC,CAAC;EAC7C;EACA,SAASF,aAAaA,CAAA,EAAG;IACvBI,YAAY,CAACC,OAAO,CAClBf,UAAU,EACVgB,IAAI,CAACC,SAAS,CAACpB,cAAc,CAACgB,UAAU,CAAC,CAAC,CAC5C,CAAC;EACH;EACA,SAASD,cAAcA,CAAA,EAAG;IACxB,IAAMM,UAAU,GAAGJ,YAAY,CAACK,OAAO,CAACnB,UAAU,CAAC;IACnD,OAAOkB,UAAU,KAAK,IAAI,GAAGF,IAAI,CAACI,KAAK,CAACF,UAAU,CAAC,GAAG,CAAC,CAAC;EAC1D;EACA,OAAOrB,cAAc;AACvB;AAEA,OAAO,SAASI,eAAeA,CAACL,aAAa,EAAEE,UAAU,EAAEC,gBAAgB,EAAE;EAC3E;EACA,IACEH,aAAa,CAACyB,gBAAgB,IAC9B9B,QAAQ,CAACK,aAAa,CAACyB,gBAAgB,CAAC,EACxC;IACA,OACE5B,wBAAwB,GACxB,GAAG,GACHK,UAAU,GACV,GAAG,GACHC,gBAAgB,GAChB,GAAG,GACHH,aAAa,CAACyB,gBAAgB;EAElC,CAAC,MAAM;IACL,OAAO5B,wBAAwB,GAAG,GAAG,GAAGK,UAAU,GAAG,GAAG,GAAGC,gBAAgB;EAC7E;AACF;AAEA,OAAO,SAASuB,sBAAsBA,CAAA,EAAG;EACvCjC,GAAG,CAACK,gBAAgB,EAAE,UAAU6B,QAAQ,EAAE;IACxCA,QAAQ,CAACC,IAAI,CAAC,CAAC;EACjB,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcare/browser-core",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.18",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"author": "dataflux",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"description": "DataFlux RUM Web 端数据指标监控",
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "c76dd29040565e45cc453000d03b5cdf06818fd0"
|
|
26
26
|
}
|
|
@@ -84,6 +84,8 @@ export function validateAndBuildConfiguration(initConfiguration) {
|
|
|
84
84
|
messageBytesLimit: 256 * ONE_KIBI_BYTE,
|
|
85
85
|
resourceUrlLimit: 5 * ONE_KIBI_BYTE,
|
|
86
86
|
storeContextsToLocal: !!initConfiguration.storeContextsToLocal,
|
|
87
|
+
// 存储到localstorage key ,默认不填,自动生成
|
|
88
|
+
storeContextsKey: initConfiguration.storeContextsKey,
|
|
87
89
|
sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson
|
|
88
90
|
},
|
|
89
91
|
computeTransportConfiguration(initConfiguration)
|
package/src/dataMap.js
CHANGED
|
@@ -148,7 +148,8 @@ export var dataMap = {
|
|
|
148
148
|
fields: {
|
|
149
149
|
error_message: ['string', 'error.message'],
|
|
150
150
|
error_stack: ['string', 'error.stack'],
|
|
151
|
-
error_causes: ['string', 'error.causes']
|
|
151
|
+
error_causes: ['string', 'error.causes'],
|
|
152
|
+
error_handling_stack: ['string', 'error.handling_stack']
|
|
152
153
|
}
|
|
153
154
|
},
|
|
154
155
|
long_task: {
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { computeBytesCount } from '../byteUtils'
|
|
2
1
|
import { DOM_EVENT } from '../enums'
|
|
3
|
-
import { map } from '../tools'
|
|
2
|
+
import { map, extend2Lev, isString } from '../tools'
|
|
4
3
|
import { addEventListener } from '../../browser/addEventListener'
|
|
5
|
-
import { createContextManager } from './contextManager'
|
|
6
4
|
var CONTEXT_STORE_KEY_PREFIX = '_gc_s'
|
|
7
5
|
|
|
8
6
|
var storageListeners = []
|
|
9
7
|
|
|
10
|
-
export function
|
|
8
|
+
export function storeContextManager(
|
|
9
|
+
configuration,
|
|
10
|
+
contextManager,
|
|
11
11
|
productKey,
|
|
12
|
-
customerDataType
|
|
13
|
-
computeBytesCountImpl
|
|
12
|
+
customerDataType
|
|
14
13
|
) {
|
|
15
|
-
|
|
16
|
-
computeBytesCountImpl = computeBytesCount
|
|
17
|
-
}
|
|
18
|
-
var storageKey = buildStorageKey(productKey, customerDataType)
|
|
19
|
-
var contextManager = createContextManager(
|
|
20
|
-
customerDataType,
|
|
21
|
-
computeBytesCountImpl
|
|
22
|
-
)
|
|
14
|
+
var storageKey = buildStorageKey(configuration, productKey, customerDataType)
|
|
23
15
|
|
|
24
|
-
synchronizeWithStorage()
|
|
25
16
|
storageListeners.push(
|
|
26
17
|
addEventListener(window, DOM_EVENT.STORAGE, function (params) {
|
|
27
18
|
if (storageKey === params.key) {
|
|
@@ -30,23 +21,43 @@ export function createStoredContextManager(
|
|
|
30
21
|
})
|
|
31
22
|
)
|
|
32
23
|
contextManager.changeObservable.subscribe(dumpToStorage)
|
|
24
|
+
contextManager.setContext(
|
|
25
|
+
extend2Lev(getFromStorage(), contextManager.getContext())
|
|
26
|
+
)
|
|
33
27
|
function synchronizeWithStorage() {
|
|
34
|
-
|
|
35
|
-
var context = rawContext !== null ? JSON.parse(rawContext) : {}
|
|
36
|
-
contextManager.setContext(context)
|
|
28
|
+
contextManager.setContext(getFromStorage())
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
function dumpToStorage() {
|
|
40
31
|
localStorage.setItem(
|
|
41
32
|
storageKey,
|
|
42
33
|
JSON.stringify(contextManager.getContext())
|
|
43
34
|
)
|
|
44
35
|
}
|
|
36
|
+
function getFromStorage() {
|
|
37
|
+
const rawContext = localStorage.getItem(storageKey)
|
|
38
|
+
return rawContext !== null ? JSON.parse(rawContext) : {}
|
|
39
|
+
}
|
|
45
40
|
return contextManager
|
|
46
41
|
}
|
|
47
42
|
|
|
48
|
-
export function buildStorageKey(productKey, customerDataType) {
|
|
49
|
-
|
|
43
|
+
export function buildStorageKey(configuration, productKey, customerDataType) {
|
|
44
|
+
// storeContextsKey
|
|
45
|
+
if (
|
|
46
|
+
configuration.storeContextsKey &&
|
|
47
|
+
isString(configuration.storeContextsKey)
|
|
48
|
+
) {
|
|
49
|
+
return (
|
|
50
|
+
CONTEXT_STORE_KEY_PREFIX +
|
|
51
|
+
'_' +
|
|
52
|
+
productKey +
|
|
53
|
+
'_' +
|
|
54
|
+
customerDataType +
|
|
55
|
+
'_' +
|
|
56
|
+
configuration.storeContextsKey
|
|
57
|
+
)
|
|
58
|
+
} else {
|
|
59
|
+
return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType
|
|
60
|
+
}
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
export function removeStorageListeners() {
|
package/types/index.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ export interface InitConfiguration {
|
|
|
79
79
|
* 是否把公共数据存储到localstorage,默认不存储
|
|
80
80
|
*/
|
|
81
81
|
storeContextsToLocal?: boolean | undefined
|
|
82
|
+
/**
|
|
83
|
+
* 定义存储到 localstorage 的 key ,默认不填,自动生成, 该参数主要是为了区分在同一个域名下,不同子路径共用store 的问题
|
|
84
|
+
*/
|
|
85
|
+
storeContextsKey?: string | undefined
|
|
82
86
|
/**
|
|
83
87
|
* 数据以 application/json 的发送方式,默认text
|
|
84
88
|
*/
|