-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a7e8bd
commit 60f8ba4
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export interface ProjectLibrary { | ||
addPermissions(params: AddPermissionsParams): boolean; | ||
create(params: CreateProjectParams): Project; | ||
delete(params: DeleteProjectParams): boolean; | ||
get(params: GetProjectParams): Project | null; | ||
list(): ReadonlyArray<Project>; | ||
modify(params: ModifyProjectParams): Project; | ||
modifyReadAccess(params: ModifyReadAccessParams): ModifyReadAccessResult; | ||
removePermissions(params: RemovePermissionsParams): boolean; | ||
} | ||
|
||
type ProjectRole = "owner" | "editor" | "author" | "contributor" | "viewer"; | ||
|
||
type ProjectPermissions = Record<ProjectRole, ReadonlyArray<string>>; | ||
|
||
export interface ReadAccess { | ||
readonly public: boolean; | ||
} | ||
|
||
export interface Project { | ||
readonly id: string; | ||
readonly displayName: string; | ||
readonly description?: string; | ||
readonly language?: string; | ||
readonly permissions?: ProjectPermissions; | ||
readonly readAccess: ReadAccess; | ||
} | ||
|
||
export type CreateProjectParams = Project; | ||
|
||
export interface DeleteProjectParams { | ||
readonly id: string; | ||
} | ||
|
||
export interface GetProjectParams { | ||
readonly id: string; | ||
} | ||
|
||
export interface ModifyProjectParams { | ||
readonly id: string; | ||
readonly displayName: string; | ||
readonly description?: string; | ||
readonly language?: string; | ||
} | ||
|
||
export interface ModifyReadAccessParams { | ||
readonly id: string; | ||
readonly readAccess: ReadAccess; | ||
} | ||
|
||
export type ModifyReadAccessResult = ModifyReadAccessParams; | ||
|
||
export interface AddPermissionsParams { | ||
readonly id: string; | ||
readonly permissions: ProjectPermissions; | ||
} | ||
|
||
export interface RemovePermissionsParams { | ||
readonly id: string; | ||
readonly permissions: ProjectPermissions; | ||
} |