feat(changedetection): add create watch action
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Create a watch',
|
||||||
|
key: 'createWatch',
|
||||||
|
description: 'Creates a new change detection watch for a specific website.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'URL',
|
||||||
|
key: 'url',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description: 'Url you want to monitor',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const url = $.step.parameters.url;
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
url,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await $.http.post('/v1/watch', body);
|
||||||
|
|
||||||
|
$.setActionItem({ raw: response.data });
|
||||||
|
},
|
||||||
|
});
|
@@ -0,0 +1,3 @@
|
|||||||
|
import createWatch from './create-watch/index.js';
|
||||||
|
|
||||||
|
export default [createWatch];
|
@@ -2,6 +2,7 @@ import defineApp from '../../helpers/define-app.js';
|
|||||||
import addAuthHeader from './common/add-auth-header.js';
|
import addAuthHeader from './common/add-auth-header.js';
|
||||||
import auth from './auth/index.js';
|
import auth from './auth/index.js';
|
||||||
import setBaseUrl from './common/set-base-url.js';
|
import setBaseUrl from './common/set-base-url.js';
|
||||||
|
import actions from './actions/index.js';
|
||||||
|
|
||||||
export default defineApp({
|
export default defineApp({
|
||||||
name: 'Changedetection',
|
name: 'Changedetection',
|
||||||
@@ -14,4 +15,5 @@ export default defineApp({
|
|||||||
primaryColor: '3056d3',
|
primaryColor: '3056d3',
|
||||||
beforeRequest: [setBaseUrl, addAuthHeader],
|
beforeRequest: [setBaseUrl, addAuthHeader],
|
||||||
auth,
|
auth,
|
||||||
|
actions,
|
||||||
});
|
});
|
||||||
|
12
packages/docs/pages/apps/changedetection/actions.md
Normal file
12
packages/docs/pages/apps/changedetection/actions.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
favicon: /favicons/changedetection.svg
|
||||||
|
items:
|
||||||
|
- name: Create a watch
|
||||||
|
desc: Creates a new change detection watch for a specific website.
|
||||||
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CustomListing from '../../components/CustomListing.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<CustomListing />
|
@@ -3,6 +3,7 @@
|
|||||||
The following integrations are currently supported by Automatisch.
|
The following integrations are currently supported by Automatisch.
|
||||||
|
|
||||||
- [Carbone](/apps/carbone/actions)
|
- [Carbone](/apps/carbone/actions)
|
||||||
|
- [Changedetection](/apps/changedetection/actions)
|
||||||
- [Datastore](/apps/datastore/actions)
|
- [Datastore](/apps/datastore/actions)
|
||||||
- [DeepL](/apps/deepl/actions)
|
- [DeepL](/apps/deepl/actions)
|
||||||
- [Delay](/apps/delay/actions)
|
- [Delay](/apps/delay/actions)
|
||||||
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 9.9 KiB |
Reference in New Issue
Block a user