Skip to content
Merged
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: 1 addition & 1 deletion packages/pieces/community/apify/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@activepieces/piece-apify",
"version": "0.1.0"
"version": "0.1.1"
}
2 changes: 1 addition & 1 deletion packages/pieces/community/apify/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion packages/pieces/community/slack/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
username,
blocks,
mentionOriginFlow,
iconEmoji,
} from '../common/props';
import { Block,KnownBlock } from '@slack/web-api';

Expand All @@ -23,6 +24,7 @@ export const slackSendDirectMessageAction = createAction({
text,
username,
profilePicture,
iconEmoji,
mentionOriginFlow,
blocks,
unfurlLinks: Property.Checkbox({
Expand All @@ -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)[]))
}

Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
threadTs,
singleSelectChannelInfo,
mentionOriginFlow,
iconEmoji,
} from '../common/props';
import { processMessageTimestamp, slackSendMessage } from '../common/utils';
import { slackAuth } from '../../';
Expand Down Expand Up @@ -34,6 +35,7 @@ export const slackSendMessageAction = createAction({
threadTs,
username,
profilePicture,
iconEmoji,
file: Property.File({
displayName: 'Attachment',
required: false,
Expand All @@ -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');
}
Expand All @@ -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)[]))
}

Expand All @@ -88,6 +90,7 @@ export const slackSendMessageAction = createAction({
text: text || undefined,
username,
profilePicture,
iconEmoji,
conversationId: channel,
threadTs: threadTs ? processMessageTimestamp(threadTs) : undefined,
file,
Expand Down
6 changes: 6 additions & 0 deletions packages/pieces/community/slack/src/lib/common/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions packages/pieces/community/slack/src/lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const slackSendMessage = async ({
conversationId,
username,
profilePicture,
iconEmoji,
blocks,
threadTs,
token,
Expand Down Expand Up @@ -33,6 +34,7 @@ export const slackSendMessage = async ({
channel: conversationId,
username,
icon_url: profilePicture,
icon_emoji: iconEmoji,
blocks: blocks as Block[],
thread_ts: threadTs,
};
Expand All @@ -54,6 +56,7 @@ type SlackSendMessageParams = {
conversationId: string;
username?: string;
profilePicture?: string;
iconEmoji?: string;
blocks?: unknown[] | Record<string, any>;
text?: string;
file?: ApFile;
Expand Down
Loading