@pitcher/js-api 1.22.0-alpha.6 → 1.22.0-beta.0

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.
Files changed (185) hide show
  1. package/js-api.esm.js +472 -139
  2. package/js-api.esm.js.map +1 -1
  3. package/js-api.umd.min.js +10 -10
  4. package/js-api.umd.min.js.map +1 -1
  5. package/lib/api/canvases/canvases.queries.d.ts +5 -5
  6. package/lib/apps/browser/stores/api.d.ts +215 -84
  7. package/lib/apps/browser/stores/app.d.ts +7 -26
  8. package/lib/apps/browser/stores/upload.d.ts +34 -24
  9. package/lib/apps/browser/util/file.d.ts +2 -2
  10. package/lib/apps/canvas-builder/composables/useCanvas.d.ts +550 -460
  11. package/lib/apps/canvas-builder/composables/useCanvasExit.d.ts +3 -0
  12. package/lib/apps/canvas-builder/composables/useCanvasHistory.d.ts +86 -74
  13. package/lib/apps/canvas-builder/composables/useCanvasHooks.d.ts +4 -4
  14. package/lib/apps/canvas-builder/composables/useCanvasPages.d.ts +3 -3
  15. package/lib/apps/canvas-builder/composables/useCanvasSectionOverrides.d.ts +3 -3
  16. package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +24 -17
  17. package/lib/apps/canvas-builder/composables/useCanvasVisibility.d.ts +2 -2
  18. package/lib/apps/canvas-builder/composables/useCollapsibles.d.ts +3 -3
  19. package/lib/apps/canvas-builder/composables/useComponentPermissions.d.ts +2 -2
  20. package/lib/apps/canvas-builder/composables/useContentSelector.d.ts +6 -4
  21. package/lib/apps/canvas-builder/composables/useInstalledEmbeddables.d.ts +15 -0
  22. package/lib/apps/canvas-builder/composables/useRecommendations.d.ts +5 -5
  23. package/lib/apps/canvas-builder/composables/useSectionPopularity.d.ts +2 -2
  24. package/lib/apps/canvas-builder/types/canvas.d.ts +19 -18
  25. package/lib/apps/canvas-builder/types/recommendations.types.d.ts +3 -3
  26. package/lib/apps/canvas-builder/util/canvas.util.d.ts +5 -4
  27. package/lib/apps/canvas-selector/appTypes.d.ts +9 -0
  28. package/lib/apps/content-selector/appTypes.d.ts +1 -0
  29. package/lib/apps/content-selector/stores/app.d.ts +8 -1
  30. package/lib/components/CFileViewer/CFileViewer.use.d.ts +2 -4
  31. package/lib/components/CFileViewer/CFileViewerFullScreen.use.d.ts +1 -1
  32. package/lib/components/canvases/CanvasesManagementBulk.use.d.ts +5 -5
  33. package/lib/components/filters/filter.util.d.ts +1 -1
  34. package/lib/components/savedCanvases/CSavedCanvasesManagementShareCanvas.use.d.ts +5 -3
  35. package/lib/composables/instanceTagsActions.use.d.ts +14 -0
  36. package/lib/composables/recentFiles.use.d.ts +1 -1
  37. package/lib/composables/suggestedTags.use.d.ts +3 -0
  38. package/lib/composables/tableColumnsSettings.use.d.ts +25 -0
  39. package/lib/composables/useCanvasOverlay.d.ts +20 -0
  40. package/lib/composables/useCanvasTablesPagination.d.ts +13 -0
  41. package/lib/composables/useConfirmation.d.ts +1 -0
  42. package/lib/composables/useElementHeightResize.d.ts +5 -0
  43. package/lib/composables/useFiles.d.ts +11 -0
  44. package/lib/constants/pitcherSettings.const.d.ts +4 -0
  45. package/lib/main.lib.d.ts +31 -21
  46. package/lib/sdk/api/HighLevelApi.d.ts +112 -14
  47. package/lib/sdk/api/modules/admin/canvas.admin.d.ts +53 -15
  48. package/lib/sdk/api/modules/admin/env.admin.d.ts +3 -2
  49. package/lib/sdk/api/modules/admin/files.admin.d.ts +43 -4
  50. package/lib/sdk/api/modules/admin/index.d.ts +53 -5
  51. package/lib/sdk/api/modules/admin/metadataTemplates.admin.d.ts +1 -2
  52. package/lib/sdk/api/modules/admin/types.admin.d.ts +132 -3
  53. package/lib/sdk/api/modules/canvas.d.ts +12 -14
  54. package/lib/sdk/api/modules/dsr/env.dsr.d.ts +4 -3
  55. package/lib/sdk/api/modules/dsr/index.d.ts +14 -3
  56. package/lib/sdk/api/modules/dsr/loading.dsr.d.ts +7 -1
  57. package/lib/sdk/api/modules/env.d.ts +16 -0
  58. package/lib/sdk/api/modules/favorites.d.ts +9 -0
  59. package/lib/sdk/api/modules/feedback.d.ts +3 -0
  60. package/lib/sdk/api/modules/files.d.ts +7 -4
  61. package/lib/sdk/api/modules/folders.d.ts +29 -0
  62. package/lib/sdk/api/modules/open.d.ts +6 -0
  63. package/lib/sdk/api/modules/sync.d.ts +1 -2
  64. package/lib/sdk/api/modules/ui/app-errors.ui.d.ts +13 -1
  65. package/lib/sdk/api/modules/ui/canvas.ui.d.ts +102 -8
  66. package/lib/sdk/api/modules/ui/content.ui.d.ts +52 -2
  67. package/lib/sdk/api/modules/ui/index.d.ts +150 -13
  68. package/lib/sdk/api/modules/ui/loading.ui.d.ts +9 -1
  69. package/lib/sdk/api/modules/ui/location.ui.d.ts +18 -1
  70. package/lib/sdk/api/modules/ui/post-call.ui.d.ts +35 -4
  71. package/lib/sdk/api/modules/ui/types.ui.d.ts +86 -8
  72. package/lib/sdk/api/modules/users.d.ts +6 -1
  73. package/lib/sdk/interfaces.d.ts +122 -3
  74. package/lib/sdk/main.d.ts +297 -151
  75. package/lib/sdk/payload.types.d.ts +134 -2
  76. package/lib/sdk/utils/httpFetch.d.ts +1 -1
  77. package/lib/sdk/utils/object.d.ts +1 -0
  78. package/lib/sdk/utils/object.spec.d.ts +1 -0
  79. package/lib/theme/light.d.ts +12 -0
  80. package/lib/types/app.d.ts +11 -0
  81. package/lib/types/call.d.ts +4 -3
  82. package/lib/types/files.d.ts +27 -1
  83. package/lib/types/filter.d.ts +5 -0
  84. package/lib/types/instance.types.d.ts +18 -0
  85. package/lib/types/{instanceSettings.d.ts → instanceSettings.types.d.ts} +10 -2
  86. package/lib/types/launchDarkly.types.d.ts +4 -4
  87. package/lib/types/organization.types.d.ts +2 -2
  88. package/lib/types/organizationSettings.types.d.ts +4 -0
  89. package/lib/types/recentFiles.types.d.ts +4 -1
  90. package/lib/types/users.d.ts +13 -0
  91. package/lib/util/fullscreen.util.d.ts +1 -1
  92. package/lib/util/string.d.ts +1 -0
  93. package/package.json +1 -1
  94. package/types/openapi/index.d.ts +23 -17
  95. package/types/openapi/models/AccessTypeEnum.d.ts +3 -1
  96. package/types/openapi/models/App.d.ts +1 -0
  97. package/types/openapi/models/AppRelease.d.ts +1 -0
  98. package/types/openapi/models/AppsDBEntry.d.ts +4 -0
  99. package/types/openapi/models/AppsDBEntryRequest.d.ts +3 -0
  100. package/types/openapi/models/Canvas.d.ts +10 -15
  101. package/types/openapi/models/CanvasCreate.d.ts +14 -12
  102. package/types/openapi/models/CanvasCreateRequest.d.ts +6 -5
  103. package/types/openapi/models/CanvasRecommendedFile.d.ts +6 -0
  104. package/types/openapi/models/CanvasRetrieve.d.ts +15 -13
  105. package/types/openapi/models/CanvasSection.d.ts +5 -2
  106. package/types/openapi/models/CanvasUpdate.d.ts +14 -12
  107. package/types/openapi/models/CanvasUpdateRequest.d.ts +5 -4
  108. package/types/openapi/models/CollaborationRoleEnum.d.ts +0 -4
  109. package/types/openapi/models/ContentDistributionGroupCreate.d.ts +1 -0
  110. package/types/openapi/models/DeletedApp.d.ts +1 -0
  111. package/types/openapi/models/{CanvasList.d.ts → DeletedCanvas.d.ts} +13 -9
  112. package/types/openapi/models/DeletedContentDistributionGroup.d.ts +1 -0
  113. package/types/openapi/models/DeletedEnvironment.d.ts +1 -0
  114. package/types/openapi/models/DeletedFavorite.d.ts +1 -0
  115. package/types/openapi/models/DeletedFile.d.ts +6 -0
  116. package/types/openapi/models/DeletedFolder.d.ts +4 -3
  117. package/types/openapi/models/DeletedInstance.d.ts +1 -0
  118. package/types/openapi/models/DeletedInstanceAssignmentGroup.d.ts +1 -0
  119. package/types/openapi/models/DeletedMetadataTemplate.d.ts +1 -0
  120. package/types/openapi/models/DeletedRegion.d.ts +1 -0
  121. package/types/openapi/models/Environment.d.ts +1 -0
  122. package/types/openapi/models/Favorite.d.ts +1 -0
  123. package/types/openapi/models/File.d.ts +6 -0
  124. package/types/openapi/models/FileCreate.d.ts +8 -0
  125. package/types/openapi/models/FileCreateRequest.d.ts +3 -0
  126. package/types/openapi/models/FilePermission.d.ts +4 -0
  127. package/types/openapi/models/FilePermissionRequest.d.ts +4 -0
  128. package/types/openapi/models/FileRetrieve.d.ts +8 -0
  129. package/types/openapi/models/FileRevision.d.ts +8 -0
  130. package/types/openapi/models/FileRevisionRequest.d.ts +3 -0
  131. package/types/openapi/models/FileUpdate.d.ts +8 -0
  132. package/types/openapi/models/FileUpdateRequest.d.ts +3 -0
  133. package/types/openapi/models/FileVersion.d.ts +5 -0
  134. package/types/openapi/models/Folder.d.ts +4 -3
  135. package/types/openapi/models/FolderCanvas.d.ts +11 -0
  136. package/types/openapi/models/FolderCreate.d.ts +8 -7
  137. package/types/openapi/models/FolderCreateRequest.d.ts +4 -2
  138. package/types/openapi/models/FolderFile.d.ts +3 -0
  139. package/types/openapi/models/FolderFolder.d.ts +5 -1
  140. package/types/openapi/models/FolderRetrieve.d.ts +8 -8
  141. package/types/openapi/models/FolderRule.d.ts +7 -0
  142. package/types/openapi/models/FolderRuleRequest.d.ts +7 -0
  143. package/types/openapi/models/FolderUpdate.d.ts +8 -8
  144. package/types/openapi/models/FolderUpdateRequest.d.ts +3 -0
  145. package/types/openapi/models/Instance.d.ts +1 -0
  146. package/types/openapi/models/InstanceUpdate.d.ts +1 -0
  147. package/types/openapi/models/MetadataTemplate.d.ts +1 -0
  148. package/types/openapi/models/OfflineSyncFolder.d.ts +17 -0
  149. package/types/openapi/models/OperatorEnum.d.ts +64 -0
  150. package/types/openapi/models/PaginatedCanvasList.d.ts +8 -0
  151. package/types/openapi/models/PaginatedFileRevisionList.d.ts +8 -0
  152. package/types/openapi/models/PaginatedOfflineSyncFolderList.d.ts +8 -0
  153. package/types/openapi/models/PatchedCanvasUpdateRequest.d.ts +5 -4
  154. package/types/openapi/models/PatchedFileRequest.d.ts +3 -0
  155. package/types/openapi/models/PatchedFileRevisionRequest.d.ts +3 -0
  156. package/types/openapi/models/PatchedFileUpdateRequest.d.ts +3 -0
  157. package/types/openapi/models/PatchedFolderUpdateRequest.d.ts +3 -0
  158. package/types/openapi/models/Region.d.ts +1 -0
  159. package/types/openapi/models/SearchFile.d.ts +3 -0
  160. package/types/openapi/models/SharedLink.d.ts +6 -5
  161. package/types/openapi/models/SharedLinkCanvas.d.ts +11 -0
  162. package/types/openapi/models/SharedLinkCanvasRequest.d.ts +8 -0
  163. package/types/openapi/models/SharedLinkCreate.d.ts +6 -5
  164. package/types/openapi/models/{SharedLinkInstanceSerialzier.d.ts → SharedLinkInstance.d.ts} +1 -1
  165. package/types/openapi/models/SharedLinkInstanceRequest.d.ts +5 -0
  166. package/types/openapi/models/{SharedLinkOrganizationSerialzier.d.ts → SharedLinkOrganization.d.ts} +1 -1
  167. package/types/openapi/models/SharedLinkOrganizationRequest.d.ts +6 -0
  168. package/lib/apps/canvas-builder/util/tsUtils.d.ts +0 -3
  169. package/lib/composables/useDetailsView.d.ts +0 -19
  170. package/lib/types/templateActions.d.ts +0 -10
  171. package/lib/util/gesture.util.d.ts +0 -6
  172. package/types/openapi/models/AppsDBGlobalEntry.d.ts +0 -8
  173. package/types/openapi/models/AppsDBGlobalEntryRequest.d.ts +0 -3
  174. package/types/openapi/models/AppsDBUserEntry.d.ts +0 -9
  175. package/types/openapi/models/AppsDBUserEntryRequest.d.ts +0 -3
  176. package/types/openapi/models/CanvasSectionRetrieve.d.ts +0 -7
  177. package/types/openapi/models/CanvasSectionRetrieveRequest.d.ts +0 -5
  178. package/types/openapi/models/FileRequest.d.ts +0 -13
  179. package/types/openapi/models/InstanceStorageCredentials.d.ts +0 -6
  180. package/types/openapi/models/MiniAccount.d.ts +0 -4
  181. package/types/openapi/models/PSPDFKitAuthPayload.d.ts +0 -3
  182. package/types/openapi/models/PSPDFKitAuthPayloadRequest.d.ts +0 -3
  183. package/types/openapi/models/PSPDFKitToken.d.ts +0 -7
  184. package/types/openapi/models/PSPDFKitTokenRequest.d.ts +0 -3
  185. package/types/openapi/models/PaginatedCanvasListList.d.ts +0 -8
