@pitcher/js-api 1.22.0-alpha.2 → 1.22.0-alpha.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.
@@ -57,9 +57,7 @@ export default function (): {
57
57
  setCurrentState(stateName: AppCurrentState, itemId?: string | undefined): void;
58
58
  clearFilters(): void;
59
59
  clearInlineEditingItem(): void;
60
- setIsDataFetchedAtLeastOnce(value: boolean): void;
61
60
  appName: Ref<"" | AppName>;
62
- isDataFetchedAtLeastOnce: Ref<boolean>;
63
61
  currentState: Ref<AppCurrentState>;
64
62
  selectedItemIds: Ref<string[]>;
65
63
  selectedSection: Ref<BrowserSectionType>;
@@ -1,10 +1,10 @@
1
1
  import { MessageApiInjection } from 'naive-ui/es/message/src/MessageProvider';
2
- import { UiToastPayload } from '../sdk/api/modules/ui/types.ui';
2
+ import { UiToastRequest } from '../sdk/api/modules/ui/types.ui';
3
3
 
4
4
  export default function useToast(): {
5
5
  initMessageProvider: () => void;
6
6
  getMessageProvider: () => MessageApiInjection | null;
7
- toast: ((data: UiToastPayload) => void) & {
7
+ toast: ((data: UiToastRequest) => void) & {
8
8
  info: (message: string) => import('naive-ui').MessageReactive | undefined;
9
9
  error: (message: string) => import('naive-ui').MessageReactive | undefined;
10
10
  warning: (message: string) => import('naive-ui').MessageReactive | undefined;
package/lib/main.lib.d.ts CHANGED
@@ -148,7 +148,7 @@ export * from './types/app';
148
148
  export * from './types/vueVirtualScroller';
149
149
  export * from './components/CUsersGroupsAccessManage/CUsersGroupsAccessManage.types';
150
150
  export * from './types/translations';
151
- export * from './types/organization';
151
+ export * from './types/organization.types';
152
152
  export * from './types/iframes';
153
153
  export * from './apps/canvas-builder/types/canvas';
154
154
  export type * from './composables/useWindowEvents';
@@ -1,7 +1,7 @@
1
- import { SelectContentRequest, SelectContentResponse, UiOpenRequest, UiToastPayload, UiPreselectSfdcMeetingIdPayload, UiPreselectSfdcMeetingIdResponse } from './types.ui';
1
+ import { UiSelectContentRequest, UiSelectContentResponse, UiOpenRequest, UiToastRequest, UiPreselectSfdcMeetingIdRequest, UiPreselectSfdcMeetingIdResponse } from './types.ui';
2
2
 
3
- export declare function ui_select_content(payload?: SelectContentRequest): Promise<SelectContentResponse>;
4
- export declare function select_content(payload?: SelectContentRequest): Promise<SelectContentResponse>;
3
+ export declare function ui_select_content(payload?: UiSelectContentRequest): Promise<UiSelectContentResponse>;
4
+ export declare function select_content(payload?: UiSelectContentRequest): Promise<UiSelectContentResponse>;
5
5
  export declare function open(payload: UiOpenRequest): Promise<void>;
6
- export declare function toast(payload: UiToastPayload): Promise<void>;
7
- export declare function preselect_sfdc_meeting_id(payload: UiPreselectSfdcMeetingIdPayload): Promise<UiPreselectSfdcMeetingIdResponse>;
6
+ export declare function toast(payload: UiToastRequest): Promise<void>;
7
+ export declare function preselect_sfdc_meeting_id(payload: UiPreselectSfdcMeetingIdRequest): Promise<UiPreselectSfdcMeetingIdResponse>;
@@ -1,8 +1,10 @@
1
- import { UI_MESSAGE_TYPES, UiMessagePayloads } from './types.ui';
1
+ import { UiBroadcastRequest, UI_MESSAGE_TYPES, UiMessagePayloads } from './types.ui';
2
2
 
3
3
  export declare function on(type: (typeof UI_MESSAGE_TYPES)[keyof typeof UI_MESSAGE_TYPES], handler: (data: UiMessagePayloads[typeof type]) => Promise<void>): Promise<() => void>;
4
+ export declare function ui_broadcast(payload: UiBroadcastRequest): Promise<void>;
4
5
  export * from './content.ui';
5
6
  export * from './loading.ui';
6
7
  export * from './location.ui';
7
8
  export * from './app-errors.ui';
8
9
  export * from './canvas.ui';
10
+ export * from './post-call.ui';
@@ -0,0 +1,3 @@
1
+ import { UiCompletePostcallRequest } from './types.ui';
2
+
3
+ export declare function complete_postcall(payload: UiCompletePostcallRequest): Promise<void>;
@@ -6,6 +6,7 @@ import { OpenRequestPayload } from '../../../payload.types';
6
6
 
7
7
  export declare const UI_MESSAGE: "UI_MESSAGE";
8
8
  export declare const UI_API_METHOD_TYPES: {
9
+ readonly UI_BROADCAST: "ui_broadcast";
9
10
  readonly UI_SELECT_CONTENT: "ui_select_content";
10
11
  readonly UI_OPEN: "ui_open";
11
12
  readonly UI_EMBEDDABLE_READY: "ui_embeddable_ready";
@@ -14,12 +15,14 @@ export declare const UI_API_METHOD_TYPES: {
14
15
  readonly UI_UPDATE_CANVAS: "ui_update_canvas";
15
16
  readonly UI_UPDATE_LOCATION: "ui_update_location";
16
17
  readonly UI_PRESELECT_SFDC_MEETING_ID: "ui_preselect_sfdc_meeting_id";
18
+ readonly UI_COMPLETE_POSTCALL: "ui_complete_postcall";
17
19
  };
18
20
  export declare const UI_MESSAGE_TYPES: {
19
- readonly UI_CONTENT_SELECTED: "ui_content_selected";
21
+ readonly UI_MEETING_CANCELED: "ui_meeting_canceled";
20
22
  };
21
- export type SelectContentRequest = Record<string, never>;
22
- export type SelectContentResponse = {
23
+ export type UiBroadcastRequest = Record<string, any>;
24
+ export type UiSelectContentRequest = Record<string, never>;
25
+ export type UiSelectContentResponse = {
23
26
  user_action: 'cancelled' | 'selected';
24
27
  content?: (ContentSelectorSelectedFile | ContentSelectorSelectedPage)[];
25
28
  };
@@ -28,7 +31,10 @@ export type UiUpdateCanvasRequest = Mutable<Canvas> & {
28
31
  fields?: string;
29
32
  };
30
33
  export type UiOpenRequest = OpenRequestPayload;
31
- export interface UiToastPayload {
34
+ export type UiCompletePostcallRequest = {
35
+ was_successfully_submitted?: boolean;
36
+ };
37
+ export interface UiToastRequest {
32
38
  type: 'info' | 'error' | 'warning' | 'success' | 'loading';
33
39
  message: string;
34
40
  duration?: number;
@@ -36,12 +42,16 @@ export interface UiToastPayload {
36
42
  keepAliveOnHover?: boolean;
37
43
  showIcon?: boolean;
38
44
  }
39
- export type UiMessagePayloads = {
40
- [UI_MESSAGE_TYPES.UI_CONTENT_SELECTED]: Required<SelectContentResponse['content']>;
41
- };
42
- export interface UiPreselectSfdcMeetingIdPayload {
45
+ export interface UiPreselectSfdcMeetingIdRequest {
43
46
  eventId: string;
44
47
  }
45
48
  export interface UiPreselectSfdcMeetingIdResponse {
46
49
  event: SfEvent | null;
47
50
  }
51
+ export type UiMessagePayloads = {
52
+ [UI_MESSAGE_TYPES.UI_MEETING_CANCELED]: UiMeetingCanceledPayload;
53
+ };
54
+ export type UiMeetingCanceledPayload = {
55
+ accountId?: string;
56
+ eventId?: string;
57
+ };
@@ -1,6 +1,6 @@
1
1
  import { Emitter } from './utils/eventEmitter';
2
- import { Favorite, File, Instance, User, Organization, Canvas } from '../../types/openapi';
3
- import { OrganizationMetadata } from '../types/organization';
2
+ import { Favorite, File, Instance, User, Canvas } from '../../types/openapi';
3
+ import { PitcherOrg } from '../types/organization.types';
4
4
  import { PaginatedData } from '../types/paginatedData';
5
5
  import { LaunchDarklyEnv } from '../types/launchDarkly.types';
6
6
  import { CLIENT_TYPE } from '../constants/cdp.const';
@@ -31,9 +31,7 @@ export interface PitcherEnv {
31
31
  mode: 'WEB' | 'IOS' | 'WINDOWS' | 'ANDROID';
32
32
  pitcher: {
33
33
  token_claims: Record<string, any>;
34
- organization: Omit<Organization, 'metadata'> & {
35
- metadata: OrganizationMetadata;
36
- };
34
+ organization: PitcherOrg;
37
35
  instance: Instance;
38
36
  user: User;
39
37
  access_token: string;
package/lib/sdk/main.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare let highLevelApi: ReturnType<typeof createHighLevelApi>;
13
13
  export declare function usePitcherApi(options?: ApiOptions): ReturnType<typeof createHighLevelApi>;
14
14
  export declare function useUi(): {
15
15
  on: typeof ui.on;
16
+ ui_broadcast: typeof ui.ui_broadcast;
16
17
  ui_select_content: typeof ui.ui_select_content;
17
18
  select_content: typeof ui.select_content;
18
19
  open: typeof ui.open;
@@ -22,7 +23,8 @@ export declare function useUi(): {
22
23
  update_location: typeof ui.update_location;
23
24
  capture_app_error: typeof ui.capture_app_error;
24
25
  update_canvas: typeof ui.update_canvas;
25
- } & Record<string, typeof ui.on | typeof ui.open | typeof ui.ui_select_content | typeof ui.toast | typeof ui.update_location | typeof ui.update_canvas | typeof ui.select_content | typeof ui.preselect_sfdc_meeting_id | typeof ui.embeddable_ready | typeof ui.capture_app_error>;
26
+ complete_postcall: typeof ui.complete_postcall;
27
+ } & Record<string, typeof ui.on | typeof ui.open | typeof ui.ui_broadcast | typeof ui.ui_select_content | typeof ui.toast | typeof ui.update_location | typeof ui.update_canvas | typeof ui.select_content | typeof ui.preselect_sfdc_meeting_id | typeof ui.embeddable_ready | typeof ui.capture_app_error | typeof ui.complete_postcall>;
26
28
  export declare function useAdmin(): {
27
29
  on: typeof admin.on;
28
30
  getEnv: typeof admin.getEnv;
@@ -175,6 +177,7 @@ export declare function useApi(): {
175
177
  } & Record<string, typeof dsr.on | typeof dsr.getEnv | typeof dsr.embeddable_ready>) | {
176
178
  ui: {
177
179
  on: typeof ui.on;
180
+ ui_broadcast: typeof ui.ui_broadcast;
178
181
  ui_select_content: typeof ui.ui_select_content;
179
182
  select_content: typeof ui.select_content;
180
183
  open: typeof ui.open;
@@ -184,7 +187,8 @@ export declare function useApi(): {
184
187
  update_location: typeof ui.update_location;
185
188
  capture_app_error: typeof ui.capture_app_error;
186
189
  update_canvas: typeof ui.update_canvas;
187
- } & Record<string, typeof ui.on | typeof ui.open | typeof ui.ui_select_content | typeof ui.toast | typeof ui.update_location | typeof ui.update_canvas | typeof ui.select_content | typeof ui.preselect_sfdc_meeting_id | typeof ui.embeddable_ready | typeof ui.capture_app_error>;
190
+ complete_postcall: typeof ui.complete_postcall;
191
+ } & Record<string, typeof ui.on | typeof ui.open | typeof ui.ui_broadcast | typeof ui.ui_select_content | typeof ui.toast | typeof ui.update_location | typeof ui.update_canvas | typeof ui.select_content | typeof ui.preselect_sfdc_meeting_id | typeof ui.embeddable_ready | typeof ui.capture_app_error | typeof ui.complete_postcall>;
188
192
  impact: {
189
193
  on: (type: string, callback: (payload: import('./interfaces').PitcherEvent) => void) => void;
190
194
  off: (type: string, callback: (payload: import('./interfaces').PitcherEvent) => void) => void;
@@ -308,6 +312,7 @@ export declare function useApi(): {
308
312
  API: import('./api/LowLevelApi').LowLevelApi;
309
313
  };
310
314
  on: typeof ui.on;
315
+ ui_broadcast: typeof ui.ui_broadcast;
311
316
  ui_select_content: typeof ui.ui_select_content;
312
317
  select_content: typeof ui.select_content;
313
318
  open: typeof ui.open;
@@ -317,6 +322,7 @@ export declare function useApi(): {
317
322
  update_location: typeof ui.update_location;
318
323
  capture_app_error: typeof ui.capture_app_error;
319
324
  update_canvas: typeof ui.update_canvas;
325
+ complete_postcall: typeof ui.complete_postcall;
320
326
  off: (type: string, callback: (payload: import('./interfaces').PitcherEvent) => void) => void;
321
327
  enterFullscreen: () => Promise<any>;
322
328
  exitFullscreen: () => Promise<any>;
@@ -0,0 +1,14 @@
1
+ import { Organization, OrganizationUpdate, OrganizationUpdateRequest } from '../../types/openapi';
2
+ import { OrganizationMetadata } from './organizationMetadata.types';
3
+ import { OrganizationSettings } from './organizationSettings.types';
4
+
5
+ export interface PitcherOrg extends Omit<Organization, 'metadata' | 'settings'> {
6
+ readonly metadata: OrganizationMetadata;
7
+ readonly settings: OrganizationSettings;
8
+ }
9
+ export interface OrganizationUpdateExtended extends Omit<OrganizationUpdate, 'settings'> {
10
+ settings?: OrganizationSettings | null;
11
+ }
12
+ export interface OrganizationUpdateRequestExtended extends Omit<OrganizationUpdateRequest, 'settings'> {
13
+ settings?: OrganizationSettings | null;
14
+ }
@@ -0,0 +1,3 @@
1
+ export type OrganizationSettings = {
2
+ impact_show_only_saved_canvases_in_canvas_manager?: boolean;
3
+ };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@pitcher/js-api",
3
- "version": "1.22.0-alpha.2",
3
+ "version": "1.22.0-alpha.4",
4
4
  "type": "module",
5
5
  "main": "js-api.umd.min.js",
6
6
  "module": "js-api.esm.js",
7
+ "types": "js-api.esm.d.ts",
7
8
  "sideEffects": false,
8
9
  "peerDependencies": {
9
10
  "lodash-es": "4"