diff --git a/packages/pieces/community/apify/package.json b/packages/pieces/community/apify/package.json index 89580a0302d..2697ae27109 100644 --- a/packages/pieces/community/apify/package.json +++ b/packages/pieces/community/apify/package.json @@ -1,4 +1,4 @@ { "name": "@activepieces/piece-apify", - "version": "0.1.0" + "version": "0.1.1" } diff --git a/packages/pieces/community/apify/src/index.ts b/packages/pieces/community/apify/src/index.ts index 417bb1d7151..2210bed3015 100644 --- a/packages/pieces/community/apify/src/index.ts +++ b/packages/pieces/community/apify/src/index.ts @@ -35,7 +35,7 @@ export const apify = createPiece({ description: 'Your full‑stack platform for web scraping', auth: apifyAuth, minimumSupportedRelease: '0.30.0', - logoUrl: 'https://cdn.activepieces.com/pieces/apify.svg', + logoUrl: 'https://cdn.activepieces.com/pieces/apify.png', categories: [PieceCategory.BUSINESS_INTELLIGENCE], authors: ['buttonsbond'], actions: [getDatasetItems, getActors, getLastRun, startActor], diff --git a/packages/pieces/community/slack/package.json b/packages/pieces/community/slack/package.json index c64169892bf..67efb4ba9be 100644 --- a/packages/pieces/community/slack/package.json +++ b/packages/pieces/community/slack/package.json @@ -1,6 +1,6 @@ { "name": "@activepieces/piece-slack", - "version": "0.11.2", + "version": "0.11.3", "dependencies": { "@slack/web-api": "7.9.0", "slackify-markdown": "4.4.0" diff --git a/packages/pieces/community/slack/src/lib/actions/send-direct-message-action.ts b/packages/pieces/community/slack/src/lib/actions/send-direct-message-action.ts index 71c84b17e45..47dd073c912 100644 --- a/packages/pieces/community/slack/src/lib/actions/send-direct-message-action.ts +++ b/packages/pieces/community/slack/src/lib/actions/send-direct-message-action.ts @@ -9,6 +9,7 @@ import { username, blocks, mentionOriginFlow, + iconEmoji, } from '../common/props'; import { Block,KnownBlock } from '@slack/web-api'; @@ -23,6 +24,7 @@ export const slackSendDirectMessageAction = createAction({ text, username, profilePicture, + iconEmoji, mentionOriginFlow, blocks, unfurlLinks: Property.Checkbox({ @@ -42,7 +44,7 @@ export const slackSendDirectMessageAction = createAction({ const blockList: (KnownBlock | Block)[] = [{ type: 'section', text: { type: 'mrkdwn', text } }] - if(blocks && Array.isArray(blocks)) { + if(blocks && Array.isArray(blocks)) { blockList.push(...(blocks as unknown as (KnownBlock | Block)[])) } @@ -60,6 +62,7 @@ export const slackSendDirectMessageAction = createAction({ text, username: context.propsValue.username, profilePicture: context.propsValue.profilePicture, + iconEmoji: context.propsValue.iconEmoji, conversationId: userId, blocks:blockList, unfurlLinks, diff --git a/packages/pieces/community/slack/src/lib/actions/send-message-action.ts b/packages/pieces/community/slack/src/lib/actions/send-message-action.ts index b66e65c6b5a..cab0d4109ae 100644 --- a/packages/pieces/community/slack/src/lib/actions/send-message-action.ts +++ b/packages/pieces/community/slack/src/lib/actions/send-message-action.ts @@ -7,6 +7,7 @@ import { threadTs, singleSelectChannelInfo, mentionOriginFlow, + iconEmoji, } from '../common/props'; import { processMessageTimestamp, slackSendMessage } from '../common/utils'; import { slackAuth } from '../../'; @@ -34,6 +35,7 @@ export const slackSendMessageAction = createAction({ threadTs, username, profilePicture, + iconEmoji, file: Property.File({ displayName: 'Attachment', required: false, @@ -54,11 +56,11 @@ export const slackSendMessageAction = createAction({ blocks, }, async run(context) { - const { text, channel,sendAsBot, username, profilePicture, threadTs, file, mentionOriginFlow, blocks, replyBroadcast, unfurlLinks } = + const { text, channel,sendAsBot, username, profilePicture, iconEmoji, threadTs, file, mentionOriginFlow, blocks, replyBroadcast, unfurlLinks } = context.propsValue; - + const token = sendAsBot ?context.auth.access_token :context.auth.data?.authed_user?.access_token ; - + if (!text && (!blocks || !Array.isArray(blocks) || blocks.length === 0)) { throw new Error('Either Message or Block Kit blocks must be provided'); } @@ -70,7 +72,7 @@ export const slackSendMessageAction = createAction({ blockList.push({ type: 'section', text: { type: 'mrkdwn', text } }); } - if(blocks && Array.isArray(blocks) && blocks.length > 0) { + if(blocks && Array.isArray(blocks) && blocks.length > 0) { blockList.push(...(blocks as unknown as (KnownBlock | Block)[])) } @@ -88,6 +90,7 @@ export const slackSendMessageAction = createAction({ text: text || undefined, username, profilePicture, + iconEmoji, conversationId: channel, threadTs: threadTs ? processMessageTimestamp(threadTs) : undefined, file, diff --git a/packages/pieces/community/slack/src/lib/common/props.ts b/packages/pieces/community/slack/src/lib/common/props.ts index ae442c453ba..4e893ed3564 100644 --- a/packages/pieces/community/slack/src/lib/common/props.ts +++ b/packages/pieces/community/slack/src/lib/common/props.ts @@ -62,6 +62,12 @@ export const profilePicture = Property.ShortText({ required: false, }); +export const iconEmoji = Property.ShortText({ + displayName: 'Icon Emoji', + description: 'The icon emoji of the bot', + required: false, +}); + export const threadTs = Property.ShortText({ displayName: 'Reply to Thread (Thread Message Link/Timestamp)', description: diff --git a/packages/pieces/community/slack/src/lib/common/utils.ts b/packages/pieces/community/slack/src/lib/common/utils.ts index 98750e81cf8..3e274feb850 100644 --- a/packages/pieces/community/slack/src/lib/common/utils.ts +++ b/packages/pieces/community/slack/src/lib/common/utils.ts @@ -6,6 +6,7 @@ export const slackSendMessage = async ({ conversationId, username, profilePicture, + iconEmoji, blocks, threadTs, token, @@ -33,6 +34,7 @@ export const slackSendMessage = async ({ channel: conversationId, username, icon_url: profilePicture, + icon_emoji: iconEmoji, blocks: blocks as Block[], thread_ts: threadTs, }; @@ -54,6 +56,7 @@ type SlackSendMessageParams = { conversationId: string; username?: string; profilePicture?: string; + iconEmoji?: string; blocks?: unknown[] | Record; text?: string; file?: ApFile;