chore: remove upsert-saml-auth-providers-role-mappings mutation

This commit is contained in:
Ali BARIN
2024-09-02 15:32:04 +00:00
parent 95dc5fb849
commit 5556aea913
4 changed files with 0 additions and 70 deletions

View File

@@ -11,7 +11,6 @@ import updateConnection from './mutations/update-connection.js';
import updateCurrentUser from './mutations/update-current-user.js';
import updateFlowStatus from './mutations/update-flow-status.js';
import updateStep from './mutations/update-step.js';
import upsertSamlAuthProvidersRoleMappings from './mutations/upsert-saml-auth-providers-role-mappings.ee.js';
// Converted mutations
import executeFlow from './mutations/execute-flow.js';
@@ -40,7 +39,6 @@ const mutationResolvers = {
updateFlowStatus,
updateStep,
updateUser,
upsertSamlAuthProvidersRoleMappings,
verifyConnection,
};

View File

@@ -1,42 +0,0 @@
import SamlAuthProvider from '../../models/saml-auth-provider.ee.js';
import SamlAuthProvidersRoleMapping from '../../models/saml-auth-providers-role-mapping.ee.js';
import isEmpty from 'lodash/isEmpty.js';
const upsertSamlAuthProvidersRoleMappings = async (
_parent,
params,
context
) => {
context.currentUser.can('update', 'SamlAuthProvider');
const samlAuthProviderId = params.input.samlAuthProviderId;
const samlAuthProvider = await SamlAuthProvider.query()
.findById(samlAuthProviderId)
.throwIfNotFound();
await samlAuthProvider
.$relatedQuery('samlAuthProvidersRoleMappings')
.delete();
if (isEmpty(params.input.samlAuthProvidersRoleMappings)) {
return [];
}
const samlAuthProvidersRoleMappingsData =
params.input.samlAuthProvidersRoleMappings.map(
(samlAuthProvidersRoleMapping) => ({
...samlAuthProvidersRoleMapping,
samlAuthProviderId: samlAuthProvider.id,
})
);
const samlAuthProvidersRoleMappings =
await SamlAuthProvidersRoleMapping.query().insert(
samlAuthProvidersRoleMappingsData
);
return samlAuthProvidersRoleMappings;
};
export default upsertSamlAuthProvidersRoleMappings;

View File

@@ -20,9 +20,6 @@ type Mutation {
updateFlowStatus(input: UpdateFlowStatusInput): Flow
updateStep(input: UpdateStepInput): Step
updateUser(input: UpdateUserInput): User
upsertSamlAuthProvidersRoleMappings(
input: UpsertSamlAuthProvidersRoleMappingsInput
): [SamlAuthProvidersRoleMapping]
verifyConnection(input: VerifyConnectionInput): Connection
}
@@ -247,16 +244,6 @@ input VerifyConnectionInput {
id: String!
}
input UpsertSamlAuthProvidersRoleMappingsInput {
samlAuthProviderId: String!
samlAuthProvidersRoleMappings: [SamlAuthProviderRoleMappingInput]
}
input SamlAuthProviderRoleMappingInput {
roleId: String!
remoteRoleName: String!
}
input CreateFlowInput {
triggerAppKey: String
connectionId: String

View File

@@ -1,13 +0,0 @@
import { gql } from '@apollo/client';
export const UPSERT_SAML_AUTH_PROVIDERS_ROLE_MAPPINGS = gql`
mutation UpsertSamlAuthProvidersRoleMappings(
$input: UpsertSamlAuthProvidersRoleMappingsInput
) {
upsertSamlAuthProvidersRoleMappings(input: $input) {
id
samlAuthProviderId
roleId
remoteRoleName
}
}
`;