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

refactor(editor): Add types to importCurlEventBus (no-changelog) #10497

Merged
merged 1 commit into from
Aug 22, 2024
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
9 changes: 4 additions & 5 deletions packages/editor-ui/src/components/NodeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ import type {
INodeProperties,
NodeParameterValue,
ConnectionTypes,
NodeParameterValueType,
} from 'n8n-workflow';
import {
NodeHelpers,
Expand All @@ -201,6 +200,7 @@ import {
displayParameter,
} from 'n8n-workflow';
import type {
CurlToJSONResponse,
INodeUi,
INodeUpdatePropertiesInformation,
IUpdateInformation,
Expand Down Expand Up @@ -235,9 +235,8 @@ import { useCredentialsStore } from '@/stores/credentials.store';
import type { EventBus } from 'n8n-design-system';
import { useExternalHooks } from '@/composables/useExternalHooks';
import { useNodeHelpers } from '@/composables/useNodeHelpers';
import { importCurlEventBus } from '@/event-bus';
import { importCurlEventBus, ndvEventBus } from '@/event-bus';
import { useToast } from '@/composables/useToast';
import { ndvEventBus } from '@/event-bus';

export default defineComponent({
name: 'NodeSettings',
Expand Down Expand Up @@ -489,12 +488,12 @@ export default defineComponent({
ndvEventBus.off('updateParameterValue', this.valueChanged);
},
methods: {
setHttpNodeParameters(parameters: NodeParameterValueType) {
setHttpNodeParameters(parameters: CurlToJSONResponse) {
try {
this.valueChanged({
node: this.node?.name,
name: 'parameters',
value: parameters,
value: parameters as unknown as INodeParameters,
});
} catch {}
},
Expand Down
8 changes: 7 additions & 1 deletion packages/editor-ui/src/event-bus/import-curl.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import type { CurlToJSONResponse } from '@/Interface';
import { createEventBus } from 'n8n-design-system/utils';

export const importCurlEventBus = createEventBus();
export interface ImportCurlEventBusEvents {
/** Command to set the HTTP node parameters based on the curl to JSON response */
setHttpNodeParameters: CurlToJSONResponse;
}

export const importCurlEventBus = createEventBus<ImportCurlEventBusEvents>();
Loading