@pitcher/js-api 1.22.0-alpha.5 → 1.22.0-alpha.6
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/js-api.esm.js +235 -59
- package/js-api.esm.js.map +1 -1
- package/js-api.umd.min.js +10 -10
- package/js-api.umd.min.js.map +1 -1
- package/lib/apps/canvas-builder/composables/useRecommendations.d.ts +1 -0
- package/lib/composables/useWindowEvents.d.ts +1 -1
- package/lib/sdk/api/onlineRestApiHandlers.d.ts +4 -0
- package/lib/sdk/interfaces.d.ts +2 -0
- package/lib/sdk/utils/httpFetch.d.ts +15 -0
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ declare function autofillCanvasContentGridsWithMatchingProperties(options: {
|
|
|
17
17
|
filesFetcher: NonNullable<CanvasBuilderProps['listFiles']>;
|
|
18
18
|
http: AxiosInstance;
|
|
19
19
|
pitcherInfo: PitcherInfo;
|
|
20
|
+
instanceSettings?: InstanceSettings;
|
|
20
21
|
}): Promise<void>;
|
|
21
22
|
declare function cleanup(): void;
|
|
22
23
|
export default function useRecommendations(): {
|
|
@@ -10,7 +10,7 @@ export type InactiveEventPayload = {
|
|
|
10
10
|
export default function (track: (eventName: string, payload: any) => void, pitcherApi?: ReturnType<typeof usePitcherApi>): {
|
|
11
11
|
registerInactiveEvent: ({ id, payload, enterEvent, exitEvent, type, }: {
|
|
12
12
|
id: string;
|
|
13
|
-
payload: InactiveEventPayload;
|
|
13
|
+
payload: InactiveEventPayload | (() => InactiveEventPayload);
|
|
14
14
|
enterEvent: (typeof CDP_EVENT_TYPE)[keyof typeof CDP_EVENT_TYPE];
|
|
15
15
|
exitEvent: (typeof CDP_EVENT_TYPE)[keyof typeof CDP_EVENT_TYPE];
|
|
16
16
|
type?: EventType;
|
package/lib/sdk/interfaces.d.ts
CHANGED
|
@@ -22,10 +22,12 @@ export interface PitcherMessage {
|
|
|
22
22
|
body?: Record<string, any>;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
type FetchMode = 'postmessage' | 'prefer-online';
|
|
25
26
|
export interface ApiOptions {
|
|
26
27
|
errorLogger?: (p: any) => string | void;
|
|
27
28
|
logLevel?: 'off' | 'info' | 'debug';
|
|
28
29
|
casing?: 'camel' | 'snake';
|
|
30
|
+
fetchMode?: FetchMode;
|
|
29
31
|
}
|
|
30
32
|
export interface PitcherEnv {
|
|
31
33
|
mode: 'WEB' | 'IOS' | 'WINDOWS' | 'ANDROID';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type FetchOptions = {
|
|
2
|
+
method?: string;
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
body?: string;
|
|
5
|
+
credentials?: RequestCredentials;
|
|
6
|
+
params?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
export declare function createHttpClient(origin: string, token: string): {
|
|
9
|
+
get: (endpoint: string, options?: FetchOptions) => Promise<any>;
|
|
10
|
+
post: (endpoint: string, body: object, options?: FetchOptions) => Promise<any>;
|
|
11
|
+
put: (endpoint: string, body: object, options?: FetchOptions) => Promise<any>;
|
|
12
|
+
delete: (endpoint: string, options?: FetchOptions) => Promise<any>;
|
|
13
|
+
patch: (endpoint: string, body: object, options?: FetchOptions) => Promise<any>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|