@pitcher/js-api 1.21.0-beta.3 → 1.21.0-beta.4
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 +286 -60
- 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 +2 -1
- package/lib/composables/useWindowEvents.d.ts +1 -1
- package/lib/main.lib.d.ts +2 -1
- package/lib/sdk/api/onlineRestApiHandlers.d.ts +4 -0
- package/lib/sdk/interfaces.d.ts +5 -2
- package/lib/sdk/utils/httpFetch.d.ts +15 -0
- package/lib/types/instance.types.d.ts +18 -0
- package/lib/types/{instanceSettings.d.ts → instanceSettings.types.d.ts} +3 -1
- package/lib/types/launchDarkly.types.d.ts +1 -1
- package/lib/types/organization.types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { PitcherInfo } from '../../../types/app';
|
|
|
3
3
|
import { ContentGridProps, CanvasBuilderProps } from '@canvas-builder/types/canvas';
|
|
4
4
|
import { RecommendedContent } from '@canvas-builder/types/recommendations.types';
|
|
5
5
|
import { Canvas } from '../../../../types/openapi';
|
|
6
|
-
import { InstanceSettings } from '../../../types/instanceSettings';
|
|
6
|
+
import { InstanceSettings } from '../../../types/instanceSettings.types';
|
|
7
7
|
|
|
8
8
|
declare function autofillCanvasContentGridsWithAi(filesFetcher: NonNullable<CanvasBuilderProps['listFiles']>): Promise<void>;
|
|
9
9
|
declare function autofillSectionContentGridsWithAi(filesFetcher: NonNullable<CanvasBuilderProps['listFiles']>): Promise<void>;
|
|
@@ -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/main.lib.d.ts
CHANGED
|
@@ -149,13 +149,14 @@ export * from './types/vueVirtualScroller';
|
|
|
149
149
|
export * from './components/CUsersGroupsAccessManage/CUsersGroupsAccessManage.types';
|
|
150
150
|
export * from './types/translations';
|
|
151
151
|
export * from './types/organization.types';
|
|
152
|
+
export * from './types/instance.types';
|
|
152
153
|
export * from './types/iframes';
|
|
153
154
|
export * from './apps/canvas-builder/types/canvas';
|
|
154
155
|
export type * from './composables/useWindowEvents';
|
|
155
156
|
export * from './types/call';
|
|
156
157
|
export * from './types/launchDarkly.types';
|
|
157
158
|
export * from './types/toast';
|
|
158
|
-
export * from './types/instanceSettings';
|
|
159
|
+
export * from './types/instanceSettings.types';
|
|
159
160
|
export * from './components/CConfigEditor/CConfigEditor.types';
|
|
160
161
|
export * from './constants/cdp.const';
|
|
161
162
|
export * from './constants/uploads.const';
|
package/lib/sdk/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Emitter } from './utils/eventEmitter';
|
|
2
|
-
import { Favorite, File,
|
|
2
|
+
import { Favorite, File, User, Canvas } from '../../types/openapi';
|
|
3
3
|
import { PitcherOrg } from '../types/organization.types';
|
|
4
|
+
import { PitcherInstance } from '../types/instance.types';
|
|
4
5
|
import { PaginatedData } from '../types/paginatedData';
|
|
5
6
|
import { LaunchDarklyEnv } from '../types/launchDarkly.types';
|
|
6
7
|
import { CLIENT_TYPE } from '../constants/cdp.const';
|
|
@@ -22,17 +23,19 @@ export interface PitcherMessage {
|
|
|
22
23
|
body?: Record<string, any>;
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
type FetchMode = 'postmessage' | 'prefer-online';
|
|
25
27
|
export interface ApiOptions {
|
|
26
28
|
errorLogger?: (p: any) => string | void;
|
|
27
29
|
logLevel?: 'off' | 'info' | 'debug';
|
|
28
30
|
casing?: 'camel' | 'snake';
|
|
31
|
+
fetchMode?: FetchMode;
|
|
29
32
|
}
|
|
30
33
|
export interface PitcherEnv {
|
|
31
34
|
mode: 'WEB' | 'IOS' | 'WINDOWS' | 'ANDROID';
|
|
32
35
|
pitcher: {
|
|
33
36
|
token_claims: Record<string, any>;
|
|
34
37
|
organization: PitcherOrg;
|
|
35
|
-
instance:
|
|
38
|
+
instance: PitcherInstance;
|
|
36
39
|
user: User;
|
|
37
40
|
access_token: string;
|
|
38
41
|
id_token: string;
|
|
@@ -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 {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Instance, InstanceUpdate, InstanceUpdateRequest, InstanceRequest, PatchedInstanceUpdateRequest } from '../../types/openapi';
|
|
2
|
+
import { InstanceSettings } from './instanceSettings.types';
|
|
3
|
+
|
|
4
|
+
export interface PitcherInstance extends Omit<Instance, 'settings'> {
|
|
5
|
+
readonly settings?: InstanceSettings;
|
|
6
|
+
}
|
|
7
|
+
export interface PitcherInstanceUpdate extends Omit<InstanceUpdate, 'settings'> {
|
|
8
|
+
settings?: InstanceSettings | null;
|
|
9
|
+
}
|
|
10
|
+
export interface PitcherInstanceUpdateRequest extends Omit<InstanceUpdateRequest, 'settings'> {
|
|
11
|
+
settings?: InstanceSettings | null;
|
|
12
|
+
}
|
|
13
|
+
export interface PitcherPatchedInstanceUpdateRequest extends Omit<PatchedInstanceUpdateRequest, 'settings'> {
|
|
14
|
+
settings?: InstanceSettings | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PitcherInstanceRequest extends Omit<InstanceRequest, 'settings'> {
|
|
17
|
+
settings?: InstanceSettings | null;
|
|
18
|
+
}
|
|
@@ -12,10 +12,12 @@ export type CanvasComponentAvailability = {
|
|
|
12
12
|
[component in CanvasComponentTypes]: boolean;
|
|
13
13
|
};
|
|
14
14
|
export type InstanceSettings = {
|
|
15
|
+
impact_show_only_saved_canvases_in_canvas_manager?: boolean;
|
|
15
16
|
canvas?: {
|
|
16
17
|
component_availability?: CanvasComponentAvailability & {
|
|
17
18
|
apps?: Record<string, boolean>;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
content_grid_autofill_files_filter_iteratee?: string;
|
|
21
|
+
section_content_grid_autofill_files_filter_iteratee?: string;
|
|
20
22
|
};
|
|
21
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TranslationOverrides } from './translations';
|
|
2
2
|
|
|
3
|
-
export type LaunchDarklyBooleanFlagKey = 'allow_ai_prompts_in_canvas_text' | 'allow_bulk_actions_canvases_files' | 'allow_canvas_duplication' | 'allow_canvas_history' | 'allow_canvas_ownership_change' | 'allow_content_grid_autofill' | 'allow_creating_canvas_with_no_template' | 'allow_embeddable_hiding' | 'allow_note_taking' | 'allow_rep_canvas_metadata_edit' | 'allow_rep_file_upload' | 'are_sections_system_controlled' | 'copy_context_to_canvas' | 'copy_template_metadata_to_canvas' | 'disable_canvas_edit_for_reps' | 'disable_file_edit_content' | 'disable_fullscreen_canvas_builder' | 'disable_impact_web_browser_fullscreen' | 'display_section_list_name' | 'enable_analytics' | 'enable_canvas_node_debugging' | 'enable_experimental_canvas_builder_dnd' | 'hide_asset_uploader' | 'interpolate_rep_canvases_on_edit_mode' | 'is_fe_sentry_enabled' | 'is_meeting_bar_account_selection_disabled' | 'is_meeting_bar_hidden' | 'is_rep_canvas_creation_disabled' | 'is_shared_link_creation_disabled' | 'is_timeline_component_allowed' | 'launch_in_full_screen_on_present_mode' | 'launch_in_present_mode_on_creation' | 'reorder_component_in_drawer' | 'show_asset_manager_for_multimedia' | 'show_popularity_icons' | 'show_system_filters';
|
|
3
|
+
export type LaunchDarklyBooleanFlagKey = 'allow_ai_prompts_in_canvas_text' | 'allow_bulk_actions_canvases_files' | 'allow_canvas_duplication' | 'allow_canvas_history' | 'allow_canvas_ownership_change' | 'allow_content_grid_autofill' | 'allow_creating_canvas_with_no_template' | 'allow_embeddable_hiding' | 'allow_note_taking' | 'allow_rep_canvas_metadata_edit' | 'allow_rep_file_upload' | 'are_sections_system_controlled' | 'copy_context_to_canvas' | 'copy_template_metadata_to_canvas' | 'disable_canvas_edit_for_reps' | 'disable_file_edit_content' | 'disable_fullscreen_canvas_builder' | 'disable_impact_web_browser_fullscreen' | 'display_section_list_name' | 'enable_analytics' | 'enable_canvas_node_debugging' | 'enable_experimental_canvas_builder_dnd' | 'hide_asset_uploader' | 'interpolate_rep_canvases_on_edit_mode' | 'is_fe_sentry_enabled' | 'is_meeting_bar_account_selection_disabled' | 'is_meeting_bar_hidden' | 'is_rep_canvas_creation_disabled' | 'is_shared_link_creation_disabled' | 'is_timeline_component_allowed' | 'launch_in_full_screen_on_present_mode' | 'launch_in_present_mode_on_creation' | 'reorder_component_in_drawer' | 'show_asset_manager_for_multimedia' | 'show_popularity_icons' | 'show_system_filters' | 'prefer_online_handlers';
|
|
4
4
|
type LaunchDarklyObjectFlags = {
|
|
5
5
|
canvas_table_pagination: CanvasTablePagination;
|
|
6
6
|
canvas_manager_table_columns: CanvasManagerTableColumns;
|
|
@@ -6,9 +6,9 @@ export interface PitcherOrg extends Omit<Organization, 'metadata' | 'settings'>
|
|
|
6
6
|
readonly metadata: OrganizationMetadata;
|
|
7
7
|
readonly settings: OrganizationSettings;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface PitcherOrganizationUpdate extends Omit<OrganizationUpdate, 'settings'> {
|
|
10
10
|
settings?: OrganizationSettings | null;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface PitcherOrganizationUpdateRequest extends Omit<OrganizationUpdateRequest, 'settings'> {
|
|
13
13
|
settings?: OrganizationSettings | null;
|
|
14
14
|
}
|