obi-sdk 0.19.57-beta.0 → 0.19.57-beta.1
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 +14 -14
- package/dist/obi-sdk.standalone.iife.js +14 -14
- package/dist/src/testUtils/obiClient.d.ts +47 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ClientEngagement, ClientType, Identity, Plan, Product } from "@obi/obi-client";
|
|
2
|
+
import { MockObiClient, MockObiSession, MockRoom, type MockClientConfig, type MockSessionConfig } from "@obi/obi-client/mocks";
|
|
3
|
+
import { ObiSDK } from "../sdk";
|
|
4
|
+
/**
|
|
5
|
+
* Subset of ObiApi methods used in SDK tests.
|
|
6
|
+
* Using a loose type since mocks return simplified data structures
|
|
7
|
+
* and are cast to ObiApi when passed to MockObiClient/MockObiSession.
|
|
8
|
+
*/
|
|
9
|
+
type MockApi = Record<string, any>;
|
|
10
|
+
type MockApiConfig = {
|
|
11
|
+
product?: Product | null;
|
|
12
|
+
plans?: Plan[];
|
|
13
|
+
selectedPlan?: Plan | null;
|
|
14
|
+
planIsCompleted?: boolean[];
|
|
15
|
+
showWidget?: boolean;
|
|
16
|
+
engagement?: ClientEngagement | null;
|
|
17
|
+
featureFlags?: Array<Record<string, any>>;
|
|
18
|
+
};
|
|
19
|
+
export declare function createMockApi(config?: MockApiConfig, overrides?: MockApi): MockApi;
|
|
20
|
+
type CreateMockSdkWithClientArgs = {
|
|
21
|
+
appToken?: string;
|
|
22
|
+
clientType?: ClientType;
|
|
23
|
+
product?: Product | null;
|
|
24
|
+
plans?: Plan[];
|
|
25
|
+
planIsCompleted?: boolean[];
|
|
26
|
+
selectedPlanUuid?: string | null;
|
|
27
|
+
identity?: Identity | null;
|
|
28
|
+
isActive?: boolean;
|
|
29
|
+
featureFlags?: Array<Record<string, any>>;
|
|
30
|
+
apiOverrides?: MockApi;
|
|
31
|
+
mockClientConfig?: MockClientConfig;
|
|
32
|
+
mockSessionConfig?: MockSessionConfig;
|
|
33
|
+
attachSession?: boolean;
|
|
34
|
+
sessionPlanId?: string | null;
|
|
35
|
+
withRoom?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare function createMockSdkWithClient({ appToken, clientType, product, plans, planIsCompleted, selectedPlanUuid, identity, isActive, featureFlags, apiOverrides, mockClientConfig, mockSessionConfig, attachSession, sessionPlanId, withRoom, }?: CreateMockSdkWithClientArgs): {
|
|
38
|
+
sdk: ObiSDK;
|
|
39
|
+
client: MockObiClient;
|
|
40
|
+
session: MockObiSession | undefined;
|
|
41
|
+
room: MockRoom | undefined;
|
|
42
|
+
mockApi: MockApi;
|
|
43
|
+
};
|
|
44
|
+
export declare function flushMicrotasks(times?: number): Promise<void>;
|
|
45
|
+
export declare function ensurePointerEventPolyfill(): () => void;
|
|
46
|
+
export declare function setupWidgetDomStubs(): () => void;
|
|
47
|
+
export {};
|