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

@objectiv/transport-xhr

Package Overview
Dependencies
Maintainers
2
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@objectiv/transport-xhr - npm Package Compare versions

Comparing version 0.0.25-next.0 to 0.0.25

2

dist/esm/index.js

@@ -1,2 +0,2 @@

var s={name:"@objectiv/transport-xhr",version:"0.0.25-next.0",description:"A TrackerTransport based on XMLHttpRequest API",license:"Apache-2.0",homepage:"https://objectiv.io",keywords:["objectiv","tracking","analytics","events","taxonomy","transport","xmlhttprequest","xhr"],repository:{type:"git",url:"https://github.com/objectiv/objectiv-analytics.git",directory:"tracker/transports/xhr"},bugs:"https://github.com/objectiv/objectiv-analytics/issues",contributors:[{name:"Surai Di Rosa",email:"surai.dirosa@gmail.com",url:"https://github.com/sdirosa"}],main:"./dist/index.js",module:"./dist/esm/index.js",types:"./dist/index.d.ts",files:["dist"],exports:{".":{require:"./dist/index.js",import:"./dist/esm/index.js",types:"./dist/index.d.ts"}},scripts:{build:"tsup src/index.ts --format cjs,esm --legacy-output --minify --dts --sourcemap --clean","deploy:verdaccio":"npm publish",prettify:"prettier --write .",tsc:"tsc --noEmit",test:"jest --silent","test:ci":"jest --silent --ci","test:coverage":"jest --silent --coverage",depcheck:"npx depcheck"},devDependencies:{"@objectiv/developer-tools":"^0.0.25-next.0","@objectiv/testing-tools":"^0.0.25-next.0",jest:"^28.1.3",prettier:"^2.7.1","ts-jest":"^28.0.7",tsup:"^6.2.1",typescript:"^4.7.4","xhr-mock":"^2.5.1"},dependencies:{"@objectiv/tracker-core":"~0.0.25-next.0"}};import{makeTransportSendError as n}from"@objectiv/tracker-core";var l=({endpoint:r,events:e})=>new Promise(function(t,i){globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Sending"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd());let o=new XMLHttpRequest,c=!0;o.open("POST",r,c),o.setRequestHeader("Content-Type","text/plain"),o.withCredentials=!0,o.onload=()=>{o.status===200?(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Succeeded"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),t(o.response)):(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Failed","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.log(`Response: ${o}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),i(n()))},o.onerror=()=>{globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Error","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),i(n())},o.send(JSON.stringify({events:e,client_session_id:globalThis.objectiv.clientSessionId,transport_time:Date.now()}))});import{isNonEmptyArray as d}from"@objectiv/tracker-core";var a=class{constructor(e){this.transportName="XHRTransport";this.endpoint=e.endpoint,this.xmlHttpRequestFunction=e.xmlHttpRequestFunction??l}async handle(...e){let t=await Promise.all(e);if(this.endpoint&&d(t))return this.xmlHttpRequestFunction({endpoint:this.endpoint,events:t})}isUsable(){return typeof XMLHttpRequest<"u"}};globalThis.objectiv=globalThis.objectiv??{};globalThis.objectiv.versions=globalThis.objectiv.versions??new Map;globalThis.objectiv.versions.set(s.name,s.version);export{a as XHRTransport,l as defaultXHRFunction};
var s={name:"@objectiv/transport-xhr",version:"0.0.25-next.0",description:"A TrackerTransport based on XMLHttpRequest API",license:"Apache-2.0",homepage:"https://objectiv.io",keywords:["objectiv","tracking","analytics","events","taxonomy","transport","xmlhttprequest","xhr"],repository:{type:"git",url:"https://github.com/objectiv/objectiv-analytics.git",directory:"tracker/transports/xhr"},bugs:"https://github.com/objectiv/objectiv-analytics/issues",contributors:[{name:"Surai Di Rosa",email:"surai.dirosa@gmail.com",url:"https://github.com/sdirosa"}],main:"./dist/index.js",module:"./dist/esm/index.js",types:"./dist/index.d.ts",files:["dist"],exports:{".":{require:"./dist/index.js",import:"./dist/esm/index.js",types:"./dist/index.d.ts"}},scripts:{build:"tsup src/index.ts --format cjs,esm --legacy-output --minify --dts --sourcemap --clean","deploy:verdaccio":"npm publish",prettify:"prettier --write .",tsc:"tsc --noEmit",test:"jest --silent","test:ci":"jest --silent --ci","test:coverage":"jest --silent --coverage",depcheck:"npx depcheck"},devDependencies:{"@objectiv/developer-tools":"^0.0.25-next.0","@objectiv/testing-tools":"^0.0.25-next.0",jest:"^28.1.3",prettier:"^2.7.1","ts-jest":"^28.0.7",tsup:"^6.2.1",typescript:"^4.7.4","xhr-mock":"^2.5.1"},dependencies:{"@objectiv/tracker-core":"~0.0.25-next.0"}};import{makeTransportSendError as n}from"@objectiv/tracker-core";var l=({endpoint:i,events:e})=>new Promise(function(t,r){globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Sending"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd());let o=new XMLHttpRequest,c=!0;o.open("POST",i,c),o.setRequestHeader("Content-Type","text/plain"),o.withCredentials=!0,o.onload=()=>{o.status===200?(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Succeeded"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),t(o.response)):(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Failed","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.log(`Response: ${o}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),r(n()))},o.onerror=()=>{globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Error","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),r(n())},o.send(JSON.stringify({events:e,client_session_id:globalThis.objectiv.clientSessionId,transport_time:Date.now()}))});import{isNonEmptyArray as d}from"@objectiv/tracker-core";var a=class{constructor(){this.transportName="XHRTransport";this.xmlHttpRequestFunction=l}initialize(e){this.endpoint=e.endpoint,globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed(`\uFF62objectiv:${this.transportName}\uFF63 Initialized`),globalThis.objectiv.devTools.TrackerConsole.log(`Endpoint: ${this.endpoint}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd())}async handle(...e){let t=await Promise.all(e);if(this.endpoint&&d(t))return this.xmlHttpRequestFunction({endpoint:this.endpoint,events:t})}isUsable(){return typeof XMLHttpRequest<"u"}};globalThis.objectiv=globalThis.objectiv??{};globalThis.objectiv.versions=globalThis.objectiv.versions??new Map;globalThis.objectiv.versions.set(s.name,s.version);export{a as XHRTransport,l as defaultXHRFunction};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { TrackerEvent, TrackerTransportInterface, NonEmptyArray, TransportableEvent } from '@objectiv/tracker-core';
import { TrackerEvent, TrackerTransportInterface, TrackerInterface, NonEmptyArray, TransportableEvent } from '@objectiv/tracker-core';

@@ -16,6 +16,2 @@ /**

/**
* The collector endpoint URL.
*/
endpoint?: string;
/**
* Optional. Override the default XMLHttpRequestFunction implementation with a custom one.

@@ -30,6 +26,6 @@ */

declare class XHRTransport implements TrackerTransportInterface {
readonly endpoint?: string;
readonly transportName = "XHRTransport";
readonly xmlHttpRequestFunction: typeof defaultXHRFunction;
constructor(config: XHRTransportConfig);
xmlHttpRequestFunction: typeof defaultXHRFunction;
endpoint?: string;
initialize(tracker: TrackerInterface): void;
handle(...args: NonEmptyArray<TransportableEvent>): Promise<any>;

@@ -36,0 +32,0 @@ isUsable(): boolean;

@@ -1,2 +0,2 @@

"use strict";var i=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var s in e)i(t,s,{get:e[s],enumerable:!0})},u=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!v.call(t,o)&&o!==s&&i(t,o,{get:()=>e[o],enumerable:!(r=T(e,o))||r.enumerable});return t};var h=t=>u(i({},"__esModule",{value:!0}),t);var j={};g(j,{XHRTransport:()=>c,defaultXHRFunction:()=>a});module.exports=h(j);var n={name:"@objectiv/transport-xhr",version:"0.0.25-next.0",description:"A TrackerTransport based on XMLHttpRequest API",license:"Apache-2.0",homepage:"https://objectiv.io",keywords:["objectiv","tracking","analytics","events","taxonomy","transport","xmlhttprequest","xhr"],repository:{type:"git",url:"https://github.com/objectiv/objectiv-analytics.git",directory:"tracker/transports/xhr"},bugs:"https://github.com/objectiv/objectiv-analytics/issues",contributors:[{name:"Surai Di Rosa",email:"surai.dirosa@gmail.com",url:"https://github.com/sdirosa"}],main:"./dist/index.js",module:"./dist/esm/index.js",types:"./dist/index.d.ts",files:["dist"],exports:{".":{require:"./dist/index.js",import:"./dist/esm/index.js",types:"./dist/index.d.ts"}},scripts:{build:"tsup src/index.ts --format cjs,esm --legacy-output --minify --dts --sourcemap --clean","deploy:verdaccio":"npm publish",prettify:"prettier --write .",tsc:"tsc --noEmit",test:"jest --silent","test:ci":"jest --silent --ci","test:coverage":"jest --silent --coverage",depcheck:"npx depcheck"},devDependencies:{"@objectiv/developer-tools":"^0.0.25-next.0","@objectiv/testing-tools":"^0.0.25-next.0",jest:"^28.1.3",prettier:"^2.7.1","ts-jest":"^28.0.7",tsup:"^6.2.1",typescript:"^4.7.4","xhr-mock":"^2.5.1"},dependencies:{"@objectiv/tracker-core":"~0.0.25-next.0"}};var l=require("@objectiv/tracker-core"),a=({endpoint:t,events:e})=>new Promise(function(s,r){globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Sending"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd());let o=new XMLHttpRequest,d=!0;o.open("POST",t,d),o.setRequestHeader("Content-Type","text/plain"),o.withCredentials=!0,o.onload=()=>{o.status===200?(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Succeeded"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),s(o.response)):(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Failed","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.log(`Response: ${o}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),r((0,l.makeTransportSendError)()))},o.onerror=()=>{globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Error","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),r((0,l.makeTransportSendError)())},o.send(JSON.stringify({events:e,client_session_id:globalThis.objectiv.clientSessionId,transport_time:Date.now()}))});var p=require("@objectiv/tracker-core");var c=class{constructor(e){this.transportName="XHRTransport";this.endpoint=e.endpoint,this.xmlHttpRequestFunction=e.xmlHttpRequestFunction??a}async handle(...e){let s=await Promise.all(e);if(this.endpoint&&(0,p.isNonEmptyArray)(s))return this.xmlHttpRequestFunction({endpoint:this.endpoint,events:s})}isUsable(){return typeof XMLHttpRequest<"u"}};globalThis.objectiv=globalThis.objectiv??{};globalThis.objectiv.versions=globalThis.objectiv.versions??new Map;globalThis.objectiv.versions.set(n.name,n.version);0&&(module.exports={XHRTransport,defaultXHRFunction});
"use strict";var r=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var s in e)r(t,s,{get:e[s],enumerable:!0})},u=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!v.call(t,o)&&o!==s&&r(t,o,{get:()=>e[o],enumerable:!(i=T(e,o))||i.enumerable});return t};var h=t=>u(r({},"__esModule",{value:!0}),t);var m={};g(m,{XHRTransport:()=>c,defaultXHRFunction:()=>a});module.exports=h(m);var n={name:"@objectiv/transport-xhr",version:"0.0.25-next.0",description:"A TrackerTransport based on XMLHttpRequest API",license:"Apache-2.0",homepage:"https://objectiv.io",keywords:["objectiv","tracking","analytics","events","taxonomy","transport","xmlhttprequest","xhr"],repository:{type:"git",url:"https://github.com/objectiv/objectiv-analytics.git",directory:"tracker/transports/xhr"},bugs:"https://github.com/objectiv/objectiv-analytics/issues",contributors:[{name:"Surai Di Rosa",email:"surai.dirosa@gmail.com",url:"https://github.com/sdirosa"}],main:"./dist/index.js",module:"./dist/esm/index.js",types:"./dist/index.d.ts",files:["dist"],exports:{".":{require:"./dist/index.js",import:"./dist/esm/index.js",types:"./dist/index.d.ts"}},scripts:{build:"tsup src/index.ts --format cjs,esm --legacy-output --minify --dts --sourcemap --clean","deploy:verdaccio":"npm publish",prettify:"prettier --write .",tsc:"tsc --noEmit",test:"jest --silent","test:ci":"jest --silent --ci","test:coverage":"jest --silent --coverage",depcheck:"npx depcheck"},devDependencies:{"@objectiv/developer-tools":"^0.0.25-next.0","@objectiv/testing-tools":"^0.0.25-next.0",jest:"^28.1.3",prettier:"^2.7.1","ts-jest":"^28.0.7",tsup:"^6.2.1",typescript:"^4.7.4","xhr-mock":"^2.5.1"},dependencies:{"@objectiv/tracker-core":"~0.0.25-next.0"}};var l=require("@objectiv/tracker-core"),a=({endpoint:t,events:e})=>new Promise(function(s,i){globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Sending"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd());let o=new XMLHttpRequest,d=!0;o.open("POST",t,d),o.setRequestHeader("Content-Type","text/plain"),o.withCredentials=!0,o.onload=()=>{o.status===200?(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("\uFF62objectiv:XHRTransport\uFF63 Succeeded"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),s(o.response)):(globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Failed","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.log(`Response: ${o}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),i((0,l.makeTransportSendError)()))},o.onerror=()=>{globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed("%c\uFF62objectiv:XHRTransport\uFF63 Error","color:red"),globalThis.objectiv.devTools.TrackerConsole.log("Events:"),globalThis.objectiv.devTools.TrackerConsole.log(e),globalThis.objectiv.devTools.TrackerConsole.groupEnd()),i((0,l.makeTransportSendError)())},o.send(JSON.stringify({events:e,client_session_id:globalThis.objectiv.clientSessionId,transport_time:Date.now()}))});var p=require("@objectiv/tracker-core");var c=class{constructor(){this.transportName="XHRTransport";this.xmlHttpRequestFunction=a}initialize(e){this.endpoint=e.endpoint,globalThis.objectiv.devTools&&(globalThis.objectiv.devTools.TrackerConsole.groupCollapsed(`\uFF62objectiv:${this.transportName}\uFF63 Initialized`),globalThis.objectiv.devTools.TrackerConsole.log(`Endpoint: ${this.endpoint}`),globalThis.objectiv.devTools.TrackerConsole.groupEnd())}async handle(...e){let s=await Promise.all(e);if(this.endpoint&&(0,p.isNonEmptyArray)(s))return this.xmlHttpRequestFunction({endpoint:this.endpoint,events:s})}isUsable(){return typeof XMLHttpRequest<"u"}};globalThis.objectiv=globalThis.objectiv??{};globalThis.objectiv.versions=globalThis.objectiv.versions??new Map;globalThis.objectiv.versions.set(n.name,n.version);0&&(module.exports={XHRTransport,defaultXHRFunction});
//# sourceMappingURL=index.js.map
{
"name": "@objectiv/transport-xhr",
"version": "0.0.25-next.0",
"version": "0.0.25",
"description": "A TrackerTransport based on XMLHttpRequest API",

@@ -54,4 +54,4 @@ "license": "Apache-2.0",

"devDependencies": {
"@objectiv/developer-tools": "^0.0.25-next.0",
"@objectiv/testing-tools": "^0.0.25-next.0",
"@objectiv/developer-tools": "^0.0.25",
"@objectiv/testing-tools": "^0.0.25",
"jest": "^28.1.3",

@@ -65,4 +65,4 @@ "prettier": "^2.7.1",

"dependencies": {
"@objectiv/tracker-core": "~0.0.25-next.0"
"@objectiv/tracker-core": "~0.0.25"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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