Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ced4602501 |
1487
packages/backend/src/apps/pdf-monkey/assets/favicon.svg
Normal file
1487
packages/backend/src/apps/pdf-monkey/assets/favicon.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 112 KiB |
21
packages/backend/src/apps/pdf-monkey/auth/index.js
Normal file
21
packages/backend/src/apps/pdf-monkey/auth/index.js
Normal 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,
|
||||
};
|
@@ -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;
|
@@ -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;
|
@@ -0,0 +1,9 @@
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
if ($.auth.data?.apiKey) {
|
||||
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default addAuthHeader;
|
@@ -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;
|
16
packages/backend/src/apps/pdf-monkey/index.js
Normal file
16
packages/backend/src/apps/pdf-monkey/index.js
Normal 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,
|
||||
});
|
@@ -252,6 +252,12 @@ export default defineConfig({
|
||||
{ text: 'Connection', link: '/apps/openai/connection' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'PDFMonkey',
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
items: [{ text: 'Connection', link: '/apps/pdf-monkey/connection' }],
|
||||
},
|
||||
{
|
||||
text: 'Pipedrive',
|
||||
collapsible: true,
|
||||
@@ -305,7 +311,7 @@ export default defineConfig({
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Actions', link: '/apps/removebg/actions' },
|
||||
{ text: 'Connection', link: '/apps/removebg/connection' }
|
||||
{ text: 'Connection', link: '/apps/removebg/connection' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
11
packages/docs/pages/apps/pdf-monkey/connection.md
Normal file
11
packages/docs/pages/apps/pdf-monkey/connection.md
Normal 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.
|
1487
packages/docs/pages/public/favicons/pdf-monkey.svg
Normal file
1487
packages/docs/pages/public/favicons/pdf-monkey.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 112 KiB |
Reference in New Issue
Block a user