@pitcher/js-api 1.21.0-beta.14 → 1.21.0-beta.15

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 (98) hide show
  1. package/js-api.esm.js +101 -8
  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/apps/browser/stores/api.d.ts +164 -104
  6. package/lib/apps/browser/stores/app.d.ts +6 -1
  7. package/lib/apps/browser/stores/upload.d.ts +30 -30
  8. package/lib/apps/canvas-builder/composables/useCanvas.d.ts +508 -421
  9. package/lib/apps/canvas-builder/composables/useCanvasHistory.d.ts +86 -74
  10. package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +18 -20
  11. package/lib/apps/canvas-builder/composables/useContentSelector.d.ts +5 -5
  12. package/lib/apps/canvas-builder/composables/useInstalledEmbeddables.d.ts +4 -1
  13. package/lib/apps/canvas-builder/types/canvas.d.ts +1 -0
  14. package/lib/apps/canvas-builder/util/canvas.util.d.ts +1 -0
  15. package/lib/apps/content-selector/stores/app.d.ts +8 -1
  16. package/lib/components/CFileViewer/CFileViewer.use.d.ts +2 -4
  17. package/lib/components/CFileViewer/CFileViewerFullScreen.use.d.ts +1 -1
  18. package/lib/components/filters/filter.util.d.ts +1 -1
  19. package/lib/composables/instanceTagsActions.use.d.ts +14 -0
  20. package/lib/composables/recentFiles.use.d.ts +1 -1
  21. package/lib/composables/suggestedTags.use.d.ts +3 -0
  22. package/lib/composables/tableColumnsSettings.use.d.ts +25 -0
  23. package/lib/composables/useCanvasOverlay.d.ts +4 -4
  24. package/lib/composables/useConfirmation.d.ts +1 -0
  25. package/lib/composables/useElementHeightResize.d.ts +5 -0
  26. package/lib/composables/useFiles.d.ts +11 -0
  27. package/lib/constants/pitcherSettings.const.d.ts +4 -0
  28. package/lib/main.lib.d.ts +23 -20
  29. package/lib/sdk/api/HighLevelApi.d.ts +95 -2
  30. package/lib/sdk/api/modules/admin/canvas.admin.d.ts +4 -8
  31. package/lib/sdk/api/modules/admin/env.admin.d.ts +3 -2
  32. package/lib/sdk/api/modules/admin/files.admin.d.ts +10 -10
  33. package/lib/sdk/api/modules/admin/index.d.ts +13 -0
  34. package/lib/sdk/api/modules/admin/metadataTemplates.admin.d.ts +1 -2
  35. package/lib/sdk/api/modules/admin/types.admin.d.ts +93 -0
  36. package/lib/sdk/api/modules/canvas.d.ts +2 -4
  37. package/lib/sdk/api/modules/dsr/env.dsr.d.ts +4 -3
  38. package/lib/sdk/api/modules/dsr/index.d.ts +7 -0
  39. package/lib/sdk/api/modules/dsr/loading.dsr.d.ts +6 -0
  40. package/lib/sdk/api/modules/env.d.ts +16 -0
  41. package/lib/sdk/api/modules/favorites.d.ts +9 -0
  42. package/lib/sdk/api/modules/feedback.d.ts +3 -0
  43. package/lib/sdk/api/modules/files.d.ts +1 -2
  44. package/lib/sdk/api/modules/folders.d.ts +29 -0
  45. package/lib/sdk/api/modules/open.d.ts +6 -0
  46. package/lib/sdk/api/modules/sync.d.ts +1 -2
  47. package/lib/sdk/api/modules/ui/app-errors.ui.d.ts +12 -0
  48. package/lib/sdk/api/modules/ui/canvas.ui.d.ts +53 -0
  49. package/lib/sdk/api/modules/ui/content.ui.d.ts +36 -3
  50. package/lib/sdk/api/modules/ui/index.d.ts +107 -0
  51. package/lib/sdk/api/modules/ui/loading.ui.d.ts +15 -0
  52. package/lib/sdk/api/modules/ui/location.ui.d.ts +17 -0
  53. package/lib/sdk/api/modules/ui/post-call.ui.d.ts +25 -0
  54. package/lib/sdk/api/modules/ui/types.ui.d.ts +59 -0
  55. package/lib/sdk/api/modules/users.d.ts +4 -0
  56. package/lib/sdk/interfaces.d.ts +117 -0
  57. package/lib/sdk/main.d.ts +67 -6
  58. package/lib/sdk/payload.types.d.ts +132 -0
  59. package/lib/types/app.d.ts +11 -0
  60. package/lib/types/filter.d.ts +5 -0
  61. package/lib/types/instanceSettings.types.d.ts +8 -2
  62. package/lib/types/launchDarkly.types.d.ts +4 -4
  63. package/lib/types/organizationSettings.types.d.ts +4 -0
  64. package/lib/types/recentFiles.types.d.ts +4 -1
  65. package/lib/types/users.d.ts +13 -0
  66. package/lib/util/fullscreen.util.d.ts +1 -1
  67. package/lib/util/string.d.ts +1 -0
  68. package/package.json +1 -1
  69. package/types/openapi/index.d.ts +4 -5
  70. package/types/openapi/models/AccessTypeEnum.d.ts +3 -1
  71. package/types/openapi/models/Canvas.d.ts +1 -0
  72. package/types/openapi/models/CanvasCreate.d.ts +1 -0
  73. package/types/openapi/models/CanvasCreateRequest.d.ts +1 -0
  74. package/types/openapi/models/CanvasRetrieve.d.ts +1 -0
  75. package/types/openapi/models/CanvasUpdate.d.ts +1 -0
  76. package/types/openapi/models/CanvasUpdateRequest.d.ts +1 -0
  77. package/types/openapi/models/DeletedCanvas.d.ts +1 -0
  78. package/types/openapi/models/DeletedFolder.d.ts +3 -3
  79. package/types/openapi/models/Folder.d.ts +3 -3
  80. package/types/openapi/models/FolderCanvas.d.ts +11 -0
  81. package/types/openapi/models/FolderCreate.d.ts +7 -7
  82. package/types/openapi/models/FolderCreateRequest.d.ts +3 -2
  83. package/types/openapi/models/FolderFile.d.ts +2 -0
  84. package/types/openapi/models/FolderFolder.d.ts +4 -2
  85. package/types/openapi/models/FolderRetrieve.d.ts +7 -8
  86. package/types/openapi/models/FolderRule.d.ts +7 -0
  87. package/types/openapi/models/FolderRuleRequest.d.ts +7 -0
  88. package/types/openapi/models/FolderUpdate.d.ts +7 -8
  89. package/types/openapi/models/FolderUpdateRequest.d.ts +2 -0
  90. package/types/openapi/models/OperatorEnum.d.ts +64 -0
  91. package/types/openapi/models/PatchedCanvasUpdateRequest.d.ts +1 -0
  92. package/types/openapi/models/PatchedFolderUpdateRequest.d.ts +2 -0
  93. package/lib/composables/useDetailsView.d.ts +0 -19
  94. package/types/openapi/models/FileRequest.d.ts +0 -16
  95. package/types/openapi/models/PSPDFKitAuthPayload.d.ts +0 -3
  96. package/types/openapi/models/PSPDFKitAuthPayloadRequest.d.ts +0 -3
  97. package/types/openapi/models/PSPDFKitToken.d.ts +0 -7
  98. package/types/openapi/models/PSPDFKitTokenRequest.d.ts +0 -3
package/js-api.esm.js CHANGED
@@ -2974,13 +2974,10 @@ function createHttpClient(origin, token) {
2974
2974
  }
2975
2975
 
2976
2976
  function normalizeNetworkFilterParams(params) {
2977
+ if (!params) return {};
2977
2978
  return Object.entries(params).reduce(
2978
2979
  (acc, [key, value]) => {
2979
- if (key.endsWith("__range") && Array.isArray(value)) {
2980
- acc[key] = value.join(",");
2981
- } else {
2982
- acc[key] = value;
2983
- }
2980
+ acc[key] = key.endsWith("__range") && Array.isArray(value) ? value.join(",") : value;
2984
2981
  return acc;
2985
2982
  },
2986
2983
  {}
@@ -3177,15 +3174,105 @@ function createHighLevelApi(options) {
3177
3174
  return {
3178
3175
  API,
3179
3176
  ...modules,
3177
+ /**
3178
+ * Subscribe to a given event type by its key.
3179
+ *
3180
+ * @param {string} type - The event type to subscribe to.
3181
+ * @param {(payload: PitcherEvent) => void} callback - The callback function to handle the event.
3182
+ * @returns A Promise resolving to a cleanup function to unsubscribe from the event. * @example
3183
+ *
3184
+ * @example
3185
+ * const unsubscribeFromSectionListUpdate = usePitcherApi().on('entered_fullscreen', (event: object) => {
3186
+ * // handle event
3187
+ * })
3188
+ * // later
3189
+ * unsubscribeFromSectionListUpdate()
3190
+ */
3180
3191
  on: (type, callback) => eventEmitter.on(type, callback),
3192
+ /**
3193
+ * Unsubscribe from a given event type by its key and the attached callback reference.
3194
+ * @param {string} type - The event type to unsubscribe from.
3195
+ * @param {(payload: PitcherEvent) => void} callback - The callback function reference to remove.
3196
+ *
3197
+ * @example
3198
+ * const callback = (event: object) => {
3199
+ * // handle event
3200
+ * }
3201
+ * usePitcherApi().on('entered_fullscreen', callback)
3202
+ * // later
3203
+ * usePitcherApi().off('entered_fullscreen', callback)
3204
+ */
3181
3205
  off: (type, callback) => eventEmitter.off(type, callback),
3206
+ /**
3207
+ * Make the entire CatalogIQ fullscreen.
3208
+ *
3209
+ * @example
3210
+ * usePitcherApi().enterFullscreen()
3211
+ */
3182
3212
  enterFullscreen: () => API.request("enter_fullscreen"),
3213
+ /**
3214
+ * Exit fullscreen mode.
3215
+ *
3216
+ * @example
3217
+ * usePitcherApi().exitFullscreen()
3218
+ */
3183
3219
  exitFullscreen: () => API.request("exit_fullscreen"),
3220
+ /**
3221
+ * Return is CatalogIQ in fullscreen.
3222
+ *
3223
+ * @example
3224
+ * usePitcherApi().isFullscreen()
3225
+ */
3226
+ isFullscreen: () => API.request("is_fullscreen"),
3227
+ /**
3228
+ * Log out the current user.
3229
+ *
3230
+ * @example
3231
+ * usePitcherApi().logout()
3232
+ */
3184
3233
  logout: () => API.request("logout"),
3234
+ /**
3235
+ * Quit the current instance and go to the instance selection screen.
3236
+ *
3237
+ * @example
3238
+ * usePitcherApi().quitInstance()
3239
+ */
3185
3240
  quitInstance: () => API.request("quit_instance"),
3241
+ /**
3242
+ * Get the request types.
3243
+ *
3244
+ * @returns {Promise<any>}
3245
+ */
3186
3246
  getRequestTypes: () => API.request("get_request_types"),
3247
+ /**
3248
+ * Broadcast an event to CatalogIQ.
3249
+ * @param {PitcherEvent} event - The event to broadcast.
3250
+ *
3251
+ * @example
3252
+ * usePitcherApi()
3253
+ * .broadcast({
3254
+ * type: "canvas_updated",
3255
+ * body: { context: { myContextProperty: 'test' } },
3256
+ * })
3257
+ * .then(function (result) {
3258
+ * useUi().toast({
3259
+ * message: "Canvas Populated.",
3260
+ * type: "info",
3261
+ * })
3262
+ * })
3263
+ */
3187
3264
  broadcast: (event) => API.request("broadcast", event),
3265
+ /**
3266
+ * Subscribe to updates.
3267
+ *
3268
+ * @returns {Promise<void>}
3269
+ */
3188
3270
  subscribe: () => API.request("subscribe"),
3271
+ /**
3272
+ * Unsubscribe from updates.
3273
+ *
3274
+ * @returns {Promise<void>}
3275
+ */
3189
3276
  unsubscribe: () => API.request("unsubscribe")
3190
3277
  };
3191
3278
  }
@@ -3211,6 +3298,7 @@ const UI_API_METHOD_TYPES = {
3211
3298
  UI_ENABLE_POSTCALL_SUBMIT: "ui_enable_postcall_submit",
3212
3299
  UI_DISABLE_POSTCALL_SUBMIT: "ui_disable_postcall_submit",
3213
3300
  UI_COMPLETE_POSTCALL: "ui_complete_postcall",
3301
+ UI_STOP_MEETING: "ui_stop_meeting",
3214
3302
  UI_CANVAS_NAVIGATE_NEXT_PAGE: "ui_canvas_navigate_next_page",
3215
3303
  UI_CANVAS_NAVIGATE_PREVIOUS_PAGE: "ui_canvas_navigate_previous_page",
3216
3304
  UI_CANVAS_NAVIGATE_PAGE: "ui_canvas_navigate_page",
@@ -3320,7 +3408,7 @@ async function canvas_navigate_page(payload) {
3320
3408
  }
3321
3409
  async function openCanvasOverlay$1(payload) {
3322
3410
  const pr = await usePostRobot();
3323
- await pr.send(window, UI_API_METHOD_TYPES.UI_OPEN_CANVAS_OVERLAY, payload);
3411
+ await pr.send(window.parent, UI_API_METHOD_TYPES.UI_OPEN_CANVAS_OVERLAY, payload);
3324
3412
  }
3325
3413
 
3326
3414
  const canvasUi = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
@@ -3338,6 +3426,10 @@ async function complete_postcall(payload) {
3338
3426
  const pr = await usePostRobot();
3339
3427
  pr.send(window.parent, UI_API_METHOD_TYPES.UI_COMPLETE_POSTCALL, payload);
3340
3428
  }
3429
+ async function stop_meeting() {
3430
+ const pr = await usePostRobot();
3431
+ pr.send(window.parent, UI_API_METHOD_TYPES.UI_STOP_MEETING);
3432
+ }
3341
3433
  async function enable_postcall_submit() {
3342
3434
  const pr = await usePostRobot();
3343
3435
  pr.send(window.parent, UI_API_METHOD_TYPES.UI_ENABLE_POSTCALL_SUBMIT);
@@ -3356,7 +3448,8 @@ const postCallUi = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty
3356
3448
  complete_postcall,
3357
3449
  disable_postcall_submit,
3358
3450
  enable_postcall_submit,
3359
- set_postcall_style
3451
+ set_postcall_style,
3452
+ stop_meeting
3360
3453
  }, Symbol.toStringTag, { value: 'Module' }));
3361
3454
 
3362
3455
  async function on_native(type, handler) {
@@ -3470,7 +3563,7 @@ async function updateCanvas(payload) {
3470
3563
  }
3471
3564
  async function openCanvasOverlay(payload) {
3472
3565
  const pr = await usePostRobot();
3473
- await pr.send(window, ADMIN_API_METHOD_TYPES.OPEN_CANVAS_OVERLAY, payload);
3566
+ await pr.send(window.parent, ADMIN_API_METHOD_TYPES.OPEN_CANVAS_OVERLAY, payload);
3474
3567
  }
3475
3568
 
3476
3569
  const canvasAdmin = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({