Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove node (no-changelog) #10400

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
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ export class ManualChatTrigger implements INodeType {
name: 'openChat',
type: 'button',
typeOptions: {
buttonConfig: {
action: 'openChat',
},
action: 'openChat',
},
default: '',
},
Expand Down
26 changes: 1 addition & 25 deletions packages/cli/src/controllers/dynamicNodeParameters.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { INodePropertyOptions, NodeParameterValueType } from 'n8n-workflow';
import type { INodePropertyOptions } from 'n8n-workflow';

import { Post, RestController } from '@/decorators';
import { getBase } from '@/WorkflowExecuteAdditionalData';
Expand Down Expand Up @@ -92,28 +92,4 @@ export class DynamicNodeParametersController {
credentials,
);
}

@Post('/action-result')
async getActionResult(
req: DynamicNodeParametersRequest.ActionResult,
): Promise<NodeParameterValueType> {
const { currentNodeParameters, nodeTypeAndVersion, path, credentials, handler, payload } =
req.body;

const additionalData = await getBase(req.user.id, currentNodeParameters);

if (handler) {
return await this.service.getActionResult(
handler,
path,
additionalData,
nodeTypeAndVersion,
currentNodeParameters,
payload,
credentials,
);
}

return;
}
}
6 changes: 0 additions & 6 deletions packages/cli/src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,6 @@ export declare namespace DynamicNodeParametersRequest {
type ResourceMapperFields = BaseRequest<{
methodName: string;
}>;

/** POST /dynamic-node-parameters/action-result */
type ActionResult = BaseRequest<{
handler: string;
payload: IDataObject | string | undefined;
}>;
}

// ----------------------------------
Expand Down
27 changes: 1 addition & 26 deletions packages/cli/src/services/dynamicNodeParameters.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import type {
INodeCredentials,
INodeParameters,
INodeTypeNameVersion,
NodeParameterValueType,
IDataObject,
} from 'n8n-workflow';
import { Workflow, RoutingNode, ApplicationError } from 'n8n-workflow';
import { NodeExecuteFunctions } from 'n8n-core';
Expand Down Expand Up @@ -158,24 +156,6 @@ export class DynamicNodeParametersService {
return method.call(thisArgs);
}

/** Returns the result of the action handler */
async getActionResult(
handler: string,
path: string,
additionalData: IWorkflowExecuteAdditionalData,
nodeTypeAndVersion: INodeTypeNameVersion,
currentNodeParameters: INodeParameters,
payload: IDataObject | string | undefined,
credentials?: INodeCredentials,
): Promise<NodeParameterValueType> {
const nodeType = this.getNodeType(nodeTypeAndVersion);
const method = this.getMethod('actionHandler', handler, nodeType);
const workflow = this.getWorkflow(nodeTypeAndVersion, currentNodeParameters, credentials);
const thisArgs = this.getThisArg(path, additionalData, workflow);
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return method.call(thisArgs, payload);
}

private getMethod(
type: 'resourceMapping',
methodName: string,
Expand All @@ -195,14 +175,9 @@ export class DynamicNodeParametersService {
methodName: string,
nodeType: INodeType,
): (this: ILoadOptionsFunctions) => Promise<INodePropertyOptions[]>;
private getMethod(
type: 'actionHandler',
methodName: string,
nodeType: INodeType,
): (this: ILoadOptionsFunctions, payload?: string) => Promise<NodeParameterValueType>;

private getMethod(
type: 'resourceMapping' | 'listSearch' | 'loadOptions' | 'actionHandler',
type: 'resourceMapping' | 'listSearch' | 'loadOptions',
methodName: string,
nodeType: INodeType,
) {
Expand Down
5 changes: 0 additions & 5 deletions packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1551,11 +1551,6 @@ export declare namespace DynamicNodeParameters {
interface ResourceMapperFieldsRequest extends BaseRequest {
methodName: string;
}

interface ActionResultRequest extends BaseRequest {
handler: string;
payload: IDataObject | string | undefined;
}
}

export interface EnvironmentVariable {
Expand Down
13 changes: 0 additions & 13 deletions packages/editor-ui/src/api/nodeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {
INodePropertyOptions,
INodeTypeDescription,
INodeTypeNameVersion,
NodeParameterValueType,
ResourceMapperFields,
} from 'n8n-workflow';
import axios from 'axios';
Expand Down Expand Up @@ -58,15 +57,3 @@ export async function getResourceMapperFields(
sendData,
);
}

export async function getNodeParameterActionResult(
context: IRestApiContext,
sendData: DynamicNodeParameters.ActionResultRequest,
): Promise<NodeParameterValueType> {
return await makeRestApiRequest(
context,
'POST',
'/dynamic-node-parameters/action-result',
sendData,
);
}
Loading
Loading