Compare commits

...

1 Commits

Author SHA1 Message Date
Rıdvan Akca
ced4602501 feat(pdf-monkey): add pdf-monkey integration 2024-04-10 14:14:48 +02:00
10 changed files with 3069 additions and 1 deletions

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 112 KiB

View File

@@ -0,0 +1,21 @@
import verifyCredentials from './verify-credentials.js';
import isStillVerified from './is-still-verified.js';
export default {
fields: [
{
key: 'apiKey',
label: 'API Key',
type: 'string',
required: true,
readOnly: false,
value: null,
placeholder: null,
description: 'PDFMonkey API secret key of your account.',
clickToCopy: false,
},
],
verifyCredentials,
isStillVerified,
};

View File

@@ -0,0 +1,8 @@
import getCurrentUser from '../common/get-current-user.js';
const isStillVerified = async ($) => {
const currentUser = await getCurrentUser($);
return !!currentUser.id;
};
export default isStillVerified;

View File

@@ -0,0 +1,15 @@
import getCurrentUser from '../common/get-current-user.js';
const verifyCredentials = async ($) => {
const currentUser = await getCurrentUser($);
const screenName = [currentUser.desired_name, currentUser.email]
.filter(Boolean)
.join(' @ ');
await $.auth.set({
screenName,
apiKey: $.auth.data.apiKey,
});
};
export default verifyCredentials;

View File

@@ -0,0 +1,9 @@
const addAuthHeader = ($, requestConfig) => {
if ($.auth.data?.apiKey) {
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
}
return requestConfig;
};
export default addAuthHeader;

View File

@@ -0,0 +1,8 @@
const getCurrentUser = async ($) => {
const response = await $.http.get('/v1/current_user');
const currentUser = response.data.current_user;
return currentUser;
};
export default getCurrentUser;

View File

@@ -0,0 +1,16 @@
import defineApp from '../../helpers/define-app.js';
import addAuthHeader from './common/add-auth-header.js';
import auth from './auth/index.js';
export default defineApp({
name: 'PDFMonkey',
key: 'pdf-monkey',
iconUrl: '{BASE_URL}/apps/pdf-monkey/assets/favicon.svg',
authDocUrl: 'https://automatisch.io/docs/apps/pdf-monkey/connection',
supportsConnections: true,
baseUrl: 'https://pdfmonkey.io',
apiBaseUrl: 'https://api.pdfmonkey.io/api',
primaryColor: 'db2777',
beforeRequest: [addAuthHeader],
auth,
});

View File

@@ -252,6 +252,12 @@ export default defineConfig({
{ text: 'Connection', link: '/apps/openai/connection' }, { text: 'Connection', link: '/apps/openai/connection' },
], ],
}, },
{
text: 'PDFMonkey',
collapsible: true,
collapsed: true,
items: [{ text: 'Connection', link: '/apps/pdf-monkey/connection' }],
},
{ {
text: 'Pipedrive', text: 'Pipedrive',
collapsible: true, collapsible: true,
@@ -305,7 +311,7 @@ export default defineConfig({
collapsed: true, collapsed: true,
items: [ items: [
{ text: 'Actions', link: '/apps/removebg/actions' }, { text: 'Actions', link: '/apps/removebg/actions' },
{ text: 'Connection', link: '/apps/removebg/connection' } { text: 'Connection', link: '/apps/removebg/connection' },
], ],
}, },
{ {

View File

@@ -0,0 +1,11 @@
# PDFMonkey
:::info
This page explains the steps you need to follow to set up the PDFMonkey
connection in Automatisch. If any of the steps are outdated, please let us know!
:::
1. Login to your PDFMonkey account: [https://dashboard.pdfmonkey.io/login](https://dashboard.pdfmonkey.io/login).
2. Go to **My Account** section from your profile.
3. Copy `API SECRET KEY` from the page to the `API Key` field on Automatisch.
4. Now, you can start using the PDFMonkey connection with Automatisch.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 112 KiB