Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const selectCurrentUserCFRolesState = (state: ICurrentUserRolesState) => state.cf;
export const selectCurrentUserCFEndpointRolesState = (endpointGuid: string) =>
(state: IAllCfRolesState) => state ? state[endpointGuid] : null;
export const selectCurrentUserCFGlobalRolesStates = (state: ICfRolesState) => state ? state.global : null;
export const selectCurrentUserCFGlobalRolesState = (role: PermissionValues) => (state: IGlobalRolesState) => state[role] || false;
export const selectCurrentUserCFOrgsRolesState = (state: ICfRolesState) => state.organizations;
export const selectCurrentUserCFSpacesRolesState = (state: ICfRolesState) => state.spaces;
export const selectCurrentUserCFGlobalScopesState = (state: IGlobalRolesState) => state ? state.scopes : [];
export const selectCurrentUserCFSpaceRolesState = (spaceId: string) => (state: ISpacesRoleState) => state[spaceId];
export const selectCurrentUserCFOrgRolesState = (orgId: string) => (state: IOrgsRoleState) => state[orgId];
// Top level cf endpoint role objects
// ============================
export const getCurrentUserCFRolesState = compose(
selectCurrentUserCFRolesState,
selectCurrentUserRolesState
);
// ============================
// Specific endpoint roles
// ============================
export const getCurrentUserCFEndpointRolesState = (endpointGuid: string) => compose(
selectCurrentUserCFEndpointRolesState(endpointGuid),
getCurrentUserCFRolesState
);
// ============================
// CF Global roles
// ============================
export const getCurrentUserCFGlobalStates = (endpointGuid: string) => compose(
export const getCurrentUserCFEndpointHasScope = (endpointGuid: string, scope: ScopeStrings) => compose(
selectCurrentUserCFGlobalHasScopes(scope),
getCurrentUserCFEndpointScopesState(endpointGuid)
);
// ============================
export const getCurrentUserCFOrgsRolesState = (endpointGuid: string) => compose(
selectCurrentUserCFOrgsRolesState,
getCurrentUserCFEndpointRolesState(endpointGuid)
);
// ============================
export const getCurrentUserCFRequestState = (endpointGuid: string) => compose(
selectCurrentUserRequestState,
getCurrentUserCFGlobalStates(endpointGuid)
);
// ============================
export const getCurrentUserCFEndpointRolesState = (endpointGuid: string) => compose(
selectCurrentUserCFEndpointRolesState(endpointGuid),
getCurrentUserCFRolesState
);
// ============================
export const internalEventTypeSelector = (type: string) => compose(
(state: InternalEventsState) => state.types[type] || {},
internalEventStateSelector
);
export function selectRequestInfo(entityType: string, entityGuid: string) {
return compose(
getEntityById(entityGuid),
getRequestEntityType(entityType),
getAPIRequestInfoState
);
}
getApplicationSource,
selectDeployAppState
);
export const selectProjectName = compose(
getApplicationProjectName,
getApplicationSource,
selectDeployAppState
);
export const selectProjectExists = compose(
getProjectExists,
selectDeployAppState
);
export const selectNewProjectCommit = compose(
getCommit,
getApplicationSource,
selectDeployAppState
);
export const selectNewProjectBranch = compose(
getBranch,
getApplicationSource,
selectDeployAppState
);
export const selectCfDetails = compose(
getCFDetails,
selectDeployAppState
);
if (favorite.entityType === 'endpoint' && !group.ethereal) {
return true;
}
return group.entitiesIds.includes(favorite.guid);
};
};
export function isFavoriteSelector(favorite: UserFavorite) {
return compose(
favoriteInGroupGroupSelector(favorite),
favoriteGroupSelector(favorite),
favoriteGroupsSelector
);
}
export const fetchingFavoritesSelector = compose(
favoriteGroupsFetchingSelector,
favoriteGroupsStateSelector
);
export const errorFetchingFavoritesSelector = compose(
favoriteGroupsErrorSelector,
favoriteGroupsStateSelector
);
selectDeployAppState
);
export const selectNewProjectCommit = compose(
getCommit,
getApplicationSource,
selectDeployAppState
);
export const selectNewProjectBranch = compose(
getBranch,
getApplicationSource,
selectDeployAppState
);
export const selectCfDetails = compose(
getCFDetails,
selectDeployAppState
);
export const selectDeployBranchName = compose(
getDeployBranchName,
getApplicationSource,
selectDeployAppState
);
export const selectPEProjectName = compose(
getProjectName,
getProjectExists,
selectDeployAppState
);