first commit
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

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,547 @@
import type {
IExecuteFunctions,
ILoadOptionsFunctions,
IDataObject,
INodeProperties,
INodePropertyOptions,
JsonObject,
IHttpRequestMethods,
IRequestOptions,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function microsoftApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
resource: string,
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
): Promise<any> {
const credentials = await this.getCredentials<{
subdomain: string;
region: string;
}>('microsoftDynamicsOAuth2Api');
let options: IRequestOptions = {
headers: {
'Content-Type': 'application/json',
accept: 'application/json',
Prefer: 'return=representation',
},
method,
body,
qs,
uri: uri || `https://${credentials.subdomain}.${credentials.region}/api/data/v9.2${resource}`,
json: true,
};
try {
if (Object.keys(option).length !== 0) {
options = Object.assign({}, options, option);
}
return await this.helpers.requestOAuth2.call(this, 'microsoftDynamicsOAuth2Api', options, {
property: 'id_token',
});
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
export async function microsoftApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
propertyName: string,
method: IHttpRequestMethods,
endpoint: string,
body: any = {},
query: IDataObject = {},
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
let uri: string | undefined;
query.$top = 100;
do {
responseData = await microsoftApiRequest.call(this, method, endpoint, body, query, uri);
uri = responseData['@odata.nextLink'];
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (responseData['@odata.nextLink'] !== undefined);
return returnData;
}
export async function getPicklistOptions(
this: ILoadOptionsFunctions,
entityName: string,
attributeName: string,
): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const endpoint = `/EntityDefinitions(LogicalName='${entityName}')/Attributes(LogicalName='${attributeName}')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet($select=Options),GlobalOptionSet($select=Options)`;
const {
OptionSet: { Options: options },
} = await microsoftApiRequest.call(this, 'GET', endpoint);
for (const option of options) {
returnData.push({
name: option.Label.UserLocalizedLabel.Label,
value: option.Value,
});
}
return returnData;
}
export async function getEntityFields(
this: ILoadOptionsFunctions,
entityName: string,
): Promise<IField[]> {
const endpoint = `/EntityDefinitions(LogicalName='${entityName}')/Attributes`;
const { value } = await microsoftApiRequest.call(this, 'GET', endpoint);
return value;
}
export function adjustAddresses(addresses: [{ [key: string]: string }]) {
const results: { [key: string]: any } = {};
for (const [index, address] of addresses.entries()) {
for (const key of Object.keys(address)) {
if (address[key] !== '') {
results[`address${index + 1}_${key}`] = address[key];
}
}
}
return results;
}
export function getAccountFields(): INodeProperties[] {
return [
{
displayName: 'Account Category Name or ID',
name: 'accountcategorycode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAccountCategories',
},
default: '',
description:
'Category to indicate whether the customer account is standard or preferred. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Account Rating Name or ID',
name: 'accountratingcode',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getAccountRatingCodes',
},
default: '',
},
{
displayName: 'Address',
name: 'addresses',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Address Field',
options: [
{
displayName: 'Address Fields',
name: 'address',
values: [
{
displayName: 'Address Type Name or ID',
name: 'addresstypecode',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getAddressTypes',
},
default: '',
},
{
displayName: 'Line1',
name: 'line1',
type: 'string',
default: '',
},
{
displayName: 'Line2',
name: 'line2',
type: 'string',
default: '',
},
{
displayName: 'Line3',
name: 'line3',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State or Province',
name: 'stateorprovince',
type: 'string',
default: '',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Postalcode',
name: 'postalcode',
type: 'string',
default: '',
},
{
displayName: 'Primary Contact Name',
name: 'primarycontactname',
type: 'string',
default: '',
},
{
displayName: 'Telephone1',
name: 'telephone1',
type: 'string',
default: '',
},
{
displayName: 'Telephone2',
name: 'telephone2',
type: 'string',
default: '',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Business Type Name or ID',
name: 'businesstypecode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBusinessTypes',
},
default: '',
description:
'The legal designation or other business type of the account for contracts or reporting purposes. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Customer Size Name or ID',
name: 'customersizecode',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getCustomerSizeCodes',
},
default: '',
},
{
displayName: 'Customer Type Name or ID',
name: 'customertypecode',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getCustomerTypeCodes',
},
default: '',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description:
'Additional information to describe the account, such as an excerpt from the companys website',
},
{
displayName: 'Email Address 1',
name: 'emailaddress1',
type: 'string',
default: '',
description: 'The primary email address for the account',
},
{
displayName: 'Email Address 2',
name: 'emailaddress2',
type: 'string',
default: '',
description: 'The secondary email address for the account',
},
{
displayName: 'Email Address 3',
name: 'emailaddress3',
type: 'string',
default: '',
description: 'Alternate email address for the account',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
},
{
displayName: 'FTP site URL',
name: 'ftpsiteurl',
type: 'string',
default: '',
description:
'URL for the accounts FTP site to enable users to access data and share documents',
},
{
displayName: 'Industry Name or ID',
name: 'industrycode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getIndustryCodes',
},
default: '',
description:
'The accounts primary industry for use in marketing segmentation and demographic analysis. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
displayOptions: {
show: {
'/resource': ['account'],
'/operation': ['update'],
},
},
description: 'Company o business name',
},
{
displayName: 'Credit Limit',
name: 'creditlimit',
type: 'number',
default: '',
description:
'Credit limit of the account. This is a useful reference when you address invoice and accounting issues with the customer.',
},
{
displayName: 'Number Of Employees',
name: 'numberofemployees',
type: 'number',
default: 0,
description:
'Number of employees that work at the account for use in marketing segmentation and demographic analysis',
},
{
displayName: 'Payment Terms Name or ID',
name: 'paymenttermscode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPaymentTermsCodes',
},
default: '',
description:
'The payment terms to indicate when the customer needs to pay the total amount. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Preferred Appointment Day Name or ID',
name: 'preferredappointmentdaycode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPreferredAppointmentDayCodes',
},
default: '',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
},
{
displayName: 'Preferred Appointment Time Name or ID',
name: 'preferredappointmenttimecode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPreferredAppointmentTimeCodes',
},
default: '',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
},
{
displayName: 'Preferred Contact Method Name or ID',
name: 'preferredcontactmethodcode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPreferredContactMethodCodes',
},
default: '',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
},
{
displayName: 'Primary Satori ID',
name: 'primarysatoriid',
type: 'string',
default: '',
},
{
displayName: 'Primary Twitter ID',
name: 'primarytwitterid',
type: 'string',
default: '',
},
{
displayName: 'Revenue',
name: 'revenue',
type: 'number',
default: '',
description:
'The annual revenue for the account, used as an indicator in financial performance analysis',
},
{
displayName: 'Shares Outstanding',
name: 'sharesoutstanding',
type: 'number',
default: '',
description:
'The number of shares available to the public for the account. This number is used as an indicator in financial performance analysis.',
},
{
displayName: 'Shipping Method Name or ID',
name: 'shippingmethodcode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getShippingMethodCodes',
},
default: '',
description:
'Shipping method for deliveries sent to the accounts address to designate the preferred carrier or other delivery option. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'SIC',
name: 'sic',
type: 'string',
default: '',
description:
'The Standard Industrial Classification (SIC) code that indicates the accounts primary industry of business, for use in marketing segmentation and demographic analysis',
},
{
displayName: 'Stage ID',
name: 'stageid',
type: 'string',
default: '',
},
{
displayName: 'Stock Exchange',
name: 'stockexchange',
type: 'string',
default: '',
description:
'The stock exchange at which the account is listed to track their stock and financial performance of the company',
},
{
displayName: 'Telephone 1',
name: 'telephone1',
type: 'string',
default: '',
description: 'The main phone number for this account',
},
{
displayName: 'Telephone 2',
name: 'telephone2',
type: 'string',
default: '',
description: 'The second phone number for this account',
},
{
displayName: 'Telephone 3',
name: 'telephone3',
type: 'string',
default: '',
description: 'The third phone number for this account',
},
{
displayName: 'Territory Name or ID',
name: 'territorycode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTerritoryCodes',
},
default: '',
description:
'Region or territory for the account for use in segmentation and analysis. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Ticker Symbol',
name: 'tickersymbol',
type: 'string',
default: '',
description:
'Type the stock exchange symbol for the account to track financial performance of the company. You can click the code entered in this field to access the latest trading information from MSN Money.',
},
{
displayName: 'Website URL',
name: 'websiteurl',
type: 'string',
default: '',
description: 'The accounts website URL to get quick details about the company profile',
},
{
displayName: 'Yomi Name',
name: 'yominame',
type: 'string',
default: '',
description:
'The phonetic spelling of the company name, if specified in Japanese, to make sure the name is pronounced correctly in phone calls and other communications',
},
];
}
export const sort = (a: { name: string }, b: { name: string }) => {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
};
export interface IField {
IsRetrievable: boolean;
LogicalName: string;
IsSearchable: string;
IsValidODataAttribute: string;
IsValidForRead: string;
CanBeSecuredForRead: string;
AttributeType: string;
IsSortableEnabled: {
Value: boolean;
};
DisplayName: {
UserLocalizedLabel: {
Label: string;
};
};
}
@@ -0,0 +1,18 @@
{
"node": "n8n-nodes-base.microsoftDynamicsCrm",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Marketing", "Sales"],
"resources": {
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/microsoft/"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftdynamicscrm/"
}
]
}
}
@@ -0,0 +1,299 @@
import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { accountFields, accountOperations } from './descriptions';
import type { IField } from './GenericFunctions';
import {
adjustAddresses,
getEntityFields,
getPicklistOptions,
microsoftApiRequest,
microsoftApiRequestAllItems,
sort,
} from './GenericFunctions';
export class MicrosoftDynamicsCrm implements INodeType {
description: INodeTypeDescription = {
displayName: 'Microsoft Dynamics CRM',
name: 'microsoftDynamicsCrm',
icon: { light: 'file:microsoftDynamicsCrm.svg', dark: 'file:microsoftDynamicsCrm.dark.svg' },
group: ['input'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Microsoft Dynamics CRM API',
defaults: {
name: 'Microsoft Dynamics CRM',
},
usableAsTool: true,
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'microsoftDynamicsOAuth2Api',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Account',
value: 'account',
},
],
default: 'account',
},
...accountOperations,
...accountFields,
],
};
methods = {
loadOptions: {
async getAccountCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'accountcategorycode');
},
async getAccountRatingCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'accountratingcode');
},
async getAddressTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'address1_addresstypecode');
},
async getBusinessTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'businesstypecode');
},
async getCustomerSizeCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'customersizecode');
},
async getCustomerTypeCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'customertypecode');
},
async getIndustryCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'industrycode');
},
async getPaymentTermsCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'paymenttermscode');
},
async getPreferredAppointmentDayCodes(
this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'preferredappointmentdaycode');
},
async getPreferredAppointmentTimeCodes(
this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'preferredappointmenttimecode');
},
async getPreferredContactMethodCodes(
this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'preferredcontactmethodcode');
},
async getShippingMethodCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'shippingmethodcode');
},
async getTerritoryCodes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return await getPicklistOptions.call(this, 'account', 'territorycode');
},
async getAccountFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const fields = await getEntityFields.call(this, 'account');
const isSelectable = (field: IField) =>
field.IsValidForRead &&
field.CanBeSecuredForRead &&
field.IsValidODataAttribute &&
field.LogicalName !== 'slaid';
return fields
.filter(isSelectable)
.filter((field) => field.DisplayName.UserLocalizedLabel?.Label)
.map((field) => ({
name: field.DisplayName.UserLocalizedLabel.Label,
value: field.LogicalName,
}))
.sort(sort);
},
async getExpandableAccountFields(
this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> {
const fields = await getEntityFields.call(this, 'account');
const isSelectable = (field: IField) =>
field.IsValidForRead &&
field.CanBeSecuredForRead &&
field.IsValidODataAttribute &&
field.AttributeType === 'Lookup' &&
field.LogicalName !== 'slaid';
return fields
.filter(isSelectable)
.map((field) => ({
name: field.DisplayName.UserLocalizedLabel.Label,
value: field.LogicalName,
}))
.sort(sort);
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
const length = items.length;
const qs: IDataObject = {};
let responseData;
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
for (let i = 0; i < length; i++) {
try {
if (resource === 'account') {
//https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/create-entity-web-api
if (operation === 'create') {
const name = this.getNodeParameter('name', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i) as {
addresses: { address: [{ [key: string]: any }] };
};
const options = this.getNodeParameter('options', i) as { returnFields: string[] };
const body = {
name,
...additionalFields,
};
if (body?.addresses?.address) {
Object.assign(body, adjustAddresses(body.addresses.address));
//@ts-ignore
delete body?.addresses;
}
if (options.returnFields) {
options.returnFields.push('accountid');
qs.$select = options.returnFields.join(',');
} else {
qs.$select = 'accountid';
}
responseData = await microsoftApiRequest.call(this, 'POST', '/accounts', body, qs);
}
if (operation === 'delete') {
//https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/update-delete-entities-using-web-api#basic-delete
const accountId = this.getNodeParameter('accountId', i) as string;
await microsoftApiRequest.call(this, 'DELETE', `/accounts(${accountId})`, {}, qs);
responseData = { success: true };
}
if (operation === 'get') {
//https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/retrieve-entity-using-web-api
const accountId = this.getNodeParameter('accountId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.returnFields) {
qs.$select = (options.returnFields as string[]).join(',');
}
if (options.expandFields) {
qs.$expand = (options.expandFields as string[]).join(',');
}
responseData = await microsoftApiRequest.call(
this,
'GET',
`/accounts(${accountId})`,
{},
qs,
);
}
if (operation === 'getAll') {
//https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i);
const filters = this.getNodeParameter('filters', i);
if (options.returnFields) {
qs.$select = (options.returnFields as string[]).join(',');
}
if (options.expandFields) {
qs.$expand = (options.expandFields as string[]).join(',');
}
if (filters.query) {
qs.$filter = filters.query as string;
}
if (returnAll) {
responseData = await microsoftApiRequestAllItems.call(
this,
'value',
'GET',
'/accounts',
{},
qs,
);
} else {
qs.$top = this.getNodeParameter('limit', 0);
responseData = await microsoftApiRequest.call(this, 'GET', '/accounts', {}, qs);
responseData = responseData.value;
}
}
if (operation === 'update') {
const accountId = this.getNodeParameter('accountId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i) as {
addresses: { address: [{ [key: string]: any }] };
};
const options = this.getNodeParameter('options', i) as { returnFields: string[] };
const body = {
...updateFields,
};
if (body?.addresses?.address) {
Object.assign(body, adjustAddresses(body.addresses.address));
//@ts-ignore
delete body?.addresses;
}
if (options.returnFields) {
options.returnFields.push('accountid');
qs.$select = options.returnFields.join(',');
} else {
qs.$select = 'accountid';
}
responseData = await microsoftApiRequest.call(
this,
'PATCH',
`/accounts(${accountId})`,
body,
qs,
);
}
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
} catch (error) {
if (this.continueOnFail()) {
const executionErrorData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray({ error: error.message }),
{ itemData: { item: i } },
);
returnData.push(...executionErrorData);
continue;
}
throw error;
}
}
return [returnData];
}
}
@@ -0,0 +1,233 @@
import type { INodeProperties } from 'n8n-workflow';
import { getAccountFields } from '../GenericFunctions';
export const accountOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['account'],
},
},
options: [
{
name: 'Create',
value: 'create',
action: 'Create an account',
},
{
name: 'Delete',
value: 'delete',
action: 'Delete an account',
},
{
name: 'Get',
value: 'get',
action: 'Get an account',
},
{
name: 'Get Many',
value: 'getAll',
action: 'Get many accounts',
},
{
name: 'Update',
value: 'update',
action: 'Update an account',
},
],
default: 'create',
},
];
export const accountFields: INodeProperties[] = [
// ----------------------------------------
// account:create
// ----------------------------------------
{
displayName: 'Name',
name: 'name',
description: 'Company or business name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['account'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['account'],
operation: ['create'],
},
},
options: [...getAccountFields()],
},
// ----------------------------------------
// account:get
// ----------------------------------------
{
displayName: 'Account ID',
name: 'accountId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['account'],
operation: ['delete', 'get', 'update'],
},
},
},
// ----------------------------------------
// account:getAll
// ----------------------------------------
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['account'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['account'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['account'],
operation: ['get', 'getAll'],
},
},
options: [
{
displayName: 'Return Field Names or IDs',
name: 'returnFields',
type: 'multiOptions',
description:
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getAccountFields',
},
default: [],
},
{
displayName: 'Expand Field Names or IDs',
name: 'expandFields',
type: 'multiOptions',
description:
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getExpandableAccountFields',
},
default: [],
},
],
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['account'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Query',
name: 'query',
type: 'string',
default: '',
description:
'Query to filter the results. Check <a href="https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api#filter-results" target="_blank">filters</a>.',
},
],
},
// ----------------------------------------
// account:update
// ----------------------------------------
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['account'],
operation: ['update'],
},
},
options: [...getAccountFields()],
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['account'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Return Field Names or IDs',
name: 'returnFields',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getAccountFields',
},
default: [],
description:
'Fields the response will include. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
],
},
];
@@ -0,0 +1 @@
export * from './AccountDescription';
@@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.7888 5.90441e-05C8.57858 0.00300251 8.37796 0.0885859 8.23034 0.238298C8.08273 0.38801 7.99998 0.589814 8 0.800062V10.6833C7.99984 10.834 8.04225 10.9817 8.12236 11.1094C8.20247 11.2371 8.31702 11.3395 8.4528 11.4049L22.8529 18.3201C22.9781 18.3806 23.1169 18.4074 23.2557 18.3979C23.3944 18.3883 23.5283 18.3428 23.6441 18.2657L30.8441 13.4657C30.9586 13.3899 31.0515 13.2859 31.114 13.1636C31.1765 13.0414 31.2064 12.9051 31.2007 12.7679C31.1951 12.6307 31.1542 12.4973 31.0819 12.3806C31.0096 12.2639 30.9084 12.1678 30.7881 12.1017L9.18801 0.101659C9.06585 0.0333917 8.92793 -0.00164085 8.788 5.90441e-05M8.82 13.6001C8.67738 13.597 8.53651 13.6321 8.412 13.7017C8.28733 13.7709 8.1834 13.8721 8.11096 13.9948C8.03853 14.1176 8.00022 14.2576 8 14.4001V39.1986C7.99976 39.3376 8.03574 39.4743 8.10438 39.5951C8.17303 39.716 8.27198 39.8169 8.39148 39.8878C8.51099 39.9588 8.64692 39.9974 8.78589 39.9999C8.92486 40.0023 9.06207 39.9685 9.18401 39.9018L31.5969 27.0938C31.7192 27.0239 31.8209 26.9229 31.8917 26.8012C31.9625 26.6794 31.9999 26.541 32.0001 26.4002V16.0001C32.0003 15.8406 31.9527 15.6846 31.8636 15.5523C31.7744 15.42 31.6477 15.3173 31.4998 15.2576C31.3519 15.1978 31.1895 15.1836 31.0334 15.2169C30.8774 15.2501 30.7348 15.3292 30.6241 15.4441L9.60001 37.6002L15.964 18.6361C16.0161 18.4675 16.0108 18.2863 15.9492 18.121C15.8876 17.9556 15.773 17.8152 15.6232 17.7217L9.22321 13.7217C9.10208 13.6459 8.96285 13.6039 8.82 13.6001Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.7888 5.90441e-05C8.57858 0.00300251 8.37796 0.0885859 8.23034 0.238298C8.08273 0.38801 7.99998 0.589814 8 0.800062V10.6833C7.99984 10.834 8.04225 10.9817 8.12236 11.1094C8.20247 11.2371 8.31702 11.3395 8.4528 11.4049L22.8529 18.3201C22.9781 18.3806 23.1169 18.4074 23.2557 18.3979C23.3944 18.3883 23.5283 18.3428 23.6441 18.2657L30.8441 13.4657C30.9586 13.3899 31.0515 13.2859 31.114 13.1636C31.1765 13.0414 31.2064 12.9051 31.2007 12.7679C31.1951 12.6307 31.1542 12.4973 31.0819 12.3806C31.0096 12.2639 30.9084 12.1678 30.7881 12.1017L9.18801 0.101659C9.06585 0.0333917 8.92793 -0.00164085 8.788 5.90441e-05M8.82 13.6001C8.67738 13.597 8.53651 13.6321 8.412 13.7017C8.28733 13.7709 8.1834 13.8721 8.11096 13.9948C8.03853 14.1176 8.00022 14.2576 8 14.4001V39.1986C7.99976 39.3376 8.03574 39.4743 8.10438 39.5951C8.17303 39.716 8.27198 39.8169 8.39148 39.8878C8.51099 39.9588 8.64692 39.9974 8.78589 39.9999C8.92486 40.0023 9.06207 39.9685 9.18401 39.9018L31.5969 27.0938C31.7192 27.0239 31.8209 26.9229 31.8917 26.8012C31.9625 26.6794 31.9999 26.541 32.0001 26.4002V16.0001C32.0003 15.8406 31.9527 15.6846 31.8636 15.5523C31.7744 15.42 31.6477 15.3173 31.4998 15.2576C31.3519 15.1978 31.1895 15.1836 31.0334 15.2169C30.8774 15.2501 30.7348 15.3292 30.6241 15.4441L9.60001 37.6002L15.964 18.6361C16.0161 18.4675 16.0108 18.2863 15.9492 18.121C15.8876 17.9556 15.773 17.8152 15.6232 17.7217L9.22321 13.7217C9.10208 13.6459 8.96285 13.6039 8.82 13.6001Z" fill="#00255A"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB