Skip to content

Commit a4cd37d

Browse files
feat(qonto): create qonto custom api call with Oauth
1 parent cac4633 commit a4cd37d

File tree

8 files changed

+168
-15
lines changed

8 files changed

+168
-15
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"extends": [
3+
"../../../../.eslintrc.base.json"
4+
],
5+
"ignorePatterns": [
6+
"!**/*"
7+
],
8+
"overrides": [
9+
{
10+
"files": [
11+
"*.ts",
12+
"*.tsx",
13+
"*.js",
14+
"*.jsx"
15+
],
16+
"rules": {}
17+
},
18+
{
19+
"files": [
20+
"*.ts",
21+
"*.tsx"
22+
],
23+
"rules": {}
24+
},
25+
{
26+
"files": [
27+
"*.js",
28+
"*.jsx"
29+
],
30+
"rules": {}
31+
}
32+
]
33+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pieces-qonto
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build pieces-qonto` to build the library.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "@activepieces/piece-qonto",
3+
"version": "0.0.1"
4+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "pieces-qonto",
3+
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/pieces/community/qonto/src",
5+
"projectType": "library",
6+
"release": {
7+
"version": {
8+
"generatorOptions": {
9+
"packageRoot": "dist/{projectRoot}",
10+
"currentVersionResolver": "git-tag"
11+
}
12+
}
13+
},
14+
"tags": [],
15+
"targets": {
16+
"build": {
17+
"executor": "@nx/js:tsc",
18+
"outputs": [
19+
"{options.outputPath}"
20+
],
21+
"options": {
22+
"outputPath": "dist/packages/pieces/community/qonto",
23+
"tsConfig": "packages/pieces/community/qonto/tsconfig.lib.json",
24+
"packageJson": "packages/pieces/community/qonto/package.json",
25+
"main": "packages/pieces/community/qonto/src/index.ts",
26+
"assets": [
27+
"packages/pieces/community/qonto/*.md"
28+
],
29+
"buildableProjectDepsInPackageJsonType": "dependencies",
30+
"updateBuildableProjectDepsInPackageJson": true
31+
}
32+
},
33+
"nx-release-publish": {
34+
"options": {
35+
"packageRoot": "dist/{projectRoot}"
36+
}
37+
},
38+
"lint": {
39+
"executor": "@nx/eslint:lint",
40+
"outputs": [
41+
"{options.outputFile}"
42+
]
43+
}
44+
}
45+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { createPiece, PieceAuth, OAuth2PropertyValue } from "@activepieces/pieces-framework";
2+
import { createCustomApiCallAction } from '@activepieces/pieces-common';
3+
4+
export const qontoAuth = PieceAuth.OAuth2({
5+
description: 'Connect to your Qonto account',
6+
authUrl: 'https://oauth.qonto.com/oauth2/auth',
7+
tokenUrl: 'https://oauth.qonto.com/oauth2/token',
8+
required: true,
9+
scope: [ // Scopes are predefined here. Ideally, it should be dynamic based on each configuration because the scopes need to be registered in advance on Qonto's side
10+
'organization.read',
11+
'team.read',
12+
'membership.read',
13+
'membership.write'
14+
],
15+
});
16+
17+
export const qonto = createPiece({
18+
displayName: "Qonto",
19+
auth: qontoAuth,
20+
minimumSupportedRelease: '0.0.1',
21+
logoUrl: "https://cdn.activepieces.com/pieces/qonto.png",
22+
authors: ["valentin-mourtialon"],
23+
actions: [
24+
createCustomApiCallAction({
25+
baseUrl: () => 'https://thirdparty.qonto.com/v2/',
26+
auth: qontoAuth,
27+
authMapping: async (auth) => ({
28+
Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,
29+
}),
30+
}),
31+
],
32+
triggers: [],
33+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "../../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noImplicitReturns": true,
9+
"noFallthroughCasesInSwitch": true,
10+
"noPropertyAccessFromIndexSignature": true
11+
},
12+
"files": [],
13+
"include": [],
14+
"references": [
15+
{
16+
"path": "./tsconfig.lib.json"
17+
}
18+
]
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"outDir": "../../../../dist/out-tsc",
6+
"declaration": true,
7+
"types": ["node"]
8+
},
9+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
10+
"include": ["src/**/*.ts"]
11+
}

tsconfig.base.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105
"@activepieces/piece-binance": [
106106
"packages/pieces/community/binance/src/index.ts"
107107
],
108+
"@activepieces/piece-blockscout": [
109+
"packages/pieces/community/blockscout/src/index.ts"
110+
],
108111
"@activepieces/piece-bonjoro": [
109112
"packages/pieces/community/bonjoro/src/index.ts"
110113
],
@@ -215,6 +218,9 @@
215218
"@activepieces/piece-elevenlabs": [
216219
"packages/pieces/community/elevenlabs/src/index.ts"
217220
],
221+
"@activepieces/piece-eth-name-service": [
222+
"packages/pieces/community/eth-name-service/src/index.ts"
223+
],
218224
"@activepieces/piece-facebook-leads": [
219225
"packages/pieces/community/facebook-leads/src/index.ts"
220226
],
@@ -437,6 +443,9 @@
437443
"@activepieces/piece-mautic": [
438444
"packages/pieces/community/mautic/src/index.ts"
439445
],
446+
"@activepieces/piece-mempool-space": [
447+
"packages/pieces/community/mempool-space/src/index.ts"
448+
],
440449
"@activepieces/piece-messagebird": [
441450
"packages/pieces/community/messagebird/src/index.ts"
442451
],
@@ -501,6 +510,9 @@
501510
"@activepieces/piece-perplexity-ai": [
502511
"packages/pieces/community/perplexity-ai/src/index.ts"
503512
],
513+
"@activepieces/piece-personal-ai": [
514+
"packages/pieces/community/personal-ai/src/index.ts"
515+
],
504516
"@activepieces/piece-photoroom": [
505517
"packages/pieces/community/photoroom/src/index.ts"
506518
],
@@ -525,6 +537,9 @@
525537
"@activepieces/piece-qdrant": [
526538
"packages/pieces/community/qdrant/src/index.ts"
527539
],
540+
"@activepieces/piece-qonto": [
541+
"packages/pieces/community/qonto/src/index.ts"
542+
],
528543
"@activepieces/piece-qrcode": [
529544
"packages/pieces/community/qrcode/src/index.ts"
530545
],
@@ -694,9 +709,6 @@
694709
"@activepieces/piece-text-helper": [
695710
"packages/pieces/community/text-helper/src/index.ts"
696711
],
697-
"@activepieces/piece-zoo": [
698-
"packages/pieces/community/zoo/src/index.ts"
699-
],
700712
"@activepieces/piece-thankster": [
701713
"packages/pieces/community/thankster/src/index.ts"
702714
],
@@ -797,6 +809,7 @@
797809
"@activepieces/piece-zoho-invoice": [
798810
"packages/pieces/community/zoho-invoice/src/index.ts"
799811
],
812+
"@activepieces/piece-zoo": ["packages/pieces/community/zoo/src/index.ts"],
800813
"@activepieces/piece-zoom": [
801814
"packages/pieces/community/zoom/src/index.ts"
802815
],
@@ -825,18 +838,6 @@
825838
"activepieces/piece-zuora": [
826839
"packages/pieces/community/zuora/src/index.ts"
827840
],
828-
"@activepieces/piece-personal-ai": [
829-
"packages/pieces/community/personal-ai/src/index.ts"
830-
],
831-
"@activepieces/piece-eth-name-service": [
832-
"packages/pieces/community/eth-name-service/src/index.ts"
833-
],
834-
"@activepieces/piece-mempool-space": [
835-
"packages/pieces/community/mempool-space/src/index.ts"
836-
],
837-
"@activepieces/piece-blockscout": [
838-
"packages/pieces/community/blockscout/src/index.ts"
839-
],
840841
"ee-embed-sdk": ["packages/ee/ui/embed-sdk/src/index.ts"],
841842
"server-worker": ["packages/server/worker/src/index.ts"],
842843
"ui-feature-forms": ["packages/ui/features-forms/src/index.ts"]

0 commit comments

Comments
 (0)