mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-29 01:39:24 +08:00
feat(Microsoft Excel SharePoint Node): Add hidden node shell (no-changelog) (#34088)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"node": "n8n-nodes-base.microsoftExcelSharePoint",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Data & Storage", "Productivity"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/credentials/microsoft/"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftexcelsharepoint/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"alias": ["_Excel", "Excel", "Sheet", "CSV", "Spreadsheet", "SharePoint"]
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
|
||||
// Shell for the Excel-on-SharePoint build. Registered but hidden: workflows
|
||||
// using it always work; the launch ticket removes the `hidden` flag.
|
||||
export class MicrosoftExcelSharePoint implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Microsoft Excel (SharePoint)',
|
||||
name: 'microsoftExcelSharePoint',
|
||||
icon: 'file:excelSharePoint.svg',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
description: 'Read and write Excel workbooks stored in SharePoint document libraries',
|
||||
defaults: {
|
||||
name: 'Microsoft Excel (SharePoint)',
|
||||
},
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
hidden: true,
|
||||
properties: [],
|
||||
};
|
||||
|
||||
// Pass-through until the first action arrives with the router.
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
return [this.getInputData()];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><g fill="#02723B" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M43.1 20.227h9.512v4.692h-9.513zm0-7.034h9.512v4.69h-9.513zm0 14.227h9.512v4.691h-9.513zm0 7.036h9.512v4.691h-9.513z"/><path d="M43.1 41.649h9.512v4.69h-9.513zM58.07 6.78H35.146V.37L.37 6.467v47.22l34.776 5.942v-7.186H58.07c.935 0 1.559-.781 1.559-1.555V8.344c0-.781-.624-1.555-1.56-1.555V6.78zM20.018 40.554l-3.274-8.593h-.148c0 .149-3.275 8.13-3.275 8.13l-4.366-.312L14.1 29.616 9.422 19.453l4.367-.312 2.963 7.974h.148c0-.148 3.274-8.287 3.274-8.287l4.522-.312-5.457 11.101 5.614 11.102-4.834-.149zM57.6 50.717H35.146v-4.37h5.458v-4.691h-5.458v-2.352h5.458v-4.69h-5.458v-2.347h5.458v-4.69h-5.458V25.23h5.458v-4.69h-5.458v-2.345h5.458v-4.692h-5.458v-4.69h22.456v41.903h-.001z"/><path d="M42.729 19.857h9.512v4.691H42.73zm0-7.035h9.512v4.691H42.73zm0 14.228h9.512v4.69H42.73zm0 7.036h9.512v4.691H42.73z"/><path d="M42.729 41.279h9.512v4.69H42.73zM57.699 6.41H34.776V0L0 6.098v47.22l34.776 5.941v-7.185h22.923c.936 0 1.56-.781 1.56-1.555V7.974c0-.781-.624-1.555-1.56-1.555zM19.647 40.184l-3.274-8.593h-.148c0 .148-3.274 8.13-3.274 8.13l-4.367-.312 5.146-10.163-4.678-10.163 4.367-.313 2.962 7.974h.149c0-.148 3.274-8.286 3.274-8.286l4.522-.313-5.458 11.102 5.615 11.101-4.834-.148zM57.23 50.347H34.776v-4.37h5.457v-4.692h-5.457v-2.352h5.457v-4.69h-5.457v-2.347h5.457v-4.69h-5.457V24.86h5.457v-4.69h-5.457v-2.346h5.457v-4.692h-5.457v-4.69h22.456v41.904z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
+42
@@ -0,0 +1,42 @@
|
||||
import type { IExecuteFunctions } from 'n8n-workflow';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { MicrosoftExcelSharePoint } from '../MicrosoftExcelSharePoint.node';
|
||||
import { MicrosoftExcel } from '../../Excel/MicrosoftExcel.node';
|
||||
|
||||
describe('MicrosoftExcelSharePoint (hidden shell)', () => {
|
||||
const node = new MicrosoftExcelSharePoint();
|
||||
|
||||
it('should be hidden from the nodes panel', () => {
|
||||
// `hidden` is the flag the editor's visibleNodeTypes filters on
|
||||
expect(node.description.hidden).toBe(true);
|
||||
});
|
||||
|
||||
it('should not collide with the OneDrive Excel node', () => {
|
||||
// Node registration is last-write-wins — a name clash would silently
|
||||
// shadow one node, so compare against the real sibling.
|
||||
const oneDriveNode = new MicrosoftExcel();
|
||||
|
||||
expect(node.description.name).toBe('microsoftExcelSharePoint');
|
||||
expect(node.description.name).not.toBe(oneDriveNode.description.name);
|
||||
expect(node.description.displayName).toBe('Microsoft Excel (SharePoint)');
|
||||
expect(node.description.displayName).not.toBe(oneDriveNode.description.displayName);
|
||||
});
|
||||
|
||||
it('should be a blank shell — no credentials, no properties', () => {
|
||||
expect(node.description.version).toBe(1);
|
||||
expect(node.description.properties).toHaveLength(0);
|
||||
expect(node.description.credentials).toBeUndefined();
|
||||
expect(node.description.usableAsTool).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should pass input through unchanged when executed', async () => {
|
||||
const ctx = mock<IExecuteFunctions>();
|
||||
const items = [{ json: { a: 1 } }, { json: { b: 2 } }];
|
||||
ctx.getInputData.mockReturnValue(items);
|
||||
|
||||
const result = await node.execute.call(ctx);
|
||||
|
||||
expect(result).toEqual([items]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
|
||||
// A pasted workflow using the hidden node must load and execute (as a pass-through)
|
||||
describe('Microsoft Excel (SharePoint) Node', () => {
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['noop.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [0, 0],
|
||||
"id": "8f4a1c22-6e1d-4a35-9c40-1af2f9f70301",
|
||||
"name": "When clicking ‘Test workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.microsoftExcelSharePoint",
|
||||
"typeVersion": 1,
|
||||
"position": [200, 0],
|
||||
"id": "4c9be7de-51f2-4633-8b0a-2f4f3f1f9d02",
|
||||
"name": "Microsoft Excel (SharePoint)"
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Excel (SharePoint)",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Microsoft Excel (SharePoint)": [
|
||||
{
|
||||
"json": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -682,6 +682,7 @@
|
||||
"dist/nodes/Microsoft/Dynamics/MicrosoftDynamicsCrm.node.js",
|
||||
"dist/nodes/Microsoft/Entra/MicrosoftEntra.node.js",
|
||||
"dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js",
|
||||
"dist/nodes/Microsoft/ExcelSharePoint/MicrosoftExcelSharePoint.node.js",
|
||||
"dist/nodes/Microsoft/GraphSecurity/MicrosoftGraphSecurity.node.js",
|
||||
"dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js",
|
||||
"dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.js",
|
||||
|
||||
Reference in New Issue
Block a user