feat(mysendinbox): piece added (#11367)

Co-authored-by: Theo dammaretz <theo@dammaretz.fr>
This commit is contained in:
sanket-a11y
2026-02-24 15:39:40 +05:30
committed by GitHub
parent 6b92883164
commit fda22ba1de
9 changed files with 149 additions and 2 deletions

View File

@@ -5,4 +5,4 @@
"firsttris.vscode-jest-runner",
"rvest.vs-code-prettier-eslint"
]
}
}

2
.vscode/launch.json vendored
View File

@@ -16,4 +16,4 @@
"autoAttachChildProcesses": false
}
]
}
}

View File

@@ -0,0 +1,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}

View File

@@ -0,0 +1,7 @@
# pieces-mysendingbox
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-mysendingbox` to build the library.

View File

@@ -0,0 +1,13 @@
{
"name": "@activepieces/piece-mysendingbox",
"version": "0.0.1",
"scripts": {
"build": "tsc -p tsconfig.lib.json",
"lint": "eslint 'src/**/*.ts'"
},
"dependencies": {
"@activepieces/pieces-common": "workspace:*",
"@activepieces/pieces-framework": "workspace:*",
"@activepieces/shared": "workspace:*"
}
}

View File

@@ -0,0 +1,59 @@
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import {
createCustomApiCallAction,
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
const markdown = `
MySendingBox API keyis available under the developer portal.
(https://app.mysendingbox.fr/account/keys)`;
export const mySendingBoxPieceAuth = PieceAuth.CustomAuth({
description: markdown,
required: true,
props: {
apiKey: PieceAuth.SecretText({
displayName: 'API Key',
required: true,
}),
},
validate: async ({ auth }) => {
if (auth) {
await httpClient.sendRequest({
method: HttpMethod.GET,
url: 'https://api.mysendingbox.fr/',
headers: {
Authorization: `Basic ${btoa(`${auth.apiKey}:`)}`,
},
});
return {
valid: true,
};
}
return {
valid: false,
error: 'Invalid Api Key',
};
},
});
export const mysendingbox = createPiece({
displayName: 'Mysendingbox',
auth: mySendingBoxPieceAuth,
minimumSupportedRelease: '0.78.0',
logoUrl: 'https://cdn.activepieces.com/pieces/mysendingbox.png',
authors: ['Blightwidow'],
actions: [
createCustomApiCallAction({
baseUrl: () => {
return 'https://api.mysendingbox.fr';
},
auth: mySendingBoxPieceAuth,
authMapping: async (auth) => ({
Authorization: `Basic ${btoa(`${auth.props.apiKey}:`)}`,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,20 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"importHelpers": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}

View File

@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"paths": {},
"outDir": "../../../../dist/packages/pieces/community/mysendingbox",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"]
}

View File

@@ -746,6 +746,9 @@
"@activepieces/piece-murf-api": [
"packages/pieces/community/murf-api/src/index.ts"
],
"@activepieces/piece-mysendingbox": [
"packages/pieces/community/mysendingbox/src/index.ts"
],
"@activepieces/piece-mysql": [
"packages/pieces/community/mysql/src/index.ts"
],