-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from pantheon-systems/PCC-1523-add-cli-comman…
…ds-for-managing-collection-user-permissions PCC-1523 Add collaborator and visibility management commands.
- Loading branch information
Showing
7 changed files
with
562 additions
and
200 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@pantheon-systems/pcc-cli": minor | ||
--- | ||
|
||
Added commands for managing collaborators and site visibility. |
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,31 @@ | ||
import ora from "ora"; | ||
import AddOnApiHelper from "../../../lib/addonApiHelper"; | ||
import { errorHandler } from "../../exceptions"; | ||
|
||
type listCollaboratorsSchemaParams = { siteId: string }; | ||
export const listCollaborators = errorHandler<listCollaboratorsSchemaParams>( | ||
async ({ siteId }: listCollaboratorsSchemaParams) => { | ||
const spinner = ora("Retrieving Collaborators...").start(); | ||
const result = await AddOnApiHelper.listCollaborators(siteId); | ||
spinner.succeed(); | ||
console.log(JSON.stringify(result, null, 4)); | ||
}, | ||
); | ||
|
||
type removeCollaboratorschemaParams = { siteId: string; email: string }; | ||
export const removeCollaborator = errorHandler<removeCollaboratorschemaParams>( | ||
async ({ siteId, email }: removeCollaboratorschemaParams) => { | ||
const spinner = ora("Removing Collaborator...").start(); | ||
await AddOnApiHelper.removeCollaborator(siteId, email); | ||
spinner.succeed(); | ||
}, | ||
); | ||
|
||
type addCollaboratorschemaParams = { siteId: string; email: string }; | ||
export const addCollaborator = errorHandler<addCollaboratorschemaParams>( | ||
async ({ siteId, email }: addCollaboratorschemaParams) => { | ||
const spinner = ora("Adding Collaborator...").start(); | ||
await AddOnApiHelper.addCollaborator(siteId, email); | ||
spinner.succeed(); | ||
}, | ||
); |
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
Oops, something went wrong.