Skip to content

Commit

Permalink
Merge branch 'main' into fix/initally-selected-step
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulTheActivePiecer committed Nov 19, 2024
2 parents 7a4b897 + 951817e commit 2026a07
Show file tree
Hide file tree
Showing 50 changed files with 945 additions and 468 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,15 @@
"contributions": [
"plugin"
]
},
{
"login": "mordonez",
"name": "Miguel",
"avatar_url": "https://avatars.githubusercontent.com/u/293837?v=4",
"profile": "https://github.com/mordonez",
"contributions": [
"plugin"
]
}
],
"commitType": "docs"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ Not into coding but still interested in contributing? Come join our [Discord](ht
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liuhuapiaoyuan"><img src="https://avatars.githubusercontent.com/u/8020726?v=4?s=100" width="100px;" alt="abc"/><br /><sub><b>abc</b></sub></a><br /><a href="https://github.com/activepieces/activepieces/commits?author=liuhuapiaoyuan" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/manojkum-d"><img src="https://avatars.githubusercontent.com/u/141437046?v=4?s=100" width="100px;" alt="manoj kumar d"/><br /><sub><b>manoj kumar d</b></sub></a><br /><a href="#plugin-manojkum-d" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/felifluid"><img src="https://avatars.githubusercontent.com/u/59516203?v=4?s=100" width="100px;" alt="Feli"/><br /><sub><b>Feli</b></sub></a><br /><a href="#plugin-felifluid" title="Plugin/utility libraries">🔌</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mordonez"><img src="https://avatars.githubusercontent.com/u/293837?v=4?s=100" width="100px;" alt="Miguel"/><br /><sub><b>Miguel</b></sub></a><br /><a href="#plugin-mordonez" 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.36.0
image: ghcr.io/activepieces/activepieces:0.36.1
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 docs/install/configuration/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ it will produce these values. </Tip>
| `AP_FLOW_WORKER_CONCURRENCY` | The number of different flows can be processed in same time | `10` |
| `AP_SCHEDULED_WORKER_CONCURRENCY` | The number of different scheduled flows can be processed in same time | `10` |
| `AP_ENCRYPTION_KEY` | ❗️ Encryption key used for connections is a 16-character hexadecimal key. You can generate one using the following command: `openssl rand -hex 16`. | `None` |
| `AP_EXECUTION_DATA_RETENTION_DAYS` | The number of days to retain execution data, logs and events. | `None` | |
| `AP_EXECUTION_DATA_RETENTION_DAYS` | The number of days to retain execution data, logs and events. | `30` | |
| `AP_FRONTEND_URL` | ❗️ Url that will be used to specify redirect url and webhook url. | `None` | [https://demo.activepieces.com/api](https://demo.activepieces.com/api) |
| `AP_JWT_SECRET` | ❗️ Encryption key used for generating JWT tokens is a 32-character hexadecimal key. You can generate one using the following command: `openssl rand -hex 32`. | `None` | [https://demo.activepieces.com](https://demo.activepieces.com) |
| `AP_QUEUE_MODE` | The queue mode to use. (MEMORY / REDIS) | `MEMORY` | |
Expand Down Expand Up @@ -55,7 +55,7 @@ it will produce these values. </Tip>
| `AP_AZURE_OPENAI_ENDPOINT` | This is required only if you want to enable code copilot | `https://{{your-resource}}.openai.azure.com/openai/deployments/{{your-model}}` |
| `AP_AZURE_OPENAI_API_VERSION` | This is required only if you want to enable code copilot | `2023-06-01-preview` |
| `AP_TRIGGER_TIMEOUT_SECONDS` | Maximum allowed runtime for a trigger to perform polling in seconds | `None` | |
| `AP_FLOW_TIMEOUT_SECONDS` | Maximum allowed runtime for a flow to run in seconds | `None` | |
| `AP_FLOW_TIMEOUT_SECONDS` | Maximum allowed runtime for a flow to run in seconds | `600` | |
| `AP_SANDBOX_PROPAGATED_ENV_VARS` | Environment variables that will be propagated to the sandboxed code. If you are using it for pieces, we strongly suggests keeping everything in the authentication object to make sure it works across AP instances. | `None` | |
| `AP_TELEMETRY_ENABLED` | Collect telemetry information. | `true` | |
| `AP_TEMPLATES_SOURCE_URL` | This is the endpoint we query for templates, remove it and templates will be removed from UI | `https://cloud.activepieces.com/api/v1/flow-templates` | |
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "activepieces",
"version": "0.36.0",
"version": "0.36.1",
"rcVersion": "0.35.0-rc.1",
"scripts": {
"prepare": "husky install",
Expand Down Expand Up @@ -227,6 +227,7 @@
"react-ripples": "2.2.1",
"react-router-dom": "6.11.2",
"react-syntax-highlighter": "15.5.0",
"react-textarea-autosize": "8.5.5",
"react-use": "17.5.1",
"recharts": "2.12.7",
"redlock": "5.0.0-beta.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/lib/handler/code-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const codeExecutor: BaseExecutor<CodeAction> = {
}

const executeAction: ActionHandler<CodeAction> = async ({ action, executionState, constants }) => {
const { censoredInput, resolvedInput } = await constants.variableService.resolve<Record<string, unknown>>({
const { censoredInput, resolvedInput } = await constants.propsResolver.resolve<Record<string, unknown>>({
unresolvedInput: action.settings.input,
executionState,
})
Expand Down
12 changes: 6 additions & 6 deletions packages/engine/src/lib/handler/context/engine-constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ExecuteFlowOperation, ExecutePropsOptions, ExecuteStepOperation, ExecuteTriggerOperation, ExecutionType, FlowVersionState, ProgressUpdateType, Project, ProjectId, ResumePayload, TriggerHookType } from '@activepieces/shared'
import { VariableService } from '../../variables/variable-service'
import { createPropsResolver, PropsResolver } from '../../variables/props-resolver'

type RetryConstants = {
maxAttempts: number
Expand Down Expand Up @@ -45,7 +45,7 @@ export class EngineConstants {
public readonly retryConstants: RetryConstants,
public readonly engineToken: string,
public readonly projectId: ProjectId,
public readonly variableService: VariableService,
public readonly propsResolver: PropsResolver,
public readonly testSingleStepMode: boolean,
public readonly progressUpdateType: ProgressUpdateType,
public readonly serverHandlerId: string | null,
Expand All @@ -64,7 +64,7 @@ export class EngineConstants {
DEFAULT_RETRY_CONSTANTS,
input.engineToken,
input.projectId,
new VariableService({
createPropsResolver({
projectId: input.projectId,
engineToken: input.engineToken,
apiUrl: input.internalApiUrl,
Expand All @@ -88,7 +88,7 @@ export class EngineConstants {
DEFAULT_RETRY_CONSTANTS,
input.engineToken,
input.projectId,
new VariableService({
createPropsResolver({
projectId: input.projectId,
engineToken: input.engineToken,
apiUrl: addTrailingSlashIfMissing(input.internalApiUrl),
Expand All @@ -111,7 +111,7 @@ export class EngineConstants {
DEFAULT_RETRY_CONSTANTS,
input.engineToken,
input.projectId,
new VariableService({
createPropsResolver({
projectId: input.projectId,
engineToken: input.engineToken,
apiUrl: addTrailingSlashIfMissing(input.internalApiUrl),
Expand All @@ -134,7 +134,7 @@ export class EngineConstants {
DEFAULT_RETRY_CONSTANTS,
input.engineToken,
input.projectId,
new VariableService({
createPropsResolver({
projectId: input.projectId,
engineToken: input.engineToken,
apiUrl: addTrailingSlashIfMissing(input.internalApiUrl),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
StepOutputStatus,
TriggerType,
} from '@activepieces/shared'
import { variableService } from '../../variables/variable-service'
import { createPropsResolver } from '../../variables/props-resolver'
import { FlowExecutorContext } from './flow-execution-context'

export const testExecutionContext = {
Expand Down Expand Up @@ -44,7 +44,7 @@ export const testExecutionContext = {
)
break
case ActionType.LOOP_ON_ITEMS: {
const { resolvedInput } = await variableService({
const { resolvedInput } = await createPropsResolver({
apiUrl,
projectId,
engineToken,
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/lib/handler/loop-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const loopExecutor: BaseExecutor<LoopOnItemsAction> = {
executionState,
constants,
}) {
const { resolvedInput, censoredInput } = await constants.variableService.resolve<LoopOnActionResolvedSettings>({
const { resolvedInput, censoredInput } = await constants.propsResolver.resolve<LoopOnActionResolvedSettings>({
unresolvedInput: {
items: action.settings.items,
},
Expand Down
5 changes: 3 additions & 2 deletions packages/engine/src/lib/handler/piece-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { createConnectionService } from '../services/connections.service'
import { createFilesService } from '../services/files.service'
import { createFlowsContext } from '../services/flows.service'
import { createContextStore } from '../services/storage.service'
import { propsProcessor } from '../variables/props-processor'
import { ActionHandler, BaseExecutor } from './base-executor'
import { ExecutionVerdict } from './context/flow-execution-context'

Expand Down Expand Up @@ -46,14 +47,14 @@ const executeAction: ActionHandler<PieceAction> = async ({ action, executionStat
piecesSource: constants.piecesSource,
})

const { resolvedInput, censoredInput } = await constants.variableService.resolve<StaticPropsValue<PiecePropertyMap>>({
const { resolvedInput, censoredInput } = await constants.propsResolver.resolve<StaticPropsValue<PiecePropertyMap>>({
unresolvedInput: action.settings.input,
executionState,
})

stepOutput.input = censoredInput

const { processedInput, errors } = await constants.variableService.applyProcessorsAndValidators(resolvedInput, pieceAction.props, piece.auth, pieceAction.requireAuth)
const { processedInput, errors } = await propsProcessor.applyProcessorsAndValidators(resolvedInput, pieceAction.props, piece.auth, pieceAction.requireAuth)
if (Object.keys(errors).length > 0) {
throw new Error(JSON.stringify(errors))
}
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/lib/handler/router-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const routerExecuter: BaseExecutor<RouterAction> = {
executionState,
constants,
}) {
const { censoredInput, resolvedInput } = await constants.variableService.resolve<RouterActionSettings>({
const { censoredInput, resolvedInput } = await constants.propsResolver.resolve<RouterActionSettings>({
unresolvedInput: {
...action.settings,
inputUiInfo: undefined,
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/src/lib/helper/piece-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { EngineConstants } from '../handler/context/engine-constants'
import { FlowExecutorContext } from '../handler/context/flow-execution-context'
import { createFlowsContext } from '../services/flows.service'
import { variableService } from '../variables/variable-service'
import { createPropsResolver } from '../variables/props-resolver'
import { pieceLoader } from './piece-loader'

export const pieceHelper = {
Expand All @@ -32,7 +32,7 @@ export const pieceHelper = {
})

try {
const { resolvedInput } = await variableService({
const { resolvedInput } = await createPropsResolver({
apiUrl: constants.internalApiUrl,
projectId: params.projectId,
engineToken: params.engineToken,
Expand Down
11 changes: 4 additions & 7 deletions packages/engine/src/lib/helper/trigger-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { FlowExecutorContext } from '../handler/context/flow-execution-context'
import { createFilesService } from '../services/files.service'
import { createFlowsContext } from '../services/flows.service'
import { createContextStore } from '../services/storage.service'
import { variableService } from '../variables/variable-service'
import { propsProcessor } from '../variables/props-processor'
import { createPropsResolver } from '../variables/props-resolver'
import { pieceLoader } from './piece-loader'

type Listener = {
Expand Down Expand Up @@ -235,7 +236,7 @@ async function prepareTriggerExecution({ pieceName, pieceVersion, triggerName, i
piecesSource,
})

const { resolvedInput } = await variableService({
const { resolvedInput } = await createPropsResolver({
apiUrl,
projectId,
engineToken,
Expand All @@ -244,11 +245,7 @@ async function prepareTriggerExecution({ pieceName, pieceVersion, triggerName, i
executionState: FlowExecutorContext.empty(),
})

const { processedInput, errors } = await variableService({
apiUrl,
projectId,
engineToken,
}).applyProcessorsAndValidators(resolvedInput, pieceTrigger.props, piece.auth, pieceTrigger.requireAuth)
const { processedInput, errors } = await propsProcessor.applyProcessorsAndValidators(resolvedInput, pieceTrigger.props, piece.auth, pieceTrigger.requireAuth)

if (Object.keys(errors).length > 0) {
throw new Error(JSON.stringify(errors))
Expand Down
Loading

0 comments on commit 2026a07

Please sign in to comment.