Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8N-3123-node-metabase #3033

Merged
merged 34 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
551d318
Boilerplate with new node's version for metabse
agobrech Mar 12, 2022
fd5d208
Metabases MVP features
agobrech Mar 14, 2022
5f1b760
Added new credential for metabse, added custom auth for metabase
agobrech Mar 21, 2022
232bffa
Fixed bug with one enpoint not working
agobrech Mar 21, 2022
d232822
Clean up code
agobrech Mar 21, 2022
a985a83
Uniformised the renovate token
agobrech Mar 22, 2022
80029ca
Made two example of responses for review
agobrech Mar 23, 2022
c58be29
Fixed lint issues
agobrech Mar 23, 2022
defc39a
Feature add datasources
agobrech Mar 28, 2022
5014917
Changed output from databases
agobrech Mar 28, 2022
7fd96c1
Changed questions data output
agobrech Mar 30, 2022
4722766
Fixed issue when testing credentials with new node format
agobrech Apr 13, 2022
b048de4
Merge branch 'master' into n8n-3123-node-metabase
agobrech Apr 14, 2022
f14d5fd
Add the possibility to get raw data
agobrech Apr 14, 2022
fabad11
Removed handle for the metabase meta results, changed export's name
agobrech Apr 25, 2022
0675292
Add binary extraction for the result data
agobrech Apr 28, 2022
1cd0b60
Fixed binary download issue
agobrech May 18, 2022
8206e57
Merge branch 'master' into n8n-3123-node-metabase
agobrech May 24, 2022
1b28270
:zap: Add preAuthentication method to credentials
RicardoE105 May 30, 2022
fbfc483
Revert "Added new credential for metabse, added custom auth for metab…
agobrech May 31, 2022
76c8782
Revert "Added new credential for metabse, added custom auth for metab…
agobrech May 31, 2022
47ba5bd
Merge branch 'master' into n8n-3123-node-metabase
agobrech May 31, 2022
b707b79
Merge branch 'feature/pre-authentication-method' into n8n-3123-node-m…
agobrech May 31, 2022
2e89114
Added preAuth and fixed autfixable linting rules
agobrech May 31, 2022
0330378
Fixed linting errors
agobrech May 31, 2022
2274dc4
Linting fixes
agobrech Jun 7, 2022
dff5ec6
Remove / at the end of url, and add placeholder for cred url
agobrech Jun 7, 2022
c952365
Make export to Json retun only json and no binary
agobrech Jun 7, 2022
3294d6d
Merge with master and fix conflicts
krynble Jul 20, 2022
85164ee
Fix lint issues
krynble Jul 20, 2022
e794c88
Add action and exception for lint rule
krynble Jul 20, 2022
78ed8ad
Remove unnecessary credential file
krynble Jul 25, 2022
8232f24
Merge master
krynble Jul 25, 2022
3217f93
:zap: Simplify and cleanup
janober Jul 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/cli/src/CredentialsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export class CredentialsHelper extends ICredentialsHelper {
if (credentialType.authenticate) {
if (typeof credentialType.authenticate === 'function') {
// Special authentication function is defined

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
return credentialType.authenticate(credentials, requestOptions as IHttpRequestOptions);
}
Expand Down Expand Up @@ -559,7 +558,6 @@ export class CredentialsHelper extends ICredentialsHelper {
nodeToTestWith?: string,
): Promise<INodeCredentialTestResult> {
const credentialTestFunction = this.getCredentialTestFunction(credentialType, nodeToTestWith);

if (credentialTestFunction === undefined) {
return Promise.resolve({
status: 'Error',
Expand Down Expand Up @@ -690,7 +688,6 @@ export class CredentialsHelper extends ICredentialsHelper {
statusCode: error.cause.response.status,
statusMessage: error.cause.response.statusText,
};

if (credentialTestFunction.testRequest.rules) {
// Special testing rules are defined so check all in order
for (const rule of credentialTestFunction.testRequest.rules) {
Expand All @@ -716,6 +713,11 @@ export class CredentialsHelper extends ICredentialsHelper {
`Received HTTP status code: ${errorResponseData.statusCode}`,
};
}
} else if (error.cause.code) {
return {
status: 'Error',
message: error.cause.code,
};
}
Logger.debug('Credential test failed', error);
return {
Expand Down
1 change: 1 addition & 0 deletions packages/nodes-base/credentials/MetabaseApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ICredentialTestRequest,
ICredentialType,
IHttpRequestHelper,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';

Expand Down
59 changes: 59 additions & 0 deletions packages/nodes-base/nodes/Metabase/AlertsDescription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { INodeProperties } from 'n8n-workflow';

export const alertsOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['alerts'],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get specific alert',
routing: {
request: {
method: 'GET',
url: '={{"/api/alert/" + $parameter.alertId}}',
},
},
action: 'Get an alert',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all the alerts',
routing: {
request: {
method: 'GET',
url: '/api/alert/',
},
},
action: 'Get all alerts',
},
],
default: 'getAll',
},
];

export const alertsFields: INodeProperties[] = [
{
displayName: 'Alert ID',
name: 'alertId',
type: 'string',
required: true,
placeholder: '0',
displayOptions: {
show: {
resource: ['alerts'],
operation: ['get'],
},
},
default: '',
},
];
Loading