@amplitude/segment-session-replay-plugin 0.0.13 → 0.0.14-SR-3115.0
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/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/index-min.js +1 -1
- package/lib/scripts/index-min.js.gz +0 -0
- package/lib/scripts/index-min.js.map +1 -1
- package/lib/scripts/index-min2.js +1 -1
- package/lib/scripts/index-min2.js.gz +0 -0
- package/lib/scripts/index-min2.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e='!function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compressionOnMessage=void 0,onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,o=t.timestamp,i=t.delay,p=t.data,d=null!=i?JSON.stringify({type:n,timestamp:o,delay:i,data:p}):JSON.stringify({type:n,timestamp:o,data:p});postMessage({compressedEvent:d,sessionId:a})},exports.compressionOnMessage=onmessage}();\n',s='!function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.trackDestinationOnMessage=void 0;var e=require("tslib"),s=require("../constants"),t=require("../messages"),n=require("../utils/gzip"),r=require("../utils/server-url");function a(a,i){return e.__awaiter(this,void 0,void 0,function(){var o,c,u,l,d,g,p,v,_,h,E,y,m;return e.__generator(this,function(R){switch(R.label){case 0:return R.trys.push([0,5,,6]),"CompressionStream"in self?[4,(0,n.gzipJson)(a,self)]:[3,2];case 1:return c=R.sent(),[3,3];case 2:c=null,R.label=3;case 3:return o=c,u="".concat(null!==(E=null===(h=i.version)||void 0===h?void 0:h.type)&&void 0!==E?E:"standalone","/").concat(null!==(m=null===(y=i.version)||void 0===y?void 0:y.version)&&void 0!==m?m:i.sdkVersion),l=new URLSearchParams({device_id:i.deviceId,session_id:"".concat(i.sessionId),type:i.eventType}),d="".concat((0,r.getServerUrl)(i.serverZone,i.trackServerUrl),"?").concat(l.toString()),g=e.__assign({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i.apiKey),"X-Client-Version":i.sdkVersion,"X-Client-Library":u,"X-Client-Url":i.currentUrl.substring(0,s.MAX_URL_LENGTH),"X-Client-Sample-Rate":"".concat(i.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},o?{"Content-Encoding":"gzip"}:{}),[4,fetch(d,{method:"POST",headers:g,body:null!=o?o:a})];case 4:return null===(p=R.sent())?[2,{shouldRetry:!1,success:!1,message:t.UNEXPECTED_ERROR_MESSAGE}]:p.status>=200&&p.status<300?(v=Math.round(new Blob(i.events).size/s.KB_SIZE),[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(i.sessionId,", size of events: ").concat(v," KB")}]):p.status>=500?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(p.status)}]:[2,{shouldRetry:!1,success:!1,message:t.UNEXPECTED_NETWORK_ERROR_MESSAGE}];case 5:return _=R.sent(),[2,{shouldRetry:!1,success:!1,message:String(_)}];case 6:return[2]}})})}function i(n,r,i,o){return e.__awaiter(this,void 0,void 0,function(){var c,u,l;return e.__generator(this,function(e){switch(e.label){case 0:c=1,e.label=1;case 1:return[4,a(r,i)];case 2:return(u=e.sent()).success?(postMessage({type:"log",id:n,message:u.message}),postMessage({type:"complete",id:n}),[2]):o&&u.shouldRetry&&c<i.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*c*s.RETRY_TIMEOUT_MS)})]:[3,4];case 3:return e.sent(),c++,[3,5];case 4:return l=c>=i.flushMaxRetries?t.MAX_RETRIES_EXCEEDED_MESSAGE:u.message,postMessage({type:"warn",id:n,message:l}),postMessage({type:"complete",id:n}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(s){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,a,o,c,u;return e.__generator(this,function(e){switch(e.label){case 0:return t=s.data,n=t.type,r=t.id,a=t.payload,o=t.context,c=t.useRetry,"send"!==n?[3,2]:(u=JSON.stringify(a),[4,i(r,u,o,c)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},exports.trackDestinationOnMessage=onmessage}();\n';export{e as compressionScript,s as trackDestinationScript};
|
|
2
2
|
//# sourceMappingURL=index-min2.js.map
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-min2.js","sources":["../../../session-replay-browser/lib/esm/worker/index.js"],"sourcesContent":["var compressionScript = \"
|
|
1
|
+
{"version":3,"file":"index-min2.js","sources":["../../../session-replay-browser/lib/esm/worker/index.js"],"sourcesContent":["var compressionScript = \"!function(){\\\"use strict\\\";Object.defineProperty(exports,\\\"__esModule\\\",{value:!0}),exports.compressionOnMessage=void 0,onmessage=function(e){var s=\\\"string\\\"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,o=t.timestamp,i=t.delay,p=t.data,d=null!=i?JSON.stringify({type:n,timestamp:o,delay:i,data:p}):JSON.stringify({type:n,timestamp:o,data:p});postMessage({compressedEvent:d,sessionId:a})},exports.compressionOnMessage=onmessage}();\\n\";\nvar trackDestinationScript = \"!function(){\\\"use strict\\\";Object.defineProperty(exports,\\\"__esModule\\\",{value:!0}),exports.trackDestinationOnMessage=void 0;var e=require(\\\"tslib\\\"),s=require(\\\"../constants\\\"),t=require(\\\"../messages\\\"),n=require(\\\"../utils/gzip\\\"),r=require(\\\"../utils/server-url\\\");function a(a,i){return e.__awaiter(this,void 0,void 0,function(){var o,c,u,l,d,g,p,v,_,h,E,y,m;return e.__generator(this,function(R){switch(R.label){case 0:return R.trys.push([0,5,,6]),\\\"CompressionStream\\\"in self?[4,(0,n.gzipJson)(a,self)]:[3,2];case 1:return c=R.sent(),[3,3];case 2:c=null,R.label=3;case 3:return o=c,u=\\\"\\\".concat(null!==(E=null===(h=i.version)||void 0===h?void 0:h.type)&&void 0!==E?E:\\\"standalone\\\",\\\"/\\\").concat(null!==(m=null===(y=i.version)||void 0===y?void 0:y.version)&&void 0!==m?m:i.sdkVersion),l=new URLSearchParams({device_id:i.deviceId,session_id:\\\"\\\".concat(i.sessionId),type:i.eventType}),d=\\\"\\\".concat((0,r.getServerUrl)(i.serverZone,i.trackServerUrl),\\\"?\\\").concat(l.toString()),g=e.__assign({\\\"Content-Type\\\":\\\"application/json\\\",Accept:\\\"*/*\\\",Authorization:\\\"Bearer \\\".concat(i.apiKey),\\\"X-Client-Version\\\":i.sdkVersion,\\\"X-Client-Library\\\":u,\\\"X-Client-Url\\\":i.currentUrl.substring(0,s.MAX_URL_LENGTH),\\\"X-Client-Sample-Rate\\\":\\\"\\\".concat(i.sampleRate),\\\"X-Sampling-Hash-Alg\\\":\\\"xxhash32\\\"},o?{\\\"Content-Encoding\\\":\\\"gzip\\\"}:{}),[4,fetch(d,{method:\\\"POST\\\",headers:g,body:null!=o?o:a})];case 4:return null===(p=R.sent())?[2,{shouldRetry:!1,success:!1,message:t.UNEXPECTED_ERROR_MESSAGE}]:p.status>=200&&p.status<300?(v=Math.round(new Blob(i.events).size/s.KB_SIZE),[2,{shouldRetry:!1,success:!0,message:\\\"Session replay event batch tracked successfully for session id \\\".concat(i.sessionId,\\\", size of events: \\\").concat(v,\\\" KB\\\")}]):p.status>=500?[2,{shouldRetry:!0,success:!1,message:\\\"HTTP \\\".concat(p.status)}]:[2,{shouldRetry:!1,success:!1,message:t.UNEXPECTED_NETWORK_ERROR_MESSAGE}];case 5:return _=R.sent(),[2,{shouldRetry:!1,success:!1,message:String(_)}];case 6:return[2]}})})}function i(n,r,i,o){return e.__awaiter(this,void 0,void 0,function(){var c,u,l;return e.__generator(this,function(e){switch(e.label){case 0:c=1,e.label=1;case 1:return[4,a(r,i)];case 2:return(u=e.sent()).success?(postMessage({type:\\\"log\\\",id:n,message:u.message}),postMessage({type:\\\"complete\\\",id:n}),[2]):o&&u.shouldRetry&&c<i.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*c*s.RETRY_TIMEOUT_MS)})]:[3,4];case 3:return e.sent(),c++,[3,5];case 4:return l=c>=i.flushMaxRetries?t.MAX_RETRIES_EXCEEDED_MESSAGE:u.message,postMessage({type:\\\"warn\\\",id:n,message:l}),postMessage({type:\\\"complete\\\",id:n}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(s){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,a,o,c,u;return e.__generator(this,function(e){switch(e.label){case 0:return t=s.data,n=t.type,r=t.id,a=t.payload,o=t.context,c=t.useRetry,\\\"send\\\"!==n?[3,2]:(u=JSON.stringify(a),[4,i(r,u,o,c)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},exports.trackDestinationOnMessage=onmessage}();\\n\";\n\nexport { compressionScript, trackDestinationScript };\n"],"names":["compressionScript","trackDestinationScript"],"mappings":"AAAG,IAACA,EAAoB,2cACpBC,EAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/segment-session-replay-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-SR-3115.0",
|
|
4
4
|
"description": "Plugin for Segment's analytics.js library to support Amplitude's Session Replay.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amplitude",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@segment/analytics-next": "^1.81.0",
|
|
32
32
|
"js-cookie": "^3.0.5",
|
|
33
|
-
"@amplitude/session-replay-browser": "1.
|
|
33
|
+
"@amplitude/session-replay-browser": "1.36.0-SR-3115.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@aws-sdk/client-s3": "^3.229.0",
|