@@ -1,24 +1,30 @@
1
1
  import { SelectedPage as ContentSelectorSelectedPage, SelectedFile as ContentSelectorSelectedFile } from '@content-selector/stores/app';
2
- import { CanvasSection, ComponentNode, EmbeddableProps, SfEvent } from '../../../../main.lib';
2
+ import { Selection } from '@content-selector/appTypes';
3
+ import { CanvasSelection } from '@canvas-selector/appTypes';
4
+ import { ComponentNode, EmbeddableProps } from '@canvas-builder/types/canvas';
5
+ import { SfEvent } from '../../../../types/sfdc';
3
6
  import { Mutable } from '../../../../types/ts';
4
- import { Canvas, User } from '../../../../../types/openapi';
7
+ import { CanvasRetrieve, User, Canvas, CanvasSection } from '../../../../../types/openapi';
5
8
  import { OpenRequestPayload } from '../../../payload.types';
6
9
 
7
10
  export declare const UI_MESSAGE: "UI_MESSAGE";
8
11
  export declare const UI_API_METHOD_TYPES: {
9
12
  readonly UI_BROADCAST: "ui_broadcast";
10
13
  readonly UI_SELECT_CONTENT: "ui_select_content";
14
+ readonly UI_SELECT_CANVASES: "ui_select_canvases";
11
15
  readonly UI_OPEN: "ui_open";
12
16
  readonly UI_EMBEDDABLE_READY: "ui_embeddable_ready";
13
17
  readonly UI_TOAST: "ui_toast";
14
18
  readonly UI_CAPTURE_APP_ERROR: "ui_capture_app_error";
15
19
  readonly UI_UPDATE_CANVAS: "ui_update_canvas";
20
+ readonly UI_OPEN_CANVAS_OVERLAY: "ui_open_canvas_overlay";
16
21
  readonly UI_UPDATE_LOCATION: "ui_update_location";
17
22
  readonly UI_PRESELECT_SFDC_MEETING_ID: "ui_preselect_sfdc_meeting_id";
18
23
  readonly UI_SET_POSTCALL_STYLE: "ui_set_postcall_style";
19
24
  readonly UI_ENABLE_POSTCALL_SUBMIT: "ui_enable_postcall_submit";
20
25
  readonly UI_DISABLE_POSTCALL_SUBMIT: "ui_disable_postcall_submit";
21
26
  readonly UI_COMPLETE_POSTCALL: "ui_complete_postcall";
27
+ readonly UI_STOP_MEETING: "ui_stop_meeting";
22
28
  readonly UI_CANVAS_NAVIGATE_NEXT_PAGE: "ui_canvas_navigate_next_page";
23
29
  readonly UI_CANVAS_NAVIGATE_PREVIOUS_PAGE: "ui_canvas_navigate_previous_page";
24
30
  readonly UI_CANVAS_NAVIGATE_PAGE: "ui_canvas_navigate_page";
@@ -34,38 +40,88 @@ export declare const UI_MESSAGE_TYPES: {
34
40
  };
35
41
  export declare const UI_NATIVE_MESSAGE_TYPES: readonly ["ui_app_set_data", "ui_app_update_data", "ui_canvas_updated"];
36
42
  export type UiBroadcastRequest = Record<string, any>;
37
- export type UiSelectContentRequest = Record<string, never>;
43
+ export type UiSelectContentRequest = {
44
+ /** Array of selections */
45
+ selections?: Selection[];
46
+ };
38
47
  export type UiSelectContentResponse = {
48
+ /** User action result */
39
49
  user_action: 'cancelled' | 'selected';
50
+ /** Selected content */
40
51
  content?: (ContentSelectorSelectedFile | ContentSelectorSelectedPage)[];
41
52
  };
53
+ export type UiSelectCanvasesRequest = {
54
+ /** Array of selections */
55
+ selections?: CanvasSelection[];
56
+ include_content?: boolean;
57
+ allowed_types?: ('canvas' | 'canvas-template' | 'section' | 'section-template')[];
58
+ };
59
+ export type UiSelectCanvasesResponse = {
60
+ /** User action result */
61
+ user_action: 'cancelled' | 'selected';
62
+ /** Selected canvases */
63
+ canvases?: Canvas[];
64
+ };
65
+ /**
66
+ * Error object to send to Pitcher sentry instance
67
+ */
42
68
  export type UiCaptureAppErrorRequest = Record<string, any>;
43
- export type UiUpdateCanvasRequest = Mutable<Canvas> & {
69
+ export type UiUpdateCanvasRequest = Mutable<CanvasRetrieve> & {
70
+ /** Comma-separated list of field keys to return from the server */
44
71
  fields?: string;
45
72
  };
46
73
  export type UiOpenRequest = OpenRequestPayload;
47
74
  export type UiCompletePostcallRequest = {
75
+ /** Indicates if the postcall was successfully submitted */
48
76
  was_successfully_submitted?: boolean;
49
77
  };
50
78
  export type UiSetPostcallStyleRequest = Record<string, any>;
51
79
  export type UiAppResizeRequest = {
80
+ /** Requested height as the number of pixels */
52
81
  height: number;
53
82
  };
54
- export type UiCanvasNavigatePageReuqest = {
83
+ export type UiCanvasNavigatePageRequest = {
84
+ /** The id of the component we want to navigate to */
55
85
  page: ComponentNode['id'];
56
86
  };
57
87
  export interface UiToastRequest {
88
+ /**
89
+ * Type of the toast, influences the default icon
90
+ * @defaultValue **REQUIRED**
91
+ */
58
92
  type: 'info' | 'error' | 'warning' | 'success' | 'loading';
93
+ /**
94
+ * Text to show inside the toast
95
+ * @defaultValue **REQUIRED**
96
+ */
59
97
  message: string;
98
+ /**
99
+ * Optional, value in milliseconds
100
+ * @defaultValue 3500
101
+ */
60
102
  duration?: number;
103
+ /**
104
+ * Visibility of the close button, default is true
105
+ * @defaultValue true
106
+ */
61
107
  closable?: boolean;
108
+ /**
109
+ * Toast won't be hidden as long as it is hovered
110
+ * @defaultValue true
111
+ */
62
112
  keepAliveOnHover?: boolean;
113
+ /**
114
+ * Set to `false` to hide the icon
115
+ * @defaultValue true
116
+ */
63
117
  showIcon?: boolean;
64
118
  }
65
119
  export interface UiPreselectSfdcMeetingIdRequest {
120
+ /** Salesforce Meeting ID */
66
121
  eventId: string;
67
122
  }
68
123
  export interface UiPreselectSfdcMeetingIdResponse {
124
+ /** Salesforce Event */
69
125
  event: SfEvent | null;
70
126
  }
71
127
  export type UiMessagePayloads = {
@@ -76,36 +132,58 @@ export type UiMessagePayloads = {
76
132
  [UI_MESSAGE_TYPES.UI_SECTION_LIST_UPDATED]: UiSectionListUpdatedPayload;
77
133
  };
78
134
  export type UiMessageEnvelope<T extends (typeof UI_MESSAGE_TYPES)[keyof typeof UI_MESSAGE_TYPES] = (typeof UI_MESSAGE_TYPES)[keyof typeof UI_MESSAGE_TYPES]> = {
135
+ /** Message type */
79
136
  type: T;
137
+ /** Message body */
80
138
  body: UiMessagePayloads[T];
81
139
  };
82
140
  export type UiMeetingCanceledPayload = {
141
+ /** Account ID */
83
142
  accountId?: string;
143
+ /** Event ID */
84
144
  eventId?: string;
85
145
  };
86
146
  export type UiAppSetDataPayload = {
147
+ /** Client name */
87
148
  client: string | null;
149
+ /** Platform name */
88
150
  platform: string | undefined;
151
+ /** User information */
89
152
  user: User | null;
153
+ /** Edit mode status */
90
154
  is_edit_mode: boolean;
155
+ /** Call status */
91
156
  in_call: boolean;
92
- canvas: Canvas;
157
+ /** Canvas data */
158
+ canvas: CanvasRetrieve;
159
+ /** Section used in canvas */
93
160
  used_in_section: CanvasSection | null;
161
+ /** Component ID */
94
162
  component_id: string;
163
+ /** Embeddable settings */
95
164
  settings: EmbeddableProps['settings'] | null;
165
+ /** Width of the canvas */
96
166
  width: string | undefined;
167
+ /** Height of the canvas */
97
168
  height: string | undefined;
169
+ /** Display mode */
98
170
  display_mode: string | undefined;
99
171
  };
100
172
  export type UiAppUpdateDataPayload = {
173
+ /** Call status */
101
174
  in_call: boolean;
175
+ /** Edit mode status */
102
176
  is_edit_mode: boolean;
103
177
  };
104
178
  export type UiCanvasUpdatedPayload = {
105
- canvas: Canvas;
179
+ /** Canvas data */
180
+ canvas: CanvasRetrieve;
106
181
  };
107
182
  export type UiSectionListUpdatedPayload = {
183
+ /** List of section IDs */
108
184
  section_list_ids: string[];
185
+ /** Section list component ID */
109
186
  section_list_component_id: string;
110
- canvas: Canvas | null;
187
+ /** Canvas data */
188
+ canvas: CanvasRetrieve | null;
111
189
  };
@@ -3,4 +3,9 @@ import { PaginatedData } from '../../../types/paginatedData';
3
3
  import { User } from '../../../../types/openapi';
4
4
 
5
5
  export declare function getUsers(payload?: GetUsersParams): Promise<PaginatedData<User>>;
6
- export declare function refreshServiceToken(payload: RefreshServiceTokenRequest): Promise<RefreshServiceTokenResponse>;
6
+ /**
7
+ * Ask for a refreshed Salesforce token. In case the token hasn't expired yet, this method will return the same token as the current one found in the (`getEnv`)[#getenv] result.
8
+ * @returns Promise resolving to an object containing the token
9
+ */
10
+ export declare function refreshServiceToken(payload?: RefreshServiceTokenRequest): Promise<RefreshServiceTokenResponse>;
11
+ export declare function refreshAccessToken(): any;
@@ -1,6 +1,7 @@
1
1
  import { Emitter } from './utils/eventEmitter';
2
- import { Favorite, File, Instance, User, Canvas } from '../../types/openapi';
2
+ import { Favorite, File, User, CanvasRetrieve } 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';
@@ -34,7 +35,7 @@ export interface PitcherEnv {
34
35
  pitcher: {
35
36
  token_claims: Record<string, any>;
36
37
  organization: PitcherOrg;
37
- instance: Instance;
38
+ instance: PitcherInstance;
38
39
  user: User;
39
40
  access_token: string;
40
41
  id_token: string;
@@ -53,6 +54,7 @@ export interface PitcherResponse {
53
54
  request: {
54
55
  id: string;
55
56
  type: string;
57
+ body?: Record<string, any>;
56
58
  };
57
59
  response: {
58
60
  status: PitcherResponseStatus;
@@ -109,54 +111,171 @@ export declare enum PitcherExternalEventName {
109
111
  OPEN_CANVAS = "open_canvas",
110
112
  START_CALL = "start_call"
111
113
  }
114
+ /**
115
+ * Base interface for update location actions.
116
+ */
112
117
  interface UpdateLocation {
118
+ /**
119
+ * The action to be performed.
120
+ */
113
121
  action: string;
114
122
  }
123
+ /**
124
+ * Represents a route in the location.
125
+ */
115
126
  export interface LocationRoute {
127
+ /**
128
+ * The path of the route.
129
+ */
116
130
  path: string;
131
+ /**
132
+ * The query parameters of the route.
133
+ */
117
134
  query: Record<string, any>;
135
+ /**
136
+ * Indicates if the route is being restored.
137
+ */
118
138
  is_restoring: boolean;
139
+ /**
140
+ * Indicates if the route is mounted.
141
+ */
119
142
  is_mounted: boolean;
120
143
  }
144
+ /**
145
+ * A record of location routes.
146
+ */
121
147
  export type LocationRoutes = Record<string, LocationRoute>;
148
+ /**
149
+ * Interface for the 'register' update location action.
150
+ */
122
151
  export interface UpdateLocationOnRegister extends UpdateLocation {
152
+ /**
153
+ * The action type.
154
+ */
123
155
  action: 'register';
156
+ /**
157
+ * The child application identifier.
158
+ */
124
159
  child_app: string;
160
+ /**
161
+ * The parent application identifier (optional).
162
+ */
125
163
  parent_app?: string;
164
+ /**
165
+ * The path of the route (optional).
166
+ */
126
167
  path?: string;
168
+ /**
169
+ * The query parameters of the route (optional).
170
+ */
127
171
  query?: Record<string, any>;
128
172
  }
173
+ /**
174
+ * Interface for the 'unregister' update location action.
175
+ */
129
176
  export interface UpdateLocationOnUnregister extends UpdateLocation {
177
+ /**
178
+ * The action type.
179
+ */
130
180
  action: 'unregister';
181
+ /**
182
+ * The application identifier.
183
+ */
131
184
  app: string;
132
185
  }
186
+ /**
187
+ * Interface for the 'update' update location action.
188
+ */
133
189
  export interface UpdateLocationOnUpdate extends UpdateLocation {
190
+ /**
191
+ * The action type.
192
+ */
134
193
  action: 'update';
194
+ /**
195
+ * The routes to be updated.
196
+ */
135
197
  routes: Record<string, Omit<LocationRoute, 'is_restoring' | 'is_mounted'>>;
136
198
  }
199
+ /**
200
+ * Interface for the 'mounted' update location action.
201
+ */
137
202
  export interface UpdateLocationOnMounted extends UpdateLocation {
203
+ /**
204
+ * The action type.
205
+ */
138
206
  action: 'mounted';
207
+ /**
208
+ * The application identifier.
209
+ */
139
210
  app: string;
140
211
  }
212
+ /**
213
+ * Interface for the 'restore' update location action.
214
+ */
141
215
  export interface UpdateLocationOnRestore extends UpdateLocation {
216
+ /**
217
+ * The action type.
218
+ */
142
219
  action: 'restore';
220
+ /**
221
+ * The routes to be restored.
222
+ */
143
223
  routes: Record<string, Omit<LocationRoute, 'is_mounted'>>;
144
224
  }
225
+ /**
226
+ * Interface for the 'restore_completed' update location action.
227
+ */
145
228
  export interface UpdateLocationOnRestoreCompleted extends UpdateLocation {
229
+ /**
230
+ * The action type.
231
+ */
146
232
  action: 'restore_completed';
233
+ /**
234
+ * The application identifier.
235
+ */
147
236
  app: string;
237
+ /**
238
+ * The path of the route.
239
+ */
148
240
  path: string;
241
+ /**
242
+ * The query parameters of the route.
243
+ */
149
244
  query: Record<string, any>;
150
245
  }
246
+ /**
247
+ * Interface for the 'get_routes_request' update location action.
248
+ */
151
249
  export interface UpdateLocationOnGetRoutesRequest extends UpdateLocation {
250
+ /**
251
+ * The action type.
252
+ */
152
253
  action: 'get_routes_request';
254
+ /**
255
+ * The application identifier.
256
+ */
153
257
  app: string;
154
258
  }
259
+ /**
260
+ * Interface for the 'get_routes_response' update location action.
261
+ */
155
262
  export interface UpdateLocationOnGetRoutesResponse extends UpdateLocation {
263
+ /**
264
+ * The action type.
265
+ */
156
266
  action: 'get_routes_response';
267
+ /**
268
+ * The application identifier.
269
+ */
157
270
  app: string;
271
+ /**
272
+ * The routes in the response.
273
+ */
158
274
  routes: LocationRoutes;
159
275
  }
276
+ /**
277
+ * Union type for all update location pitcher events.
278
+ */
160
279
  export type UpdateLocationPitcherEvent = UpdateLocationOnUnregister | UpdateLocationOnRestore | UpdateLocationOnUpdate | UpdateLocationOnRegister | UpdateLocationOnRestoreCompleted | UpdateLocationOnMounted | UpdateLocationOnGetRoutesRequest | UpdateLocationOnGetRoutesResponse;
161
280
  export interface PitcherEventMap {
162
281
  [PitcherEventName.ENV_CHANGED]: PitcherEnv;
@@ -202,7 +321,7 @@ export interface PitcherEventMap {
202
321
  */
203
322
  [PitcherEventName.EXITED_FULLSCREEN]: void;
204
323
  [PitcherEventName.CANVAS_UPDATED]: Record<string, any>;
205
- [PitcherEventName.CANVAS_UPDATED_SUCCESS]: Partial<Canvas>;
324
+ [PitcherEventName.CANVAS_UPDATED_SUCCESS]: Partial<CanvasRetrieve>;
206
325
  [PitcherEventName.UPDATE_LOCATION]: UpdateLocationPitcherEvent;
207
326
  [PitcherEventName.FILE_CLOSED]: {
208
327
  file_id?: string;