FlotiqPluginApiClient¶
class FlotiqPluginApiClient¶
Type definition for the API client provided to plugins. It is a proxy to the Flotiq API client, which checks plugin permissions before making any API calls. Each content type has the same set of methods available, but they will check permissions for the given content type before making any API calls.
Properties
| Name | Type | Description |
|---|---|---|
key: string (optional) |
FlotiqPluginApiClientMethods | Methods for a specific content type. The content type name is dynamic and depends on the content types available in the Flotiq account. |
getMediaUrl |
FlotiqPluginApiClientGetMediaUrl | Generate url for media. Use width/height params to generate url for resized image. Will throw an error without access to the media. |
getContentTypes |
FlotiqPluginApiClientGetContentTypes | Get list of content types with provided parameters. Will throw an error without access to the all content types. |
function FlotiqPluginApiClientGetContentTypes¶
Query parameters for content types list (e.g. limit, page etc.)
Returns
- Promise<ContentTypeDefinition[]>
Parameters
| Name | Type | Description |
|---|---|---|
params |
ApiRequestObject |
function FlotiqPluginApiClientGetMediaUrl¶
Media data object
Returns
- string
Parameters
| Name | Type | Description |
|---|---|---|
mediaData |
(Media\|MediaHydrated) |
|
height |
number |
|
width |
number |
class FlotiqPluginApiClientMethods¶
Type definition for the API client methods provided to plugins.
Properties
| Name | Type | Description |
|---|---|---|
get |
get | Get a content object, passing id as an argument. Will throw an error without access to the content type. |
getVersions |
getVersions | Get a content object versions, passing id as an argument. Will throw an error without access to the content type. |
getVersion |
getVersion | Get a content object version, passing id and version as arguments. Will throw an error without access to the content type. |
list |
list | List content objects, passing query parameters as an argument. Will throw an error without access to the content type. |
post |
post | Create a content object, passing object as an argument. Will throw an error without access to the content type. |
put |
put | Update a content object, passing id and object as arguments. Will throw an error without access to the content type. |
patch |
patch | Update part of a content object, passing id and object as arguments. Will throw an error without access to the content type. |
delete |
delete | Delete a content object, passing id as an argument. Will throw an error without access to the content type. |
getContentType |
getContentType | Get the content type definition. Will throw an error without access to the content type. |
putContentType |
putContentType | Update the content type definition. Will throw an error without access to the content type. |
function delete¶
Delete a content object, passing id as an argument. Will throw an error without access to the content type.
Returns
- Promise<void>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
function get¶
Get a content object, passing id as an argument. Will throw an error without access to the content type.
Returns
- Promise<ContentObject>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
function getContentType¶
Get the content type definition. Will throw an error without access to the content type.
Returns
- Promise<ContentTypeDefinition>
function getVersion¶
Get a content object version, passing id and version as arguments. Will throw an error without access to the content type.
Returns
- Promise<ContentObject>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
|
version |
string |
function getVersions¶
Get a content object versions, passing id as an argument. Will throw an error without access to the content type.
Returns
- Promise<ContentObject[]>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
function list¶
List content objects, passing query parameters as an argument. Will throw an error without access to the content type.
Returns
- Promise<ContentObject[]>
Parameters
| Name | Type | Description |
|---|---|---|
params |
ApiRequestObject |
function patch¶
Update part of a content object, passing id and object as arguments. Will throw an error without access to the content type.
Returns
- Promise<ContentObject>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
|
object |
Partial<ContentObject> |
function post¶
Create a content object, passing object as an argument. Will throw an error without access to the content type.
Returns
- Promise<ContentObject>
Parameters
| Name | Type | Description |
|---|---|---|
object |
WithOptionalInternalProps<ContentObject> |
function put¶
Update a content object, passing id and object as arguments. Will throw an error without access to the content type.
Returns
- Promise<ContentObject>
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
|
object |
WithOptionalInternalProps<ContentObject> |
function putContentType¶
Update the content type definition. Will throw an error without access to the content type.
Returns
- Promise<ContentTypeDefinition>
Parameters
| Name | Type | Description |
|---|---|---|
object |
WithOptionalInternalProps<ContentTypeDefinition> |