Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(monday): add new boards trigger #1856

Open
wants to merge 1 commit into
base: AUT-962
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/backend/src/apps/monday/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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';

export default defineApp({
name: 'Monday',
Expand All @@ -13,4 +14,5 @@ export default defineApp({
primaryColor: 'F62B54',
beforeRequest: [addAuthHeader],
auth,
triggers,
});
3 changes: 3 additions & 0 deletions packages/backend/src/apps/monday/triggers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import newBoards from './new-boards/index.js';

export default [newBoards];
29 changes: 29 additions & 0 deletions packages/backend/src/apps/monday/triggers/new-boards/index.js
Original file line number Diff line number Diff line change
@@ -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,
},
});
}
},
});
5 changes: 4 additions & 1 deletion packages/docs/pages/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ export default defineConfig({
text: 'Monday',
collapsible: true,
collapsed: true,
items: [{ text: 'Connection', link: '/apps/monday/connection' }],
items: [
{ text: 'Triggers', link: '/apps/monday/triggers' },
{ text: 'Connection', link: '/apps/monday/connection' },
],
},
{
text: 'Notion',
Expand Down
12 changes: 12 additions & 0 deletions packages/docs/pages/apps/monday/triggers.md
Original file line number Diff line number Diff line change
@@ -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 />
1 change: 1 addition & 0 deletions packages/docs/pages/guide/available-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading