posthog-node 4.13.0 → 4.14.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/CHANGELOG.md +4 -0
- package/lib/index.cjs.js +26 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +10 -0
- package/lib/index.esm.js +26 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +10 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.cjs.js
CHANGED
|
@@ -22,7 +22,7 @@ function _interopNamespace(e) {
|
|
|
22
22
|
return Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var version = "4.
|
|
25
|
+
var version = "4.14.0";
|
|
26
26
|
|
|
27
27
|
var PostHogPersistedProperty;
|
|
28
28
|
(function (PostHogPersistedProperty) {
|
|
@@ -327,7 +327,7 @@ function safeSetTimeout(fn, timeout) {
|
|
|
327
327
|
return t;
|
|
328
328
|
}
|
|
329
329
|
function getFetch() {
|
|
330
|
-
return typeof fetch !== 'undefined' ? fetch : typeof
|
|
330
|
+
return typeof fetch !== 'undefined' ? fetch : typeof globalThis.fetch !== 'undefined' ? globalThis.fetch : undefined;
|
|
331
331
|
}
|
|
332
332
|
// FNV-1a hash function
|
|
333
333
|
// https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
|
|
@@ -1595,6 +1595,30 @@ class PostHogCoreStateless {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
return newSurveys ?? [];
|
|
1597
1597
|
}
|
|
1598
|
+
get props() {
|
|
1599
|
+
if (!this._props) {
|
|
1600
|
+
this._props = this.getPersistedProperty(PostHogPersistedProperty.Props);
|
|
1601
|
+
}
|
|
1602
|
+
return this._props || {};
|
|
1603
|
+
}
|
|
1604
|
+
set props(val) {
|
|
1605
|
+
this._props = val;
|
|
1606
|
+
}
|
|
1607
|
+
async register(properties) {
|
|
1608
|
+
this.wrap(() => {
|
|
1609
|
+
this.props = {
|
|
1610
|
+
...this.props,
|
|
1611
|
+
...properties,
|
|
1612
|
+
};
|
|
1613
|
+
this.setPersistedProperty(PostHogPersistedProperty.Props, this.props);
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
async unregister(property) {
|
|
1617
|
+
this.wrap(() => {
|
|
1618
|
+
delete this.props[property];
|
|
1619
|
+
this.setPersistedProperty(PostHogPersistedProperty.Props, this.props);
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1598
1622
|
/***
|
|
1599
1623
|
*** QUEUEING AND FLUSHING
|
|
1600
1624
|
***/
|