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-experimental.0 to 0.0.25-next.0

2

dist/esm/index.js

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

var s={name:"@objectiv/transport-xhr",version:"0.0.25-experimental.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-experimental.0","@objectiv/testing-tools":"^0.0.25-experimental.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-experimental.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,p=!0;o.open("POST",r,p),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 T,processEndpoint as a}from"@objectiv/tracker-core";var c=class{constructor(e){this.transportName="XHRTransport";this.endpoint=a(e),this.xmlHttpRequestFunction=e.xmlHttpRequestFunction??l}initialize(e){this.endpoint=a(e)}async handle(...e){let t=await Promise.all(e);if(this.endpoint&&T(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{c 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: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};
//# sourceMappingURL=index.js.map

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

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

@@ -14,4 +14,8 @@ /**

*/
declare type XHRTransportConfig = TrackerTransportEndpointBaseConfig & {
declare type XHRTransportConfig = {
/**
* The collector endpoint URL.
*/
endpoint?: string;
/**
* Optional. Override the default XMLHttpRequestFunction implementation with a custom one.

@@ -25,8 +29,7 @@ */

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

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

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

"use strict";var n=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var s in e)n(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&&n(t,o,{get:()=>e[o],enumerable:!(r=T(e,o))||r.enumerable});return t};var m=t=>u(n({},"__esModule",{value:!0}),t);var j={};g(j,{XHRTransport:()=>p,defaultXHRFunction:()=>c});module.exports=m(j);var l={name:"@objectiv/transport-xhr",version:"0.0.25-experimental.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-experimental.0","@objectiv/testing-tools":"^0.0.25-experimental.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-experimental.0"}};var a=require("@objectiv/tracker-core"),c=({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,a.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,a.makeTransportSendError)())},o.send(JSON.stringify({events:e,client_session_id:globalThis.objectiv.clientSessionId,transport_time:Date.now()}))});var i=require("@objectiv/tracker-core");var p=class{constructor(e){this.transportName="XHRTransport";this.endpoint=(0,i.processEndpoint)(e),this.xmlHttpRequestFunction=e.xmlHttpRequestFunction??c}initialize(e){this.endpoint=(0,i.processEndpoint)(e)}async handle(...e){let s=await Promise.all(e);if(this.endpoint&&(0,i.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(l.name,l.version);0&&(module.exports={XHRTransport,defaultXHRFunction});
"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});
//# sourceMappingURL=index.js.map
{
"name": "@objectiv/transport-xhr",
"version": "0.0.25-experimental.0",
"version": "0.0.25-next.0",
"description": "A TrackerTransport based on XMLHttpRequest API",

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

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

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

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

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