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