mirror of
https://github.com/ComfortablyCoding/strapi-plugin-website-builder.git
synced 2025-12-19 00:06:58 -05:00
3.4 KiB
3.4 KiB
Configuration API
- default
{
"shared": {},
"builds": [],
"hooks": {}
}
shared
- type:
object
default values between all builds
- example
{
"headers": {
"X-Powered-By": "Strapi CMS"
}
}
headers
- type:
functionorobject - arguments:
{ record } - description: The default headers to be sent with the request for all builds. Any build specific headers with the same nproperty ame will override these. A record is only provided to the function for event triggers.
params
- type:
functionorobject - arguments:
{ record } - description: The default parameters to be sent with the request for all builds. Any build specific params with the same property name will override these. A record is only provided to the function for event triggers.
build
- type
array
build configurations
name
- type:
string - description: The name for the build. MUST BE UNIQUE.
url
- type:
string - description: The url for the build.
trigger
-
type:
object -
description: The trigger configuration for the build.
-
type
- type:
string - description: The trigger type for the build. It can be
manual,cron, orevent.
- type:
-
expression
- type:
string - description: The cron expression to use for the
crontigger type. Required for thecrontrigger type only.
- type:
-
events
-
type:
array -
description: The events to trigger new build on. Required for the
eventtrigger type only.-
uid
- type:
string - description: The uid of the content type to watch mutations on.
- type:
-
actions
- type:
actions - description: The actions/mutations to listen for on the content type. Possible values are
create,update,delete,publish,unpublish.publishandunpublishare only available on content types, not media mutations.
- type:
-
-
-
method
- type:
string - default:
POST - description: The method to use for the request that triggers the build. Supported methods are
GETandPOST.
headers
- type:
functionorobject - arguments:
{ record } - description: The headers to be sent with the request. A record is only provided to the function for event triggers.
- example
:::: code-group
{
headers: () => ({
'X-Powered-By': 'Lorem Ipsum',
});
}
{
headers: {
'X-Powered-By': 'Lorem Ipsum',
};
}
::::
params
- type:
functionorobject - arguments:
{ record } - description: The parameters to be sent with the request. A record is only provided to the function for event triggers.
- example
:::: code-group
{
params: () => ({
lorem: 'ipsum',
});
}
{
params: {
'lorem': 'ipsum',
};
}
::::
body
- type:
functionorobject - arguments:
{ record } - description: The parameters to be sent with the request. A record is only provided to the function for event triggers.
- example
:::: code-group
{
body: () => ({
lorem: 'ipsum',
});
}
{
body: {
'lorem': 'ipsum',
};
}
::::
hooks
- type:
object
hook into specific areas to extend functionality
beforeRequest
- type:
function - arguments:
requestConfig - description: Mutate the request before it is sent out
- example
{
hooks: {
beforeRequest: (requestConfig) => {
requestConfig.headers.custom = 'custom_value';
return config;
};
}
}