mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
feat(Microsoft Entra ID Node): New node (#11779)
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
This commit is contained in:
committed by
GitHub
parent
52ae02abaa
commit
3006ccf41b
115
packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts
Normal file
115
packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodePropertyOptions,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType } 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 Micosoft Entra ID API',
|
||||
defaults: {
|
||||
name: 'Micosoft Entra ID',
|
||||
},
|
||||
inputs: [NodeConnectionType.Main],
|
||||
outputs: [NodeConnectionType.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'microsoftEntraOAuth2Api',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: 'https://graph.microsoft.com/v1.0',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user