obi-sdk 0.19.38-beta.0 → 0.19.38-beta.2
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.js +13 -13
- package/dist/obi-sdk.standalone.iife.js +13 -13
- package/dist/src/sdk.d.ts +3 -27
- package/package.json +1 -1
- package/dist/src/empty.test.d.ts +0 -1
- package/dist/src/engagement.d.ts +0 -16
- package/dist/src/engagement.test.d.ts +0 -1
- package/dist/src/sdk.engagement.prompts.test.d.ts +0 -1
- package/dist/src/sdk.engagement.test.d.ts +0 -1
- package/dist/src/sdk.test.d.ts +0 -1
- package/dist/src/url-matcher.test.d.ts +0 -1
- package/dist/src/widget.test.d.ts +0 -1
package/dist/src/sdk.d.ts
CHANGED
|
@@ -13,12 +13,6 @@ export type ObiSDKEvents = {
|
|
|
13
13
|
text: string;
|
|
14
14
|
autoCloseMs?: number;
|
|
15
15
|
}) => void;
|
|
16
|
-
engagementSessionStarted: (payload: {
|
|
17
|
-
sessionCount: number;
|
|
18
|
-
lastSessionStartAt: number;
|
|
19
|
-
lastActivityAt: number;
|
|
20
|
-
scopeKey: string;
|
|
21
|
-
}) => void;
|
|
22
16
|
};
|
|
23
17
|
export type InitialiseArgs = {
|
|
24
18
|
queuedCommands?: Command[];
|
|
@@ -36,28 +30,17 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
36
30
|
private commandQueue;
|
|
37
31
|
/** HACK: Need to prevent initialisation from being called if resumed. */
|
|
38
32
|
private _resumed;
|
|
39
|
-
private _engagementScopeKey;
|
|
40
|
-
private _engagementInitialised;
|
|
41
|
-
/** Guard to avoid multiple prompts within the same session edge */
|
|
42
|
-
private _engagementPromptedAtSessionCount;
|
|
43
33
|
/**
|
|
44
34
|
* Creates a client that should persist for the lifetime of the SDK.
|
|
45
35
|
* Resumes an ongoing session if one exists.
|
|
46
36
|
*/
|
|
47
37
|
constructor(appToken?: string);
|
|
48
38
|
createClient(appToken: string): Promise<void>;
|
|
49
|
-
private _maybeInitEngagement;
|
|
50
|
-
private _attachEngagementLifecycle;
|
|
51
|
-
/**
|
|
52
|
-
* Compute which engagement level applies for the given cumulative session count.
|
|
53
|
-
* Returns the style ("modal" | "popover") or null if no level applies.
|
|
54
|
-
*/
|
|
55
|
-
private _engagementStyleForSession;
|
|
56
39
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
40
|
+
* Act on server-provided engagement.style when available, respecting stop conditions
|
|
41
|
+
* and URL blacklist gating.
|
|
59
42
|
*/
|
|
60
|
-
private
|
|
43
|
+
private _maybeActOnServerEngagement;
|
|
61
44
|
initialise(args?: InitialiseArgs): Promise<void>;
|
|
62
45
|
/**
|
|
63
46
|
* Update the SDK configuration. This is typically called before a plan starts,
|
|
@@ -122,11 +105,4 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
122
105
|
captureScreen(): Promise<string>;
|
|
123
106
|
save(): void;
|
|
124
107
|
load(): string | null;
|
|
125
|
-
/** Read-only helper for engagement storage info for current scope */
|
|
126
|
-
getEngagementInfo(): {
|
|
127
|
-
sessionCount: number;
|
|
128
|
-
lastActivityAt: number | null;
|
|
129
|
-
lastSessionStartAt: number | null;
|
|
130
|
-
scopeKey: string | null;
|
|
131
|
-
};
|
|
132
108
|
}
|
package/package.json
CHANGED
package/dist/src/empty.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/engagement.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Identity } from "@obi/obi-client";
|
|
2
|
-
export type EngagementState = {
|
|
3
|
-
lastActivityAt: number;
|
|
4
|
-
lastSessionStartAt?: number;
|
|
5
|
-
sessionCount: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Compute a stable per-onboardee-per-product scope key.
|
|
9
|
-
* Prefer onboardee UUID if available, else email, else a hash of identity.
|
|
10
|
-
* Always include product UUID (or other stable product identifier) to isolate across products.
|
|
11
|
-
*/
|
|
12
|
-
export declare function computeScopeKey(productUuid: string | undefined | null, identity?: Identity | null): string | null;
|
|
13
|
-
export declare function readState(scopeKey: string): EngagementState | null;
|
|
14
|
-
export declare function writeState(scopeKey: string, state: EngagementState): void;
|
|
15
|
-
export declare function isNewSession(now: number, lastActivityAt: number | undefined | null, thresholdMs?: number): boolean;
|
|
16
|
-
export declare function markActivity(now: number, state: EngagementState): EngagementState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/sdk.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|