Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"extends": [
|
||||
"../../../../.eslintrc.base.json"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"!**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx",
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# pieces-pushbullet
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-pushbullet` to build the library.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@activepieces/piece-pushbullet",
|
||||
"version": "0.0.1",
|
||||
"type": "commonjs",
|
||||
"main": "./src/index.js",
|
||||
"types": "./src/index.d.ts",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "pieces-pushbullet",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/pushbullet/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/pushbullet",
|
||||
"tsConfig": "packages/pieces/community/pushbullet/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/pushbullet/package.json",
|
||||
"main": "packages/pieces/community/pushbullet/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/pushbullet/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/pushbullet/src/i18n",
|
||||
"output": "./src/i18n",
|
||||
"glob": "**/!(i18n.json)"
|
||||
}
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"updateBuildableProjectDepsInPackageJson": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"prebuild",
|
||||
"^build"
|
||||
]
|
||||
},
|
||||
"nx-release-publish": {
|
||||
"options": {
|
||||
"packageRoot": "dist/{projectRoot}"
|
||||
}
|
||||
},
|
||||
"prebuild": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/pieces/community/pushbullet",
|
||||
"command": "bun install --no-save --silent"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Cross-device notification service": "Cross-device notification service",
|
||||
"\n1. Login to your Pushbullet Dashboard.\n2. Go to **https://www.pushbullet.com/#settings/account**.\n3. **Create Access Token** then copy to the clipboard and paste it.": "\n1. Login to your Pushbullet Dashboard.\n2. Go to **https://www.pushbullet.com/#settings/account**.\n3. **Create Access Token** then copy to the clipboard and paste it.",
|
||||
"Send a Link": "Send a Link",
|
||||
"Send a Note": "Send a Note",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Send a link notification": "Send a link notification",
|
||||
"Send me a text notification": "Send me a text notification",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"URL to send": "URL to send",
|
||||
"Title": "Title",
|
||||
"Body": "Body",
|
||||
"Note Title": "Note Title",
|
||||
"Note Body": "Note Body",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Response is Binary ?": "Response is Binary ?",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
createPiece,
|
||||
OAuth2PropertyValue,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { bushbulletAuth } from './lib/common/auth';
|
||||
import { sendALink } from './lib/actions/send-a-link';
|
||||
import { sendANote } from './lib/actions/send-a-note';
|
||||
import { createCustomApiCallAction } from '@activepieces/pieces-common';
|
||||
import { BASE_URL } from './lib/common/client';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
|
||||
export const pushbullet = createPiece({
|
||||
displayName: 'Pushbullet',
|
||||
description: 'Cross-device notification service',
|
||||
categories: [PieceCategory.COMMUNICATION],
|
||||
auth: bushbulletAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/pushbullet.png',
|
||||
authors: ['sanket-a11y'],
|
||||
actions: [
|
||||
sendALink,
|
||||
sendANote,
|
||||
createCustomApiCallAction({
|
||||
auth: bushbulletAuth,
|
||||
baseUrl: () => BASE_URL,
|
||||
authMapping: async (auth) => {
|
||||
const access_token = auth;
|
||||
return {
|
||||
Authorization: `Bearer ${access_token.secret_text}`,
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
},
|
||||
}),
|
||||
],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,45 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { bushbulletAuth } from '../common/auth';
|
||||
import { makeRequest } from '../common/client';
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
|
||||
export const sendALink = createAction({
|
||||
auth: bushbulletAuth,
|
||||
name: 'sendALink',
|
||||
displayName: 'Send a Link',
|
||||
description: 'Send a link notification',
|
||||
props: {
|
||||
url: Property.ShortText({
|
||||
displayName: 'URL to send',
|
||||
description: '',
|
||||
required: true,
|
||||
}),
|
||||
title: Property.ShortText({
|
||||
displayName: 'Title',
|
||||
description: '',
|
||||
required: false,
|
||||
}),
|
||||
body: Property.ShortText({
|
||||
displayName: 'Body',
|
||||
description: '',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { url, title, body } = context.propsValue;
|
||||
|
||||
const response = await makeRequest(
|
||||
context.auth.secret_text,
|
||||
HttpMethod.POST,
|
||||
'/pushes',
|
||||
{
|
||||
type: 'link',
|
||||
url,
|
||||
title,
|
||||
body,
|
||||
}
|
||||
);
|
||||
|
||||
return response;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { bushbulletAuth } from '../common/auth';
|
||||
import { makeRequest } from '../common/client';
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
|
||||
export const sendANote = createAction({
|
||||
auth: bushbulletAuth,
|
||||
name: 'sendANote',
|
||||
displayName: 'Send a Note',
|
||||
description: 'Send me a text notification',
|
||||
props: {
|
||||
title: Property.ShortText({
|
||||
displayName: 'Note Title',
|
||||
description: '',
|
||||
required: true,
|
||||
}),
|
||||
body: Property.ShortText({
|
||||
displayName: 'Note Body',
|
||||
description: '',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
return await makeRequest(
|
||||
context.auth.secret_text,
|
||||
HttpMethod.POST,
|
||||
'/pushes',
|
||||
{
|
||||
type: 'note',
|
||||
title: context.propsValue.title,
|
||||
body: context.propsValue.body,
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { PieceAuth } from '@activepieces/pieces-framework';
|
||||
|
||||
const authHelpDescription = `
|
||||
1. Login to your Pushbullet Dashboard.
|
||||
2. Go to **https://www.pushbullet.com/#settings/account**.
|
||||
3. **Create Access Token** then copy to the clipboard and paste it.`;
|
||||
|
||||
export const bushbulletAuth = PieceAuth.SecretText({
|
||||
displayName: 'API Token',
|
||||
description: authHelpDescription,
|
||||
required: true,
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
|
||||
export const BASE_URL = `https://api.pushbullet.com/v2`;
|
||||
|
||||
export async function makeRequest(
|
||||
access_token: string,
|
||||
method: HttpMethod,
|
||||
path: string,
|
||||
body?: unknown
|
||||
) {
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method,
|
||||
url: `${BASE_URL}${path}`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${access_token}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body,
|
||||
});
|
||||
return response.body;
|
||||
} catch (error: any) {
|
||||
throw new Error(`Unexpected error: ${error.message || String(error)}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"importHelpers": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noPropertyAccessFromIndexSignature": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user