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 docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
activepieces:
image: ghcr.io/activepieces/activepieces:0.78.0
image: ghcr.io/activepieces/activepieces:0.78.1
container_name: activepieces
restart: unless-stopped
## Enable the following line if you already use AP_EXECUTION_MODE with SANDBOX_PROCESS or old activepieces, checking the breaking change documentation for more info.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "activepieces",
"version": "0.78.0",
"version": "0.78.1",
"rcVersion": "0.78.0-rc.0",
"scripts": {
"prepare": "husky install",
Expand Down
2 changes: 1 addition & 1 deletion packages/pieces/community/google-sheets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-google-sheets",
"version": "0.14.4",
"version": "0.14.5",
"dependencies": {
"csv-parse": "5.6.0",
"googleapis": "129.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const exportSheetAction = createAction({
token: await getAccessToken(auth),
},
responseType: 'arraybuffer',
followRedirects: true,
});

if (returnAsText) {
Expand Down
33 changes: 33 additions & 0 deletions packages/pieces/community/kapso/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions packages/pieces/community/kapso/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pieces-kapso

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build pieces-kapso` to build the library.
19 changes: 19 additions & 0 deletions packages/pieces/community/kapso/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/pieces/community/kapso/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@activepieces/piece-kapso",
"version": "0.0.1",
"type": "commonjs",
"main": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"@kapso/whatsapp-cloud-api": "^0.1.1",
"tslib": "^2.3.0"
}
}
66 changes: 66 additions & 0 deletions packages/pieces/community/kapso/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "pieces-kapso",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/kapso/src",
"projectType": "library",
"release": {
"version": {
"manifestRootsToUpdate": [
"dist/{projectRoot}"
],
"currentVersionResolver": "git-tag",
"fallbackCurrentVersionResolver": "disk"
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/kapso",
"tsConfig": "packages/pieces/community/kapso/tsconfig.lib.json",
"packageJson": "packages/pieces/community/kapso/package.json",
"main": "packages/pieces/community/kapso/src/index.ts",
"assets": [
"packages/pieces/community/kapso/*.md",
{
"input": "packages/pieces/community/kapso/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true,
"clean": false
},
"dependsOn": [
"prebuild",
"^build"
]
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"prebuild": {
"dependsOn": [
"^build"
],
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/kapso",
"command": "bun install --no-save --silent"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
}
}
}
56 changes: 56 additions & 0 deletions packages/pieces/community/kapso/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { kapsoAuth, KAPSO_BASE_URL } from './lib/common';
import { sendTextMessage } from './lib/actions/send-text-message';
import { sendButtons } from './lib/actions/send-buttons';
import { sendList } from './lib/actions/send-list';
import { sendImage } from './lib/actions/send-image';
import { sendVideo } from './lib/actions/send-video';
import { sendAudio } from './lib/actions/send-audio';
import { sendDocument } from './lib/actions/send-document';
import { sendSticker } from './lib/actions/send-sticker';
import { sendLocation } from './lib/actions/send-location';
import { requestLocation } from './lib/actions/request-location';
import { sendContact } from './lib/actions/send-contact';
import { sendReaction } from './lib/actions/send-reaction';
import { markAsRead } from './lib/actions/mark-as-read';
import { sendTemplate } from './lib/actions/send-template';
import { newMessage } from './lib/triggers/new-message';
import { messageStatusUpdate } from './lib/triggers/message-status-update';

export const kapso = createPiece({
displayName: 'Kapso',
description: 'Send and receive WhatsApp messages, media, templates, and more using the Kapso WhatsApp API.',
auth: kapsoAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/kapso.png',
categories: [PieceCategory.COMMUNICATION],
authors: ['onyedikachi-david'],
actions: [
sendTextMessage,
sendButtons,
sendList,
sendImage,
sendVideo,
sendAudio,
sendDocument,
sendSticker,
sendLocation,
requestLocation,
sendContact,
sendReaction,
markAsRead,
sendTemplate,
createCustomApiCallAction({
auth: kapsoAuth,
baseUrl: () => KAPSO_BASE_URL,
authMapping: async (auth) => {
return {
'X-API-Key': auth.secret_text,
};
},
}),
],
triggers: [newMessage, messageStatusUpdate],
});
30 changes: 30 additions & 0 deletions packages/pieces/community/kapso/src/lib/actions/mark-as-read.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { kapsoAuth } from '../common';
import { makeClient } from '../common';
import { phoneNumberIdDropdown } from '../common/props';

export const markAsRead = createAction({
auth: kapsoAuth,
name: 'mark_as_read',
displayName: 'Mark Message as Read',
description: 'Mark a WhatsApp message as read.',
props: {
phoneNumberId: phoneNumberIdDropdown,
messageId: Property.ShortText({
displayName: 'Message ID',
description: 'The ID of the message to mark as read.',
required: true,
}),
},
async run(context) {
const { phoneNumberId, messageId } = context.propsValue;
const client = makeClient(context.auth.secret_text);

const response = await client.messages.markRead({
phoneNumberId,
messageId,
});

return response;
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { kapsoAuth } from '../common';
import { makeClient } from '../common';
import { phoneNumberIdDropdown } from '../common/props';

export const requestLocation = createAction({
auth: kapsoAuth,
name: 'request_user_location',
displayName: 'Request User Location',
description: 'Send a location request message to a WhatsApp user.',
props: {
phoneNumberId: phoneNumberIdDropdown,
to: Property.ShortText({
displayName: 'Recipient Phone Number',
description:
'The recipient\'s phone number in international format (e.g. 15551234567).',
required: true,
}),
bodyText: Property.LongText({
displayName: 'Body Text',
description: 'The message body displayed with the location request.',
required: true,
}),
},
async run(context) {
const { phoneNumberId, to, bodyText } = context.propsValue;
const client = makeClient(context.auth.secret_text);

const response = await client.messages.sendInteractiveLocationRequest({
phoneNumberId,
to,
bodyText,
parameters: {
requestMessage: bodyText,
},
});

return response;
},
});
45 changes: 45 additions & 0 deletions packages/pieces/community/kapso/src/lib/actions/send-audio.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { kapsoAuth } from '../common';
import { makeClient } from '../common';
import { phoneNumberIdDropdown } from '../common/props';

export const sendAudio = createAction({
auth: kapsoAuth,
name: 'send_audio',
displayName: 'Send Audio',
description: 'Send an audio message via WhatsApp.',
props: {
phoneNumberId: phoneNumberIdDropdown,
to: Property.ShortText({
displayName: 'Recipient Phone Number',
description:
'The recipient\'s phone number in international format (e.g. 15551234567).',
required: true,
}),
audioUrl: Property.ShortText({
displayName: 'Audio URL',
description: 'Public URL of the audio file to send.',
required: false,
}),
audioId: Property.ShortText({
displayName: 'Audio Media ID',
description: 'Media ID of a previously uploaded audio. Use either URL or Media ID.',
required: false,
}),
},
async run(context) {
const { phoneNumberId, to, audioUrl, audioId } = context.propsValue;
const client = makeClient(context.auth.secret_text);

const response = await client.messages.sendAudio({
phoneNumberId,
to,
audio: {
link: audioUrl ?? undefined,
id: audioId ?? undefined,
},
});

return response;
},
});
Loading
Loading