Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-rum-web

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-rum-web - npm Package Compare versions

Comparing version 1.15.0 to 1.16.0

dist/cjs/events/time-to-interactive-event.d.ts

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Changelog

## [1.16.0](https://github.com/aws-observability/aws-rum-web/compare/v1.15.0...v1.16.0) (2023-11-16)
### Features
* Allow override of domain metadata attribute ([#453](https://github.com/aws-observability/aws-rum-web/issues/453)) ([b658d45](https://github.com/aws-observability/aws-rum-web/commit/b658d45257c1632f183baace0f5a1e19ca78ede3))
* extend addXRayTraceIdHeader to accept allow list ([#466](https://github.com/aws-observability/aws-rum-web/issues/466)) ([fdc30fd](https://github.com/aws-observability/aws-rum-web/commit/fdc30fd99dd3fc133695fcbf40867bfd8175d0b2))
* Time to interactive ([#465](https://github.com/aws-observability/aws-rum-web/issues/465)) ([8cf2753](https://github.com/aws-observability/aws-rum-web/commit/8cf2753f5a8ad6bf0dfc5b7224bcaac2eee78ef8))
## [1.15.0](https://github.com/aws-observability/aws-rum-web/compare/v1.14.0...v1.15.0) (2023-10-02)

@@ -7,0 +17,0 @@

2

dist/cjs/event-cache/EventCache.js

@@ -19,3 +19,3 @@ "use strict";

var EventBus_1 = require("../event-bus/EventBus");
var webClientVersion = '1.15.0';
var webClientVersion = '1.16.0';
/**

@@ -22,0 +22,0 @@ * A cache which stores events generated by telemetry plugins.

@@ -6,2 +6,3 @@ export { PartialConfig as AwsRumConfig, Orchestration as AwsRum, PartialCookieAttributes, PageIdFormat, PageIdFormatEnum, Telemetry, TelemetryEnum } from './orchestration/Orchestration';

export { PluginContext } from './plugins/types';
export { TTIPlugin } from './plugins/event-plugins/TTIPlugin';
export * from './plugins/event-plugins/DomEventPlugin';

@@ -8,0 +9,0 @@ export * from './plugins/event-plugins/JsErrorPlugin';

@@ -17,3 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TelemetryEnum = exports.PageIdFormatEnum = exports.AwsRum = void 0;
exports.TTIPlugin = exports.TelemetryEnum = exports.PageIdFormatEnum = exports.AwsRum = void 0;
var Orchestration_1 = require("./orchestration/Orchestration");

@@ -23,2 +23,4 @@ Object.defineProperty(exports, "AwsRum", { enumerable: true, get: function () { return Orchestration_1.Orchestration; } });

Object.defineProperty(exports, "TelemetryEnum", { enumerable: true, get: function () { return Orchestration_1.TelemetryEnum; } });
var TTIPlugin_1 = require("./plugins/event-plugins/TTIPlugin");
Object.defineProperty(exports, "TTIPlugin", { enumerable: true, get: function () { return TTIPlugin_1.TTIPlugin; } });
__exportStar(require("./plugins/event-plugins/DomEventPlugin"), exports);

@@ -25,0 +27,0 @@ __exportStar(require("./plugins/event-plugins/JsErrorPlugin"), exports);

@@ -22,2 +22,3 @@ import { MonkeyPatched } from '../MonkeyPatched';

private beginTrace;
private isTraceIdHeaderEnabled;
private addXRayTraceIdHeader;

@@ -24,0 +25,0 @@ private endTrace;

@@ -58,3 +58,3 @@ "use strict";

xRayTraceEvent.subsegments.push(subsegment);
if (_this.config.addXRayTraceIdHeader) {
if (_this.isTraceIdHeaderEnabled(input)) {
_this.addXRayTraceIdHeader(input, init, argsArray, xRayTraceEvent);

@@ -205,2 +205,6 @@ }

};
FetchPlugin.prototype.isTraceIdHeaderEnabled = function (input) {
var url = (0, http_utils_1.resourceToUrlString)(input);
return (0, http_utils_1.isTraceIdHeaderEnabled)(url, this.config.addXRayTraceIdHeader);
};
FetchPlugin.prototype.appendErrorCauseFromPrimitive = function (subsegment, error) {

@@ -207,0 +211,0 @@ subsegment.cause = {

@@ -92,4 +92,4 @@ "use strict";

var _this = _super.call(this, exports.XHR_PLUGIN_ID) || this;
_this.addXRayTraceIdHeader = function () {
return _this.config.addXRayTraceIdHeader;
_this.addXRayTraceIdHeader = function (url) {
return (0, http_utils_1.isTraceIdHeaderEnabled)(url, _this.config.addXRayTraceIdHeader);
};

@@ -107,5 +107,5 @@ _this.isTracingEnabled = function () {

if (xhrDetails) {
var endTimee = (0, http_utils_1.epochTime)();
xhrDetails.trace.end_time = endTimee;
xhrDetails.trace.subsegments[0].end_time = endTimee;
var endTime = (0, http_utils_1.epochTime)();
xhrDetails.trace.end_time = endTime;
xhrDetails.trace.subsegments[0].end_time = endTime;
xhrDetails.trace.subsegments[0].http.response = {

@@ -202,3 +202,3 @@ status: xhr.status

self.isTracingEnabled() &&
self.addXRayTraceIdHeader() &&
self.addXRayTraceIdHeader(xhrDetails.url) &&
self.isSessionRecorded()) {

@@ -205,0 +205,0 @@ this.setRequestHeader(http_utils_1.X_AMZN_TRACE_ID, (0, http_utils_1.getAmznTraceIdHeaderValue)(xhrDetails.trace.trace_id, xhrDetails.trace.subsegments[0].id));

@@ -15,1 +15,2 @@ export declare const UNKNOWN = "unknown";

export declare const SESSION_START_EVENT_TYPE: string;
export declare const TIME_TO_INTERACTIVE_EVENT_TYPE: string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SESSION_START_EVENT_TYPE = exports.PAGE_VIEW_EVENT_TYPE = exports.JS_ERROR_EVENT_TYPE = exports.DOM_EVENT_TYPE = exports.PERFORMANCE_RESOURCE_EVENT_TYPE = exports.PERFORMANCE_NAVIGATION_EVENT_TYPE = exports.CLS_EVENT_TYPE = exports.FID_EVENT_TYPE = exports.LCP_EVENT_TYPE = exports.XRAY_TRACE_EVENT_TYPE = exports.HTTP_EVENT_TYPE = exports.RUM_AWS_PREFIX = exports.RUM_AMZ_PREFIX = exports.UNKNOWN = void 0;
exports.TIME_TO_INTERACTIVE_EVENT_TYPE = exports.SESSION_START_EVENT_TYPE = exports.PAGE_VIEW_EVENT_TYPE = exports.JS_ERROR_EVENT_TYPE = exports.DOM_EVENT_TYPE = exports.PERFORMANCE_RESOURCE_EVENT_TYPE = exports.PERFORMANCE_NAVIGATION_EVENT_TYPE = exports.CLS_EVENT_TYPE = exports.FID_EVENT_TYPE = exports.LCP_EVENT_TYPE = exports.XRAY_TRACE_EVENT_TYPE = exports.HTTP_EVENT_TYPE = exports.RUM_AWS_PREFIX = exports.RUM_AMZ_PREFIX = exports.UNKNOWN = void 0;
exports.UNKNOWN = 'unknown';

@@ -25,1 +25,3 @@ exports.RUM_AMZ_PREFIX = 'com.amazon.rum';

exports.SESSION_START_EVENT_TYPE = "".concat(exports.RUM_AMZ_PREFIX, ".session_start_event");
// Time to interactive event
exports.TIME_TO_INTERACTIVE_EVENT_TYPE = "".concat(exports.RUM_AMZ_PREFIX, ".time_to_interactive_event");

@@ -10,3 +10,3 @@ import { Http, Subsegment, XRayTraceEvent } from '../../events/xray-trace-event';

recordAllRequests?: boolean;
addXRayTraceIdHeader?: boolean;
addXRayTraceIdHeader?: boolean | RegExp[];
};

@@ -19,4 +19,5 @@ export declare type HttpPluginConfig = {

recordAllRequests: boolean;
addXRayTraceIdHeader: boolean;
addXRayTraceIdHeader: boolean | RegExp[];
};
export declare const isTraceIdHeaderEnabled: (url: string, addXrayTraceIdHeader: boolean | RegExp[]) => boolean;
export declare type TraceHeader = {

@@ -23,0 +24,0 @@ traceId?: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resourceToUrlString = exports.getTraceHeader = exports.getAmznTraceIdHeaderValue = exports.addAmznTraceIdHeaderToHeaders = exports.addAmznTraceIdHeaderToInit = exports.requestInfoToHostname = exports.createXRaySubsegment = exports.createXRayTraceEvent = exports.createXRayTraceEventHttp = exports.epochTime = exports.isUrlAllowed = exports.is429 = exports.is5xx = exports.is4xx = exports.defaultConfig = exports.X_AMZN_TRACE_ID = exports.byteToHex = void 0;
exports.resourceToUrlString = exports.getTraceHeader = exports.getAmznTraceIdHeaderValue = exports.addAmznTraceIdHeaderToHeaders = exports.addAmznTraceIdHeaderToInit = exports.requestInfoToHostname = exports.createXRaySubsegment = exports.createXRayTraceEvent = exports.createXRayTraceEventHttp = exports.epochTime = exports.isUrlAllowed = exports.is429 = exports.is5xx = exports.is4xx = exports.defaultConfig = exports.isTraceIdHeaderEnabled = exports.X_AMZN_TRACE_ID = exports.byteToHex = void 0;
var random_1 = require("../../utils/random");

@@ -11,2 +11,9 @@ // All one-byte hex strings from 0x00 to 0xff.

exports.X_AMZN_TRACE_ID = 'X-Amzn-Trace-Id';
var isTraceIdHeaderEnabled = function (url, addXrayTraceIdHeader) {
if (Array.isArray(addXrayTraceIdHeader)) {
return addXrayTraceIdHeader.some(function (matcher) { return matcher.test(url); });
}
return addXrayTraceIdHeader;
};
exports.isTraceIdHeaderEnabled = isTraceIdHeaderEnabled;
exports.defaultConfig = {

@@ -13,0 +20,0 @@ logicalServiceName: 'rum.aws.amazon.com',

@@ -81,2 +81,4 @@ "use strict";

this.attributes = __assign(__assign({}, sessionAttributes), this.attributes);
this.attributes.domain =
sessionAttributes.domain || this.attributes.domain;
};

@@ -83,0 +85,0 @@ SessionManager.prototype.getUserId = function () {

@@ -114,1 +114,3 @@ export declare enum ResourceType {

export declare const isLCPSupported: () => boolean;
export declare const isFCPSupported: () => boolean;
export declare const isLongTaskSupported: () => boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isLCPSupported = exports.httpStatusText = exports.getResourceFileType = exports.shuffle = exports.performanceKey = exports.InitiatorType = exports.ResourceType = void 0;
exports.isLongTaskSupported = exports.isFCPSupported = exports.isLCPSupported = exports.httpStatusText = exports.getResourceFileType = exports.shuffle = exports.performanceKey = exports.InitiatorType = exports.ResourceType = void 0;
var ResourceType;

@@ -191,1 +191,9 @@ (function (ResourceType) {

exports.isLCPSupported = isLCPSupported;
var isFCPSupported = function () {
return PerformanceObserver.supportedEntryTypes.includes('paint');
};
exports.isFCPSupported = isFCPSupported;
var isLongTaskSupported = function () {
return PerformanceObserver.supportedEntryTypes.includes('longtask');
};
exports.isLongTaskSupported = isLongTaskSupported;

@@ -16,3 +16,3 @@ var __assign = (this && this.__assign) || function () {

import EventBus, { Topic } from '../event-bus/EventBus';
var webClientVersion = '1.15.0';
var webClientVersion = '1.16.0';
/**

@@ -19,0 +19,0 @@ * A cache which stores events generated by telemetry plugins.

@@ -6,2 +6,3 @@ export { PartialConfig as AwsRumConfig, Orchestration as AwsRum, PartialCookieAttributes, PageIdFormat, PageIdFormatEnum, Telemetry, TelemetryEnum } from './orchestration/Orchestration';

export { PluginContext } from './plugins/types';
export { TTIPlugin } from './plugins/event-plugins/TTIPlugin';
export * from './plugins/event-plugins/DomEventPlugin';

@@ -8,0 +9,0 @@ export * from './plugins/event-plugins/JsErrorPlugin';

export { Orchestration as AwsRum, PageIdFormatEnum, TelemetryEnum } from './orchestration/Orchestration';
export { TTIPlugin } from './plugins/event-plugins/TTIPlugin';
export * from './plugins/event-plugins/DomEventPlugin';

@@ -3,0 +4,0 @@ export * from './plugins/event-plugins/JsErrorPlugin';

@@ -22,2 +22,3 @@ import { MonkeyPatched } from '../MonkeyPatched';

private beginTrace;
private isTraceIdHeaderEnabled;
private addXRayTraceIdHeader;

@@ -24,0 +25,0 @@ private endTrace;

@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () {

import { MonkeyPatched } from '../MonkeyPatched';
import { defaultConfig, epochTime, createXRayTraceEvent, addAmznTraceIdHeaderToInit, createXRayTraceEventHttp, isUrlAllowed, createXRaySubsegment, requestInfoToHostname, addAmznTraceIdHeaderToHeaders, resourceToUrlString, is429, is4xx, is5xx, getTraceHeader } from '../utils/http-utils';
import { defaultConfig, epochTime, createXRayTraceEvent, addAmznTraceIdHeaderToInit, createXRayTraceEventHttp, isUrlAllowed, createXRaySubsegment, requestInfoToHostname, addAmznTraceIdHeaderToHeaders, resourceToUrlString, is429, is4xx, is5xx, getTraceHeader, isTraceIdHeaderEnabled } from '../utils/http-utils';
import { HTTP_EVENT_TYPE, XRAY_TRACE_EVENT_TYPE } from '../utils/constant';

@@ -56,3 +56,3 @@ import { errorEventToJsErrorEvent, isErrorPrimitive } from '../utils/js-error-utils';

xRayTraceEvent.subsegments.push(subsegment);
if (_this.config.addXRayTraceIdHeader) {
if (_this.isTraceIdHeaderEnabled(input)) {
_this.addXRayTraceIdHeader(input, init, argsArray, xRayTraceEvent);

@@ -203,2 +203,6 @@ }

};
FetchPlugin.prototype.isTraceIdHeaderEnabled = function (input) {
var url = resourceToUrlString(input);
return isTraceIdHeaderEnabled(url, this.config.addXRayTraceIdHeader);
};
FetchPlugin.prototype.appendErrorCauseFromPrimitive = function (subsegment, error) {

@@ -205,0 +209,0 @@ subsegment.cause = {

@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () {

import { MonkeyPatched } from '../MonkeyPatched';
import { defaultConfig, epochTime, createXRayTraceEvent, getAmznTraceIdHeaderValue, X_AMZN_TRACE_ID, isUrlAllowed, createXRaySubsegment, requestInfoToHostname, is429, is4xx, is5xx } from '../utils/http-utils';
import { defaultConfig, epochTime, createXRayTraceEvent, getAmznTraceIdHeaderValue, X_AMZN_TRACE_ID, isUrlAllowed, createXRaySubsegment, requestInfoToHostname, is429, is4xx, is5xx, isTraceIdHeaderEnabled } from '../utils/http-utils';
import { XhrError } from '../../errors/XhrError';

@@ -90,4 +90,4 @@ import { HTTP_EVENT_TYPE, XRAY_TRACE_EVENT_TYPE } from '../utils/constant';

var _this = _super.call(this, XHR_PLUGIN_ID) || this;
_this.addXRayTraceIdHeader = function () {
return _this.config.addXRayTraceIdHeader;
_this.addXRayTraceIdHeader = function (url) {
return isTraceIdHeaderEnabled(url, _this.config.addXRayTraceIdHeader);
};

@@ -105,5 +105,5 @@ _this.isTracingEnabled = function () {

if (xhrDetails) {
var endTimee = epochTime();
xhrDetails.trace.end_time = endTimee;
xhrDetails.trace.subsegments[0].end_time = endTimee;
var endTime = epochTime();
xhrDetails.trace.end_time = endTime;
xhrDetails.trace.subsegments[0].end_time = endTime;
xhrDetails.trace.subsegments[0].http.response = {

@@ -200,3 +200,3 @@ status: xhr.status

self.isTracingEnabled() &&
self.addXRayTraceIdHeader() &&
self.addXRayTraceIdHeader(xhrDetails.url) &&
self.isSessionRecorded()) {

@@ -203,0 +203,0 @@ this.setRequestHeader(X_AMZN_TRACE_ID, getAmznTraceIdHeaderValue(xhrDetails.trace.trace_id, xhrDetails.trace.subsegments[0].id));

@@ -15,1 +15,2 @@ export declare const UNKNOWN = "unknown";

export declare const SESSION_START_EVENT_TYPE: string;
export declare const TIME_TO_INTERACTIVE_EVENT_TYPE: string;

@@ -22,1 +22,3 @@ export var UNKNOWN = 'unknown';

export var SESSION_START_EVENT_TYPE = "".concat(RUM_AMZ_PREFIX, ".session_start_event");
// Time to interactive event
export var TIME_TO_INTERACTIVE_EVENT_TYPE = "".concat(RUM_AMZ_PREFIX, ".time_to_interactive_event");

@@ -10,3 +10,3 @@ import { Http, Subsegment, XRayTraceEvent } from '../../events/xray-trace-event';

recordAllRequests?: boolean;
addXRayTraceIdHeader?: boolean;
addXRayTraceIdHeader?: boolean | RegExp[];
};

@@ -19,4 +19,5 @@ export declare type HttpPluginConfig = {

recordAllRequests: boolean;
addXRayTraceIdHeader: boolean;
addXRayTraceIdHeader: boolean | RegExp[];
};
export declare const isTraceIdHeaderEnabled: (url: string, addXrayTraceIdHeader: boolean | RegExp[]) => boolean;
export declare type TraceHeader = {

@@ -23,0 +24,0 @@ traceId?: string;

@@ -8,2 +8,8 @@ import { getRandomValues } from '../../utils/random';

export var X_AMZN_TRACE_ID = 'X-Amzn-Trace-Id';
export var isTraceIdHeaderEnabled = function (url, addXrayTraceIdHeader) {
if (Array.isArray(addXrayTraceIdHeader)) {
return addXrayTraceIdHeader.some(function (matcher) { return matcher.test(url); });
}
return addXrayTraceIdHeader;
};
export var defaultConfig = {

@@ -10,0 +16,0 @@ logicalServiceName: 'rum.aws.amazon.com',

@@ -78,2 +78,4 @@ var __assign = (this && this.__assign) || function () {

this.attributes = __assign(__assign({}, sessionAttributes), this.attributes);
this.attributes.domain =
sessionAttributes.domain || this.attributes.domain;
};

@@ -80,0 +82,0 @@ SessionManager.prototype.getUserId = function () {

@@ -114,1 +114,3 @@ export declare enum ResourceType {

export declare const isLCPSupported: () => boolean;
export declare const isFCPSupported: () => boolean;
export declare const isLongTaskSupported: () => boolean;

@@ -184,1 +184,7 @@ export var ResourceType;

};
export var isFCPSupported = function () {
return PerformanceObserver.supportedEntryTypes.includes('paint');
};
export var isLongTaskSupported = function () {
return PerformanceObserver.supportedEntryTypes.includes('longtask');
};

@@ -22,2 +22,3 @@ import { MonkeyPatched } from '../MonkeyPatched';

private beginTrace;
private isTraceIdHeaderEnabled;
private addXRayTraceIdHeader;

@@ -24,0 +25,0 @@ private endTrace;

@@ -15,1 +15,2 @@ export declare const UNKNOWN = "unknown";

export declare const SESSION_START_EVENT_TYPE: string;
export declare const TIME_TO_INTERACTIVE_EVENT_TYPE: string;

@@ -10,3 +10,3 @@ import { Http, Subsegment, XRayTraceEvent } from '../../events/xray-trace-event';

recordAllRequests?: boolean;
addXRayTraceIdHeader?: boolean;
addXRayTraceIdHeader?: boolean | RegExp[];
};

@@ -19,4 +19,5 @@ export declare type HttpPluginConfig = {

recordAllRequests: boolean;
addXRayTraceIdHeader: boolean;
addXRayTraceIdHeader: boolean | RegExp[];
};
export declare const isTraceIdHeaderEnabled: (url: string, addXrayTraceIdHeader: boolean | RegExp[]) => boolean;
export declare type TraceHeader = {

@@ -23,0 +24,0 @@ traceId?: string;

@@ -114,1 +114,3 @@ export declare enum ResourceType {

export declare const isLCPSupported: () => boolean;
export declare const isFCPSupported: () => boolean;
export declare const isLongTaskSupported: () => boolean;
{
"name": "aws-rum-web",
"version": "1.15.0",
"version": "1.16.0",
"sideEffects": false,

@@ -5,0 +5,0 @@ "description": "The Amazon CloudWatch RUM web client.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc