scheduledActions
For use with Netlify Visual Editor only.
connector.scheduledActions(opts)
Used to add support in Visual Editor for scheduled publishing with your data source.
After you define the functions for creating and modifying scheduled events on your data source, Netlify will expose a models.ScheduledAction
interface that you can use in connector.sync()
.
Note that this only works if your data source offers support for scheduled publishing or scheduled actions.
Takes an object where the keys are functions defined by your connector. The object contains the following properties:
Parameter | Description |
---|---|
create | Used to create a new scheduled event in your data source. |
delete | Used to delete a previously scheduled event in your data source. |
update | Used to update a previously scheduled event in your data source. |
create
Receives a function to create a new scheduled event in your data source. The function is passed an object as the first parameter with the following properties:
Property | Description |
---|---|
scheduledAction | Object representing the action to schedule. |
state | Object containing data stored in initState when addConnector runs. |
Usage example
delete
Receives a function to delete a previously scheduled event in your data source. The function is passed an object as the first parameter with the following properties:
Property | Description |
---|---|
scheduledAction | Object representing the action to delete. |
state | Object containing data stored in initState when addConnector runs. |
Usage example
update
Receives a function to update a previously scheduled event in your data source. The function is passed an object as the first parameter with the following properties:
Property | Description |
---|---|
scheduledAction | Object representing the action to update. |
state | Object containing data stored in initState when addConnector runs. |
Usage example
scheduledAction
Object representing the action to schedule on the data source. The object contains the following properties:
Parameter | Description |
---|---|
name | String representing the name of the action to be scheduled. |
action | ConnectorScheduledActionActionType representing the type of action. |
documentIds | Array of strings representing the Document ID values to be scheduled. |
executeAt | ISO-formatted string used to determine the time at which the event should be triggered. |