AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { HttpMethod } from '@activepieces/pieces-common';
import {
OAuth2PropertyValue,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { weekdoneAuth } from '../../auth';
import {
weekdoneApiCall,
weekdoneItemsDropdown,
weekdoneTeamsDropdown,
weekdoneUsersDropdown,
} from '../../common';
export const deleteItemLikeAction = createAction({
auth: weekdoneAuth,
name: 'delete_item_like',
displayName: 'Delete Item Like',
description: 'Remove your like from an item.',
audience: 'both',
aiMetadata: { description: 'Remove the authenticated user\'s like from a Weekdone item identified by its ID; the user/team/period filters only help locate the item. Mutates the item, so not idempotent.', idempotent: false },
props: {
user_id_filter: Property.Dropdown({
auth: weekdoneAuth,
displayName: 'User (Filter)',
required: false,
refreshers: [],
options: async ({ auth }) => {
if (!(auth as OAuth2PropertyValue)?.access_token) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const state = await weekdoneUsersDropdown(auth as OAuth2PropertyValue);
return {
...state,
options: [{ label: 'Me', value: 'me' as any }, ...state.options],
};
},
}),
team_id: Property.Dropdown({
auth: weekdoneAuth,
displayName: 'Team (Filter)',
required: false,
refreshers: [],
options: async ({ auth }) => {
if (!(auth as OAuth2PropertyValue)?.access_token) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
return weekdoneTeamsDropdown(auth as OAuth2PropertyValue);
},
}),
period: Property.ShortText({
displayName: 'Period (Filter)',
required: false,
}),
item_id: Property.Dropdown({
auth: weekdoneAuth,
displayName: 'Item',
required: true,
refreshers: ['user_id_filter', 'team_id', 'period'],
options: async ({ auth, user_id_filter, team_id, period }) => {
if (!(auth as OAuth2PropertyValue)?.access_token) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
return weekdoneItemsDropdown(auth as OAuth2PropertyValue, {
userId: user_id_filter as any,
teamId: team_id ? Number(team_id) : undefined,
period: period as string | undefined,
});
},
}),
},
async run({ auth, propsValue }) {
return weekdoneApiCall({
auth: auth as OAuth2PropertyValue,
method: HttpMethod.DELETE,
path: `/item/${propsValue.item_id}/likes`,
});
},
});