refactor(editor): Add types to importCurlEventBus (no-changelog) (#10497)
This commit is contained in:
@@ -189,7 +189,6 @@ import type {
|
||||
INodeProperties,
|
||||
NodeParameterValue,
|
||||
ConnectionTypes,
|
||||
NodeParameterValueType,
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
NodeHelpers,
|
||||
@@ -201,6 +200,7 @@ import {
|
||||
displayParameter,
|
||||
} from 'n8n-workflow';
|
||||
import type {
|
||||
CurlToJSONResponse,
|
||||
INodeUi,
|
||||
INodeUpdatePropertiesInformation,
|
||||
IUpdateInformation,
|
||||
@@ -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',
|
||||
@@ -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 {}
|
||||
},
|
||||
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user