mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Fix name of BambooHR node
This commit is contained in:
parent
88809936ee
commit
bbf3c4c004
|
@ -3,10 +3,10 @@ import {
|
||||||
INodeProperties,
|
INodeProperties,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
export class BambooHRApi implements ICredentialType {
|
export class BambooHrApi implements ICredentialType {
|
||||||
name = 'bambooHRApi';
|
name = 'bambooHrApi';
|
||||||
displayName = 'BambooHR API';
|
displayName = 'BambooHR API';
|
||||||
documentationUrl = 'bambooHR';
|
documentationUrl = 'bambooHr';
|
||||||
properties: INodeProperties[] = [
|
properties: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
displayName: 'Subdomain',
|
displayName: 'Subdomain',
|
|
@ -1,33 +0,0 @@
|
||||||
import {
|
|
||||||
AllEntities,
|
|
||||||
Entity,
|
|
||||||
PropertiesOf,
|
|
||||||
} from 'n8n-workflow';
|
|
||||||
|
|
||||||
type BambooHRMap = {
|
|
||||||
employee: 'create' | 'get' | 'getAll' | 'update';
|
|
||||||
employeeDocument: 'delete' | 'download' | 'get' | 'getAll' | 'update' | 'upload';
|
|
||||||
file: 'delete' | 'download' | 'getAll' | 'update';
|
|
||||||
companyReport: 'get';
|
|
||||||
};
|
|
||||||
|
|
||||||
export type BambooHR = AllEntities<BambooHRMap>;
|
|
||||||
|
|
||||||
export type BambooHRFile = Entity<BambooHRMap, 'file'>;
|
|
||||||
export type BambooHREmployee = Entity<BambooHRMap, 'employee'>;
|
|
||||||
export type BambooHREmployeeDocument = Entity<BambooHRMap, 'employeeDocument'>;
|
|
||||||
export type BambooHRCompanyReport = Entity<BambooHRMap, 'companyReport'>;
|
|
||||||
|
|
||||||
export type FileProperties = PropertiesOf<BambooHRFile>;
|
|
||||||
export type EmployeeProperties = PropertiesOf<BambooHREmployee>;
|
|
||||||
export type EmployeeDocumentProperties = PropertiesOf<BambooHREmployeeDocument>;
|
|
||||||
export type CompanyReportProperties = PropertiesOf<BambooHRCompanyReport>;
|
|
||||||
|
|
||||||
export interface IAttachment {
|
|
||||||
fields: {
|
|
||||||
item?: object[];
|
|
||||||
};
|
|
||||||
actions: {
|
|
||||||
item?: object[];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -13,7 +13,7 @@ import { versionDescription } from './v1/actions/versionDescription';
|
||||||
import { loadOptions } from './v1/methods';
|
import { loadOptions } from './v1/methods';
|
||||||
import { credentialTest } from './v1/methods';
|
import { credentialTest } from './v1/methods';
|
||||||
|
|
||||||
export class BambooHR implements INodeType {
|
export class BambooHr implements INodeType {
|
||||||
description: INodeTypeDescription;
|
description: INodeTypeDescription;
|
||||||
|
|
||||||
constructor(baseDescription: INodeTypeBaseDescription) {
|
constructor(baseDescription: INodeTypeBaseDescription) {
|
||||||
|
@ -23,7 +23,7 @@ export class BambooHR implements INodeType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
methods = {
|
methods = {
|
||||||
loadOptions,
|
loadOptions,
|
||||||
credentialTest,
|
credentialTest,
|
||||||
};
|
};
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
33
packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts
Normal file
33
packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import {
|
||||||
|
AllEntities,
|
||||||
|
Entity,
|
||||||
|
PropertiesOf,
|
||||||
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
|
type BambooHrMap = {
|
||||||
|
employee: 'create' | 'get' | 'getAll' | 'update';
|
||||||
|
employeeDocument: 'delete' | 'download' | 'get' | 'getAll' | 'update' | 'upload';
|
||||||
|
file: 'delete' | 'download' | 'getAll' | 'update';
|
||||||
|
companyReport: 'get';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type BambooHr = AllEntities<BambooHrMap>;
|
||||||
|
|
||||||
|
export type BambooHrFile = Entity<BambooHrMap, 'file'>;
|
||||||
|
export type BambooHrEmployee = Entity<BambooHrMap, 'employee'>;
|
||||||
|
export type BambooHrEmployeeDocument = Entity<BambooHrMap, 'employeeDocument'>;
|
||||||
|
export type BambooHrCompanyReport = Entity<BambooHrMap, 'companyReport'>;
|
||||||
|
|
||||||
|
export type FileProperties = PropertiesOf<BambooHrFile>;
|
||||||
|
export type EmployeeProperties = PropertiesOf<BambooHrEmployee>;
|
||||||
|
export type EmployeeDocumentProperties = PropertiesOf<BambooHrEmployeeDocument>;
|
||||||
|
export type CompanyReportProperties = PropertiesOf<BambooHrCompanyReport>;
|
||||||
|
|
||||||
|
export interface IAttachment {
|
||||||
|
fields: {
|
||||||
|
item?: object[];
|
||||||
|
};
|
||||||
|
actions: {
|
||||||
|
item?: object[];
|
||||||
|
};
|
||||||
|
}
|
|
@ -50,7 +50,7 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[]
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'United States',
|
placeholder: 'United States',
|
||||||
description: 'The name of the country. Must exist in the BambooHR country list',
|
description: 'The name of the country. Must exist in the BambooHr country list',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -321,4 +321,4 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return elements;
|
return elements;
|
||||||
};
|
};
|
|
@ -50,7 +50,7 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[]
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'United States',
|
placeholder: 'United States',
|
||||||
description: 'The name of the country. Must exist in the BambooHR country list',
|
description: 'The name of the country. Must exist in the BambooHr country list',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -347,4 +347,4 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return elements;
|
return elements;
|
||||||
};
|
};
|
|
@ -11,20 +11,20 @@ import * as employeeDocument from './employeeDocument';
|
||||||
import * as file from './file';
|
import * as file from './file';
|
||||||
import * as companyReport from './companyReport';
|
import * as companyReport from './companyReport';
|
||||||
|
|
||||||
import { BambooHR } from './Interfaces';
|
import { BambooHr } from './Interfaces';
|
||||||
|
|
||||||
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[]> {
|
export async function router(this: IExecuteFunctions): Promise<INodeExecutionData[]> {
|
||||||
const items = this.getInputData();
|
const items = this.getInputData();
|
||||||
const operationResult: INodeExecutionData[] = [];
|
const operationResult: INodeExecutionData[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
const resource = this.getNodeParameter<BambooHR>('resource', i);
|
const resource = this.getNodeParameter<BambooHr>('resource', i);
|
||||||
const operation = this.getNodeParameter('operation', i);
|
const operation = this.getNodeParameter('operation', i);
|
||||||
|
|
||||||
const bamboohr = {
|
const bamboohr = {
|
||||||
resource,
|
resource,
|
||||||
operation,
|
operation,
|
||||||
} as BambooHR;
|
} as BambooHr;
|
||||||
|
|
||||||
if (bamboohr.operation === 'delete') {
|
if (bamboohr.operation === 'delete') {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
|
@ -10,7 +10,7 @@ import * as companyReport from './companyReport';
|
||||||
export const versionDescription: INodeTypeDescription = {
|
export const versionDescription: INodeTypeDescription = {
|
||||||
credentials: [
|
credentials: [
|
||||||
{
|
{
|
||||||
name: 'bambooHRApi',
|
name: 'bambooHrApi',
|
||||||
required: true,
|
required: true,
|
||||||
testedBy: 'bambooHrApiCredentialTest',
|
testedBy: 'bambooHrApiCredentialTest',
|
||||||
},
|
},
|
||||||
|
@ -21,9 +21,9 @@ export const versionDescription: INodeTypeDescription = {
|
||||||
description: 'Consume BambooHR API',
|
description: 'Consume BambooHR API',
|
||||||
displayName: 'BambooHR',
|
displayName: 'BambooHR',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
icon: 'file:bambooHR.png',
|
icon: 'file:bambooHr.png',
|
||||||
inputs: ['main'],
|
inputs: ['main'],
|
||||||
name: 'bambooHR',
|
name: 'bambooHr',
|
||||||
outputs: ['main'],
|
outputs: ['main'],
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
|
@ -57,4 +57,4 @@ export const versionDescription: INodeTypeDescription = {
|
||||||
],
|
],
|
||||||
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
||||||
version: 1,
|
version: 1,
|
||||||
};
|
};
|
|
@ -25,7 +25,7 @@ export async function apiRequest(
|
||||||
query: IDataObject = {},
|
query: IDataObject = {},
|
||||||
option: IDataObject = {},
|
option: IDataObject = {},
|
||||||
) {
|
) {
|
||||||
const credentials = await this.getCredentials('bambooHRApi');
|
const credentials = await this.getCredentials('bambooHrApi');
|
||||||
|
|
||||||
if (!credentials) {
|
if (!credentials) {
|
||||||
throw new NodeOperationError(this.getNode(), 'No credentials returned!');
|
throw new NodeOperationError(this.getNode(), 'No credentials returned!');
|
|
@ -44,7 +44,7 @@
|
||||||
"dist/credentials/AutomizyApi.credentials.js",
|
"dist/credentials/AutomizyApi.credentials.js",
|
||||||
"dist/credentials/AutopilotApi.credentials.js",
|
"dist/credentials/AutopilotApi.credentials.js",
|
||||||
"dist/credentials/Aws.credentials.js",
|
"dist/credentials/Aws.credentials.js",
|
||||||
"dist/credentials/BambooHRApi.credentials.js",
|
"dist/credentials/BambooHrApi.credentials.js",
|
||||||
"dist/credentials/BannerbearApi.credentials.js",
|
"dist/credentials/BannerbearApi.credentials.js",
|
||||||
"dist/credentials/BaserowApi.credentials.js",
|
"dist/credentials/BaserowApi.credentials.js",
|
||||||
"dist/credentials/BeeminderApi.credentials.js",
|
"dist/credentials/BeeminderApi.credentials.js",
|
||||||
|
@ -348,7 +348,7 @@
|
||||||
"dist/nodes/Aws/SQS/AwsSqs.node.js",
|
"dist/nodes/Aws/SQS/AwsSqs.node.js",
|
||||||
"dist/nodes/Aws/Textract/AwsTextract.node.js",
|
"dist/nodes/Aws/Textract/AwsTextract.node.js",
|
||||||
"dist/nodes/Aws/Transcribe/AwsTranscribe.node.js",
|
"dist/nodes/Aws/Transcribe/AwsTranscribe.node.js",
|
||||||
"dist/nodes/BambooHR/BambooHR.node.js",
|
"dist/nodes/BambooHr/BambooHr.node.js",
|
||||||
"dist/nodes/Bannerbear/Bannerbear.node.js",
|
"dist/nodes/Bannerbear/Bannerbear.node.js",
|
||||||
"dist/nodes/Baserow/Baserow.node.js",
|
"dist/nodes/Baserow/Baserow.node.js",
|
||||||
"dist/nodes/Beeminder/Beeminder.node.js",
|
"dist/nodes/Beeminder/Beeminder.node.js",
|
||||||
|
|
Loading…
Reference in a new issue