Send an app error to Pitcher sentry instance.
error object to send to Pitcher sentry instance
Closes the already open file that was opened via api or by the user.
Fetches a canvas by id with the defined fields or all of them.
Fetches a list of canvases to use in your app.
// The `filters` object is a reserved payload key to transfer the metadata dict over the wire.
adminApi.getCanvases({
search: 'my search query',
ordering: '-created_at',
filters: {
metadata__mydaterangefiltername__range: ['2023-12-10', '2023-12-22'],
metadata__mymultiselectfiltername: ['optionAValue', 'optionCValue'],
},
fields: 'id,name,metadata',
})
Fetches the necessary info for the app to know where it is embedded.
Check out usePitcherApi().getEnv() for more information.
Fetches a list of metadata templates to use in your app. Instance is auto-injected by admin app if in instance scope.
Optional
payload: GetInstanceMetadataTemplatesPayloadFetches a list of users from the admin API.
Optional
payload: GetUsersParamsOptional parameters for filtering users
Promise resolving to a paginated list of users
Opens a modal to view a canvas by ID.
onMounted(() => {
adminApi.openCanvasOverlay({
id: '01HH4RCBH631K4JDHWAQB0RPR6',
edit_mode: false,
fullscreen: true,
})
})
You can also specify a position for the canvas overlay:
adminApi.openCanvasOverlay({
id: '01HH4RCBH631K4JDHWAQB0RPR6',
position: {
top: '10px',
left: '20px',
right: '20px',
bottom: '10px'
}
})
Opens the agenda selector modal to allow the user to select agenda content and handle the outcome.
const api = useApi() // or useAdmin() if you know that you 're in Admin context
adminApi.selectAgendaContent({
// optional payload
initial_agenda: {
name: 'test',
groups: []
}
})
Allows the user to select (and preselect) canvases from the instance.
This method allows you to prompt the user to select canvases from the CatalogIQ instance and use that canvas selection in your application.
optional payload to preselect specific canvases
Promise with the user action and selected canvases
const api = useApi() // or useAdmin() if you know that you 're in Admin context
api
.selectCanvases({
allowed_types: ['canvas','canvas-template','section','section-template'] // default ['canvas']
selections: [
{ id: "01HCZ623YYRFJQ0F7B69VWE510" },
{ id: "02HCZ623YYRFJQ0F7B69VWE510" },
], // default []
})
Opens the collection player selector modal to allow the user to select collection player content and handle the outcome.
const api = useApi() // or useAdmin() if you know that you 're in Admin context
adminApi.selectCollectionContent({
// optional payload
initial_data: {
name: 'test',
groups: []
}
})
Opens a selector that allows you to select (and preselect) from your Pitcher uploaded content.
Updates a canvas by ID and returns the defined fields or all of them.
API methods available in the CatalogIQ Admin.
You can store the API object in a variable and call the methods directly.
Most methods have a
snake_case
andcamelCase
version of their name available.