refactor: Use internal namespace for the existing API
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
const createApiTokenMock = async (apiToken) => {
|
||||
const data = {
|
||||
id: apiToken.id,
|
||||
token: apiToken.token,
|
||||
createdAt: apiToken.createdAt.getTime(),
|
||||
updatedAt: apiToken.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'ApiToken',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createApiTokenMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const getApiTokensMock = async (apiTokens) => {
|
||||
const data = apiTokens.map((apiToken) => {
|
||||
return {
|
||||
id: apiToken.id,
|
||||
token:
|
||||
apiToken.token.substring(0, 4) +
|
||||
'...' +
|
||||
apiToken.token.substring(apiToken.token.length - 4),
|
||||
createdAt: apiToken.createdAt.getTime(),
|
||||
updatedAt: apiToken.updatedAt.getTime(),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'ApiToken',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getApiTokensMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const createAppConfigMock = (appConfig) => {
|
||||
return {
|
||||
data: {
|
||||
key: appConfig.key,
|
||||
useOnlyPredefinedAuthClients: appConfig.useOnlyPredefinedAuthClients,
|
||||
disabled: appConfig.disabled,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'AppConfig',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createAppConfigMock;
|
||||
@@ -1,17 +0,0 @@
|
||||
const createOAuthClientMock = (oauthClient) => {
|
||||
return {
|
||||
data: {
|
||||
name: oauthClient.name,
|
||||
active: oauthClient.active,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createOAuthClientMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const getOAuthClientMock = (oauthClient) => {
|
||||
return {
|
||||
data: {
|
||||
name: oauthClient.name,
|
||||
id: oauthClient.id,
|
||||
active: oauthClient.active,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getOAuthClientMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const getAdminOAuthClientsMock = (oauthClients) => {
|
||||
return {
|
||||
data: oauthClients.map((oauthClient) => ({
|
||||
name: oauthClient.name,
|
||||
id: oauthClient.id,
|
||||
active: oauthClient.active,
|
||||
})),
|
||||
meta: {
|
||||
count: oauthClients.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAdminOAuthClientsMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const updateOAuthClientMock = (oauthClient) => {
|
||||
return {
|
||||
data: {
|
||||
id: oauthClient.id,
|
||||
name: oauthClient.name,
|
||||
active: oauthClient.active,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateOAuthClientMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const updateConfigMock = (
|
||||
logoConfig,
|
||||
primaryDarkConfig,
|
||||
primaryLightConfig,
|
||||
primaryMainConfig,
|
||||
titleConfig
|
||||
) => {
|
||||
return {
|
||||
data: {
|
||||
logoSvgData: logoConfig,
|
||||
'palette.primary.dark': primaryDarkConfig,
|
||||
'palette.primary.light': primaryLightConfig,
|
||||
'palette.primary.main': primaryMainConfig,
|
||||
title: titleConfig,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateConfigMock;
|
||||
@@ -1,49 +0,0 @@
|
||||
const getPermissionsCatalogMock = async () => {
|
||||
const data = {
|
||||
actions: [
|
||||
{
|
||||
key: 'read',
|
||||
label: 'Read',
|
||||
subjects: ['Connection', 'Execution', 'Flow'],
|
||||
},
|
||||
{
|
||||
key: 'manage',
|
||||
label: 'Manage',
|
||||
subjects: ['Connection', '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,32 +0,0 @@
|
||||
const createRoleMock = async (role, permissions = []) => {
|
||||
const data = {
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
isAdmin: role.isAdmin,
|
||||
description: role.description,
|
||||
createdAt: role.createdAt.getTime(),
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
permissions: permissions.map((permission) => ({
|
||||
id: permission.id,
|
||||
action: permission.action,
|
||||
conditions: permission.conditions,
|
||||
roleId: permission.roleId,
|
||||
subject: permission.subject,
|
||||
createdAt: permission.createdAt.getTime(),
|
||||
updatedAt: permission.updatedAt.getTime(),
|
||||
})),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Role',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createRoleMock;
|
||||
@@ -1,32 +0,0 @@
|
||||
const getRoleMock = async (role, permissions) => {
|
||||
const data = {
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
isAdmin: role.isAdmin,
|
||||
description: role.description,
|
||||
createdAt: role.createdAt.getTime(),
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
permissions: permissions.map((permission) => ({
|
||||
id: permission.id,
|
||||
action: permission.action,
|
||||
conditions: permission.conditions,
|
||||
roleId: permission.roleId,
|
||||
subject: permission.subject,
|
||||
createdAt: permission.createdAt.getTime(),
|
||||
updatedAt: permission.updatedAt.getTime(),
|
||||
})),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Role',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getRoleMock;
|
||||
@@ -1,25 +0,0 @@
|
||||
const getRolesMock = async (roles) => {
|
||||
const data = roles.map((role) => {
|
||||
return {
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
isAdmin: role.isAdmin,
|
||||
description: role.description,
|
||||
createdAt: role.createdAt.getTime(),
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Role',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getRolesMock;
|
||||
@@ -1,32 +0,0 @@
|
||||
const updateRoleMock = (role, permissions = []) => {
|
||||
const data = {
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
isAdmin: role.isAdmin,
|
||||
description: role.description,
|
||||
createdAt: role.createdAt.getTime(),
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
permissions: permissions.map((permission) => ({
|
||||
id: permission.id,
|
||||
action: permission.action,
|
||||
conditions: permission.conditions,
|
||||
roleId: permission.roleId,
|
||||
subject: permission.subject,
|
||||
createdAt: permission.createdAt.getTime(),
|
||||
updatedAt: permission.updatedAt.getTime(),
|
||||
})),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Role',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateRoleMock;
|
||||
@@ -1,29 +0,0 @@
|
||||
const createSamlAuthProviderMock = 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 createSamlAuthProviderMock;
|
||||
@@ -1,23 +0,0 @@
|
||||
const getRoleMappingsMock = async (roleMappings) => {
|
||||
const data = roleMappings.map((roleMapping) => {
|
||||
return {
|
||||
id: roleMapping.id,
|
||||
samlAuthProviderId: roleMapping.samlAuthProviderId,
|
||||
roleId: roleMapping.roleId,
|
||||
remoteRoleName: roleMapping.remoteRoleName,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'RoleMapping',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getRoleMappingsMock;
|
||||
@@ -1,29 +0,0 @@
|
||||
const getSamlAuthProviderMock = 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 getSamlAuthProviderMock;
|
||||
@@ -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;
|
||||
@@ -1,23 +0,0 @@
|
||||
const createRoleMappingsMock = async (roleMappings) => {
|
||||
const data = roleMappings.map((roleMapping) => {
|
||||
return {
|
||||
id: roleMapping.id,
|
||||
samlAuthProviderId: roleMapping.samlAuthProviderId,
|
||||
roleId: roleMapping.roleId,
|
||||
remoteRoleName: roleMapping.remoteRoleName,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'RoleMapping',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createRoleMappingsMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const createTemplateMock = async (template) => {
|
||||
const data = {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
flowData: template.getFlowDataWithIconUrls(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Template',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createTemplateMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const getTemplateMock = async (template) => {
|
||||
const data = {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
flowData: template.getFlowDataWithIconUrls(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Template',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getTemplateMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const getTemplatesMock = async (templates) => {
|
||||
const data = templates.map((template) => ({
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
flowData: template.getFlowDataWithIconUrls(),
|
||||
}));
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Template',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getTemplatesMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const updateTemplateMock = async (template) => {
|
||||
const data = {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
flowData: template.flowData,
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Template',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateTemplateMock;
|
||||
@@ -1,30 +0,0 @@
|
||||
import appConfig from '../../../../../../../src/config/app.js';
|
||||
|
||||
const createUserMock = (user) => {
|
||||
const userData = {
|
||||
createdAt: user.createdAt.getTime(),
|
||||
email: user.email,
|
||||
fullName: user.fullName,
|
||||
id: user.id,
|
||||
status: user.status,
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
acceptInvitationUrl: user.acceptInvitationUrl,
|
||||
};
|
||||
|
||||
if (appConfig.isCloud && user.trialExpiryDate) {
|
||||
userData.trialExpiryDate = user.trialExpiryDate.toISOString();
|
||||
}
|
||||
|
||||
return {
|
||||
data: userData,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createUserMock;
|
||||
@@ -1,30 +0,0 @@
|
||||
const getUserMock = (currentUser, role) => {
|
||||
return {
|
||||
data: {
|
||||
createdAt: currentUser.createdAt.getTime(),
|
||||
email: currentUser.email,
|
||||
fullName: currentUser.fullName,
|
||||
id: currentUser.id,
|
||||
role: {
|
||||
createdAt: role.createdAt.getTime(),
|
||||
description: null,
|
||||
id: role.id,
|
||||
isAdmin: role.isAdmin,
|
||||
name: role.name,
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
},
|
||||
status: currentUser.status,
|
||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||
updatedAt: currentUser.updatedAt.getTime(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getUserMock;
|
||||
@@ -1,38 +0,0 @@
|
||||
const getUsersMock = async (users, roles) => {
|
||||
const data = users.map((user) => {
|
||||
const role = roles.find((r) => r.id === user.roleId);
|
||||
|
||||
return {
|
||||
createdAt: user.createdAt.getTime(),
|
||||
email: user.email,
|
||||
fullName: user.fullName,
|
||||
id: user.id,
|
||||
role: role
|
||||
? {
|
||||
createdAt: role.createdAt.getTime(),
|
||||
description: role.description,
|
||||
id: role.id,
|
||||
isAdmin: role.isAdmin,
|
||||
name: role.name,
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
}
|
||||
: null,
|
||||
status: user.status,
|
||||
trialExpiryDate: user.trialExpiryDate.toISOString(),
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getUsersMock;
|
||||
@@ -1,28 +0,0 @@
|
||||
const updateUserMock = (user, role) => {
|
||||
return {
|
||||
data: {
|
||||
createdAt: user.createdAt.getTime(),
|
||||
email: user.email,
|
||||
fullName: user.fullName,
|
||||
id: user.id,
|
||||
status: user.status,
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
role: {
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
isAdmin: role.isAdmin,
|
||||
createdAt: role.createdAt.getTime(),
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
},
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateUserMock;
|
||||
@@ -1,24 +0,0 @@
|
||||
const createConnection = (connection) => {
|
||||
const connectionData = {
|
||||
id: connection.id,
|
||||
key: connection.key,
|
||||
oauthClientId: connection.oauthClientId,
|
||||
formattedData: connection.formattedData,
|
||||
verified: connection.verified || false,
|
||||
createdAt: connection.createdAt.getTime(),
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: connectionData,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Connection',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createConnection;
|
||||
@@ -1,14 +0,0 @@
|
||||
const getActionSubstepsMock = (substeps) => {
|
||||
return {
|
||||
data: substeps,
|
||||
meta: {
|
||||
count: substeps.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getActionSubstepsMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const getActionsMock = (actions) => {
|
||||
const actionsData = actions.map((trigger) => {
|
||||
return {
|
||||
name: trigger.name,
|
||||
key: trigger.key,
|
||||
description: trigger.description,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: actionsData,
|
||||
meta: {
|
||||
count: actions.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getActionsMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const getAppMock = (app) => {
|
||||
return {
|
||||
data: {
|
||||
authDocUrl: app.authDocUrl,
|
||||
iconUrl: app.iconUrl,
|
||||
key: app.key,
|
||||
name: app.name,
|
||||
primaryColor: app.primaryColor,
|
||||
supportsConnections: app.supportsConnections,
|
||||
supportsOauthClients: app.auth.generateAuthUrl ? true : false,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAppMock;
|
||||
@@ -1,24 +0,0 @@
|
||||
const getAppsMock = (apps) => {
|
||||
const appsData = apps.map((app) => ({
|
||||
authDocUrl: app.authDocUrl,
|
||||
iconUrl: app.iconUrl,
|
||||
key: app.key,
|
||||
name: app.name,
|
||||
primaryColor: app.primaryColor,
|
||||
supportsConnections: app.supportsConnections,
|
||||
supportsOauthClients: app?.auth?.generateAuthUrl ? true : false,
|
||||
}));
|
||||
|
||||
return {
|
||||
data: appsData,
|
||||
meta: {
|
||||
count: appsData.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAppsMock;
|
||||
@@ -1,20 +0,0 @@
|
||||
const getAuthMock = (auth) => {
|
||||
return {
|
||||
data: {
|
||||
fields: auth.fields,
|
||||
authenticationSteps: auth.authenticationSteps,
|
||||
reconnectionSteps: auth.reconnectionSteps,
|
||||
sharedReconnectionSteps: auth.sharedReconnectionSteps,
|
||||
sharedAuthenticationSteps: auth.sharedAuthenticationSteps,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAuthMock;
|
||||
@@ -1,20 +0,0 @@
|
||||
const getAppConfigMock = (appConfig) => {
|
||||
return {
|
||||
data: {
|
||||
key: appConfig.key,
|
||||
useOnlyPredefinedAuthClients: appConfig.useOnlyPredefinedAuthClients,
|
||||
disabled: appConfig.disabled,
|
||||
createdAt: appConfig.createdAt.getTime(),
|
||||
updatedAt: appConfig.updatedAt.getTime(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'AppConfig',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAppConfigMock;
|
||||
@@ -1,24 +0,0 @@
|
||||
const getConnectionsMock = (connections) => {
|
||||
return {
|
||||
data: connections.map((connection) => ({
|
||||
id: connection.id,
|
||||
key: connection.key,
|
||||
verified: connection.verified,
|
||||
oauthClientId: connection.oauthClientId,
|
||||
formattedData: {
|
||||
screenName: connection.formattedData.screenName,
|
||||
},
|
||||
createdAt: connection.createdAt.getTime(),
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
})),
|
||||
meta: {
|
||||
count: connections.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Connection',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getConnectionsMock;
|
||||
@@ -1,40 +0,0 @@
|
||||
const getFlowsMock = async (flows, steps, currentUserId) => {
|
||||
const data = flows.map((flow) => {
|
||||
const flowSteps = steps.filter((step) => step.flowId === flow.id);
|
||||
|
||||
return {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
isOwner: flow.userId === currentUserId,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: flowSteps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFlowsMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const getOAuthClientMock = (oauthClient) => {
|
||||
return {
|
||||
data: {
|
||||
name: oauthClient.name,
|
||||
id: oauthClient.id,
|
||||
active: oauthClient.active,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getOAuthClientMock;
|
||||
@@ -1,18 +0,0 @@
|
||||
const getOAuthClientsMock = (oauthClients) => {
|
||||
return {
|
||||
data: oauthClients.map((oauthClient) => ({
|
||||
name: oauthClient.name,
|
||||
id: oauthClient.id,
|
||||
active: oauthClient.active,
|
||||
})),
|
||||
meta: {
|
||||
count: oauthClients.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'OAuthClient',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getOAuthClientsMock;
|
||||
@@ -1,14 +0,0 @@
|
||||
const getTriggerSubstepsMock = (substeps) => {
|
||||
return {
|
||||
data: substeps,
|
||||
meta: {
|
||||
count: substeps.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getTriggerSubstepsMock;
|
||||
@@ -1,25 +0,0 @@
|
||||
const getTriggersMock = (triggers) => {
|
||||
const triggersData = triggers.map((trigger) => {
|
||||
return {
|
||||
description: trigger.description,
|
||||
key: trigger.key,
|
||||
name: trigger.name,
|
||||
pollInterval: trigger.pollInterval,
|
||||
showWebhookUrl: trigger.showWebhookUrl,
|
||||
type: trigger.type,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: triggersData,
|
||||
meta: {
|
||||
count: triggers.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getTriggersMock;
|
||||
@@ -1,39 +0,0 @@
|
||||
const configMock = (config) => {
|
||||
return {
|
||||
data: {
|
||||
id: config.id,
|
||||
updatedAt: config.updatedAt.getTime(),
|
||||
createdAt: config.createdAt.getTime(),
|
||||
disableFavicon: config.disableFavicon,
|
||||
disableNotificationsPage: config.disableNotificationsPage,
|
||||
additionalDrawerLink: config.additionalDrawerLink,
|
||||
additionalDrawerLinkIcon: config.additionalDrawerLinkIcon,
|
||||
additionalDrawerLinkText: config.additionalDrawerLinkText,
|
||||
logoSvgData: config.logoSvgData,
|
||||
palettePrimaryDark: config.palettePrimaryDark,
|
||||
palettePrimaryMain: config.palettePrimaryMain,
|
||||
palettePrimaryLight: config.palettePrimaryLight,
|
||||
installationCompleted: config.installationCompleted || false,
|
||||
title: config.title,
|
||||
enableTemplates: config.enableTemplates,
|
||||
enableFooter: config.enableFooter || false,
|
||||
footerLogoSvgData: config.footerLogoSvgData,
|
||||
footerCopyrightText: config.footerCopyrightText,
|
||||
footerBackgroundColor: config.footerBackgroundColor,
|
||||
footerTextColor: config.footerTextColor,
|
||||
footerDocsUrl: config.footerDocsUrl,
|
||||
footerTosUrl: config.footerTosUrl,
|
||||
footerPrivacyPolicyUrl: config.footerPrivacyPolicyUrl,
|
||||
footerImprintUrl: config.footerImprintUrl,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Config',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default configMock;
|
||||
@@ -1,20 +0,0 @@
|
||||
const infoMock = () => {
|
||||
return {
|
||||
data: {
|
||||
docsUrl: 'https://automatisch.io/docs',
|
||||
installationCompleted: true,
|
||||
isCloud: false,
|
||||
isEnterprise: true,
|
||||
isMation: false,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default infoMock;
|
||||
@@ -1,19 +0,0 @@
|
||||
const licenseMock = () => {
|
||||
return {
|
||||
data: {
|
||||
expireAt: '2025-12-31T23:59:59Z',
|
||||
id: '123',
|
||||
name: 'license-name',
|
||||
verified: true,
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default licenseMock;
|
||||
@@ -1,40 +0,0 @@
|
||||
const getFlowsMock = async (flows, steps, currentUserId) => {
|
||||
const data = flows.map((flow) => {
|
||||
const flowSteps = steps.filter((step) => step.flowId === flow.id);
|
||||
|
||||
return {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
isOwner: flow.userId === currentUserId,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: flowSteps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFlowsMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const resetConnectionMock = (connection) => {
|
||||
const data = {
|
||||
id: connection.id,
|
||||
key: connection.key,
|
||||
verified: connection.verified,
|
||||
oauthClientId: connection.oauthClientId,
|
||||
formattedData: {
|
||||
screenName: connection.formattedData.screenName,
|
||||
},
|
||||
createdAt: connection.createdAt.getTime(),
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Connection',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default resetConnectionMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const updateConnectionMock = (connection) => {
|
||||
const data = {
|
||||
id: connection.id,
|
||||
key: connection.key,
|
||||
verified: connection.verified,
|
||||
oauthClientId: connection.oauthClientId,
|
||||
formattedData: {
|
||||
screenName: connection.formattedData.screenName,
|
||||
},
|
||||
createdAt: connection.createdAt.getTime(),
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Connection',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateConnectionMock;
|
||||
@@ -1,40 +0,0 @@
|
||||
const getExecutionStepsMock = async (executionSteps, steps) => {
|
||||
const data = executionSteps.map((executionStep) => {
|
||||
const step = steps.find((step) => step.id === executionStep.stepId);
|
||||
|
||||
return {
|
||||
id: executionStep.id,
|
||||
dataIn: executionStep.dataIn,
|
||||
dataOut: executionStep.dataOut,
|
||||
errorDetails: executionStep.errorDetails,
|
||||
status: executionStep.status,
|
||||
createdAt: executionStep.createdAt.getTime(),
|
||||
updatedAt: executionStep.updatedAt.getTime(),
|
||||
step: {
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
webhookUrl: step.webhookUrl,
|
||||
status: step.status,
|
||||
position: step.position,
|
||||
parameters: step.parameters,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: executionSteps.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'ExecutionStep',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getExecutionStepsMock;
|
||||
@@ -1,42 +0,0 @@
|
||||
const getExecutionMock = async (execution, flow, steps) => {
|
||||
const data = {
|
||||
id: execution.id,
|
||||
testRun: execution.testRun,
|
||||
status: execution.status,
|
||||
createdAt: execution.createdAt.getTime(),
|
||||
updatedAt: execution.updatedAt.getTime(),
|
||||
flow: {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: steps.map((step) => ({
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
webhookUrl: step.webhookUrl,
|
||||
status: step.status,
|
||||
position: step.position,
|
||||
parameters: step.parameters,
|
||||
})),
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Execution',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getExecutionMock;
|
||||
@@ -1,42 +0,0 @@
|
||||
const getExecutionsMock = async (executions, flow, steps) => {
|
||||
const data = executions.map((execution) => ({
|
||||
id: execution.id,
|
||||
testRun: execution.testRun,
|
||||
createdAt: execution.createdAt.getTime(),
|
||||
updatedAt: execution.updatedAt.getTime(),
|
||||
status: 'success',
|
||||
flow: {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: steps.map((step) => ({
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
webhookUrl: step.webhookUrl,
|
||||
status: step.status,
|
||||
position: step.position,
|
||||
parameters: step.parameters,
|
||||
})),
|
||||
},
|
||||
}));
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: executions.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'Execution',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getExecutionsMock;
|
||||
@@ -1,23 +0,0 @@
|
||||
const createFlowMock = async (flow) => {
|
||||
const data = {
|
||||
id: flow.id,
|
||||
active: flow.active,
|
||||
name: flow.name,
|
||||
status: flow.status,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createFlowMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const createStepMock = async (step) => {
|
||||
const data = {
|
||||
id: step.id,
|
||||
type: step.type || 'action',
|
||||
key: step.key || null,
|
||||
appKey: step.appKey || null,
|
||||
iconUrl: step.iconUrl || null,
|
||||
webhookUrl: step.webhookUrl || null,
|
||||
status: step.status || 'incomplete',
|
||||
position: step.position,
|
||||
parameters: step.parameters || {},
|
||||
};
|
||||
|
||||
return {
|
||||
data,
|
||||
meta: {
|
||||
type: 'Step',
|
||||
count: 1,
|
||||
isArray: false,
|
||||
currentPage: null,
|
||||
totalPages: null,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createStepMock;
|
||||
@@ -1,38 +0,0 @@
|
||||
const duplicateFlowMock = async (flow, steps = []) => {
|
||||
const data = {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (steps.length) {
|
||||
data.steps = steps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
}));
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default duplicateFlowMock;
|
||||
@@ -1,41 +0,0 @@
|
||||
import { expect } from 'vitest';
|
||||
|
||||
const exportFlowMock = async (flow, steps = []) => {
|
||||
const data = {
|
||||
id: expect.any(String),
|
||||
name: flow.name,
|
||||
};
|
||||
|
||||
if (steps.length) {
|
||||
data.steps = steps.map((step) => {
|
||||
const computedStep = {
|
||||
id: expect.any(String),
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
appKey: step.appKey,
|
||||
type: step.type,
|
||||
parameters: expect.any(Object),
|
||||
position: step.position,
|
||||
};
|
||||
|
||||
if (step.type === 'trigger') {
|
||||
computedStep.webhookPath = expect.stringContaining('/webhooks/flows/');
|
||||
}
|
||||
|
||||
return computedStep;
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default exportFlowMock;
|
||||
@@ -1,38 +0,0 @@
|
||||
const getFlowMock = async (flow, steps = []) => {
|
||||
const data = {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (steps.length) {
|
||||
data.steps = steps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
}));
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFlowMock;
|
||||
@@ -1,40 +0,0 @@
|
||||
const getFlowsMock = async (flows, steps, currentUserId) => {
|
||||
const data = flows.map((flow) => {
|
||||
const flowSteps = steps.filter((step) => step.flowId === flow.id);
|
||||
|
||||
return {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
isOwner: flow.userId === currentUserId,
|
||||
steps: flowSteps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: 1,
|
||||
isArray: true,
|
||||
totalPages: 1,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFlowsMock;
|
||||
@@ -1,21 +0,0 @@
|
||||
const getFlowMock = async (folder) => {
|
||||
const data = {
|
||||
id: folder.id,
|
||||
name: folder.name,
|
||||
createdAt: folder.createdAt.getTime(),
|
||||
updatedAt: folder.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Folder',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFlowMock;
|
||||
@@ -1,35 +0,0 @@
|
||||
import { expect } from 'vitest';
|
||||
|
||||
const importFlowMock = async (flow, steps = []) => {
|
||||
const data = {
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
active: flow.active,
|
||||
};
|
||||
|
||||
if (steps.length) {
|
||||
data.steps = steps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: expect.any(Object),
|
||||
position: step.position,
|
||||
status: 'incomplete',
|
||||
type: step.type,
|
||||
}));
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default importFlowMock;
|
||||
@@ -1,29 +0,0 @@
|
||||
const updateFlowFolderMock = async (flow, folder) => {
|
||||
const data = {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
folder: {
|
||||
id: folder.id,
|
||||
name: folder.name,
|
||||
createdAt: folder.createdAt.getTime(),
|
||||
updatedAt: folder.updatedAt.getTime(),
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateFlowFolderMock;
|
||||
@@ -1,38 +0,0 @@
|
||||
const updateFlowStatusMock = async (flow, steps = []) => {
|
||||
const data = {
|
||||
active: flow.active,
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (steps.length) {
|
||||
data.steps = steps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
id: step.id,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
webhookUrl: step.webhookUrl,
|
||||
}));
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Flow',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateFlowStatusMock;
|
||||
@@ -1,21 +0,0 @@
|
||||
const createFolderMock = async (flow) => {
|
||||
const data = {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Folder',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createFolderMock;
|
||||
@@ -1,23 +0,0 @@
|
||||
const getFoldersMock = async (folders) => {
|
||||
const data = folders.map((folder) => {
|
||||
return {
|
||||
id: folder.id,
|
||||
name: folder.name,
|
||||
createdAt: folder.createdAt.getTime(),
|
||||
updatedAt: folder.updatedAt.getTime(),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Folder',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getFoldersMock;
|
||||
@@ -1,21 +0,0 @@
|
||||
const updateFolderMock = async (flow) => {
|
||||
const data = {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Folder',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateFolderMock;
|
||||
@@ -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,23 +0,0 @@
|
||||
const getSamlAuthProvidersMock = async (samlAuthProviders) => {
|
||||
const data = samlAuthProviders.map((samlAuthProvider) => {
|
||||
return {
|
||||
id: samlAuthProvider.id,
|
||||
name: samlAuthProvider.name,
|
||||
loginUrl: samlAuthProvider.loginUrl,
|
||||
issuer: samlAuthProvider.issuer,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'SamlAuthProvider',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getSamlAuthProvidersMock;
|
||||
@@ -1,36 +0,0 @@
|
||||
const createDynamicFieldsMock = async () => {
|
||||
const data = [
|
||||
{
|
||||
label: 'Bot name',
|
||||
key: 'botName',
|
||||
type: 'string',
|
||||
required: true,
|
||||
value: 'Automatisch',
|
||||
description:
|
||||
'Specify the bot name which appears as a bold username above the message inside Slack. Defaults to Automatisch.',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Bot icon',
|
||||
key: 'botIcon',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'Either an image url or an emoji available to your team (surrounded by :). For example, https://example.com/icon_256.png or :robot_face:',
|
||||
variables: true,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createDynamicFieldsMock;
|
||||
@@ -1,26 +0,0 @@
|
||||
const getConnectionMock = async (connection) => {
|
||||
const data = {
|
||||
id: connection.id,
|
||||
key: connection.key,
|
||||
verified: connection.verified,
|
||||
oauthClientId: connection.oauthClientId,
|
||||
formattedData: {
|
||||
screenName: connection.formattedData.screenName,
|
||||
},
|
||||
createdAt: connection.createdAt.getTime(),
|
||||
updatedAt: connection.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Connection',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getConnectionMock;
|
||||
@@ -1,42 +0,0 @@
|
||||
const getPreviousStepsMock = async (steps, executionSteps) => {
|
||||
const data = steps.map((step) => {
|
||||
const filteredExecutionSteps = executionSteps.filter(
|
||||
(executionStep) => executionStep.stepId === step.id
|
||||
);
|
||||
|
||||
return {
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
key: step.key,
|
||||
name: step.name,
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
webhookUrl: step.webhookUrl,
|
||||
status: step.status,
|
||||
position: step.position,
|
||||
parameters: step.parameters,
|
||||
executionSteps: filteredExecutionSteps.map((executionStep) => ({
|
||||
id: executionStep.id,
|
||||
dataIn: executionStep.dataIn,
|
||||
dataOut: executionStep.dataOut,
|
||||
errorDetails: executionStep.errorDetails,
|
||||
status: executionStep.status,
|
||||
createdAt: executionStep.createdAt.getTime(),
|
||||
updatedAt: executionStep.updatedAt.getTime(),
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Step',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getPreviousStepsMock;
|
||||
@@ -1,34 +0,0 @@
|
||||
const testStepMock = async (step, lastExecutionStep) => {
|
||||
const data = {
|
||||
id: step.id,
|
||||
appKey: step.appKey,
|
||||
key: step.key,
|
||||
iconUrl: step.iconUrl,
|
||||
lastExecutionStep: {
|
||||
id: lastExecutionStep.id,
|
||||
status: lastExecutionStep.status,
|
||||
dataIn: lastExecutionStep.dataIn,
|
||||
dataOut: lastExecutionStep.dataOut,
|
||||
errorDetails: lastExecutionStep.errorDetails,
|
||||
createdAt: lastExecutionStep.createdAt.getTime(),
|
||||
updatedAt: lastExecutionStep.updatedAt.getTime(),
|
||||
},
|
||||
parameters: step.parameters,
|
||||
position: step.position,
|
||||
status: step.status,
|
||||
type: step.type,
|
||||
};
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Step',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default testStepMock;
|
||||
@@ -1,27 +0,0 @@
|
||||
const updateStepMock = (step) => {
|
||||
const data = {
|
||||
id: step.id,
|
||||
type: step.type || 'action',
|
||||
key: step.key || null,
|
||||
name: step.name || null,
|
||||
appKey: step.appKey || null,
|
||||
iconUrl: step.iconUrl || null,
|
||||
webhookUrl: step.webhookUrl || null,
|
||||
status: step.status || 'incomplete',
|
||||
position: step.position,
|
||||
parameters: step.parameters || {},
|
||||
};
|
||||
|
||||
return {
|
||||
data,
|
||||
meta: {
|
||||
type: 'Step',
|
||||
count: 1,
|
||||
isArray: false,
|
||||
currentPage: null,
|
||||
totalPages: null,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateStepMock;
|
||||
@@ -1,24 +0,0 @@
|
||||
const getTemplatesMock = async (templates) => {
|
||||
const data = templates.map((template) => {
|
||||
return {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
flowData: template.getFlowDataWithIconUrls(),
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
data: data,
|
||||
meta: {
|
||||
count: data.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Template',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getTemplatesMock;
|
||||
@@ -1,29 +0,0 @@
|
||||
import appConfig from '../../../../../../src/config/app.js';
|
||||
|
||||
const createUserMock = (user) => {
|
||||
const userData = {
|
||||
createdAt: user.createdAt.getTime(),
|
||||
email: user.email,
|
||||
fullName: user.fullName,
|
||||
id: user.id,
|
||||
status: user.status,
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (appConfig.isCloud && user.trialExpiryDate) {
|
||||
userData.trialExpiryDate = user.trialExpiryDate.toISOString();
|
||||
}
|
||||
|
||||
return {
|
||||
data: userData,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createUserMock;
|
||||
@@ -1,55 +0,0 @@
|
||||
const getAppsMock = () => {
|
||||
const appsData = [
|
||||
{
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/deepl/connection',
|
||||
connectionCount: 1,
|
||||
flowCount: 1,
|
||||
iconUrl: 'http://localhost:3000/apps/deepl/assets/favicon.svg',
|
||||
key: 'deepl',
|
||||
name: 'DeepL',
|
||||
primaryColor: '#0d2d45',
|
||||
supportsConnections: true,
|
||||
},
|
||||
{
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/github/connection',
|
||||
connectionCount: 1,
|
||||
flowCount: 1,
|
||||
iconUrl: 'http://localhost:3000/apps/github/assets/favicon.svg',
|
||||
key: 'github',
|
||||
name: 'GitHub',
|
||||
primaryColor: '#000000',
|
||||
supportsConnections: true,
|
||||
},
|
||||
{
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/slack/connection',
|
||||
flowCount: 1,
|
||||
iconUrl: 'http://localhost:3000/apps/slack/assets/favicon.svg',
|
||||
key: 'slack',
|
||||
name: 'Slack',
|
||||
primaryColor: '#4a154b',
|
||||
supportsConnections: true,
|
||||
},
|
||||
{
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/webhook/connection',
|
||||
flowCount: 1,
|
||||
iconUrl: 'http://localhost:3000/apps/webhook/assets/favicon.svg',
|
||||
key: 'webhook',
|
||||
name: 'Webhook',
|
||||
primaryColor: '#0059F7',
|
||||
supportsConnections: false,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
data: appsData,
|
||||
meta: {
|
||||
count: appsData.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getAppsMock;
|
||||
@@ -1,39 +0,0 @@
|
||||
const getCurrentUserMock = (currentUser, role, permissions) => {
|
||||
return {
|
||||
data: {
|
||||
createdAt: currentUser.createdAt.getTime(),
|
||||
email: currentUser.email,
|
||||
fullName: currentUser.fullName,
|
||||
id: currentUser.id,
|
||||
permissions: permissions.map((permission) => ({
|
||||
id: permission.id,
|
||||
roleId: permission.roleId,
|
||||
action: permission.action,
|
||||
subject: permission.subject,
|
||||
conditions: permission.conditions,
|
||||
createdAt: permission.createdAt.getTime(),
|
||||
updatedAt: permission.updatedAt.getTime(),
|
||||
})),
|
||||
role: {
|
||||
createdAt: role.createdAt.getTime(),
|
||||
description: null,
|
||||
id: role.id,
|
||||
isAdmin: role.isAdmin,
|
||||
name: role.name,
|
||||
updatedAt: role.updatedAt.getTime(),
|
||||
},
|
||||
status: currentUser.status,
|
||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||
updatedAt: currentUser.updatedAt.getTime(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getCurrentUserMock;
|
||||
@@ -1,14 +0,0 @@
|
||||
const getInvoicesMock = async (invoices) => {
|
||||
return {
|
||||
data: invoices,
|
||||
meta: {
|
||||
count: invoices.length,
|
||||
currentPage: null,
|
||||
isArray: true,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getInvoicesMock;
|
||||
@@ -1,27 +0,0 @@
|
||||
const getSubscriptionMock = (subscription) => {
|
||||
return {
|
||||
data: {
|
||||
id: subscription.id,
|
||||
paddlePlanId: subscription.paddlePlanId,
|
||||
paddleSubscriptionId: subscription.paddleSubscriptionId,
|
||||
cancelUrl: subscription.cancelUrl,
|
||||
updateUrl: subscription.updateUrl,
|
||||
status: subscription.status,
|
||||
nextBillAmount: subscription.nextBillAmount,
|
||||
nextBillDate: subscription.nextBillDate.toISOString(),
|
||||
lastBillDate: subscription.lastBillDate,
|
||||
cancellationEffectiveDate: subscription.cancellationEffectiveDate,
|
||||
createdAt: subscription.createdAt.getTime(),
|
||||
updatedAt: subscription.updatedAt.getTime(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Subscription',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getSubscriptionMock;
|
||||
@@ -1,17 +0,0 @@
|
||||
const getUserTrialMock = async (currentUser) => {
|
||||
return {
|
||||
data: {
|
||||
inTrial: await currentUser.inTrial(),
|
||||
expireAt: currentUser.trialExpiryDate.toISOString(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'Object',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default getUserTrialMock;
|
||||
@@ -1,29 +0,0 @@
|
||||
import appConfig from '../../../../../../src/config/app.js';
|
||||
|
||||
const registerUserMock = (user) => {
|
||||
const userData = {
|
||||
createdAt: user.createdAt.getTime(),
|
||||
email: user.email,
|
||||
fullName: user.fullName,
|
||||
id: user.id,
|
||||
status: user.status,
|
||||
updatedAt: user.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (appConfig.isCloud && user.trialExpiryDate) {
|
||||
userData.trialExpiryDate = user.trialExpiryDate.toISOString();
|
||||
}
|
||||
|
||||
return {
|
||||
data: userData,
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default registerUserMock;
|
||||
@@ -1,22 +0,0 @@
|
||||
const updateCurrentUserPasswordMock = (currentUser) => {
|
||||
return {
|
||||
data: {
|
||||
createdAt: currentUser.createdAt.getTime(),
|
||||
email: currentUser.email,
|
||||
fullName: currentUser.fullName,
|
||||
id: currentUser.id,
|
||||
status: currentUser.status,
|
||||
updatedAt: currentUser.updatedAt.getTime(),
|
||||
trialExpiryDate: currentUser.trialExpiryDate?.toISOString(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateCurrentUserPasswordMock;
|
||||
@@ -1,21 +0,0 @@
|
||||
const updateCurrentUserMock = (currentUser) => {
|
||||
return {
|
||||
data: {
|
||||
createdAt: currentUser.createdAt.getTime(),
|
||||
email: currentUser.email,
|
||||
fullName: currentUser.fullName,
|
||||
id: currentUser.id,
|
||||
status: currentUser.status,
|
||||
updatedAt: currentUser.updatedAt.getTime(),
|
||||
},
|
||||
meta: {
|
||||
count: 1,
|
||||
currentPage: null,
|
||||
isArray: false,
|
||||
totalPages: null,
|
||||
type: 'User',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default updateCurrentUserMock;
|
||||
Reference in New Issue
Block a user