diff --git a/packages/pieces/community/qonto/.eslintrc.json b/packages/pieces/community/qonto/.eslintrc.json new file mode 100644 index 00000000000..4a4e695c547 --- /dev/null +++ b/packages/pieces/community/qonto/.eslintrc.json @@ -0,0 +1,33 @@ +{ + "extends": [ + "../../../../.eslintrc.base.json" + ], + "ignorePatterns": [ + "!**/*" + ], + "overrides": [ + { + "files": [ + "*.ts", + "*.tsx", + "*.js", + "*.jsx" + ], + "rules": {} + }, + { + "files": [ + "*.ts", + "*.tsx" + ], + "rules": {} + }, + { + "files": [ + "*.js", + "*.jsx" + ], + "rules": {} + } + ] +} \ No newline at end of file diff --git a/packages/pieces/community/qonto/README.md b/packages/pieces/community/qonto/README.md new file mode 100644 index 00000000000..65381ba4f77 --- /dev/null +++ b/packages/pieces/community/qonto/README.md @@ -0,0 +1,7 @@ +# pieces-qonto + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build pieces-qonto` to build the library. diff --git a/packages/pieces/community/qonto/package.json b/packages/pieces/community/qonto/package.json new file mode 100644 index 00000000000..fe09a18272f --- /dev/null +++ b/packages/pieces/community/qonto/package.json @@ -0,0 +1,4 @@ +{ + "name": "@activepieces/piece-qonto", + "version": "0.0.1" +} diff --git a/packages/pieces/community/qonto/project.json b/packages/pieces/community/qonto/project.json new file mode 100644 index 00000000000..dd380153fec --- /dev/null +++ b/packages/pieces/community/qonto/project.json @@ -0,0 +1,45 @@ +{ + "name": "pieces-qonto", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/pieces/community/qonto/src", + "projectType": "library", + "release": { + "version": { + "generatorOptions": { + "packageRoot": "dist/{projectRoot}", + "currentVersionResolver": "git-tag" + } + } + }, + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": [ + "{options.outputPath}" + ], + "options": { + "outputPath": "dist/packages/pieces/community/qonto", + "tsConfig": "packages/pieces/community/qonto/tsconfig.lib.json", + "packageJson": "packages/pieces/community/qonto/package.json", + "main": "packages/pieces/community/qonto/src/index.ts", + "assets": [ + "packages/pieces/community/qonto/*.md" + ], + "buildableProjectDepsInPackageJsonType": "dependencies", + "updateBuildableProjectDepsInPackageJson": true + } + }, + "nx-release-publish": { + "options": { + "packageRoot": "dist/{projectRoot}" + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": [ + "{options.outputFile}" + ] + } + } +} \ No newline at end of file diff --git a/packages/pieces/community/qonto/src/index.ts b/packages/pieces/community/qonto/src/index.ts new file mode 100644 index 00000000000..9635a08ab43 --- /dev/null +++ b/packages/pieces/community/qonto/src/index.ts @@ -0,0 +1,33 @@ +import { createPiece, PieceAuth, OAuth2PropertyValue } from "@activepieces/pieces-framework"; +import { createCustomApiCallAction } from '@activepieces/pieces-common'; + +export const qontoAuth = PieceAuth.OAuth2({ + description: 'Connect to your Qonto account', + authUrl: 'https://oauth.qonto.com/oauth2/auth', + tokenUrl: 'https://oauth.qonto.com/oauth2/token', + required: true, + 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 + 'organization.read', + 'team.read', + 'membership.read', + 'membership.write' + ], +}); + +export const qonto = createPiece({ + displayName: "Qonto", + auth: qontoAuth, + minimumSupportedRelease: '0.0.1', + logoUrl: "https://cdn.activepieces.com/pieces/qonto.png", + authors: ["valentin-mourtialon"], + actions: [ + createCustomApiCallAction({ + baseUrl: () => 'https://thirdparty.qonto.com/v2/', + auth: qontoAuth, + authMapping: async (auth) => ({ + Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`, + }), + }), + ], + triggers: [], +}); \ No newline at end of file diff --git a/packages/pieces/community/qonto/tsconfig.json b/packages/pieces/community/qonto/tsconfig.json new file mode 100644 index 00000000000..29c9dd1bfc1 --- /dev/null +++ b/packages/pieces/community/qonto/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noPropertyAccessFromIndexSignature": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/packages/pieces/community/qonto/tsconfig.lib.json b/packages/pieces/community/qonto/tsconfig.lib.json new file mode 100644 index 00000000000..211035190af --- /dev/null +++ b/packages/pieces/community/qonto/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 05eae9f85a8..8c9c87a8a29 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -587,6 +587,9 @@ "@activepieces/piece-qdrant": [ "packages/pieces/community/qdrant/src/index.ts" ], + "@activepieces/piece-qonto": [ + "packages/pieces/community/qonto/src/index.ts" + ], "@activepieces/piece-qrcode": [ "packages/pieces/community/qrcode/src/index.ts" ],