oaeproject/Hilary

View on GitHub
packages/oae-principals/lib/constants.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
/*!
 * Copyright 2014 Apereo Foundation (AF) Licensed under the
 * Educational Community License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may
 * obtain a copy of the License at
 *
 *     http://opensource.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

import { AuthzConstants } from 'oae-authz/lib/constants.js';

const PrincipalsConstants = {};

PrincipalsConstants.events = {
  CREATED_GROUP: 'createdGroup',
  CREATED_USER: 'createdUser',
  GET_GROUP_PROFILE: 'getGroupProfile',
  GET_MEMBERSHIPS_LIBRARY: 'getMembershipsLibrary',
  GET_USER_PROFILE: 'getUserProfile',
  JOINED_GROUP: 'joinedGroup',
  LEFT_GROUP: 'leftGroup',
  SET_GROUP_PICTURE: 'setGroupPicture',
  SET_USER_PICTURE: 'setUserPicture',
  UPDATED_GROUP: 'updatedGroup',
  UPDATED_GROUP_MEMBERS: 'updatedGroupMembers',
  UPDATED_USER: 'updatedUser',
  DELETED_EMAIL_TOKEN: 'deletedEmailToken',
  DELETED_GROUP: 'deletedGroup',
  DELETED_USER: 'deletedUser',
  REQUEST_TO_JOIN_GROUP: 'requestToJoinGroup',
  REQUEST_TO_JOIN_GROUP_ACCEPTED: 'acceptedRequestToJoinGroup',
  REQUEST_TO_JOIN_GROUP_REJECTED: 'rejectedRequestToJoinGroup',
  RESTORED_GROUP: 'restoredGroup',
  RESTORED_USER: 'restoredUser',
  VERIFIED_EMAIL: 'verifiedEmail'
};

PrincipalsConstants.picture = {};
PrincipalsConstants.picture.size = {
  SMALL: 32,
  MEDIUM: 162
};

PrincipalsConstants.activity = {
  ACTIVITY_GROUP_CREATE: 'group-create',
  ACTIVITY_GROUP_UPDATE: 'group-update',
  ACTIVITY_GROUP_UPDATE_VISIBILITY: 'group-update-visibility',
  ACTIVITY_GROUP_ADD_MEMBER: 'group-add-member',
  ACTIVITY_GROUP_UPDATE_MEMBER_ROLE: 'group-update-member-role',
  ACTIVITY_GROUP_JOIN: 'group-join',
  ACTIVITY_REQUEST_TO_JOIN_GROUP: 'request-to-join-group',
  ACTIVITY_REQUEST_TO_JOIN_GROUP_ACCEPTED: 'request-to-join-group-accepted',
  ACTIVITY_REQUEST_TO_JOIN_GROUP_REJECTED: 'request-to-join-group-rejected',
  ACTIVITY_USER_UPDATE: 'user-update'
};

PrincipalsConstants.library = {
  MEMBERSHIPS_INDEX_NAME: 'principals:memberships',
  MEMBERS_INDEX_NAME: 'principals:members'
};

PrincipalsConstants.emailPreferences = {
  IMMEDIATE: 'immediate',
  DAILY: 'daily',
  WEEKLY: 'weekly',
  NEVER: 'never'
};

PrincipalsConstants.role = {
  ALL_PRIORITY: [AuthzConstants.role.MEMBER, AuthzConstants.role.MANAGER]
};

PrincipalsConstants.exportType = {
  CONTENT_DATA: 'content',
  PERSONAL_DATA: 'personal-data',
  SHARED_DATA: 'shared'
};

PrincipalsConstants.requestStatus = {
  CANCEL: 'cancel',
  REJECT: 'reject',
  ACCEPT: 'accept',
  PENDING: 'pending'
};

export { PrincipalsConstants };