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,3 @@
|
||||
{
|
||||
"presets": [["@nx/js/babel", { "useBuiltIns": "usage" }]]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# pieces-hackernews
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running lint
|
||||
|
||||
Run `nx lint pieces-hackernews` to execute the lint via [ESLint](https://eslint.org/).
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "@activepieces/piece-hackernews",
|
||||
"version": "0.3.8"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "pieces-hackernews",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/hackernews/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": [
|
||||
"{options.outputPath}"
|
||||
],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/pieces/community/hackernews",
|
||||
"tsConfig": "packages/pieces/community/hackernews/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/hackernews/package.json",
|
||||
"main": "packages/pieces/community/hackernews/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/hackernews/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/hackernews/src/i18n",
|
||||
"output": "./src/i18n",
|
||||
"glob": "**/!(i18n.json)"
|
||||
}
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"updateBuildableProjectDepsInPackageJson": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"prebuild"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
},
|
||||
"prebuild": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/pieces/community/hackernews",
|
||||
"command": "bun install --no-save --silent"
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "Eine Social-News-Website",
|
||||
"Fetch Top Stories": "Top Geschichten abrufen",
|
||||
"Fetch top stories from hackernews": "Top-Geschichten von Hackernews abrufen",
|
||||
"Number of Stories": "Anzahl der Geschichten"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "Un sitio web de noticias sociales",
|
||||
"Fetch Top Stories": "Obtener Historias Principales",
|
||||
"Fetch top stories from hackernews": "Obtener historias destacadas de hackernews",
|
||||
"Number of Stories": "Número de historias"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "Un site d'actualités sociales",
|
||||
"Fetch Top Stories": "Récupérer les meilleures histoires",
|
||||
"Fetch top stories from hackernews": "Récupérer les meilleures histoires des hackernews",
|
||||
"Number of Stories": "Nombre d'histoires"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "ソーシャルニュースのウェブサイト",
|
||||
"Fetch Top Stories": "トップストーリーを取得",
|
||||
"Fetch top stories from hackernews": "ハッカーニュースからトップストーリーを取得",
|
||||
"Number of Stories": "ストーリー数"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "Een sociale nieuws website",
|
||||
"Fetch Top Stories": "Top verhalen ophalen",
|
||||
"Fetch top stories from hackernews": "Topverhalen van hackernews ophalen",
|
||||
"Number of Stories": "Aantal verhalen"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "Site de noticias sociais",
|
||||
"Fetch Top Stories": "Buscar as melhores histórias",
|
||||
"Fetch top stories from hackernews": "Buscar histórias mais recentes de hackernews",
|
||||
"Number of Stories": "Número de histórias"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"Hacker News": "Новости хакера",
|
||||
"A social news website": "Новости соцсетей",
|
||||
"Fetch Top Stories": "Получить лучшие истории",
|
||||
"Fetch top stories from hackernews": "Получить топ историй из хакерентов",
|
||||
"Number of Stories": "Количество историй"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "A social news website",
|
||||
"Fetch Top Stories": "Fetch Top Stories",
|
||||
"Fetch top stories from hackernews": "Fetch top stories from hackernews",
|
||||
"Number of Stories": "Number of Stories"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"Hacker News": "Hacker News",
|
||||
"A social news website": "A social news website",
|
||||
"Fetch Top Stories": "Fetch Top Stories",
|
||||
"Fetch top stories from hackernews": "Fetch top stories from hackernews",
|
||||
"Number of Stories": "Number of Stories"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"A social news website": "A social news website",
|
||||
"Fetch Top Stories": "Fetch Top Stories",
|
||||
"Fetch top stories from hackernews": "Fetch top stories from hackernews",
|
||||
"Number of Stories": "Number of Stories"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { PieceAuth, createPiece } from '@activepieces/pieces-framework';
|
||||
import { fetchTopStories } from './lib/actions/top-stories-in-hacker-news';
|
||||
|
||||
export const hackernews = createPiece({
|
||||
displayName: 'Hacker News',
|
||||
description: 'A social news website',
|
||||
|
||||
minimumSupportedRelease: '0.30.0',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/hackernews.png',
|
||||
auth: PieceAuth.None(),
|
||||
categories: [],
|
||||
authors: ["kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud"],
|
||||
actions: [fetchTopStories],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
||||
|
||||
export const fetchTopStories = createAction({
|
||||
name: 'fetch_top_stories', // Must be a unique across the piece, this shouldn't be changed.
|
||||
displayName: 'Fetch Top Stories',
|
||||
description: 'Fetch top stories from hackernews',
|
||||
props: {
|
||||
// Properties to ask from the user, in this ask we will take number of
|
||||
number_of_stories: Property.Number({
|
||||
displayName: 'Number of Stories',
|
||||
description: undefined,
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(configValue) {
|
||||
const HACKER_NEWS_API_URL = 'https://hacker-news.firebaseio.com/v0/';
|
||||
const topStoryIdsResponse = await httpClient.sendRequest<string[]>({
|
||||
method: HttpMethod.GET,
|
||||
url: `${HACKER_NEWS_API_URL}topstories.json`,
|
||||
});
|
||||
const topStoryIds: string[] = topStoryIdsResponse.body;
|
||||
const topStories: Record<string, unknown>[] = [];
|
||||
for (
|
||||
let i = 0;
|
||||
i <
|
||||
Math.min(configValue.propsValue['number_of_stories'], topStoryIds.length);
|
||||
i++
|
||||
) {
|
||||
const storyId = topStoryIds[i];
|
||||
const storyResponse = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${HACKER_NEWS_API_URL}item/${storyId}.json`,
|
||||
});
|
||||
topStories.push(storyResponse.body);
|
||||
}
|
||||
return topStories;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
],
|
||||
"compilerOptions": {
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user