raindrop-ai 0.0.79 → 0.0.80-otelv2
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/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -21
- package/dist/index.mjs +1 -21
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -741,7 +741,6 @@ declare class Raindrop {
|
|
|
741
741
|
* ```
|
|
742
742
|
*/
|
|
743
743
|
trackAi(event: AiTrackEvent | AiTrackEvent[]): string | Array<string | undefined> | undefined;
|
|
744
|
-
private isEnvWithLocalStorage;
|
|
745
744
|
setUserDetails(event: IdentifyEvent): void;
|
|
746
745
|
trackSignal(signal: SignalEvent | SignalEvent[]): void | void[];
|
|
747
746
|
private getSize;
|
package/dist/index.d.ts
CHANGED
|
@@ -741,7 +741,6 @@ declare class Raindrop {
|
|
|
741
741
|
* ```
|
|
742
742
|
*/
|
|
743
743
|
trackAi(event: AiTrackEvent | AiTrackEvent[]): string | Array<string | undefined> | undefined;
|
|
744
|
-
private isEnvWithLocalStorage;
|
|
745
744
|
setUserDetails(event: IdentifyEvent): void;
|
|
746
745
|
trackSignal(signal: SignalEvent | SignalEvent[]): void | void[];
|
|
747
746
|
private getSize;
|
package/dist/index.js
CHANGED
|
@@ -138,7 +138,7 @@ var CategorizationRequestSchema = import_zod.z.object({
|
|
|
138
138
|
// package.json
|
|
139
139
|
var package_default = {
|
|
140
140
|
name: "raindrop-ai",
|
|
141
|
-
version: "0.0.
|
|
141
|
+
version: "0.0.80",
|
|
142
142
|
main: "dist/index.js",
|
|
143
143
|
module: "dist/index.mjs",
|
|
144
144
|
types: "dist/index.d.ts",
|
|
@@ -962,10 +962,6 @@ var Raindrop = class {
|
|
|
962
962
|
this.partialEventBuffer = /* @__PURE__ */ new Map();
|
|
963
963
|
this.partialEventTimeouts = /* @__PURE__ */ new Map();
|
|
964
964
|
this.inFlightRequests = /* @__PURE__ */ new Set();
|
|
965
|
-
//We are writing to local storage for browser-like environments where the
|
|
966
|
-
//page might get closed/reloaded before the buffer is flushed.
|
|
967
|
-
// Node 25/26 are making breaking changes here: https://github.com/nodejs/node/issues/60303
|
|
968
|
-
this.isEnvWithLocalStorage = typeof localStorage !== "undefined" && typeof localStorage.getItem === "function" && typeof localStorage.setItem === "function" && typeof localStorage.removeItem === "function";
|
|
969
965
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
970
966
|
if (!config.writeKey) {
|
|
971
967
|
throw new Error("A writeKey is required to use Raindrop");
|
|
@@ -976,13 +972,6 @@ var Raindrop = class {
|
|
|
976
972
|
this.bufferTimeout = (_c = config.bufferTimeout) != null ? _c : 1e3;
|
|
977
973
|
this.buffer = new Array();
|
|
978
974
|
this.disabled = (_d = config.disabled) != null ? _d : false;
|
|
979
|
-
if (this.isEnvWithLocalStorage && !this.disabled) {
|
|
980
|
-
const storedBuffer = localStorage.getItem("raindrop_analytics_buffer");
|
|
981
|
-
if (storedBuffer) {
|
|
982
|
-
this.buffer = JSON.parse(storedBuffer);
|
|
983
|
-
this.flush();
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
975
|
this.debugLogs = (_e = config.debugLogs) != null ? _e : false;
|
|
987
976
|
this.redactPii = (_f = config.redactPii) != null ? _f : false;
|
|
988
977
|
this.context = this.getContext();
|
|
@@ -1227,12 +1216,6 @@ var Raindrop = class {
|
|
|
1227
1216
|
if (this.disabled) {
|
|
1228
1217
|
return;
|
|
1229
1218
|
}
|
|
1230
|
-
if (this.isEnvWithLocalStorage) {
|
|
1231
|
-
localStorage.setItem("raindrop_analytics_buffer", JSON.stringify(this.buffer));
|
|
1232
|
-
if (event == null ? void 0 : event.properties) {
|
|
1233
|
-
event.properties = { ...event.properties, localStorage: "true" };
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
1219
|
if (this.debugLogs) {
|
|
1237
1220
|
console.log("[raindrop] Added to queue: " + JSON.stringify({ event }));
|
|
1238
1221
|
}
|
|
@@ -1255,9 +1238,6 @@ var Raindrop = class {
|
|
|
1255
1238
|
}
|
|
1256
1239
|
const currentBuffer = this.buffer;
|
|
1257
1240
|
this.buffer = new Array();
|
|
1258
|
-
if (this.isEnvWithLocalStorage) {
|
|
1259
|
-
localStorage.removeItem("raindrop_analytics_buffer");
|
|
1260
|
-
}
|
|
1261
1241
|
const events = currentBuffer.filter((e) => e.type === "event");
|
|
1262
1242
|
const aiEvents = currentBuffer.filter((e) => e.type === "ai");
|
|
1263
1243
|
const identify = currentBuffer.filter((e) => e.type === "identify");
|
package/dist/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ var CategorizationRequestSchema = z.object({
|
|
|
104
104
|
// package.json
|
|
105
105
|
var package_default = {
|
|
106
106
|
name: "raindrop-ai",
|
|
107
|
-
version: "0.0.
|
|
107
|
+
version: "0.0.80",
|
|
108
108
|
main: "dist/index.js",
|
|
109
109
|
module: "dist/index.mjs",
|
|
110
110
|
types: "dist/index.d.ts",
|
|
@@ -367,10 +367,6 @@ var Raindrop = class {
|
|
|
367
367
|
this.partialEventBuffer = /* @__PURE__ */ new Map();
|
|
368
368
|
this.partialEventTimeouts = /* @__PURE__ */ new Map();
|
|
369
369
|
this.inFlightRequests = /* @__PURE__ */ new Set();
|
|
370
|
-
//We are writing to local storage for browser-like environments where the
|
|
371
|
-
//page might get closed/reloaded before the buffer is flushed.
|
|
372
|
-
// Node 25/26 are making breaking changes here: https://github.com/nodejs/node/issues/60303
|
|
373
|
-
this.isEnvWithLocalStorage = typeof localStorage !== "undefined" && typeof localStorage.getItem === "function" && typeof localStorage.setItem === "function" && typeof localStorage.removeItem === "function";
|
|
374
370
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
375
371
|
if (!config.writeKey) {
|
|
376
372
|
throw new Error("A writeKey is required to use Raindrop");
|
|
@@ -381,13 +377,6 @@ var Raindrop = class {
|
|
|
381
377
|
this.bufferTimeout = (_c = config.bufferTimeout) != null ? _c : 1e3;
|
|
382
378
|
this.buffer = new Array();
|
|
383
379
|
this.disabled = (_d = config.disabled) != null ? _d : false;
|
|
384
|
-
if (this.isEnvWithLocalStorage && !this.disabled) {
|
|
385
|
-
const storedBuffer = localStorage.getItem("raindrop_analytics_buffer");
|
|
386
|
-
if (storedBuffer) {
|
|
387
|
-
this.buffer = JSON.parse(storedBuffer);
|
|
388
|
-
this.flush();
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
380
|
this.debugLogs = (_e = config.debugLogs) != null ? _e : false;
|
|
392
381
|
this.redactPii = (_f = config.redactPii) != null ? _f : false;
|
|
393
382
|
this.context = this.getContext();
|
|
@@ -632,12 +621,6 @@ var Raindrop = class {
|
|
|
632
621
|
if (this.disabled) {
|
|
633
622
|
return;
|
|
634
623
|
}
|
|
635
|
-
if (this.isEnvWithLocalStorage) {
|
|
636
|
-
localStorage.setItem("raindrop_analytics_buffer", JSON.stringify(this.buffer));
|
|
637
|
-
if (event == null ? void 0 : event.properties) {
|
|
638
|
-
event.properties = { ...event.properties, localStorage: "true" };
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
624
|
if (this.debugLogs) {
|
|
642
625
|
console.log("[raindrop] Added to queue: " + JSON.stringify({ event }));
|
|
643
626
|
}
|
|
@@ -660,9 +643,6 @@ var Raindrop = class {
|
|
|
660
643
|
}
|
|
661
644
|
const currentBuffer = this.buffer;
|
|
662
645
|
this.buffer = new Array();
|
|
663
|
-
if (this.isEnvWithLocalStorage) {
|
|
664
|
-
localStorage.removeItem("raindrop_analytics_buffer");
|
|
665
|
-
}
|
|
666
646
|
const events = currentBuffer.filter((e) => e.type === "event");
|
|
667
647
|
const aiEvents = currentBuffer.filter((e) => e.type === "ai");
|
|
668
648
|
const identify = currentBuffer.filter((e) => e.type === "identify");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "raindrop-ai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.80-otelv2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"@dawn-analytics/redact-pii": "0.1.2",
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
48
|
"@opentelemetry/resources": "^2.0.1",
|
|
49
|
-
"@traceloop/node-server-sdk": "0.19.0-otel-v1",
|
|
50
49
|
"weakref": "^0.2.1",
|
|
51
50
|
"zod": "^3.23.8"
|
|
52
51
|
},
|
|
@@ -85,5 +84,8 @@
|
|
|
85
84
|
"resolve": true
|
|
86
85
|
},
|
|
87
86
|
"clean": true
|
|
87
|
+
},
|
|
88
|
+
"optionalDependencies": {
|
|
89
|
+
"@traceloop/node-server-sdk": "0.22.2"
|
|
88
90
|
}
|
|
89
91
|
}
|