mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)
This commit is contained in:
@@ -8,6 +8,10 @@ import { flow } from 'lodash';
|
||||
|
||||
import type { Zammad } from './types';
|
||||
|
||||
export function tolerateTrailingSlash(url: string) {
|
||||
return url.endsWith('/') ? url.substr(0, url.length - 1) : url;
|
||||
}
|
||||
|
||||
export async function zammadApiRequest(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
@@ -105,10 +109,6 @@ export async function zammadApiRequestAllItems(
|
||||
return returnData;
|
||||
}
|
||||
|
||||
export function tolerateTrailingSlash(url: string) {
|
||||
return url.endsWith('/') ? url.substr(0, url.length - 1) : url;
|
||||
}
|
||||
|
||||
export function throwOnEmptyUpdate(this: IExecuteFunctions, resource: string) {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
@@ -120,12 +120,12 @@ export function throwOnEmptyUpdate(this: IExecuteFunctions, resource: string) {
|
||||
// loadOptions utils
|
||||
// ----------------------------------
|
||||
|
||||
export const prettifyDisplayName = (fieldName: string) => fieldName.replace('name', ' Name');
|
||||
|
||||
export const fieldToLoadOption = (i: Zammad.Field) => {
|
||||
return { name: i.display ? prettifyDisplayName(i.display) : i.name, value: i.name };
|
||||
};
|
||||
|
||||
export const prettifyDisplayName = (fieldName: string) => fieldName.replace('name', ' Name');
|
||||
|
||||
export const isCustomer = (user: Zammad.User) =>
|
||||
user.role_ids.includes(3) && !user.email.endsWith('@zammad.org');
|
||||
|
||||
|
||||
4
packages/nodes-base/nodes/Zammad/types.d.ts
vendored
4
packages/nodes-base/nodes/Zammad/types.d.ts
vendored
@@ -23,9 +23,9 @@ export declare namespace Zammad {
|
||||
accessToken: string;
|
||||
};
|
||||
|
||||
export type UserAdditionalFields = IDataObject & Zammad.CustomFieldsUi & Zammad.AddressUi;
|
||||
export type UserAdditionalFields = IDataObject & CustomFieldsUi & AddressUi;
|
||||
export type UserUpdateFields = UserAdditionalFields;
|
||||
export type UserFilterFields = IDataObject & Zammad.SortUi;
|
||||
export type UserFilterFields = IDataObject & SortUi;
|
||||
|
||||
export type Organization = {
|
||||
active: boolean;
|
||||
|
||||
Reference in New Issue
Block a user