Compare commits
1 Commits
AUT-755
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
![]() |
06b99ac58a |
@@ -8,7 +8,7 @@
|
|||||||
"version": "latest"
|
"version": "latest"
|
||||||
},
|
},
|
||||||
"ghcr.io/devcontainers/features/node:1": {
|
"ghcr.io/devcontainers/features/node:1": {
|
||||||
"version": 18
|
"version": 20
|
||||||
},
|
},
|
||||||
"ghcr.io/devcontainers/features/common-utils:1": {
|
"ghcr.io/devcontainers/features/common-utils:1": {
|
||||||
"username": "vscode",
|
"username": "vscode",
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-html-markdown": "^1.3.0",
|
"node-html-markdown": "^1.3.0",
|
||||||
"nodemailer": "6.7.0",
|
"nodemailer": "6.9.9",
|
||||||
"oauth-1.0a": "^2.2.6",
|
"oauth-1.0a": "^2.2.6",
|
||||||
"objection": "^3.0.0",
|
"objection": "^3.0.0",
|
||||||
"passport": "^0.6.0",
|
"passport": "^0.6.0",
|
||||||
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 112 KiB |
@@ -1,21 +0,0 @@
|
|||||||
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,
|
|
||||||
};
|
|
@@ -1,8 +0,0 @@
|
|||||||
import getCurrentUser from '../common/get-current-user.js';
|
|
||||||
|
|
||||||
const isStillVerified = async ($) => {
|
|
||||||
const currentUser = await getCurrentUser($);
|
|
||||||
return !!currentUser.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default isStillVerified;
|
|
@@ -1,15 +0,0 @@
|
|||||||
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;
|
|
@@ -1,9 +0,0 @@
|
|||||||
const addAuthHeader = ($, requestConfig) => {
|
|
||||||
if ($.auth.data?.apiKey) {
|
|
||||||
requestConfig.headers.Authorization = `Bearer ${$.auth.data.apiKey}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return requestConfig;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default addAuthHeader;
|
|
@@ -1,8 +0,0 @@
|
|||||||
const getCurrentUser = async ($) => {
|
|
||||||
const response = await $.http.get('/v1/current_user');
|
|
||||||
const currentUser = response.data.current_user;
|
|
||||||
|
|
||||||
return currentUser;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getCurrentUser;
|
|
@@ -1,4 +0,0 @@
|
|||||||
import listTemplates from './list-templates/index.js';
|
|
||||||
import listWorkspaces from './list-workspaces/index.js';
|
|
||||||
|
|
||||||
export default [listTemplates, listWorkspaces];
|
|
@@ -1,39 +0,0 @@
|
|||||||
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;
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,29 +0,0 @@
|
|||||||
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;
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,20 +0,0 @@
|
|||||||
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';
|
|
||||||
|
|
||||||
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,
|
|
||||||
});
|
|
@@ -1,99 +0,0 @@
|
|||||||
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);
|
|
||||||
},
|
|
||||||
});
|
|
@@ -1,3 +0,0 @@
|
|||||||
import documentsGenerated from './documents-generated/index.js';
|
|
||||||
|
|
||||||
export default [documentsGenerated];
|
|
@@ -1,10 +0,0 @@
|
|||||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
|
||||||
import SamlAuthProvider from '../../../../../models/saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const samlAuthProvider = await SamlAuthProvider.query()
|
|
||||||
.findById(request.params.samlAuthProviderId)
|
|
||||||
.throwIfNotFound();
|
|
||||||
|
|
||||||
renderObject(response, samlAuthProvider);
|
|
||||||
};
|
|
@@ -1,34 +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 { createSamlAuthProvider } from '../../../../../../test/factories/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';
|
|
||||||
|
|
||||||
describe('GET /api/v1/admin/saml-auth-provider/:samlAuthProviderId', () => {
|
|
||||||
let samlAuthProvider, currentUser, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
const role = await createRole({ key: 'admin' });
|
|
||||||
currentUser = await createUser({ roleId: role.id });
|
|
||||||
samlAuthProvider = await createSamlAuthProvider();
|
|
||||||
|
|
||||||
token = createAuthTokenByUserId(currentUser.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return saml auth provider with specified id', async () => {
|
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
|
||||||
|
|
||||||
const response = await request(app)
|
|
||||||
.get(`/api/v1/admin/saml-auth-providers/${samlAuthProvider.id}`)
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedPayload = await getSamlAuthProviderMock(samlAuthProvider);
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,11 +0,0 @@
|
|||||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
|
||||||
import SamlAuthProvider from '../../../../../models/saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
export default async (request, response) => {
|
|
||||||
const samlAuthProviders = await SamlAuthProvider.query().orderBy(
|
|
||||||
'created_at',
|
|
||||||
'desc'
|
|
||||||
);
|
|
||||||
|
|
||||||
renderObject(response, samlAuthProviders);
|
|
||||||
};
|
|
@@ -1,39 +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 { createSamlAuthProvider } from '../../../../../../test/factories/saml-auth-provider.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';
|
|
||||||
|
|
||||||
describe('GET /api/v1/admin/saml-auth-providers', () => {
|
|
||||||
let samlAuthProviderOne, samlAuthProviderTwo, currentUser, token;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
const role = await createRole({ key: 'admin' });
|
|
||||||
currentUser = await createUser({ roleId: role.id });
|
|
||||||
|
|
||||||
samlAuthProviderOne = await createSamlAuthProvider();
|
|
||||||
samlAuthProviderTwo = await createSamlAuthProvider();
|
|
||||||
|
|
||||||
token = createAuthTokenByUserId(currentUser.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return saml auth providers', async () => {
|
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
|
||||||
|
|
||||||
const response = await request(app)
|
|
||||||
.get('/api/v1/admin/saml-auth-providers')
|
|
||||||
.set('Authorization', token)
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
const expectedPayload = await getSamlAuthProvidersMock([
|
|
||||||
samlAuthProviderTwo,
|
|
||||||
samlAuthProviderOne,
|
|
||||||
]);
|
|
||||||
|
|
||||||
expect(response.body).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,17 +1,16 @@
|
|||||||
const authorizationList = {
|
const authorizationList = {
|
||||||
'GET /api/v1/users/:userId': {
|
'/api/v1/users/:userId': {
|
||||||
action: 'read',
|
action: 'read',
|
||||||
subject: 'User',
|
subject: 'User',
|
||||||
},
|
},
|
||||||
'GET /api/v1/users/': {
|
'/api/v1/users/': {
|
||||||
action: 'read',
|
action: 'read',
|
||||||
subject: 'User',
|
subject: 'User',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const authorizeUser = async (request, response, next) => {
|
export const authorizeUser = async (request, response, next) => {
|
||||||
const currentRoute =
|
const currentRoute = request.baseUrl + request.route.path;
|
||||||
request.method + ' ' + request.baseUrl + request.route.path;
|
|
||||||
const currentRouteRule = authorizationList[currentRoute];
|
const currentRouteRule = authorizationList[currentRoute];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -21,13 +20,3 @@ export const authorizeUser = async (request, response, next) => {
|
|||||||
return response.status(403).end();
|
return response.status(403).end();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const authorizeAdmin = async (request, response, next) => {
|
|
||||||
const role = await request.currentUser.$relatedQuery('role');
|
|
||||||
|
|
||||||
if (role?.isAdmin) {
|
|
||||||
next();
|
|
||||||
} else {
|
|
||||||
return response.status(403).end();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
import { hasValidLicense } from './license.ee.js';
|
|
||||||
|
|
||||||
export const checkIsEnterprise = async (request, response, next) => {
|
|
||||||
if (await hasValidLicense()) {
|
|
||||||
next();
|
|
||||||
} else {
|
|
||||||
return response.status(404).end();
|
|
||||||
}
|
|
||||||
};
|
|
@@ -4,8 +4,8 @@ import appConfig from '../config/app.js';
|
|||||||
const levels = {
|
const levels = {
|
||||||
error: 0,
|
error: 0,
|
||||||
warn: 1,
|
warn: 1,
|
||||||
http: 2,
|
info: 2,
|
||||||
info: 3,
|
http: 3,
|
||||||
debug: 4,
|
debug: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -15,8 +15,6 @@ const renderObject = (response, object) => {
|
|||||||
let data = isPaginated(object) ? object.records : object;
|
let data = isPaginated(object) ? object.records : object;
|
||||||
const type = isPaginated(object)
|
const type = isPaginated(object)
|
||||||
? object.records[0].constructor.name
|
? object.records[0].constructor.name
|
||||||
: Array.isArray(object)
|
|
||||||
? object[0].constructor.name
|
|
||||||
: object.constructor.name;
|
: object.constructor.name;
|
||||||
|
|
||||||
const serializer = serializers[type];
|
const serializer = serializers[type];
|
||||||
|
@@ -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;
|
|
@@ -5,7 +5,6 @@ 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 samlAuthProvidersRouter from './api/v1/saml-auth-providers.ee.js';
|
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
@@ -15,6 +14,5 @@ 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/admin/saml-auth-providers', samlAuthProvidersRouter);
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
import userSerializer from './user.js';
|
import userSerializer from './user.js';
|
||||||
import roleSerializer from './role.js';
|
import roleSerializer from './role.js';
|
||||||
import permissionSerializer from './permission.js';
|
import permissionSerializer from './permission.js';
|
||||||
import samlAuthProviderSerializer from './saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
const serializers = {
|
const serializers = {
|
||||||
User: userSerializer,
|
User: userSerializer,
|
||||||
Role: roleSerializer,
|
Role: roleSerializer,
|
||||||
Permission: permissionSerializer,
|
Permission: permissionSerializer,
|
||||||
SamlAuthProvider: samlAuthProviderSerializer,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default serializers;
|
export default serializers;
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import { createPermission } from '../../test/factories/permission';
|
|
||||||
import permissionSerializer from './permission';
|
|
||||||
|
|
||||||
describe('permissionSerializer', () => {
|
|
||||||
let permission;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
permission = await createPermission();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return permission data', async () => {
|
|
||||||
const expectedPayload = {
|
|
||||||
id: permission.id,
|
|
||||||
roleId: permission.roleId,
|
|
||||||
action: permission.action,
|
|
||||||
subject: permission.subject,
|
|
||||||
conditions: permission.conditions,
|
|
||||||
createdAt: permission.createdAt,
|
|
||||||
updatedAt: permission.updatedAt,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(permissionSerializer(permission)).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,25 +0,0 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import { createRole } from '../../test/factories/role';
|
|
||||||
import roleSerializer from './role';
|
|
||||||
|
|
||||||
describe('roleSerializer', () => {
|
|
||||||
let role;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
role = await createRole();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return role data', async () => {
|
|
||||||
const expectedPayload = {
|
|
||||||
id: role.id,
|
|
||||||
name: role.name,
|
|
||||||
key: role.key,
|
|
||||||
description: role.description,
|
|
||||||
createdAt: role.createdAt,
|
|
||||||
updatedAt: role.updatedAt,
|
|
||||||
isAdmin: role.isAdmin,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(roleSerializer(role)).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,18 +0,0 @@
|
|||||||
const samlAuthProviderSerializer = (samlAuthProvider) => {
|
|
||||||
return {
|
|
||||||
id: samlAuthProvider.id,
|
|
||||||
name: samlAuthProvider.name,
|
|
||||||
certificate: samlAuthProvider.certificate,
|
|
||||||
signatureAlgorithm: samlAuthProvider.signatureAlgorithm,
|
|
||||||
issuer: samlAuthProvider.issuer,
|
|
||||||
entryPoint: samlAuthProvider.entryPoint,
|
|
||||||
firstnameAttributeName: samlAuthProvider.firstnameAttributeName,
|
|
||||||
surnameAttributeName: samlAuthProvider.surnameAttributeName,
|
|
||||||
emailAttributeName: samlAuthProvider.emailAttributeName,
|
|
||||||
roleAttributeName: samlAuthProvider.roleAttributeName,
|
|
||||||
active: samlAuthProvider.active,
|
|
||||||
defaultRoleId: samlAuthProvider.defaultRoleId,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default samlAuthProviderSerializer;
|
|
@@ -1,32 +0,0 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import { createSamlAuthProvider } from '../../test/factories/saml-auth-provider.ee.js';
|
|
||||||
import samlAuthProviderSerializer from './saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
describe('samlAuthProviderSerializer', () => {
|
|
||||||
let samlAuthProvider;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
samlAuthProvider = await createSamlAuthProvider();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return saml auth provider data', async () => {
|
|
||||||
const expectedPayload = {
|
|
||||||
id: samlAuthProvider.id,
|
|
||||||
name: samlAuthProvider.name,
|
|
||||||
certificate: samlAuthProvider.certificate,
|
|
||||||
signatureAlgorithm: samlAuthProvider.signatureAlgorithm,
|
|
||||||
issuer: samlAuthProvider.issuer,
|
|
||||||
entryPoint: samlAuthProvider.entryPoint,
|
|
||||||
firstnameAttributeName: samlAuthProvider.firstnameAttributeName,
|
|
||||||
surnameAttributeName: samlAuthProvider.surnameAttributeName,
|
|
||||||
emailAttributeName: samlAuthProvider.emailAttributeName,
|
|
||||||
roleAttributeName: samlAuthProvider.roleAttributeName,
|
|
||||||
active: samlAuthProvider.active,
|
|
||||||
defaultRoleId: samlAuthProvider.defaultRoleId,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(samlAuthProviderSerializer(samlAuthProvider)).toEqual(
|
|
||||||
expectedPayload
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,76 +0,0 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
|
||||||
import { DateTime } from 'luxon';
|
|
||||||
import appConfig from '../config/app';
|
|
||||||
import { createUser } from '../../test/factories/user';
|
|
||||||
import { createPermission } from '../../test/factories/permission';
|
|
||||||
import userSerializer from './user';
|
|
||||||
|
|
||||||
describe('userSerializer', () => {
|
|
||||||
let user, role, permissionOne, permissionTwo;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
user = await createUser();
|
|
||||||
role = await user.$relatedQuery('role');
|
|
||||||
|
|
||||||
permissionOne = await createPermission({
|
|
||||||
roleId: role.id,
|
|
||||||
action: 'read',
|
|
||||||
subject: 'User',
|
|
||||||
});
|
|
||||||
|
|
||||||
permissionTwo = await createPermission({
|
|
||||||
roleId: role.id,
|
|
||||||
action: 'read',
|
|
||||||
subject: 'Role',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return user data', async () => {
|
|
||||||
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(false);
|
|
||||||
|
|
||||||
const expectedPayload = {
|
|
||||||
createdAt: user.createdAt,
|
|
||||||
email: user.email,
|
|
||||||
fullName: user.fullName,
|
|
||||||
id: user.id,
|
|
||||||
roleId: user.roleId,
|
|
||||||
updatedAt: user.updatedAt,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(userSerializer(user)).toEqual(expectedPayload);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return user data with the role', async () => {
|
|
||||||
user.role = role;
|
|
||||||
|
|
||||||
const expectedPayload = {
|
|
||||||
role,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(userSerializer(user)).toMatchObject(expectedPayload);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return user data with the permissions', async () => {
|
|
||||||
user.permissions = [permissionOne, permissionTwo];
|
|
||||||
|
|
||||||
const expectedPayload = {
|
|
||||||
permissions: [permissionOne, permissionTwo],
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(userSerializer(user)).toMatchObject(expectedPayload);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return user data with trial expiry date', async () => {
|
|
||||||
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(true);
|
|
||||||
|
|
||||||
await user.$query().patch({
|
|
||||||
trialExpiryDate: DateTime.now().plus({ days: 30 }).toISODate(),
|
|
||||||
});
|
|
||||||
|
|
||||||
const expectedPayload = {
|
|
||||||
trialExpiryDate: user.trialExpiryDate,
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(userSerializer(user)).toMatchObject(expectedPayload);
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,33 +0,0 @@
|
|||||||
import { createRole } from './role';
|
|
||||||
import SamlAuthProvider from '../../src/models/saml-auth-provider.ee.js';
|
|
||||||
|
|
||||||
export const createSamlAuthProvider = async (params = {}) => {
|
|
||||||
params.name = params?.name || 'Keycloak SAML';
|
|
||||||
params.certificate = params?.certificate || 'certificate';
|
|
||||||
params.signatureAlgorithm = params?.signatureAlgorithm || 'sha512';
|
|
||||||
|
|
||||||
params.entryPoint =
|
|
||||||
params?.entryPoint ||
|
|
||||||
'https://example.com/auth/realms/automatisch/protocol/saml';
|
|
||||||
|
|
||||||
params.issuer = params?.issuer || 'automatisch-client';
|
|
||||||
|
|
||||||
params.firstnameAttributeName =
|
|
||||||
params?.firstnameAttributeName || 'urn:oid:2.1.1.42';
|
|
||||||
|
|
||||||
params.surnameAttributeName =
|
|
||||||
params?.surnameAttributeName || 'urn:oid:2.1.1.4';
|
|
||||||
|
|
||||||
params.emailAttributeName =
|
|
||||||
params?.emailAttributeName || 'urn:oid:1.1.2342.19200300.100.1.1';
|
|
||||||
|
|
||||||
params.roleAttributeName = params?.roleAttributeName || 'Role';
|
|
||||||
params.defaultRoleId = params?.defaultRoleId || (await createRole()).id;
|
|
||||||
params.active = params?.active || true;
|
|
||||||
|
|
||||||
const samlAuthProvider = await SamlAuthProvider.query()
|
|
||||||
.insert(params)
|
|
||||||
.returning('*');
|
|
||||||
|
|
||||||
return samlAuthProvider;
|
|
||||||
};
|
|
@@ -1,29 +0,0 @@
|
|||||||
const getSamlAuthProvidersMock = async (samlAuthProvider) => {
|
|
||||||
const data = {
|
|
||||||
active: samlAuthProvider.active,
|
|
||||||
certificate: samlAuthProvider.certificate,
|
|
||||||
defaultRoleId: samlAuthProvider.defaultRoleId,
|
|
||||||
emailAttributeName: samlAuthProvider.emailAttributeName,
|
|
||||||
entryPoint: samlAuthProvider.entryPoint,
|
|
||||||
firstnameAttributeName: samlAuthProvider.firstnameAttributeName,
|
|
||||||
id: samlAuthProvider.id,
|
|
||||||
issuer: samlAuthProvider.issuer,
|
|
||||||
name: samlAuthProvider.name,
|
|
||||||
roleAttributeName: samlAuthProvider.roleAttributeName,
|
|
||||||
signatureAlgorithm: samlAuthProvider.signatureAlgorithm,
|
|
||||||
surnameAttributeName: samlAuthProvider.surnameAttributeName,
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
data: data,
|
|
||||||
meta: {
|
|
||||||
count: 1,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: false,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'SamlAuthProvider',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getSamlAuthProvidersMock;
|
|
@@ -1,31 +0,0 @@
|
|||||||
const getSamlAuthProvidersMock = async (samlAuthProviders) => {
|
|
||||||
const data = samlAuthProviders.map((samlAuthProvider) => {
|
|
||||||
return {
|
|
||||||
active: samlAuthProvider.active,
|
|
||||||
certificate: samlAuthProvider.certificate,
|
|
||||||
defaultRoleId: samlAuthProvider.defaultRoleId,
|
|
||||||
emailAttributeName: samlAuthProvider.emailAttributeName,
|
|
||||||
entryPoint: samlAuthProvider.entryPoint,
|
|
||||||
firstnameAttributeName: samlAuthProvider.firstnameAttributeName,
|
|
||||||
id: samlAuthProvider.id,
|
|
||||||
issuer: samlAuthProvider.issuer,
|
|
||||||
name: samlAuthProvider.name,
|
|
||||||
roleAttributeName: samlAuthProvider.roleAttributeName,
|
|
||||||
signatureAlgorithm: samlAuthProvider.signatureAlgorithm,
|
|
||||||
surnameAttributeName: samlAuthProvider.surnameAttributeName,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
data: data,
|
|
||||||
meta: {
|
|
||||||
count: data.length,
|
|
||||||
currentPage: null,
|
|
||||||
isArray: true,
|
|
||||||
totalPages: null,
|
|
||||||
type: 'SamlAuthProvider',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default getSamlAuthProvidersMock;
|
|
@@ -252,15 +252,6 @@ 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: 'Connection', link: '/apps/pdf-monkey/connection' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: 'Pipedrive',
|
text: 'Pipedrive',
|
||||||
collapsible: true,
|
collapsible: true,
|
||||||
@@ -314,7 +305,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,11 +0,0 @@
|
|||||||
# 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.
|
|
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
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 />
|
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 112 KiB |
@@ -3,7 +3,6 @@ import Box from '@mui/material/Box';
|
|||||||
import Toolbar from '@mui/material/Toolbar';
|
import Toolbar from '@mui/material/Toolbar';
|
||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||||
import Stack from '@mui/material/Stack';
|
|
||||||
import AppsIcon from '@mui/icons-material/Apps';
|
import AppsIcon from '@mui/icons-material/Apps';
|
||||||
import SwapCallsIcon from '@mui/icons-material/SwapCalls';
|
import SwapCallsIcon from '@mui/icons-material/SwapCalls';
|
||||||
import HistoryIcon from '@mui/icons-material/History';
|
import HistoryIcon from '@mui/icons-material/History';
|
||||||
@@ -140,7 +139,7 @@ export default function PublicLayout({
|
|||||||
onDrawerClose={closeDrawer}
|
onDrawerClose={closeDrawer}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', height: '100%' }}>
|
<Box sx={{ display: 'flex' }}>
|
||||||
<Drawer
|
<Drawer
|
||||||
links={drawerLinks}
|
links={drawerLinks}
|
||||||
bottomLinks={bottomLinks}
|
bottomLinks={bottomLinks}
|
||||||
@@ -149,10 +148,11 @@ export default function PublicLayout({
|
|||||||
onClose={closeDrawer}
|
onClose={closeDrawer}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack flex={1}>
|
<Box sx={{ flex: 1 }}>
|
||||||
<Toolbar />
|
<Toolbar />
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
</Stack>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@@ -1,44 +0,0 @@
|
|||||||
import { Link } from 'react-router-dom';
|
|
||||||
import Button from '@mui/material/Button';
|
|
||||||
import Stack from '@mui/material/Stack';
|
|
||||||
import Typography from '@mui/material/Typography';
|
|
||||||
|
|
||||||
import * as URLS from 'config/urls';
|
|
||||||
import useFormatMessage from 'hooks/useFormatMessage';
|
|
||||||
import useAuthentication from 'hooks/useAuthentication';
|
|
||||||
import Layout from 'components/Layout';
|
|
||||||
import PublicLayout from 'components/PublicLayout';
|
|
||||||
|
|
||||||
export default function NoResultFound(): React.ReactElement {
|
|
||||||
const formatMessage = useFormatMessage();
|
|
||||||
const { isAuthenticated } = useAuthentication();
|
|
||||||
|
|
||||||
const pageContent = (
|
|
||||||
<Stack
|
|
||||||
justifyContent="center"
|
|
||||||
alignItems="center"
|
|
||||||
flex={1}
|
|
||||||
spacing={1}
|
|
||||||
p={2}
|
|
||||||
mb={11}
|
|
||||||
>
|
|
||||||
<Typography variant="h1" color="primary" textAlign="center">
|
|
||||||
404
|
|
||||||
</Typography>
|
|
||||||
<Typography variant="body1" textAlign="center">
|
|
||||||
{formatMessage('notFoundPage.title')}
|
|
||||||
</Typography>
|
|
||||||
<Link to={isAuthenticated ? URLS.FLOWS : URLS.LOGIN}>
|
|
||||||
<Button variant="contained" sx={{ mt: 3 }} component="div">
|
|
||||||
{formatMessage('notFoundPage.button')}
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
|
|
||||||
return isAuthenticated ? (
|
|
||||||
<Layout>{pageContent}</Layout>
|
|
||||||
) : (
|
|
||||||
<PublicLayout>{pageContent}</PublicLayout>
|
|
||||||
);
|
|
||||||
}
|
|
@@ -265,7 +265,5 @@
|
|||||||
"authClient.buttonSubmit": "Submit",
|
"authClient.buttonSubmit": "Submit",
|
||||||
"authClient.inputName": "Name",
|
"authClient.inputName": "Name",
|
||||||
"authClient.inputActive": "Active",
|
"authClient.inputActive": "Active",
|
||||||
"updateAuthClient.title": "Update auth client",
|
"updateAuthClient.title": "Update auth client"
|
||||||
"notFoundPage.title": "We can't seem to find a page you're looking for.",
|
|
||||||
"notFoundPage.button": "Back to home page"
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { Route, Routes as ReactRouterRoutes, Navigate } from 'react-router-dom';
|
import { Route, Routes, Navigate } from 'react-router-dom';
|
||||||
import Layout from 'components/Layout';
|
import Layout from 'components/Layout';
|
||||||
import NoResultFound from 'components/NotFound';
|
|
||||||
import PublicLayout from 'components/PublicLayout';
|
import PublicLayout from 'components/PublicLayout';
|
||||||
import Applications from 'pages/Applications';
|
import Applications from 'pages/Applications';
|
||||||
import Application from 'pages/Application';
|
import Application from 'pages/Application';
|
||||||
@@ -18,134 +17,127 @@ import * as URLS from 'config/urls';
|
|||||||
import settingsRoutes from './settingsRoutes';
|
import settingsRoutes from './settingsRoutes';
|
||||||
import adminSettingsRoutes from './adminSettingsRoutes';
|
import adminSettingsRoutes from './adminSettingsRoutes';
|
||||||
import Notifications from 'pages/Notifications';
|
import Notifications from 'pages/Notifications';
|
||||||
import useConfig from 'hooks/useConfig';
|
|
||||||
import useAuthentication from 'hooks/useAuthentication';
|
|
||||||
|
|
||||||
function Routes() {
|
export default (
|
||||||
const { config } = useConfig();
|
<Routes>
|
||||||
const { isAuthenticated } = useAuthentication();
|
<Route
|
||||||
|
path={URLS.EXECUTIONS}
|
||||||
|
element={
|
||||||
|
<Layout>
|
||||||
|
<Executions />
|
||||||
|
</Layout>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
return (
|
<Route
|
||||||
<ReactRouterRoutes>
|
path={URLS.EXECUTION_PATTERN}
|
||||||
<Route
|
element={
|
||||||
path={URLS.EXECUTIONS}
|
<Layout>
|
||||||
element={
|
<Execution />
|
||||||
<Layout>
|
</Layout>
|
||||||
<Executions />
|
}
|
||||||
</Layout>
|
/>
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.EXECUTION_PATTERN}
|
path={URLS.FLOWS}
|
||||||
element={
|
element={
|
||||||
<Layout>
|
<Layout>
|
||||||
<Execution />
|
<Flows />
|
||||||
</Layout>
|
</Layout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.FLOWS}
|
path={URLS.FLOW_PATTERN}
|
||||||
element={
|
element={
|
||||||
<Layout>
|
<Layout>
|
||||||
<Flows />
|
<Flow />
|
||||||
</Layout>
|
</Layout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.FLOW_PATTERN}
|
path={`${URLS.APPS}/*`}
|
||||||
element={
|
element={
|
||||||
<Layout>
|
<Layout>
|
||||||
<Flow />
|
<Applications />
|
||||||
</Layout>
|
</Layout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={`${URLS.APPS}/*`}
|
path={`${URLS.APP_PATTERN}/*`}
|
||||||
element={
|
element={
|
||||||
<Layout>
|
<Layout>
|
||||||
<Applications />
|
<Application />
|
||||||
</Layout>
|
</Layout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route path={`${URLS.EDITOR}/*`} element={<EditorRoutes />} />
|
||||||
path={`${URLS.APP_PATTERN}/*`}
|
|
||||||
element={
|
|
||||||
<Layout>
|
|
||||||
<Application />
|
|
||||||
</Layout>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route path={`${URLS.EDITOR}/*`} element={<EditorRoutes />} />
|
<Route
|
||||||
|
path={URLS.LOGIN}
|
||||||
|
element={
|
||||||
|
<PublicLayout>
|
||||||
|
<Login />
|
||||||
|
</PublicLayout>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.LOGIN}
|
path={URLS.LOGIN_CALLBACK}
|
||||||
element={
|
element={<LoginCallback />}
|
||||||
<PublicLayout>
|
/>
|
||||||
<Login />
|
|
||||||
</PublicLayout>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route path={URLS.LOGIN_CALLBACK} element={<LoginCallback />} />
|
<Route
|
||||||
|
path={URLS.SIGNUP}
|
||||||
|
element={
|
||||||
|
<PublicLayout>
|
||||||
|
<SignUp />
|
||||||
|
</PublicLayout>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.SIGNUP}
|
path={URLS.FORGOT_PASSWORD}
|
||||||
element={
|
element={
|
||||||
<PublicLayout>
|
<PublicLayout>
|
||||||
<SignUp />
|
<ForgotPassword />
|
||||||
</PublicLayout>
|
</PublicLayout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.FORGOT_PASSWORD}
|
path={URLS.RESET_PASSWORD}
|
||||||
element={
|
element={
|
||||||
<PublicLayout>
|
<PublicLayout>
|
||||||
<ForgotPassword />
|
<ResetPassword />
|
||||||
</PublicLayout>
|
</PublicLayout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={URLS.RESET_PASSWORD}
|
path={URLS.UPDATES}
|
||||||
element={
|
element={
|
||||||
<PublicLayout>
|
<Layout>
|
||||||
<ResetPassword />
|
<Notifications />
|
||||||
</PublicLayout>
|
</Layout>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!config?.disableNotificationsPage && (
|
<Route path="/" element={<Navigate to={URLS.FLOWS} replace />} />
|
||||||
<Route
|
|
||||||
path={URLS.UPDATES}
|
|
||||||
element={
|
|
||||||
<Layout>
|
|
||||||
<Notifications />
|
|
||||||
</Layout>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Route
|
<Route path={URLS.SETTINGS}>{settingsRoutes}</Route>
|
||||||
path="/"
|
|
||||||
element={
|
|
||||||
<Navigate to={isAuthenticated ? URLS.FLOWS : URLS.LOGIN} replace />
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route path={URLS.SETTINGS}>{settingsRoutes}</Route>
|
<Route path={URLS.ADMIN_SETTINGS}>{adminSettingsRoutes}</Route>
|
||||||
|
|
||||||
<Route path={URLS.ADMIN_SETTINGS}>{adminSettingsRoutes}</Route>
|
<Route
|
||||||
|
element={
|
||||||
<Route path="*" element={<NoResultFound />} />
|
<Layout>
|
||||||
</ReactRouterRoutes>
|
<div>404</div>
|
||||||
);
|
</Layout>
|
||||||
}
|
}
|
||||||
|
/>
|
||||||
export default <Routes />;
|
</Routes>
|
||||||
|
);
|
||||||
|
@@ -11458,10 +11458,10 @@ node-releases@^2.0.1:
|
|||||||
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz"
|
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz"
|
||||||
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
|
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
|
||||||
|
|
||||||
nodemailer@6.7.0:
|
nodemailer@6.9.9:
|
||||||
version "6.7.0"
|
version "6.9.9"
|
||||||
resolved "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.0.tgz"
|
resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.9.9.tgz#4549bfbf710cc6addec5064dd0f19874d24248d9"
|
||||||
integrity sha512-AtiTVUFHLiiDnMQ43zi0YgkzHOEWUkhDgPlBXrsDzJiJvB29Alo4OKxHQ0ugF3gRqRQIneCLtZU3yiUo7pItZw==
|
integrity sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==
|
||||||
|
|
||||||
nodemon@^2.0.13:
|
nodemon@^2.0.13:
|
||||||
version "2.0.15"
|
version "2.0.15"
|
||||||
|
Reference in New Issue
Block a user