-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(editor): Move
nodeTypes
into store module (#3799)
* ⚡ Refactor `nodeTypes` into store module * ⚡ Fix condition * 🔥 Remove leftovers * ⚡ Move `getNodeTranslationHeaders`, `getNodesInformation`, `getNodeParameterOptions` * ⚡ Move leftover call * ⚡ Correct excess prefix * 🚚 Rename `nodeType` to `getNodeType` * 🚚 Move logic to `getFullNodesProperties` * ⚡ Simplify `getNodeType` * ⚡ Refactor `nodeTypes` mutations * ⚡ Refactor `Vue.set` call * ⚡ Simplify check * 🚚 Move export to bottom * 📘 Simplify typing * 🔥 Remove unused interface * 👕 Add `void` * 🚚 Fix naming * 🔥 Remove logging * ⚡ Simplify `updateNodeTypes` * 🚚 Move `omit` to utils * 🐛 Update `rootGetters` call * 🐛 Fix `allNodeTypes` call in `nativelyNumberSuffixedDefaults` * 🔥 Remove unused method * 🔥 Remove excess namespace Co-authored-by: Mutasem <[email protected]>
- Loading branch information
1 parent
0b61e61
commit f535ffc
Showing
29 changed files
with
244 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { makeRestApiRequest } from './helpers'; | ||
import type { | ||
INodeTranslationHeaders, | ||
IRestApiContext, | ||
} from '@/Interface'; | ||
import type { | ||
ILoadOptions, | ||
INodeCredentials, | ||
INodeParameters, | ||
INodePropertyOptions, | ||
INodeTypeDescription, | ||
INodeTypeNameVersion, | ||
} from 'n8n-workflow'; | ||
|
||
export async function getNodeTypes( | ||
context: IRestApiContext, | ||
{ onlyLatest } = { onlyLatest: false }, | ||
) { | ||
return makeRestApiRequest(context, 'GET', '/node-types', { onlyLatest }); | ||
} | ||
|
||
export async function getNodeTranslationHeaders( | ||
context: IRestApiContext, | ||
): Promise<INodeTranslationHeaders | undefined> { | ||
return makeRestApiRequest(context, 'GET', '/node-translation-headers'); | ||
} | ||
|
||
export async function getNodesInformation( | ||
context: IRestApiContext, | ||
nodeInfos: INodeTypeNameVersion[], | ||
): Promise<INodeTypeDescription[]> { | ||
return makeRestApiRequest(context, 'POST', '/node-types', { nodeInfos }); | ||
} | ||
|
||
export async function getNodeParameterOptions( | ||
context: IRestApiContext, | ||
sendData: { | ||
nodeTypeAndVersion: INodeTypeNameVersion, | ||
path: string, | ||
methodName?: string, | ||
loadOptions?: ILoadOptions, | ||
currentNodeParameters: INodeParameters, | ||
credentials?: INodeCredentials, | ||
}, | ||
): Promise<INodePropertyOptions[]> { | ||
return makeRestApiRequest(context, 'GET', '/node-parameter-options', sendData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.