@leanbase-giangnd/js 0.3.1 → 0.4.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/dist/index.cjs +836 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +59 -43
- package/dist/index.mjs +837 -86
- package/dist/index.mjs.map +1 -1
- package/dist/leanbase.iife.js +2577 -510
- package/dist/leanbase.iife.js.map +1 -1
- package/package.json +2 -1
- package/src/extensions/replay/external/lazy-loaded-session-recorder.ts +104 -17
- package/src/extensions/replay/session-recording.ts +9 -6
- package/src/leanbase.ts +4 -1
- package/src/utils/request-router.ts +39 -0
- package/src/version.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1383,6 +1383,7 @@ declare class SessionRecording$1 {
|
|
|
1383
1383
|
private _receivedFlags;
|
|
1384
1384
|
private _persistFlagsOnSessionListener;
|
|
1385
1385
|
private _lazyLoadedSessionRecording;
|
|
1386
|
+
private _debug;
|
|
1386
1387
|
get started(): boolean;
|
|
1387
1388
|
get status(): SessionRecordingStatus$1;
|
|
1388
1389
|
constructor(_instance: Leanbase);
|
|
@@ -1409,6 +1410,21 @@ declare class SessionRecording$1 {
|
|
|
1409
1410
|
tryAddCustomEvent(tag: string, payload: any): boolean;
|
|
1410
1411
|
}
|
|
1411
1412
|
|
|
1413
|
+
type RequestRouterTarget$1 = 'api' | 'ui' | 'assets';
|
|
1414
|
+
/**
|
|
1415
|
+
* Leanbase-local version of PostHog's RequestRouter.
|
|
1416
|
+
*
|
|
1417
|
+
* Browser SDK always has a requestRouter instance; Leanbase IIFE needs this too so
|
|
1418
|
+
* features like Session Replay can construct ingestion URLs.
|
|
1419
|
+
*/
|
|
1420
|
+
declare class RequestRouter$1 {
|
|
1421
|
+
private readonly instance;
|
|
1422
|
+
constructor(instance: Leanbase);
|
|
1423
|
+
get apiHost(): string;
|
|
1424
|
+
get uiHost(): string | undefined;
|
|
1425
|
+
endpointFor(target: RequestRouterTarget$1, path?: string): string;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1412
1428
|
declare class RageClick {
|
|
1413
1429
|
clicks: {
|
|
1414
1430
|
x: number;
|
|
@@ -3722,31 +3738,6 @@ declare class Autocapture {
|
|
|
3722
3738
|
isBrowserSupported(): boolean;
|
|
3723
3739
|
}
|
|
3724
3740
|
|
|
3725
|
-
declare enum ConsentStatus {
|
|
3726
|
-
PENDING = -1,
|
|
3727
|
-
DENIED = 0,
|
|
3728
|
-
GRANTED = 1
|
|
3729
|
-
}
|
|
3730
|
-
/**
|
|
3731
|
-
* ConsentManager provides tools for managing user consent as configured by the application.
|
|
3732
|
-
*/
|
|
3733
|
-
declare class ConsentManager {
|
|
3734
|
-
private _instance;
|
|
3735
|
-
private _persistentStore?;
|
|
3736
|
-
constructor(_instance: PostHog);
|
|
3737
|
-
private get _config();
|
|
3738
|
-
get consent(): ConsentStatus;
|
|
3739
|
-
isOptedOut(): boolean;
|
|
3740
|
-
isOptedIn(): boolean;
|
|
3741
|
-
isExplicitlyOptedOut(): boolean;
|
|
3742
|
-
optInOut(isOptedIn: boolean): void;
|
|
3743
|
-
reset(): void;
|
|
3744
|
-
private get _storageKey();
|
|
3745
|
-
private get _storedConsent();
|
|
3746
|
-
private get _storage();
|
|
3747
|
-
private _getDnt;
|
|
3748
|
-
}
|
|
3749
|
-
|
|
3750
3741
|
declare class SessionIdManager {
|
|
3751
3742
|
private readonly _sessionIdGenerator;
|
|
3752
3743
|
private readonly _windowIdGenerator;
|
|
@@ -4410,6 +4401,27 @@ declare class SiteApps {
|
|
|
4410
4401
|
onRemoteConfig(response: RemoteConfig): void;
|
|
4411
4402
|
}
|
|
4412
4403
|
|
|
4404
|
+
/**
|
|
4405
|
+
* The request router helps simplify the logic to determine which endpoints should be called for which things
|
|
4406
|
+
* The basic idea is that for a given region (US or EU), we have a set of endpoints that we should call depending
|
|
4407
|
+
* on the type of request (events, replays, flags, etc.) and handle overrides that may come from configs or the flags endpoint
|
|
4408
|
+
*/
|
|
4409
|
+
declare enum RequestRouterRegion {
|
|
4410
|
+
US = "us",
|
|
4411
|
+
EU = "eu",
|
|
4412
|
+
CUSTOM = "custom"
|
|
4413
|
+
}
|
|
4414
|
+
type RequestRouterTarget = 'api' | 'ui' | 'assets';
|
|
4415
|
+
declare class RequestRouter {
|
|
4416
|
+
instance: PostHog;
|
|
4417
|
+
private _regionCache;
|
|
4418
|
+
constructor(instance: PostHog);
|
|
4419
|
+
get apiHost(): string;
|
|
4420
|
+
get uiHost(): string | undefined;
|
|
4421
|
+
get region(): RequestRouterRegion;
|
|
4422
|
+
endpointFor(target: RequestRouterTarget, path?: string): string;
|
|
4423
|
+
}
|
|
4424
|
+
|
|
4413
4425
|
interface WebExperimentTransform {
|
|
4414
4426
|
attributes?: {
|
|
4415
4427
|
name: string;
|
|
@@ -6055,25 +6067,29 @@ declare class PostHog {
|
|
|
6055
6067
|
private _checkLocalStorageForDebug;
|
|
6056
6068
|
}
|
|
6057
6069
|
|
|
6070
|
+
declare enum ConsentStatus {
|
|
6071
|
+
PENDING = -1,
|
|
6072
|
+
DENIED = 0,
|
|
6073
|
+
GRANTED = 1
|
|
6074
|
+
}
|
|
6058
6075
|
/**
|
|
6059
|
-
*
|
|
6060
|
-
* The basic idea is that for a given region (US or EU), we have a set of endpoints that we should call depending
|
|
6061
|
-
* on the type of request (events, replays, flags, etc.) and handle overrides that may come from configs or the flags endpoint
|
|
6076
|
+
* ConsentManager provides tools for managing user consent as configured by the application.
|
|
6062
6077
|
*/
|
|
6063
|
-
declare
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
get
|
|
6075
|
-
get
|
|
6076
|
-
|
|
6078
|
+
declare class ConsentManager {
|
|
6079
|
+
private _instance;
|
|
6080
|
+
private _persistentStore?;
|
|
6081
|
+
constructor(_instance: PostHog);
|
|
6082
|
+
private get _config();
|
|
6083
|
+
get consent(): ConsentStatus;
|
|
6084
|
+
isOptedOut(): boolean;
|
|
6085
|
+
isOptedIn(): boolean;
|
|
6086
|
+
isExplicitlyOptedOut(): boolean;
|
|
6087
|
+
optInOut(isOptedIn: boolean): void;
|
|
6088
|
+
reset(): void;
|
|
6089
|
+
private get _storageKey();
|
|
6090
|
+
private get _storedConsent();
|
|
6091
|
+
private get _storage();
|
|
6092
|
+
private _getDnt;
|
|
6077
6093
|
}
|
|
6078
6094
|
|
|
6079
6095
|
declare class Leanbase extends PostHogCore {
|
|
@@ -6085,7 +6101,7 @@ declare class Leanbase extends PostHogCore {
|
|
|
6085
6101
|
sessionPersistence?: LeanbasePersistence;
|
|
6086
6102
|
sessionManager?: SessionIdManager$1;
|
|
6087
6103
|
sessionPropsManager?: SessionPropsManager$1;
|
|
6088
|
-
requestRouter: RequestRouter;
|
|
6104
|
+
requestRouter: RequestRouter$1;
|
|
6089
6105
|
consent: ConsentManager;
|
|
6090
6106
|
sessionRecording?: SessionRecording$1;
|
|
6091
6107
|
isRemoteConfigLoaded?: boolean;
|