Skip to content

Commit

Permalink
Create GroupingsApiService (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
JorWo authored Feb 23, 2024
1 parent 9c0cf0b commit 69b4fc4
Show file tree
Hide file tree
Showing 5 changed files with 1,734 additions and 6 deletions.
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-slot": "^1.0.2",
"axios": "^1.6.7",
"axios-retry": "^4.0.0",
"camaro": "^6.2.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
Expand Down
8 changes: 2 additions & 6 deletions ui/src/access/User.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { MemberResult } from '@/services/GroupingsApiResults';
import Role from './Role';

type User = {
name: string,
firstName: string,
lastName: string,
uid: string,
uhUuid: string,
roles: Role[]
}
} & MemberResult

export const AnonymousUser: User = {
name: '',
Expand Down
151 changes: 151 additions & 0 deletions ui/src/services/GroupingsApiResults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
export type Announcement = {
message: string,
start: string,
end: string,
state: string
};

export type Announcements = {
resultCode: string,
announcements: Announcement[]
};

export type GroupingResult = {
resultCode: string,
groupPath: string
};

export type MemberResult = {
uid: string,
uhUuid: string,
name: string,
firstName: string,
lastName: string
};

export type GroupingPath = {
path: string,
name: string,
description: string
};

export type GroupingPaths = {
resultCode: string,
groupingPaths: GroupingPath[]
}

export type Membership = {
inBasis: boolean,
inInclude: boolean,
inExclude: boolean,
inOwner: boolean,
inBasisAndInclude: boolean,
optOutEnabled: boolean,
optInEnabled: boolean,
selfOpted: boolean
} & GroupingPath

export type MembershipResults = {
resultCode: string,
results: Membership[]
}

export type GroupingMember = {
whereListed: string
} & MemberResult;

export type GroupingMembers = {
members: GroupingMember[]
};

export type GroupingGroupMember = {
resultCode: string
} & MemberResult;

export type GroupingGroupMembers = {
members: GroupingGroupMember[]
} & GroupingResult;

export type GroupingGroupsMembers = {
groupsMembersList: GroupingGroupMembers[]
isBasis: boolean,
isInclude: boolean,
isExclude: boolean,
isOwners: boolean,
paginationComplete: boolean,
allMembers: GroupingMembers,
pageNumber: number
} & GroupingResult;

export type GroupingDescription = {
description: string
} & GroupingResult;

export type GroupingSyncDestination = {
name: string,
description: string,
tooltip: string,
synced: boolean,
hidden: boolean
}

export type GroupingSyncDestinations = {
resultCode: string,
syncDestinations: GroupingSyncDestination[]
}

export type GroupingOptAttributes = {
optInOn: boolean,
optOutOn: boolean
} & GroupingResult;

export type GroupingUpdateDescriptionResult = {
currentDescription: string,
updatedDescription: string
} & GroupingResult;

export type GroupingAddResult = GroupingResult | MemberResult;

export type GroupingAddResults = {
results: GroupingAddResult[]
} & GroupingResult

export type GroupingRemoveResult = GroupingResult | MemberResult;

export type GroupingRemoveResults = {
results: GroupingRemoveResult[]
} & GroupingResult

export type GroupingMoveMemberResult = {
addResult: GroupingAddResult,
removeResult: GroupingRemoveResult
} & GroupingResult;

export type GroupingMoveMembersResult = {
addResults: GroupingAddResults,
removeResults: GroupingRemoveResults
} & GroupingResult;

export type MemberAttributeResults = {
resultCode: string,
invalid: string[],
result: MemberResult[]
}

export type ApiSubError = {
message: string
};

export type ApiValidationError = {
object: string,
field: string,
rejectedValue: unknown
} & ApiSubError;

export type ApiError = {
status: string,
timestamp: string,
message: string,
debugMessage: string,
subErrors: ApiValidationError[]
};
Loading

0 comments on commit 69b4fc4

Please sign in to comment.