Files
alighasami 3d5eaf9445
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
first commit
2026-03-17 16:22:57 +03:30

119 lines
2.7 KiB
TypeScript

import type {
ILoadOptionsFunctions,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { groupFields, groupOperations, userFields, userOperations } from './descriptions';
import { getGroupProperties, getGroups, getUserProperties, getUsers } from './GenericFunctions';
export class MicrosoftEntra implements INodeType {
description: INodeTypeDescription = {
displayName: 'Microsoft Entra ID',
name: 'microsoftEntra',
icon: {
light: 'file:microsoftEntra.svg',
dark: 'file:microsoftEntra.dark.svg',
},
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Interact with Microsoft Entra ID API',
schemaPath: 'Microsoft/Entra',
defaults: {
name: 'Microsoft Entra ID',
},
usableAsTool: true,
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'microsoftEntraOAuth2Api',
required: true,
},
],
requestDefaults: {
headers: {
'Content-Type': 'application/json',
},
baseURL:
'={{ ($credentials.graphApiBaseUrl || "https://graph.microsoft.com").replace(/\\/+$/, "") }}/v1.0',
},
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Group',
value: 'group',
},
{
name: 'User',
value: 'user',
},
],
default: 'user',
},
...groupOperations,
...groupFields,
...userOperations,
...userFields,
],
};
methods = {
loadOptions: {
getGroupProperties,
async getGroupPropertiesGetAll(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
// Filter items not supported for list endpoint
return (await getGroupProperties.call(this)).filter(
(x) =>
![
'allowExternalSenders',
'autoSubscribeNewMembers',
'hideFromAddressLists',
'hideFromOutlookClients',
'isSubscribedByMail',
'unseenCount',
].includes(x.value as string),
);
},
getUserProperties,
async getUserPropertiesGetAll(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
// Filter items not supported for list endpoint
return (await getUserProperties.call(this)).filter(
(x) =>
![
'aboutMe',
'birthday',
'hireDate',
'interests',
'mySite',
'pastProjects',
'preferredName',
'responsibilities',
'schools',
'skills',
'mailboxSettings',
].includes(x.value as string),
);
},
},
listSearch: {
getGroups,
getUsers,
},
};
}