Rename CLI trust-center commands
Replace the trust-center command tree with compliance-portal so the CLI matches the product and GraphQL rename. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -68,12 +68,12 @@ type createResponse struct {
|
||||
|
||||
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
var (
|
||||
flagOrg string
|
||||
flagTitle string
|
||||
flagContent string
|
||||
flagDocumentType string
|
||||
flagClassification string
|
||||
flagTrustCenterVisibility string
|
||||
flagOrg string
|
||||
flagTitle string
|
||||
flagContent string
|
||||
flagDocumentType string
|
||||
flagClassification string
|
||||
flagCompliancePortalVisibility string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -199,16 +199,16 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
input["content"] = flagContent
|
||||
}
|
||||
|
||||
if flagTrustCenterVisibility != "" {
|
||||
if flagCompliancePortalVisibility != "" {
|
||||
if err := cmdutil.ValidateEnum(
|
||||
"trust-center-visibility",
|
||||
flagTrustCenterVisibility,
|
||||
"compliance-portal-visibility",
|
||||
flagCompliancePortalVisibility,
|
||||
[]string{"NONE", "PRIVATE", "PUBLIC"},
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
input["trustCenterVisibility"] = flagTrustCenterVisibility
|
||||
input["compliancePortalVisibility"] = flagCompliancePortalVisibility
|
||||
}
|
||||
|
||||
data, err := client.Do(
|
||||
@@ -242,7 +242,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().StringVar(&flagContent, "content", "", "Document content")
|
||||
cmd.Flags().StringVar(&flagDocumentType, "document-type", "", "Document type: OTHER, GOVERNANCE, POLICY, PROCEDURE, PLAN, REGISTER, RECORD, REPORT, TEMPLATE")
|
||||
cmd.Flags().StringVar(&flagClassification, "classification", "", "Classification: PUBLIC, INTERNAL, CONFIDENTIAL, SECRET")
|
||||
cmd.Flags().StringVar(&flagTrustCenterVisibility, "trust-center-visibility", "", "Trust center visibility: NONE, PRIVATE, PUBLIC")
|
||||
cmd.Flags().StringVar(&flagCompliancePortalVisibility, "compliance-portal-visibility", "", "Compliance portal visibility: NONE, PRIVATE, PUBLIC")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: DocumentOrder, $filter
|
||||
node {
|
||||
id
|
||||
status
|
||||
trustCenterVisibility
|
||||
compliancePortalVisibility
|
||||
versions(first: 1) {
|
||||
edges {
|
||||
node {
|
||||
@@ -63,10 +63,10 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: DocumentOrder, $filter
|
||||
`
|
||||
|
||||
type document struct {
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
TrustCenterVisibility string `json:"trustCenterVisibility"`
|
||||
Versions struct {
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
CompliancePortalVisibility string `json:"compliancePortalVisibility"`
|
||||
Versions struct {
|
||||
Edges []struct {
|
||||
Node struct {
|
||||
Title string `json:"title"`
|
||||
|
||||
@@ -34,7 +34,7 @@ mutation($input: UpdateDocumentInput!) {
|
||||
updateDocument(input: $input) {
|
||||
document {
|
||||
id
|
||||
trustCenterVisibility
|
||||
compliancePortalVisibility
|
||||
}
|
||||
documentVersion {
|
||||
id
|
||||
@@ -52,8 +52,8 @@ mutation($input: UpdateDocumentInput!) {
|
||||
type updateResponse struct {
|
||||
UpdateDocument struct {
|
||||
Document struct {
|
||||
ID string `json:"id"`
|
||||
TrustCenterVisibility string `json:"trustCenterVisibility"`
|
||||
ID string `json:"id"`
|
||||
CompliancePortalVisibility string `json:"compliancePortalVisibility"`
|
||||
} `json:"document"`
|
||||
DocumentVersion *struct {
|
||||
ID string `json:"id"`
|
||||
@@ -69,11 +69,11 @@ type updateResponse struct {
|
||||
|
||||
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
var (
|
||||
flagTitle string
|
||||
flagContent string
|
||||
flagDocumentType string
|
||||
flagClassification string
|
||||
flagTrustCenterVisibility string
|
||||
flagTitle string
|
||||
flagContent string
|
||||
flagDocumentType string
|
||||
flagClassification string
|
||||
flagCompliancePortalVisibility string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -134,16 +134,16 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
input["classification"] = flagClassification
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("trust-center-visibility") {
|
||||
if cmd.Flags().Changed("compliance-portal-visibility") {
|
||||
if err := cmdutil.ValidateEnum(
|
||||
"trust-center-visibility",
|
||||
flagTrustCenterVisibility,
|
||||
"compliance-portal-visibility",
|
||||
flagCompliancePortalVisibility,
|
||||
[]string{"NONE", "PRIVATE", "PUBLIC"},
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
input["trustCenterVisibility"] = flagTrustCenterVisibility
|
||||
input["compliancePortalVisibility"] = flagCompliancePortalVisibility
|
||||
}
|
||||
|
||||
if len(input) == 1 {
|
||||
@@ -189,7 +189,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().StringVar(&flagContent, "content", "", "Document content")
|
||||
cmd.Flags().StringVar(&flagDocumentType, "document-type", "", "Document type: OTHER, GOVERNANCE, POLICY, PROCEDURE, PLAN, REGISTER, RECORD, REPORT, TEMPLATE, STATEMENT_OF_APPLICABILITY")
|
||||
cmd.Flags().StringVar(&flagClassification, "classification", "", "Classification: PUBLIC, INTERNAL, CONFIDENTIAL, SECRET")
|
||||
cmd.Flags().StringVar(&flagTrustCenterVisibility, "trust-center-visibility", "", "Trust center visibility: NONE, PRIVATE, PUBLIC")
|
||||
cmd.Flags().StringVar(&flagCompliancePortalVisibility, "compliance-portal-visibility", "", "Compliance portal visibility: NONE, PRIVATE, PUBLIC")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ query($id: ID!) {
|
||||
... on Document {
|
||||
id
|
||||
status
|
||||
trustCenterVisibility
|
||||
compliancePortalVisibility
|
||||
currentPublishedMajor
|
||||
currentPublishedMinor
|
||||
versions(first: 1) {
|
||||
@@ -61,13 +61,13 @@ query($id: ID!) {
|
||||
|
||||
type viewResponse struct {
|
||||
Node *struct {
|
||||
Typename string `json:"__typename"`
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
TrustCenterVisibility string `json:"trustCenterVisibility"`
|
||||
CurrentPublishedMajor *int `json:"currentPublishedMajor"`
|
||||
CurrentPublishedMinor *int `json:"currentPublishedMinor"`
|
||||
Versions struct {
|
||||
Typename string `json:"__typename"`
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
CompliancePortalVisibility string `json:"compliancePortalVisibility"`
|
||||
CurrentPublishedMajor *int `json:"currentPublishedMajor"`
|
||||
CurrentPublishedMinor *int `json:"currentPublishedMinor"`
|
||||
Versions struct {
|
||||
Edges []struct {
|
||||
Node struct {
|
||||
Title string `json:"title"`
|
||||
@@ -153,7 +153,7 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("ID:"), doc.ID)
|
||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Status:"), doc.Status)
|
||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Visibility:"), doc.TrustCenterVisibility)
|
||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Visibility:"), doc.CompliancePortalVisibility)
|
||||
|
||||
if len(doc.Versions.Edges) > 0 {
|
||||
v := doc.Versions.Edges[0].Node
|
||||
|
||||
Reference in New Issue
Block a user