Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ff0dd0b415 | ||
![]() |
f0b5d85a7a |
@@ -0,0 +1,70 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create board',
|
||||
key: 'createBoard',
|
||||
description: 'Creates a new board.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Board Name',
|
||||
key: 'boardName',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'Title for the board.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Board Kind',
|
||||
key: 'boardKind',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
options: [
|
||||
{
|
||||
label: 'Main',
|
||||
value: 'public',
|
||||
},
|
||||
{
|
||||
label: 'Private',
|
||||
value: 'private',
|
||||
},
|
||||
{
|
||||
label: 'Shareable',
|
||||
value: 'share',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Template ID',
|
||||
key: 'templateId',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
"When you switch on developer mode, you'll spot the template IDs in your template store. Additionally, you have the option to utilize the Board ID from any board you've saved as a template.",
|
||||
variables: true,
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const { boardName, boardKind, templateId } = $.step.parameters;
|
||||
|
||||
const body = {
|
||||
query: `mutation {
|
||||
create_board (board_name: "${boardName}", board_kind: ${boardKind}${
|
||||
templateId ? `, template_id: ${templateId}` : ''
|
||||
}) {
|
||||
id
|
||||
name
|
||||
board_kind
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
const { data } = await $.http.post('/', body);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
3
packages/backend/src/apps/monday/actions/index.js
Normal file
3
packages/backend/src/apps/monday/actions/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import createBoard from './create-board/index.js';
|
||||
|
||||
export default [createBoard];
|
@@ -1,6 +1,8 @@
|
||||
import defineApp from '../../helpers/define-app.js';
|
||||
import addAuthHeader from './common/add-auth-header.js';
|
||||
import auth from './auth/index.js';
|
||||
import triggers from './triggers/index.js';
|
||||
import actions from './actions/index.js';
|
||||
|
||||
export default defineApp({
|
||||
name: 'Monday',
|
||||
@@ -13,4 +15,6 @@ export default defineApp({
|
||||
primaryColor: 'F62B54',
|
||||
beforeRequest: [addAuthHeader],
|
||||
auth,
|
||||
triggers,
|
||||
actions,
|
||||
});
|
||||
|
3
packages/backend/src/apps/monday/triggers/index.js
Normal file
3
packages/backend/src/apps/monday/triggers/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import newBoards from './new-boards/index.js';
|
||||
|
||||
export default [newBoards];
|
@@ -0,0 +1,29 @@
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New board',
|
||||
key: 'newBoard',
|
||||
pollInterval: 15,
|
||||
description: 'Triggers when a new board is created.',
|
||||
|
||||
async run($) {
|
||||
const body = {
|
||||
query: 'query { boards { id, name } }',
|
||||
};
|
||||
|
||||
const { data } = await $.http.post('/', body);
|
||||
|
||||
if (!data?.data?.boards?.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const board of data.data.boards) {
|
||||
$.pushTriggerItem({
|
||||
raw: board,
|
||||
meta: {
|
||||
internalId: board.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
@@ -228,7 +228,11 @@ export default defineConfig({
|
||||
text: 'Monday',
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
items: [{ text: 'Connection', link: '/apps/monday/connection' }],
|
||||
items: [
|
||||
{ text: 'Actions', link: '/apps/monday/actions' },
|
||||
{ text: 'Triggers', link: '/apps/monday/triggers' },
|
||||
{ text: 'Connection', link: '/apps/monday/connection' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Notion',
|
||||
|
12
packages/docs/pages/apps/monday/actions.md
Normal file
12
packages/docs/pages/apps/monday/actions.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
favicon: /favicons/monday.svg
|
||||
items:
|
||||
- name: Create board
|
||||
desc: Creates a new board.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import CustomListing from '../../components/CustomListing.vue'
|
||||
</script>
|
||||
|
||||
<CustomListing />
|
12
packages/docs/pages/apps/monday/triggers.md
Normal file
12
packages/docs/pages/apps/monday/triggers.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
favicon: /favicons/monday.svg
|
||||
items:
|
||||
- name: New board
|
||||
desc: Triggers when a new board is created.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import CustomListing from '../../components/CustomListing.vue'
|
||||
</script>
|
||||
|
||||
<CustomListing />
|
@@ -23,6 +23,7 @@ The following integrations are currently supported by Automatisch.
|
||||
- [Invoice Ninja](/apps/invoice-ninja/triggers)
|
||||
- [Mattermost](/apps/mattermost/actions)
|
||||
- [Miro](/apps/miro/actions)
|
||||
- [Monday](/apps/monday/triggers)
|
||||
- [Notion](/apps/notion/triggers)
|
||||
- [Ntfy](/apps/ntfy/actions)
|
||||
- [Odoo](/apps/odoo/actions)
|
||||
|
Reference in New Issue
Block a user