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,32 @@
import type { EmployeeDocumentProperties } from '../../Interfaces';
export const employeeDocumentDelDescription: EmployeeDocumentProperties = [
{
displayName: 'Employee ID',
name: 'employeeId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['employeeDocument'],
},
},
default: '',
description: 'ID of the employee',
},
{
displayName: 'File ID',
name: 'fileId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['employeeDocument'],
},
},
default: '',
description: 'ID of the employee file',
},
];
@@ -0,0 +1,21 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function del(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
const body: IDataObject = {};
const requestMethod = 'DELETE';
//meta data
const id: string = this.getNodeParameter('employeeId', index) as string;
const fileId: string = this.getNodeParameter('fileId', index) as string;
//endpoint
const endpoint = `employees/${id}/files/${fileId}`;
//response
await apiRequest.call(this, requestMethod, endpoint, body);
//return
return this.helpers.returnJsonArray({ success: true });
}
@@ -0,0 +1,4 @@
import { employeeDocumentDelDescription as description } from './description';
import { del as execute } from './execute';
export { description, execute };
@@ -0,0 +1,46 @@
import type { EmployeeDocumentProperties } from '../../Interfaces';
export const employeeDocumentDownloadDescription: EmployeeDocumentProperties = [
{
displayName: 'Employee ID',
name: 'employeeId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['download'],
resource: ['employeeDocument'],
},
},
default: '',
description: 'ID of the employee',
},
{
displayName: 'File ID',
name: 'fileId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['download'],
resource: ['employeeDocument'],
},
},
default: '',
description: 'ID of the employee file',
},
{
displayName: 'Put Output In Field',
name: 'output',
type: 'string',
default: 'data',
required: true,
description: 'The name of the output field to put the binary file data in',
displayOptions: {
show: {
operation: ['download'],
resource: ['employeeDocument'],
},
},
},
];
@@ -0,0 +1,57 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function download(this: IExecuteFunctions, index: number) {
const body: IDataObject = {};
const requestMethod = 'GET';
const items = this.getInputData();
//meta data
const id: string = this.getNodeParameter('employeeId', index) as string;
const fileId: string = this.getNodeParameter('fileId', index) as string;
const output: string = this.getNodeParameter('output', index) as string;
//endpoint
const endpoint = `employees/${id}/files/${fileId}/`;
//response
const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, {
encoding: null,
json: false,
resolveWithFullResponse: true,
});
let mimeType = response.headers['content-type'] as string | undefined;
mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined;
const contentDisposition = response.headers['content-disposition'];
const fileNameRegex = /(?<=filename=").*\b/;
const match = fileNameRegex.exec(contentDisposition as string);
let fileName = '';
// file name was found
if (match !== null) {
fileName = match[0];
}
const newItem: INodeExecutionData = {
json: items[index].json,
binary: {},
};
if (items[index].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.
Object.assign(newItem.binary, items[index].binary);
}
newItem.binary = {
[output]: await this.helpers.prepareBinaryData(
response.body as unknown as Buffer,
fileName,
mimeType,
),
};
return [newItem as unknown as INodeExecutionData[]];
}
@@ -0,0 +1,4 @@
import { employeeDocumentDownloadDescription as description } from './description';
import { download as execute } from './execute';
export { description, execute };
@@ -0,0 +1,61 @@
import type { EmployeeDocumentProperties } from '../../Interfaces';
export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [
{
displayName: 'Employee ID',
name: 'employeeId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['getAll'],
resource: ['employeeDocument'],
},
},
default: '',
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
displayOptions: {
show: {
operation: ['getAll'],
resource: ['employeeDocument'],
},
},
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 5,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
maxValue: 1000,
},
displayOptions: {
show: {
operation: ['getAll'],
resource: ['employeeDocument'],
returnAll: [false],
},
},
},
{
displayName: 'Simplify',
name: 'simplifyOutput',
type: 'boolean',
default: true,
displayOptions: {
show: {
operation: ['getAll'],
resource: ['employeeDocument'],
},
},
description: 'Whether to return a simplified version of the response instead of the raw data',
},
];
@@ -0,0 +1,52 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function getAll(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const body: IDataObject = {};
const requestMethod = 'GET';
//meta data
const id = this.getNodeParameter('employeeId', index) as string;
//limit parameters
const simplifyOutput: boolean = this.getNodeParameter('simplifyOutput', index) as boolean;
const returnAll: boolean = this.getNodeParameter('returnAll', 0, false);
const limit: number = this.getNodeParameter('limit', 0, 0);
//endpoint
const endpoint = `employees/${id}/files/view/`;
//response
const responseData = await apiRequest.call(this, requestMethod, endpoint, body);
const onlyFilesArray = [];
//return only files without categories
if (simplifyOutput) {
for (let i = 0; i < responseData.categories.length; i++) {
if (responseData.categories[i].hasOwnProperty('files')) {
for (let j = 0; j < responseData.categories[i].files.length; j++) {
onlyFilesArray.push(responseData.categories[i].files[j]);
}
}
}
if (!returnAll && onlyFilesArray.length > limit) {
return this.helpers.returnJsonArray(onlyFilesArray.slice(0, limit));
} else {
return this.helpers.returnJsonArray(onlyFilesArray);
}
}
//return limited result
if (!returnAll && responseData.categories.length > limit) {
return this.helpers.returnJsonArray(responseData.categories.slice(0, limit) as IDataObject[]);
}
//return
return this.helpers.returnJsonArray(responseData.categories as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { employeeDocumentGetAllDescription as description } from './description';
import { getAll as execute } from './execute';
export { description, execute };
@@ -0,0 +1,61 @@
import type { INodeProperties } from 'n8n-workflow';
import * as del from './del';
import * as download from './download';
import * as getAll from './getAll';
import * as update from './update';
import * as upload from './upload';
export { del, download, getAll, update, upload };
export const descriptions: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['employeeDocument'],
},
},
options: [
{
name: 'Delete',
value: 'delete',
description: 'Delete an employee document',
action: 'Delete an employee document',
},
{
name: 'Download',
value: 'download',
description: 'Download an employee document',
action: 'Download an employee document',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many employee documents',
action: 'Get many employee documents',
},
{
name: 'Update',
value: 'update',
description: 'Update an employee document',
action: 'Update an employee document',
},
{
name: 'Upload',
value: 'upload',
description: 'Upload an employee document',
action: 'Upload an employee document',
},
],
default: 'delete',
},
...del.description,
...download.description,
...getAll.description,
...update.description,
...upload.description,
];
@@ -0,0 +1,71 @@
import type { EmployeeDocumentProperties } from '../../Interfaces';
export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [
{
displayName: 'Employee ID',
name: 'employeeId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['update'],
resource: ['employeeDocument'],
},
},
default: '',
},
{
displayName: 'File ID',
name: 'fileId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['update'],
resource: ['employeeDocument'],
},
},
default: '',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: ['update'],
resource: ['employeeDocument'],
},
},
options: [
{
displayName: 'Employee Document Category Name or ID',
name: 'categoryId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getEmployeeDocumentCategories',
loadOptionsDependsOn: ['employeeId'],
},
default: '',
description:
'ID of the new category of the file. 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: '',
description: 'New name of the file',
},
{
displayName: 'Share with Employee',
name: 'shareWithEmployee',
type: 'boolean',
default: true,
description: 'Whether this file is shared or not',
},
],
},
];
@@ -0,0 +1,28 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function update(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
let body: IDataObject = {};
const requestMethod = 'POST';
//meta data
const id = this.getNodeParameter('employeeId', index) as string;
const fileId = this.getNodeParameter('fileId', index) as string;
//endpoint
const endpoint = `employees/${id}/files/${fileId}`;
//body parameters
body = this.getNodeParameter('updateFields', index);
body.shareWithEmployee ? (body.shareWithEmployee = 'yes') : (body.shareWithEmployee = 'no');
//response
await apiRequest.call(this, requestMethod, endpoint, body);
//return
return this.helpers.returnJsonArray({ success: true });
}
@@ -0,0 +1,4 @@
import { employeeDocumentUpdateDescription as description } from './description';
import { update as execute } from './execute';
export { description, execute };
@@ -0,0 +1,68 @@
import type { EmployeeDocumentProperties } from '../../Interfaces';
export const employeeDocumentUploadDescription: EmployeeDocumentProperties = [
{
displayName: 'Employee ID',
name: 'employeeId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['upload'],
resource: ['employeeDocument'],
},
},
default: '',
description: 'ID of the employee',
},
{
displayName: 'Employee Document Category ID',
name: 'categoryId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: ['upload'],
resource: ['employeeDocument'],
},
},
default: '',
},
{
displayName: 'Input Data Field Name',
name: 'binaryPropertyName',
type: 'string',
default: 'data',
displayOptions: {
show: {
operation: ['upload'],
resource: ['employeeDocument'],
},
},
required: true,
description:
'The name of the input field containing the binary file data to be uploaded. Supported file types: PNG, JPEG.',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['upload'],
resource: ['employeeDocument'],
},
},
default: {},
options: [
{
displayName: 'Share with Employee',
name: 'share',
type: 'boolean',
default: true,
description: 'Whether this file is shared or not',
},
],
},
];
@@ -0,0 +1,39 @@
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function upload(this: IExecuteFunctions, index: number) {
let body: IDataObject = {};
const requestMethod = 'POST';
const id: string = this.getNodeParameter('employeeId', index) as string;
const category = this.getNodeParameter('categoryId', index) as string;
const options = this.getNodeParameter('options', index);
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', index);
const { fileName, mimeType } = this.helpers.assertBinaryData(index, binaryPropertyName);
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(index, binaryPropertyName);
body = {
json: false,
formData: {
file: {
value: binaryDataBuffer,
options: {
filename: fileName,
contentType: mimeType,
},
},
fileName,
category,
},
resolveWithFullResponse: true,
};
if (options.hasOwnProperty('share') && body.formData) {
Object.assign(body.formData, options.share ? { share: 'yes' } : { share: 'no' });
}
//endpoint
const endpoint = `employees/${id}/files`;
const { headers } = await apiRequest.call(this, requestMethod, endpoint, {}, {}, body);
return this.helpers.returnJsonArray({ fileId: headers.location.split('/').pop() });
}
@@ -0,0 +1,4 @@
import { employeeDocumentUploadDescription as description } from './description';
import { upload as execute } from './execute';
export { description, execute };