Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c12dacfa40 | ||
![]() |
71a404063c | ||
![]() |
8bb7b16c0e |
@@ -1,120 +0,0 @@
|
|||||||
import defineAction from '../../../../helpers/define-action.js';
|
|
||||||
|
|
||||||
export default defineAction({
|
|
||||||
name: 'Change a scheduled event',
|
|
||||||
key: 'changeScheduledEvent',
|
|
||||||
description: 'Changes a scheduled event',
|
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
label: 'Scheduled Event',
|
|
||||||
key: 'scheduledEventId',
|
|
||||||
type: 'dropdown',
|
|
||||||
required: true,
|
|
||||||
description: '',
|
|
||||||
variables: false,
|
|
||||||
source: {
|
|
||||||
type: 'query',
|
|
||||||
name: 'getDynamicData',
|
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'key',
|
|
||||||
value: 'listScheduledEvents',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Status',
|
|
||||||
key: 'status',
|
|
||||||
type: 'dropdown',
|
|
||||||
required: false,
|
|
||||||
description:
|
|
||||||
'After the status has been changed to COMPLETED or CANCELED, it becomes immutable and cannot be modified further.',
|
|
||||||
variables: true,
|
|
||||||
options: [
|
|
||||||
{ label: 'SCHEDULED', value: 1 },
|
|
||||||
{ label: 'ACTIVE', value: 2 },
|
|
||||||
{ label: 'COMPLETED', value: 3 },
|
|
||||||
{ label: 'CANCELED', value: 4 },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Type',
|
|
||||||
key: 'entityType',
|
|
||||||
type: 'dropdown',
|
|
||||||
required: true,
|
|
||||||
variables: true,
|
|
||||||
options: [
|
|
||||||
{ label: 'Stage channel', value: 1 },
|
|
||||||
{ label: 'Voice channel', value: 2 },
|
|
||||||
{ label: 'External', value: 3 },
|
|
||||||
],
|
|
||||||
additionalFields: {
|
|
||||||
type: 'query',
|
|
||||||
name: 'getDynamicFields',
|
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'key',
|
|
||||||
value: 'listScheduledEventFieldsForChange',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'parameters.entityType',
|
|
||||||
value: '{parameters.entityType}',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Name',
|
|
||||||
key: 'name',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Description',
|
|
||||||
key: 'description',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Image',
|
|
||||||
key: 'image',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
description:
|
|
||||||
'Image as DataURI scheme [data:image/<jpeg/png/gif>;base64,BASE64_ENCODED_<JPEG/PNG/GIF>_IMAGE_DATA]',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
async run($) {
|
|
||||||
const data = {
|
|
||||||
channel_id: $.step.parameters.channel_id,
|
|
||||||
name: $.step.parameters.name,
|
|
||||||
scheduled_start_time: $.step.parameters.scheduledStartTime,
|
|
||||||
scheduled_end_time: $.step.parameters.scheduledEndTime,
|
|
||||||
description: $.step.parameters.description,
|
|
||||||
entity_type: $.step.parameters.entityType,
|
|
||||||
image: $.step.parameters.image,
|
|
||||||
};
|
|
||||||
|
|
||||||
const isExternal = $.step.parameters.entityType === 3;
|
|
||||||
|
|
||||||
if (isExternal) {
|
|
||||||
data.entity_metadata = {
|
|
||||||
location: $.step.parameters.location,
|
|
||||||
};
|
|
||||||
|
|
||||||
data.channel_id = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await $.http?.patch(
|
|
||||||
`/guilds/${$.auth.data.guildId}/scheduled-events/${$.step.parameters.scheduledEventId}`,
|
|
||||||
data
|
|
||||||
);
|
|
||||||
|
|
||||||
$.setActionItem({ raw: response.data });
|
|
||||||
},
|
|
||||||
});
|
|
@@ -1,9 +1,4 @@
|
|||||||
import changeScheduledEvent from './change-scheduled-event/index.js';
|
|
||||||
import sendMessageToChannel from './send-message-to-channel/index.js';
|
import sendMessageToChannel from './send-message-to-channel/index.js';
|
||||||
import createScheduledEvent from './create-scheduled-event/index.js';
|
import createScheduledEvent from './create-scheduled-event/index.js';
|
||||||
|
|
||||||
export default [
|
export default [sendMessageToChannel, createScheduledEvent];
|
||||||
changeScheduledEvent,
|
|
||||||
sendMessageToChannel,
|
|
||||||
createScheduledEvent,
|
|
||||||
];
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import listChannels from './list-channels/index.js';
|
import listChannels from './list-channels/index.js';
|
||||||
import listScheduledEvents from './list-scheduled-events/index.js';
|
|
||||||
import listVoiceChannels from './list-voice-channels/index.js';
|
import listVoiceChannels from './list-voice-channels/index.js';
|
||||||
|
|
||||||
export default [listChannels, listScheduledEvents, listVoiceChannels];
|
export default [listChannels, listVoiceChannels];
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'List scheduled events',
|
|
||||||
key: 'listScheduledEvents',
|
|
||||||
|
|
||||||
async run($) {
|
|
||||||
const scheduledEvents = {
|
|
||||||
data: [],
|
|
||||||
error: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await $.http.get(
|
|
||||||
`/guilds/${$.auth.data.guildId}/scheduled-events`
|
|
||||||
);
|
|
||||||
|
|
||||||
scheduledEvents.data = response.data.map((scheduledEvent) => {
|
|
||||||
return {
|
|
||||||
value: scheduledEvent.id,
|
|
||||||
name: scheduledEvent.name,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return scheduledEvents;
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,7 +1,3 @@
|
|||||||
import listExternalScheduledEventFields from './list-external-scheduled-event-fields/index.js';
|
import listExternalScheduledEventFields from './list-external-scheduled-event-fields/index.js';
|
||||||
import listScheduledEventFieldsForChange from './list-scheduled-event-fields-for-change/index.js';
|
|
||||||
|
|
||||||
export default [
|
export default [listExternalScheduledEventFields];
|
||||||
listExternalScheduledEventFields,
|
|
||||||
listScheduledEventFieldsForChange,
|
|
||||||
];
|
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
export default {
|
|
||||||
name: 'List scheduled event fields for change',
|
|
||||||
key: 'listScheduledEventFieldsForChange',
|
|
||||||
|
|
||||||
async run($) {
|
|
||||||
const isExternal = $.step.parameters.entityType === 3;
|
|
||||||
|
|
||||||
if (isExternal) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: 'Location',
|
|
||||||
key: 'location',
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
description:
|
|
||||||
'The location of the event (1-100 characters). This will be omitted if type is NOT EXTERNAL',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Start-Time',
|
|
||||||
key: 'scheduledStartTime',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
description: 'The time the event will start [ISO8601]',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'End-Time',
|
|
||||||
key: 'scheduledEndTime',
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
description:
|
|
||||||
'The time the event will end [ISO8601]. This will be omitted if type is NOT EXTERNAL',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: 'Channel',
|
|
||||||
key: 'channel_id',
|
|
||||||
type: 'dropdown',
|
|
||||||
required: true,
|
|
||||||
description:
|
|
||||||
'Pick a voice or stage channel to link the event to. This will be omitted if type is EXTERNAL',
|
|
||||||
variables: true,
|
|
||||||
source: {
|
|
||||||
type: 'query',
|
|
||||||
name: 'getDynamicData',
|
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'key',
|
|
||||||
value: 'listVoiceChannels',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Location',
|
|
||||||
key: 'location',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
description:
|
|
||||||
'The location of the event (1-100 characters). This will be omitted if type is NOT EXTERNAL',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Start-Time',
|
|
||||||
key: 'scheduledStartTime',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
description: 'The time the event will start [ISO8601]',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'End-Time',
|
|
||||||
key: 'scheduledEndTime',
|
|
||||||
type: 'string',
|
|
||||||
required: false,
|
|
||||||
description:
|
|
||||||
'The time the event will end [ISO8601]. This will be omitted if type is NOT EXTERNAL',
|
|
||||||
variables: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
};
|
|
@@ -0,0 +1,241 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Generate document',
|
||||||
|
key: 'generateDocument',
|
||||||
|
description: 'Creates a new document.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Workspace',
|
||||||
|
key: 'workspaceId',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
source: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicData',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listWorkspaces',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Template',
|
||||||
|
key: 'templateId',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: false,
|
||||||
|
depensOn: ['parameters.workspaceId'],
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
source: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicData',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listTemplates',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'parameters.workspaceId',
|
||||||
|
value: '{parameters.workspaceId}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Use a Custom Json Structure?',
|
||||||
|
key: 'useCustomJsonStructure',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description:
|
||||||
|
'Please indicate "yes" if you would rather create a full JSON payload instead of relying on Automatisch mapping for the Document data.',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'Yes',
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'No',
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
additionalFields: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicFields',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listDocumentData',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'parameters.useCustomJsonStructure',
|
||||||
|
value: '{parameters.useCustomJsonStructure}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Add Line Items?',
|
||||||
|
key: 'addLineItems',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description:
|
||||||
|
'Choose "yes" to include information for Line Items (such as in an invoice).',
|
||||||
|
variables: true,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'Yes',
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'No',
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
additionalFields: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicFields',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listLineItems',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'parameters.addLineItems',
|
||||||
|
value: '{parameters.addLineItems}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Custom Filename',
|
||||||
|
key: 'customFilename',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description:
|
||||||
|
'You have the option to define a custom filename for generated documents. If left blank, a random value will be assigned.',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Meta Data',
|
||||||
|
key: 'metaData',
|
||||||
|
type: 'dynamic',
|
||||||
|
required: false,
|
||||||
|
description:
|
||||||
|
'Extra information appended to the generated Document but not accessible within its Template.',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
label: 'Key',
|
||||||
|
key: 'metaDataKey',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
key: 'metaDataValue',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const {
|
||||||
|
templateId,
|
||||||
|
useCustomJsonStructure,
|
||||||
|
customJsonPayload,
|
||||||
|
customFilename,
|
||||||
|
addLineItems,
|
||||||
|
lineItems,
|
||||||
|
documentData,
|
||||||
|
metaData,
|
||||||
|
} = $.step.parameters;
|
||||||
|
let payload = {};
|
||||||
|
let meta = {};
|
||||||
|
|
||||||
|
const documentDataObject = documentData.reduce((result, entry) => {
|
||||||
|
const key = entry.documentDataKey?.toLowerCase();
|
||||||
|
const value = entry.documentDataValue;
|
||||||
|
|
||||||
|
if (key && value) {
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
[entry.documentDataKey?.toLowerCase()]: entry.documentDataValue,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const lineItemsObject = lineItems.reduce((result, entry) => {
|
||||||
|
const key = entry.lineItemKey?.toLowerCase();
|
||||||
|
const value = entry.lineItemValue;
|
||||||
|
|
||||||
|
if (key && value) {
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
[entry.lineItemKey?.toLowerCase()]: entry.lineItemValue,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const metaDataObject = metaData.reduce((result, entry) => {
|
||||||
|
const key = entry.metaDataKey?.toLowerCase();
|
||||||
|
const value = entry.metaDataValue;
|
||||||
|
|
||||||
|
if (key && value) {
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
[entry.metaDataKey?.toLowerCase()]: entry.metaDataValue,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
if (metaDataObject) {
|
||||||
|
meta = metaDataObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (customFilename) {
|
||||||
|
meta._filename = customFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useCustomJsonStructure) {
|
||||||
|
payload = JSON.parse(customJsonPayload);
|
||||||
|
} else {
|
||||||
|
payload = documentDataObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addLineItems) {
|
||||||
|
payload.lineItems = [lineItemsObject];
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
document: {
|
||||||
|
document_template_id: templateId,
|
||||||
|
meta: JSON.stringify(meta),
|
||||||
|
payload: JSON.stringify(payload),
|
||||||
|
status: 'pending',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await $.http.post('/v1/documents', body);
|
||||||
|
|
||||||
|
$.setActionItem({
|
||||||
|
raw: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
3
packages/backend/src/apps/pdf-monkey/actions/index.js
Normal file
3
packages/backend/src/apps/pdf-monkey/actions/index.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import generateDocument from './generate-document/index.js';
|
||||||
|
|
||||||
|
export default [generateDocument];
|
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;
|
@@ -0,0 +1,4 @@
|
|||||||
|
import listTemplates from './list-templates/index.js';
|
||||||
|
import listWorkspaces from './list-workspaces/index.js';
|
||||||
|
|
||||||
|
export default [listTemplates, listWorkspaces];
|
@@ -0,0 +1,39 @@
|
|||||||
|
export default {
|
||||||
|
name: 'List templates',
|
||||||
|
key: 'listTemplates',
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const templates = {
|
||||||
|
data: [],
|
||||||
|
};
|
||||||
|
const workspaceId = $.step.parameters.workspaceId;
|
||||||
|
let next = false;
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
page: 'all',
|
||||||
|
'q[workspace_id]': workspaceId,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!workspaceId) {
|
||||||
|
return templates;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
const { data } = await $.http.get('/v1/document_template_cards', params);
|
||||||
|
next = data.meta.next_page;
|
||||||
|
|
||||||
|
if (!data?.document_template_cards?.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const template of data.document_template_cards) {
|
||||||
|
templates.data.push({
|
||||||
|
value: template.id,
|
||||||
|
name: template.identifier,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} while (next);
|
||||||
|
|
||||||
|
return templates;
|
||||||
|
},
|
||||||
|
};
|
@@ -0,0 +1,29 @@
|
|||||||
|
export default {
|
||||||
|
name: 'List workspaces',
|
||||||
|
key: 'listWorkspaces',
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const workspaces = {
|
||||||
|
data: [],
|
||||||
|
};
|
||||||
|
let next = false;
|
||||||
|
|
||||||
|
do {
|
||||||
|
const { data } = await $.http.get('/v1/workspace_cards');
|
||||||
|
next = data.meta.next_page;
|
||||||
|
|
||||||
|
if (!data?.workspace_cards?.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const workspace of data.workspace_cards) {
|
||||||
|
workspaces.data.push({
|
||||||
|
value: workspace.id,
|
||||||
|
name: workspace.identifier,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} while (next);
|
||||||
|
|
||||||
|
return workspaces;
|
||||||
|
},
|
||||||
|
};
|
@@ -0,0 +1,4 @@
|
|||||||
|
import listDocumentData from './list-document-data/index.js';
|
||||||
|
import listLineItems from './list-line-items/index.js';
|
||||||
|
|
||||||
|
export default [listDocumentData, listLineItems];
|
@@ -0,0 +1,48 @@
|
|||||||
|
export default {
|
||||||
|
name: 'List document data',
|
||||||
|
key: 'listDocumentData',
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
if ($.step.parameters.useCustomJsonStructure) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Data for the Document (JSON Payload)',
|
||||||
|
key: 'customJsonPayload',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description:
|
||||||
|
'Use the JSON format { "firstname": "John", "lastname": "Doe" }.',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Data for the Document',
|
||||||
|
key: 'documentData',
|
||||||
|
type: 'dynamic',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
label: 'Key',
|
||||||
|
key: 'documentDataKey',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
key: 'documentDataValue',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
@@ -0,0 +1,37 @@
|
|||||||
|
export default {
|
||||||
|
name: 'List line items',
|
||||||
|
key: 'listLineItems',
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
if ($.step.parameters.addLineItems) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Line Items',
|
||||||
|
key: 'lineItems',
|
||||||
|
type: 'dynamic',
|
||||||
|
required: false,
|
||||||
|
description:
|
||||||
|
'Data for a single item. Available as "lineItems" in your PDFMonkey Template.',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
label: 'Key',
|
||||||
|
key: 'lineItemKey',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
key: 'lineItemValue',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
24
packages/backend/src/apps/pdf-monkey/index.js
Normal file
24
packages/backend/src/apps/pdf-monkey/index.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import defineApp from '../../helpers/define-app.js';
|
||||||
|
import addAuthHeader from './common/add-auth-header.js';
|
||||||
|
import auth from './auth/index.js';
|
||||||
|
import triggers from './triggers/index.js';
|
||||||
|
import dynamicData from './dynamic-data/index.js';
|
||||||
|
import actions from './actions/index.js';
|
||||||
|
import dynamicFields from './dynamic-fields/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: '376794',
|
||||||
|
beforeRequest: [addAuthHeader],
|
||||||
|
auth,
|
||||||
|
triggers,
|
||||||
|
dynamicData,
|
||||||
|
actions,
|
||||||
|
dynamicFields,
|
||||||
|
});
|
@@ -0,0 +1,99 @@
|
|||||||
|
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||||
|
|
||||||
|
export default defineTrigger({
|
||||||
|
name: 'Documents Generated',
|
||||||
|
key: 'documentsGenerated',
|
||||||
|
pollInterval: 15,
|
||||||
|
description:
|
||||||
|
'Triggers upon the successful completion of document generation.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Workspace',
|
||||||
|
key: 'workspaceId',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: true,
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
source: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicData',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listWorkspaces',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Templates',
|
||||||
|
key: 'templateIds',
|
||||||
|
type: 'dynamic',
|
||||||
|
required: false,
|
||||||
|
description: 'Apply this trigger exclusively for particular templates.',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
label: 'Template',
|
||||||
|
key: 'templateId',
|
||||||
|
type: 'dropdown',
|
||||||
|
required: false,
|
||||||
|
depensOn: ['parameters.workspaceId'],
|
||||||
|
description: '',
|
||||||
|
variables: true,
|
||||||
|
source: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicData',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'key',
|
||||||
|
value: 'listTemplates',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'parameters.workspaceId',
|
||||||
|
value: '{parameters.workspaceId}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const workspaceId = $.step.parameters.workspaceId;
|
||||||
|
const templateIds = $.step.parameters.templateIds;
|
||||||
|
const allTemplates = templateIds
|
||||||
|
.map((templateId) => templateId.templateId)
|
||||||
|
.join(',');
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
'page[size]': 100,
|
||||||
|
'q[workspace_id]': workspaceId,
|
||||||
|
'q[status]': 'success',
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!templateIds.length) {
|
||||||
|
params['q[document_template_id]'] = allTemplates;
|
||||||
|
}
|
||||||
|
|
||||||
|
let next = false;
|
||||||
|
do {
|
||||||
|
const { data } = await $.http.get('/v1/document_cards', { params });
|
||||||
|
|
||||||
|
if (!data?.document_cards?.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
next = data.meta.next_page;
|
||||||
|
|
||||||
|
for (const document of data.document_cards) {
|
||||||
|
$.pushTriggerItem({
|
||||||
|
raw: document,
|
||||||
|
meta: {
|
||||||
|
internalId: document.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} while (next);
|
||||||
|
},
|
||||||
|
});
|
3
packages/backend/src/apps/pdf-monkey/triggers/index.js
Normal file
3
packages/backend/src/apps/pdf-monkey/triggers/index.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import documentsGenerated from './documents-generated/index.js';
|
||||||
|
|
||||||
|
export default [documentsGenerated];
|
@@ -1,6 +0,0 @@
|
|||||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
|
||||||
import permissionCatalog from '../../../../../helpers/permission-catalog.ee.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
renderObject(response, permissionCatalog);
|
|
||||||
};
|
|
@@ -1,32 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../../app.js';
|
|
||||||
import createAuthTokenByUserId from '../../../../../helpers/create-auth-token-by-user-id.js';
|
|
||||||
import { createRole } from '../../../../../../test/factories/role.js';
|
|
||||||
import { createUser } from '../../../../../../test/factories/user.js';
|
|
||||||
import getPermissionsCatalogMock from '../../../../../../test/mocks/rest/api/v1/admin/permissions/get-permissions-catalog.ee.js';
|
|
||||||
import * as license from '../../../../../helpers/license.ee.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/admin/permissions/catalog', () => {
|
|
||||||
let role, currentUser, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
role = await createRole({ key: 'admin' });
|
|
||||||
currentUser = await createUser({ roleId: role.id });
|
|
||||||
|
|
||||||
token = createAuthTokenByUserId(currentUser.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return roles', async () => {
|
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
|
||||||
|
|
||||||
const response = await request(app)
|
|
||||||
.get('/api/v1/admin/permissions/catalog')
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedPayload = await getPermissionsCatalogMock();
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,16 +0,0 @@
|
|||||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
|
||||||
import Role from '../../../../../models/role.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const role = await Role.query()
|
|
||||||
.leftJoinRelated({
|
|
||||||
permissions: true,
|
|
||||||
})
|
|
||||||
.withGraphFetched({
|
|
||||||
permissions: true,
|
|
||||||
})
|
|
||||||
.findById(request.params.roleId)
|
|
||||||
.throwIfNotFound();
|
|
||||||
|
|
||||||
renderObject(response, role);
|
|
||||||
};
|
|
@@ -1,38 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../../app.js';
|
|
||||||
import createAuthTokenByUserId from '../../../../../helpers/create-auth-token-by-user-id.js';
|
|
||||||
import { createRole } from '../../../../../../test/factories/role.js';
|
|
||||||
import { createUser } from '../../../../../../test/factories/user.js';
|
|
||||||
import { createPermission } from '../../../../../../test/factories/permission.js';
|
|
||||||
import getRoleMock from '../../../../../../test/mocks/rest/api/v1/admin/roles/get-role.ee.js';
|
|
||||||
import * as license from '../../../../../helpers/license.ee.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/admin/roles/:roleId', () => {
|
|
||||||
let role, currentUser, token, permissionOne, permissionTwo;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
role = await createRole({ key: 'admin' });
|
|
||||||
permissionOne = await createPermission({ roleId: role.id });
|
|
||||||
permissionTwo = await createPermission({ roleId: role.id });
|
|
||||||
currentUser = await createUser({ roleId: role.id });
|
|
||||||
|
|
||||||
token = createAuthTokenByUserId(currentUser.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return roles', async () => {
|
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
|
||||||
|
|
||||||
const response = await request(app)
|
|
||||||
.get(`/api/v1/admin/roles/${role.id}`)
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedPayload = await getRoleMock(role, [
|
|
||||||
permissionOne,
|
|
||||||
permissionTwo,
|
|
||||||
]);
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,8 +0,0 @@
|
|||||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
|
||||||
import Role from '../../../../../models/role.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const roles = await Role.query().orderBy('name');
|
|
||||||
|
|
||||||
renderObject(response, roles);
|
|
||||||
};
|
|
@@ -1,33 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../../app.js';
|
|
||||||
import createAuthTokenByUserId from '../../../../../helpers/create-auth-token-by-user-id.js';
|
|
||||||
import { createRole } from '../../../../../../test/factories/role.js';
|
|
||||||
import { createUser } from '../../../../../../test/factories/user.js';
|
|
||||||
import getRolesMock from '../../../../../../test/mocks/rest/api/v1/admin/roles/get-roles.ee.js';
|
|
||||||
import * as license from '../../../../../helpers/license.ee.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/admin/roles', () => {
|
|
||||||
let roleOne, roleTwo, currentUser, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
roleOne = await createRole({ key: 'admin' });
|
|
||||||
roleTwo = await createRole({ key: 'user' });
|
|
||||||
currentUser = await createUser({ roleId: roleOne.id });
|
|
||||||
|
|
||||||
token = createAuthTokenByUserId(currentUser.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return roles', async () => {
|
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
|
||||||
|
|
||||||
const response = await request(app)
|
|
||||||
.get('/api/v1/admin/roles')
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedPayload = await getRolesMock([roleOne, roleTwo]);
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -5,7 +5,7 @@ import createAuthTokenByUserId from '../../../../../helpers/create-auth-token-by
|
|||||||
import { createRole } from '../../../../../../test/factories/role.js';
|
import { createRole } from '../../../../../../test/factories/role.js';
|
||||||
import { createUser } from '../../../../../../test/factories/user.js';
|
import { createUser } from '../../../../../../test/factories/user.js';
|
||||||
import { createSamlAuthProvider } from '../../../../../../test/factories/saml-auth-provider.ee.js';
|
import { createSamlAuthProvider } from '../../../../../../test/factories/saml-auth-provider.ee.js';
|
||||||
import getSamlAuthProviderMock from '../../../../../../test/mocks/rest/api/v1/admin/saml-auth-providers/get-saml-auth-provider.ee.js';
|
import getSamlAuthProviderMock from '../../../../../../test/mocks/rest/api/v1/saml-auth-providers/get-saml-auth-provider.ee.js';
|
||||||
import * as license from '../../../../../helpers/license.ee.js';
|
import * as license from '../../../../../helpers/license.ee.js';
|
||||||
|
|
||||||
describe('GET /api/v1/admin/saml-auth-provider/:samlAuthProviderId', () => {
|
describe('GET /api/v1/admin/saml-auth-provider/:samlAuthProviderId', () => {
|
||||||
|
@@ -5,7 +5,7 @@ import createAuthTokenByUserId from '../../../../../helpers/create-auth-token-by
|
|||||||
import { createRole } from '../../../../../../test/factories/role.js';
|
import { createRole } from '../../../../../../test/factories/role.js';
|
||||||
import { createUser } from '../../../../../../test/factories/user.js';
|
import { createUser } from '../../../../../../test/factories/user.js';
|
||||||
import { createSamlAuthProvider } from '../../../../../../test/factories/saml-auth-provider.ee.js';
|
import { createSamlAuthProvider } from '../../../../../../test/factories/saml-auth-provider.ee.js';
|
||||||
import getSamlAuthProvidersMock from '../../../../../../test/mocks/rest/api/v1/admin/saml-auth-providers/get-saml-auth-providers.ee.js';
|
import getSamlAuthProvidersMock from '../../../../../../test/mocks/rest/api/v1/saml-auth-providers/get-saml-auth-providers.ee.js';
|
||||||
import * as license from '../../../../../helpers/license.ee.js';
|
import * as license from '../../../../../helpers/license.ee.js';
|
||||||
|
|
||||||
describe('GET /api/v1/admin/saml-auth-providers', () => {
|
describe('GET /api/v1/admin/saml-auth-providers', () => {
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
import { renderObject } from '../../../../helpers/renderer.js';
|
|
||||||
import axios from '../../../../helpers/axios-with-proxy.js';
|
|
||||||
import logger from '../../../../helpers/logger.js';
|
|
||||||
|
|
||||||
const NOTIFICATIONS_URL =
|
|
||||||
'https://notifications.automatisch.io/notifications.json';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
let notifications = [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await axios.get(NOTIFICATIONS_URL);
|
|
||||||
notifications = response.data;
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error fetching notifications API endpoint!', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderObject(response, notifications);
|
|
||||||
};
|
|
@@ -1,9 +0,0 @@
|
|||||||
import { describe, it } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../app.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/automatisch/notifications', () => {
|
|
||||||
it('should return Automatisch notifications', async () => {
|
|
||||||
await request(app).get('/api/v1/automatisch/notifications').expect(200);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,8 +0,0 @@
|
|||||||
import { renderObject } from '../../../../helpers/renderer.js';
|
|
||||||
import Billing from '../../../../helpers/billing/index.ee.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const paddleInfo = Billing.paddleInfo;
|
|
||||||
|
|
||||||
renderObject(response, paddleInfo);
|
|
||||||
};
|
|
@@ -1,33 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../app.js';
|
|
||||||
import createAuthTokenByUserId from '../../../../helpers/create-auth-token-by-user-id.js';
|
|
||||||
import { createUser } from '../../../../../test/factories/user.js';
|
|
||||||
import getPaddleInfoMock from '../../../../../test/mocks/rest/api/v1/payment/get-paddle-info.js';
|
|
||||||
import appConfig from '../../../../config/app.js';
|
|
||||||
import billing from '../../../../helpers/billing/index.ee.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/payment/paddle-info', () => {
|
|
||||||
let user, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
user = await createUser();
|
|
||||||
token = createAuthTokenByUserId(user.id);
|
|
||||||
|
|
||||||
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(true);
|
|
||||||
vi.spyOn(billing.paddleInfo, 'vendorId', 'get').mockReturnValue(
|
|
||||||
'sampleVendorId'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return payment plans', async () => {
|
|
||||||
const response = await request(app)
|
|
||||||
.get('/api/v1/payment/paddle-info')
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedResponsePayload = await getPaddleInfoMock();
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedResponsePayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,8 +0,0 @@
|
|||||||
import { renderObject } from '../../../../helpers/renderer.js';
|
|
||||||
import Billing from '../../../../helpers/billing/index.ee.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const paymentPlans = Billing.paddlePlans;
|
|
||||||
|
|
||||||
renderObject(response, paymentPlans);
|
|
||||||
};
|
|
@@ -1,29 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import request from 'supertest';
|
|
||||||
import app from '../../../../app.js';
|
|
||||||
import createAuthTokenByUserId from '../../../../helpers/create-auth-token-by-user-id.js';
|
|
||||||
import { createUser } from '../../../../../test/factories/user.js';
|
|
||||||
import getPaymentPlansMock from '../../../../../test/mocks/rest/api/v1/payment/get-plans.js';
|
|
||||||
import appConfig from '../../../../config/app.js';
|
|
||||||
|
|
||||||
describe('GET /api/v1/payment/plans', () => {
|
|
||||||
let user, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
user = await createUser();
|
|
||||||
token = createAuthTokenByUserId(user.id);
|
|
||||||
|
|
||||||
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return payment plans', async () => {
|
|
||||||
const response = await request(app)
|
|
||||||
.get('/api/v1/payment/plans')
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedResponsePayload = await getPaymentPlansMock();
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedResponsePayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,17 +0,0 @@
|
|||||||
import { Router } from 'express';
|
|
||||||
import { authenticateUser } from '../../../../helpers/authentication.js';
|
|
||||||
import { authorizeAdmin } from '../../../../helpers/authorization.js';
|
|
||||||
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
|
|
||||||
import getPermissionsCatalogAction from '../../../../controllers/api/v1/admin/permissions/get-permissions-catalog.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/catalog',
|
|
||||||
authenticateUser,
|
|
||||||
authorizeAdmin,
|
|
||||||
checkIsEnterprise,
|
|
||||||
getPermissionsCatalogAction
|
|
||||||
);
|
|
||||||
|
|
||||||
export default router;
|
|
@@ -1,26 +0,0 @@
|
|||||||
import { Router } from 'express';
|
|
||||||
import { authenticateUser } from '../../../../helpers/authentication.js';
|
|
||||||
import { authorizeAdmin } from '../../../../helpers/authorization.js';
|
|
||||||
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
|
|
||||||
import getRolesAction from '../../../../controllers/api/v1/admin/roles/get-roles.ee.js';
|
|
||||||
import getRoleAction from '../../../../controllers/api/v1/admin/roles/get-role.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/',
|
|
||||||
authenticateUser,
|
|
||||||
authorizeAdmin,
|
|
||||||
checkIsEnterprise,
|
|
||||||
getRolesAction
|
|
||||||
);
|
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/:roleId',
|
|
||||||
authenticateUser,
|
|
||||||
authorizeAdmin,
|
|
||||||
checkIsEnterprise,
|
|
||||||
getRoleAction
|
|
||||||
);
|
|
||||||
|
|
||||||
export default router;
|
|
@@ -1,26 +0,0 @@
|
|||||||
import { Router } from 'express';
|
|
||||||
import { authenticateUser } from '../../../../helpers/authentication.js';
|
|
||||||
import { authorizeAdmin } from '../../../../helpers/authorization.js';
|
|
||||||
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
|
|
||||||
import getSamlAuthProvidersAction from '../../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-providers.ee.js';
|
|
||||||
import getSamlAuthProviderAction from '../../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/',
|
|
||||||
authenticateUser,
|
|
||||||
authorizeAdmin,
|
|
||||||
checkIsEnterprise,
|
|
||||||
getSamlAuthProvidersAction
|
|
||||||
);
|
|
||||||
|
|
||||||
router.get(
|
|
||||||
'/:samlAuthProviderId',
|
|
||||||
authenticateUser,
|
|
||||||
authorizeAdmin,
|
|
||||||
checkIsEnterprise,
|
|
||||||
getSamlAuthProviderAction
|
|
||||||
);
|
|
||||||
|
|
||||||
export default router;
|
|
@@ -1,10 +1,8 @@
|
|||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import versionAction from '../../../controllers/api/v1/automatisch/version.js';
|
import versionAction from '../../../controllers/api/v1/automatisch/version.js';
|
||||||
import notificationsAction from '../../../controllers/api/v1/automatisch/notifications.js';
|
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get('/version', versionAction);
|
router.get('/version', versionAction);
|
||||||
router.get('/notifications', notificationsAction);
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
import { Router } from 'express';
|
|
||||||
import { authenticateUser } from '../../../helpers/authentication.js';
|
|
||||||
import checkIsCloud from '../../../helpers/check-is-cloud.js';
|
|
||||||
import getPlansAction from '../../../controllers/api/v1/payment/get-plans.ee.js';
|
|
||||||
import getPaddleInfoAction from '../../../controllers/api/v1/payment/get-paddle-info.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
router.get('/plans', authenticateUser, checkIsCloud, getPlansAction);
|
|
||||||
router.get('/paddle-info', authenticateUser, checkIsCloud, getPaddleInfoAction);
|
|
||||||
|
|
||||||
export default router;
|
|
26
packages/backend/src/routes/api/v1/saml-auth-providers.ee.js
Normal file
26
packages/backend/src/routes/api/v1/saml-auth-providers.ee.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { Router } from 'express';
|
||||||
|
import { authenticateUser } from '../../../helpers/authentication.js';
|
||||||
|
import { authorizeAdmin } from '../../../helpers/authorization.js';
|
||||||
|
import { checkIsEnterprise } from '../../../helpers/check-is-enterprise.js';
|
||||||
|
import getSamlAuthProvidersAction from '../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-providers.ee.js';
|
||||||
|
import getSamlAuthProviderAction from '../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-provider.ee.js';
|
||||||
|
|
||||||
|
const router = Router();
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/',
|
||||||
|
authenticateUser,
|
||||||
|
authorizeAdmin,
|
||||||
|
checkIsEnterprise,
|
||||||
|
getSamlAuthProvidersAction
|
||||||
|
);
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/:samlAuthProviderId',
|
||||||
|
authenticateUser,
|
||||||
|
authorizeAdmin,
|
||||||
|
checkIsEnterprise,
|
||||||
|
getSamlAuthProviderAction
|
||||||
|
);
|
||||||
|
|
||||||
|
export default router;
|
@@ -5,10 +5,7 @@ import paddleRouter from './paddle.ee.js';
|
|||||||
import healthcheckRouter from './healthcheck.js';
|
import healthcheckRouter from './healthcheck.js';
|
||||||
import automatischRouter from './api/v1/automatisch.js';
|
import automatischRouter from './api/v1/automatisch.js';
|
||||||
import usersRouter from './api/v1/users.js';
|
import usersRouter from './api/v1/users.js';
|
||||||
import paymentRouter from './api/v1/payment.ee.js';
|
import samlAuthProvidersRouter from './api/v1/saml-auth-providers.ee.js';
|
||||||
import samlAuthProvidersRouter from './api/v1/admin/saml-auth-providers.ee.js';
|
|
||||||
import rolesRouter from './api/v1/admin/roles.ee.js';
|
|
||||||
import permissionsRouter from './api/v1/admin/permissions.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
@@ -18,9 +15,6 @@ router.use('/paddle', paddleRouter);
|
|||||||
router.use('/healthcheck', healthcheckRouter);
|
router.use('/healthcheck', healthcheckRouter);
|
||||||
router.use('/api/v1/automatisch', automatischRouter);
|
router.use('/api/v1/automatisch', automatischRouter);
|
||||||
router.use('/api/v1/users', usersRouter);
|
router.use('/api/v1/users', usersRouter);
|
||||||
router.use('/api/v1/payment', paymentRouter);
|
|
||||||
router.use('/api/v1/admin/saml-auth-providers', samlAuthProvidersRouter);
|
router.use('/api/v1/admin/saml-auth-providers', samlAuthProvidersRouter);
|
||||||
router.use('/api/v1/admin/roles', rolesRouter);
|
|
||||||
router.use('/api/v1/admin/permissions', permissionsRouter);
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
import permissionSerializer from './permission.js';
|
|
||||||
|
|
||||||
const roleSerializer = (role) => {
|
const roleSerializer = (role) => {
|
||||||
let roleData = {
|
return {
|
||||||
id: role.id,
|
id: role.id,
|
||||||
name: role.name,
|
name: role.name,
|
||||||
key: role.key,
|
key: role.key,
|
||||||
@@ -10,14 +8,6 @@ const roleSerializer = (role) => {
|
|||||||
updatedAt: role.updatedAt,
|
updatedAt: role.updatedAt,
|
||||||
isAdmin: role.isAdmin,
|
isAdmin: role.isAdmin,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (role.permissions) {
|
|
||||||
roleData.permissions = role.permissions.map((permission) =>
|
|
||||||
permissionSerializer(permission)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return roleData;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default roleSerializer;
|
export default roleSerializer;
|
||||||
|
@@ -1,25 +1,12 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
import { describe, it, expect, beforeEach } from 'vitest';
|
||||||
import { createRole } from '../../test/factories/role';
|
import { createRole } from '../../test/factories/role';
|
||||||
import roleSerializer from './role';
|
import roleSerializer from './role';
|
||||||
import { createPermission } from '../../test/factories/permission';
|
|
||||||
|
|
||||||
describe('roleSerializer', () => {
|
describe('roleSerializer', () => {
|
||||||
let role, permissionOne, permissionTwo;
|
let role;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
role = await createRole();
|
role = await createRole();
|
||||||
|
|
||||||
permissionOne = await createPermission({
|
|
||||||
roleId: role.id,
|
|
||||||
action: 'read',
|
|
||||||
subject: 'User',
|
|
||||||
});
|
|
||||||
|
|
||||||
permissionTwo = await createPermission({
|
|
||||||
roleId: role.id,
|
|
||||||
action: 'read',
|
|
||||||
subject: 'Role',
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return role data', async () => {
|
it('should return role data', async () => {
|
||||||
@@ -35,14 +22,4 @@ describe('roleSerializer', () => {
|
|||||||
|
|
||||||
expect(roleSerializer(role)).toEqual(expectedPayload);
|
expect(roleSerializer(role)).toEqual(expectedPayload);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return role data with the permissions', async () => {
|
|
||||||
role.permissions = [permissionOne, permissionTwo];
|
|
||||||
|
|
||||||
const expectedPayload = {
|
|
||||||
permissions: [permissionOne, permissionTwo],
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(roleSerializer(role)).toMatchObject(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@@ -9,6 +9,7 @@ const userSerializer = (user) => {
|
|||||||
createdAt: user.createdAt,
|
createdAt: user.createdAt,
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
fullName: user.fullName,
|
fullName: user.fullName,
|
||||||
|
roleId: user.roleId,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (user.role) {
|
if (user.role) {
|
||||||
|
@@ -33,6 +33,7 @@ describe('userSerializer', () => {
|
|||||||
email: user.email,
|
email: user.email,
|
||||||
fullName: user.fullName,
|
fullName: user.fullName,
|
||||||
id: user.id,
|
id: user.id,
|
||||||
|
roleId: user.roleId,
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,64 +0,0 @@
|
|||||||
const getPermissionsCatalogMock = async () => {
|
|
||||||
const data = {
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
key: 'create',
|
|
||||||
label: 'Create',
|
|
||||||
subjects: ['Connection', 'Flow'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'read',
|
|
||||||
label: 'Read',
|
|
||||||
subjects: ['Connection', 'Execution', 'Flow'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'update',
|
|
||||||
label: 'Update',
|
|
||||||
subjects: ['Connection', 'Flow'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'delete',
|
|
||||||
label: 'Delete',
|
|
||||||
subjects: ['Connection', 'Flow'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'publish',
|
|
||||||
label: 'Publish',
|
|
||||||
subjects: ['Flow'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
conditions: [
|
|
||||||
{
|
|
||||||
key: 'isCreator',
|
|
||||||
label: 'Is creator',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
subjects: [
|
|
||||||
{
|
|
||||||
key: 'Connection',
|
|
||||||
label: 'Connection',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'Flow',
|
|
||||||
label: 'Flow',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'Execution',
|
|
||||||
label: 'Execution',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
data: data,
|
|
||||||
meta: {
|
|
||||||
count: 1,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: false,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'Object',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getPermissionsCatalogMock;
|
|
@@ -1,33 +0,0 @@
|
|||||||
const getRoleMock = async (role, permissions) => {
|
|
||||||
const data = {
|
|
||||||
id: role.id,
|
|
||||||
key: role.key,
|
|
||||||
name: role.name,
|
|
||||||
isAdmin: role.isAdmin,
|
|
||||||
description: role.description,
|
|
||||||
createdAt: role.createdAt.toISOString(),
|
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
|
||||||
permissions: permissions.map((permission) => ({
|
|
||||||
id: permission.id,
|
|
||||||
action: permission.action,
|
|
||||||
conditions: permission.conditions,
|
|
||||||
roleId: permission.roleId,
|
|
||||||
subject: permission.subject,
|
|
||||||
createdAt: permission.createdAt.toISOString(),
|
|
||||||
updatedAt: permission.updatedAt.toISOString(),
|
|
||||||
})),
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
data: data,
|
|
||||||
meta: {
|
|
||||||
count: 1,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: false,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'Role',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getRoleMock;
|
|
@@ -1,26 +0,0 @@
|
|||||||
const getRolesMock = async (roles) => {
|
|
||||||
const data = roles.map((role) => {
|
|
||||||
return {
|
|
||||||
id: role.id,
|
|
||||||
key: role.key,
|
|
||||||
name: role.name,
|
|
||||||
isAdmin: role.isAdmin,
|
|
||||||
description: role.description,
|
|
||||||
createdAt: role.createdAt.toISOString(),
|
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
data: data,
|
|
||||||
meta: {
|
|
||||||
count: data.length,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: true,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'Role',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getRolesMock;
|
|
@@ -1,17 +0,0 @@
|
|||||||
const getPaddleInfoMock = async () => {
|
|
||||||
return {
|
|
||||||
data: {
|
|
||||||
sandbox: true,
|
|
||||||
vendorId: 'sampleVendorId',
|
|
||||||
},
|
|
||||||
meta: {
|
|
||||||
count: 1,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: false,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'Object',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getPaddleInfoMock;
|
|
@@ -1,22 +0,0 @@
|
|||||||
const getPaymentPlansMock = async () => {
|
|
||||||
return {
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
limit: '10,000',
|
|
||||||
name: '10k - monthly',
|
|
||||||
price: '€20',
|
|
||||||
productId: '47384',
|
|
||||||
quota: 10000,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
meta: {
|
|
||||||
count: 1,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: true,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'Object',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getPaymentPlansMock;
|
|
@@ -1,4 +1,4 @@
|
|||||||
const getSamlAuthProviderMock = async (samlAuthProvider) => {
|
const getSamlAuthProvidersMock = async (samlAuthProvider) => {
|
||||||
const data = {
|
const data = {
|
||||||
active: samlAuthProvider.active,
|
active: samlAuthProvider.active,
|
||||||
certificate: samlAuthProvider.certificate,
|
certificate: samlAuthProvider.certificate,
|
||||||
@@ -26,4 +26,4 @@ const getSamlAuthProviderMock = async (samlAuthProvider) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getSamlAuthProviderMock;
|
export default getSamlAuthProvidersMock;
|
@@ -15,6 +15,7 @@ const getCurrentUserMock = (currentUser, role) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
roleId: role.id,
|
||||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||||
updatedAt: currentUser.updatedAt.toISOString(),
|
updatedAt: currentUser.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
@@ -14,6 +14,7 @@ const getUserMock = (currentUser, role) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
roleId: role.id,
|
||||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||||
updatedAt: currentUser.updatedAt.toISOString(),
|
updatedAt: currentUser.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
const getUsersMock = async (users, roles) => {
|
const getUsersMock = async (users, roles) => {
|
||||||
const data = users.map((user) => {
|
const data = users.map((user) => {
|
||||||
const role = roles.find((r) => r.id === user.roleId);
|
const role = roles.find((r) => r.id === user.roleId);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
createdAt: user.createdAt.toISOString(),
|
createdAt: user.createdAt.toISOString(),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
@@ -17,7 +16,8 @@ const getUsersMock = async (users, roles) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
}
|
}
|
||||||
: null,
|
: null, // Fallback to null if role not found
|
||||||
|
roleId: user.roleId,
|
||||||
trialExpiryDate: user.trialExpiryDate.toISOString(),
|
trialExpiryDate: user.trialExpiryDate.toISOString(),
|
||||||
updatedAt: user.updatedAt.toISOString(),
|
updatedAt: user.updatedAt.toISOString(),
|
||||||
};
|
};
|
||||||
|
@@ -252,6 +252,16 @@ export default defineConfig({
|
|||||||
{ text: 'Connection', link: '/apps/openai/connection' },
|
{ text: 'Connection', link: '/apps/openai/connection' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'PDFMonkey',
|
||||||
|
collapsible: true,
|
||||||
|
collapsed: true,
|
||||||
|
items: [
|
||||||
|
{ text: 'Triggers', link: '/apps/pdf-monkey/triggers' },
|
||||||
|
{ text: 'Actions', link: '/apps/pdf-monkey/actions' },
|
||||||
|
{ text: 'Connection', link: '/apps/pdf-monkey/connection' },
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Pipedrive',
|
text: 'Pipedrive',
|
||||||
collapsible: true,
|
collapsible: true,
|
||||||
@@ -305,7 +315,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' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
---
|
---
|
||||||
favicon: /favicons/discord.svg
|
favicon: /favicons/discord.svg
|
||||||
items:
|
items:
|
||||||
- name: Change a scheduled event
|
|
||||||
desc: Changes a scheduled event.
|
|
||||||
- name: Send a message to channel
|
- name: Send a message to channel
|
||||||
desc: Sends a message to a specific channel you specify.
|
desc: Sends a message to a specific channel you specify.
|
||||||
- name: Create a scheduled event
|
- name: Create a scheduled event
|
||||||
|
12
packages/docs/pages/apps/pdf-monkey/actions.md
Normal file
12
packages/docs/pages/apps/pdf-monkey/actions.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
favicon: /favicons/pdf-monkey.svg
|
||||||
|
items:
|
||||||
|
- name: Generate documents
|
||||||
|
desc: Creates a new document.
|
||||||
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CustomListing from '../../components/CustomListing.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<CustomListing />
|
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.
|
12
packages/docs/pages/apps/pdf-monkey/triggers.md
Normal file
12
packages/docs/pages/apps/pdf-monkey/triggers.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
favicon: /favicons/pdf-monkey.svg
|
||||||
|
items:
|
||||||
|
- name: Documents Generated
|
||||||
|
desc: Triggers upon the successful completion of document generation.
|
||||||
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CustomListing from '../../components/CustomListing.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<CustomListing />
|
@@ -26,6 +26,7 @@ The following integrations are currently supported by Automatisch.
|
|||||||
- [Ntfy](/apps/ntfy/actions)
|
- [Ntfy](/apps/ntfy/actions)
|
||||||
- [Odoo](/apps/odoo/actions)
|
- [Odoo](/apps/odoo/actions)
|
||||||
- [OpenAI](/apps/openai/actions)
|
- [OpenAI](/apps/openai/actions)
|
||||||
|
- [PDFMonkey](/apps/pdf-monkey/actions)
|
||||||
- [Pipedrive](/apps/pipedrive/triggers)
|
- [Pipedrive](/apps/pipedrive/triggers)
|
||||||
- [Placetel](/apps/placetel/triggers)
|
- [Placetel](/apps/placetel/triggers)
|
||||||
- [PostgreSQL](/apps/postgresql/actions)
|
- [PostgreSQL](/apps/postgresql/actions)
|
||||||
|
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