mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
refactor(core): Fix misspelling of credentials (#3479)
This commit is contained in:
parent
34e891c0f8
commit
0f630b97cb
|
@ -19,7 +19,7 @@ import {
|
|||
awsApiRequestREST,
|
||||
IExpenseDocument,
|
||||
simplify,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
export class AwsTextract implements INodeType {
|
||||
|
@ -93,7 +93,7 @@ export class AwsTextract implements INodeType {
|
|||
credentialTest: {
|
||||
async awsTextractApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject, 'sts');
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject, 'sts');
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
|
|
|
@ -128,7 +128,7 @@ export interface IExpenseDocument {
|
|||
}];
|
||||
}
|
||||
|
||||
export async function validateCrendetials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject, service: string): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject, service: string): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = decryptedCredentials;
|
||||
|
||||
// Concatenate path and instantiate URL object so it parses correctly query strings
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
import {
|
||||
dhlApiRequest,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
export class Dhl implements INodeType {
|
||||
|
@ -103,7 +103,7 @@ export class Dhl implements INodeType {
|
|||
credentialTest: {
|
||||
async dhlApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
if (error.statusCode === 401) {
|
||||
return {
|
||||
|
|
|
@ -42,7 +42,7 @@ export async function dhlApiRequest(this: IHookFunctions | IExecuteFunctions | I
|
|||
}
|
||||
}
|
||||
|
||||
export async function validateCrendetials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = decryptedCredentials;
|
||||
|
||||
const { apiKey } = credentials as {
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
|
||||
import {
|
||||
dropcontactApiRequest,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
} from './GenericFunction';
|
||||
|
||||
export class Dropcontact implements INodeType {
|
||||
|
@ -273,7 +273,7 @@ export class Dropcontact implements INodeType {
|
|||
credentialTest: {
|
||||
async dropcontactApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
|
|
|
@ -57,7 +57,7 @@ export async function dropcontactApiRequest(
|
|||
}
|
||||
}
|
||||
|
||||
export async function validateCrendetials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = decryptedCredentials;
|
||||
|
||||
const { apiKey } = credentials as {
|
||||
|
|
|
@ -227,7 +227,7 @@ export function qsSetStatus(status: string) {
|
|||
|
||||
// Validation -----------------------------------------------------------------------
|
||||
|
||||
export async function validateCrendetials(
|
||||
export async function validateCredentials(
|
||||
this: ICredentialTestFunctions,
|
||||
decryptedCredentials: ICredentialDataDecryptedObject,
|
||||
): Promise<IHaloPSATokens> {
|
||||
|
|
|
@ -31,7 +31,7 @@ import {
|
|||
haloPSAApiRequestAllItems,
|
||||
qsSetStatus,
|
||||
simplifyHaloPSAGetOutput,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
export class HaloPSA implements INodeType {
|
||||
|
@ -201,7 +201,7 @@ export class HaloPSA implements INodeType {
|
|||
credential: ICredentialsDecrypted,
|
||||
): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
|
|
|
@ -69,7 +69,7 @@ export async function linearApiRequestAllItems(this: IHookFunctions | IExecuteFu
|
|||
return returnData;
|
||||
}
|
||||
|
||||
export async function validateCrendetials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = decryptedCredentials;
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
linearApiRequest,
|
||||
linearApiRequestAllItems,
|
||||
sort,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import {
|
||||
|
@ -79,7 +79,7 @@ export class Linear implements INodeType {
|
|||
credentialTest: {
|
||||
async linearApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
const { error: err } = error as JsonObject;
|
||||
const errors = (err as IDataObject).errors as [{ extensions: { code: string } }];
|
||||
|
|
|
@ -711,7 +711,7 @@ export function getConditions() {
|
|||
return elements;
|
||||
}
|
||||
|
||||
export function validateCrendetials(this: ICredentialTestFunctions, credentials: ICredentialDataDecryptedObject) {
|
||||
export function validateCredentials(this: ICredentialTestFunctions, credentials: ICredentialDataDecryptedObject) {
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${credentials.apiKey}`,
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
notionApiRequest,
|
||||
notionApiRequestAllItems,
|
||||
simplifyObjects,
|
||||
validateCrendetials,
|
||||
validateCredentials,
|
||||
validateJSON,
|
||||
} from '../GenericFunctions';
|
||||
|
||||
|
@ -198,7 +198,7 @@ export class NotionV2 implements INodeType {
|
|||
credentialTest: {
|
||||
async notionApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendetials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
|
|
Loading…
Reference in a new issue