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:
Bryan Frimin
2026-07-20 18:08:22 +02:00
parent 8773a54396
commit 263ea61aba
27 changed files with 183 additions and 183 deletions

View File

@@ -62,13 +62,13 @@ type createResponse struct {
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command { func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
var ( var (
flagOrg string flagOrg string
flagFramework string flagFramework string
flagName string flagName string
flagState string flagState string
flagValidFrom string flagValidFrom string
flagValidUntil string flagValidUntil string
flagTrustCenterVisibility string flagCompliancePortalVisibility string
) )
cmd := &cobra.Command{ cmd := &cobra.Command{
@@ -160,8 +160,8 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
input["validUntil"] = flagValidUntil input["validUntil"] = flagValidUntil
} }
if flagTrustCenterVisibility != "" { if flagCompliancePortalVisibility != "" {
input["trustCenterVisibility"] = flagTrustCenterVisibility input["compliancePortalVisibility"] = flagCompliancePortalVisibility
} }
data, err := client.Do( data, err := client.Do(
@@ -195,7 +195,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&flagState, "state", "", "Audit state: NOT_STARTED, IN_PROGRESS, COMPLETED, REJECTED, OUTDATED") cmd.Flags().StringVar(&flagState, "state", "", "Audit state: NOT_STARTED, IN_PROGRESS, COMPLETED, REJECTED, OUTDATED")
cmd.Flags().StringVar(&flagValidFrom, "valid-from", "", "Valid from date (e.g. 2026-01-01)") cmd.Flags().StringVar(&flagValidFrom, "valid-from", "", "Valid from date (e.g. 2026-01-01)")
cmd.Flags().StringVar(&flagValidUntil, "valid-until", "", "Valid until date (e.g. 2026-12-31)") cmd.Flags().StringVar(&flagValidUntil, "valid-until", "", "Valid until date (e.g. 2026-12-31)")
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 return cmd
} }

View File

@@ -57,11 +57,11 @@ type updateResponse struct {
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command { func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
var ( var (
flagName string flagName string
flagState string flagState string
flagValidFrom string flagValidFrom string
flagValidUntil string flagValidUntil string
flagTrustCenterVisibility string flagCompliancePortalVisibility string
) )
cmd := &cobra.Command{ cmd := &cobra.Command{
@@ -107,8 +107,8 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
input["validUntil"] = flagValidUntil input["validUntil"] = flagValidUntil
} }
if cmd.Flags().Changed("trust-center-visibility") { if cmd.Flags().Changed("compliance-portal-visibility") {
input["trustCenterVisibility"] = flagTrustCenterVisibility input["compliancePortalVisibility"] = flagCompliancePortalVisibility
} }
if len(input) == 1 { if len(input) == 1 {
@@ -144,7 +144,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&flagState, "state", "", "Audit state: NOT_STARTED, IN_PROGRESS, COMPLETED, REJECTED, OUTDATED") cmd.Flags().StringVar(&flagState, "state", "", "Audit state: NOT_STARTED, IN_PROGRESS, COMPLETED, REJECTED, OUTDATED")
cmd.Flags().StringVar(&flagValidFrom, "valid-from", "", "Valid from date (e.g. 2026-01-01)") cmd.Flags().StringVar(&flagValidFrom, "valid-from", "", "Valid from date (e.g. 2026-01-01)")
cmd.Flags().StringVar(&flagValidUntil, "valid-until", "", "Valid until date (e.g. 2026-12-31)") cmd.Flags().StringVar(&flagValidUntil, "valid-until", "", "Valid until date (e.g. 2026-12-31)")
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 return cmd
} }

View File

@@ -23,10 +23,10 @@ package commitment
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/trust-center/commitment/create" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitment/create"
"go.probo.inc/probo/pkg/cmd/trust-center/commitment/delete" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitment/delete"
"go.probo.inc/probo/pkg/cmd/trust-center/commitment/list" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitment/list"
"go.probo.inc/probo/pkg/cmd/trust-center/commitment/update" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitment/update"
) )
func NewCmdCommitment(f *cmdutil.Factory) *cobra.Command { func NewCmdCommitment(f *cmdutil.Factory) *cobra.Command {

View File

@@ -23,10 +23,10 @@ package commitmentgroup
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/trust-center/commitmentgroup/create" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitmentgroup/create"
"go.probo.inc/probo/pkg/cmd/trust-center/commitmentgroup/delete" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitmentgroup/delete"
"go.probo.inc/probo/pkg/cmd/trust-center/commitmentgroup/list" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitmentgroup/list"
"go.probo.inc/probo/pkg/cmd/trust-center/commitmentgroup/update" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitmentgroup/update"
) )
func NewCmdCommitmentGroup(f *cmdutil.Factory) *cobra.Command { func NewCmdCommitmentGroup(f *cmdutil.Factory) *cobra.Command {

View File

@@ -18,23 +18,23 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
package trustcenter package complianceportal
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/trust-center/commitment" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitment"
"go.probo.inc/probo/pkg/cmd/trust-center/commitmentgroup" "go.probo.inc/probo/pkg/cmd/compliance-portal/commitmentgroup"
"go.probo.inc/probo/pkg/cmd/trust-center/file" "go.probo.inc/probo/pkg/cmd/compliance-portal/file"
"go.probo.inc/probo/pkg/cmd/trust-center/reference" "go.probo.inc/probo/pkg/cmd/compliance-portal/reference"
"go.probo.inc/probo/pkg/cmd/trust-center/update" "go.probo.inc/probo/pkg/cmd/compliance-portal/update"
"go.probo.inc/probo/pkg/cmd/trust-center/view" "go.probo.inc/probo/pkg/cmd/compliance-portal/view"
) )
func NewCmdTrustCenter(f *cmdutil.Factory) *cobra.Command { func NewCmdCompliancePortal(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "trust-center <command>", Use: "compliance-portal <command>",
Short: "Manage trust center", Short: "Manage compliance portal",
Aliases: []string{"tc"}, Aliases: []string{"tc"},
} }

View File

@@ -30,9 +30,9 @@ import (
) )
const deleteMutation = ` const deleteMutation = `
mutation($input: DeleteTrustCenterFileInput!) { mutation($input: DeleteCompliancePortalFileInput!) {
deleteTrustCenterFile(input: $input) { deleteCompliancePortalFile(input: $input) {
deletedTrustCenterFileId deletedCompliancePortalFileId
} }
} }
` `
@@ -42,7 +42,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "delete <id>", Use: "delete <id>",
Short: "Delete a trust center file", Short: "Delete a compliance portal file",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if !flagYes { if !flagYes {
@@ -53,7 +53,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
var confirmed bool var confirmed bool
err := huh.NewConfirm(). err := huh.NewConfirm().
Title(fmt.Sprintf("Delete trust center file %s?", args[0])). Title(fmt.Sprintf("Delete compliance portal file %s?", args[0])).
Value(&confirmed). Value(&confirmed).
Run() Run()
if err != nil { if err != nil {
@@ -97,7 +97,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
_, _ = fmt.Fprintf( _, _ = fmt.Fprintf(
f.IOStreams.Out, f.IOStreams.Out,
"Deleted trust center file %s\n", "Deleted compliance portal file %s\n",
args[0], args[0],
) )

View File

@@ -23,14 +23,14 @@ package file
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/trust-center/file/delete" "go.probo.inc/probo/pkg/cmd/compliance-portal/file/delete"
"go.probo.inc/probo/pkg/cmd/trust-center/file/list" "go.probo.inc/probo/pkg/cmd/compliance-portal/file/list"
) )
func NewCmdFile(f *cmdutil.Factory) *cobra.Command { func NewCmdFile(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "file <command>", Use: "file <command>",
Short: "Manage trust center files", Short: "Manage compliance portal files",
} }
cmd.AddCommand(list.NewCmdList(f)) cmd.AddCommand(list.NewCmdList(f))

View File

@@ -30,18 +30,18 @@ import (
) )
const listQuery = ` const listQuery = `
query($id: ID!, $first: Int, $after: CursorKey, $orderBy: TrustCenterFileOrder) { query($id: ID!, $first: Int, $after: CursorKey, $orderBy: CompliancePortalFileOrder) {
node(id: $id) { node(id: $id) {
__typename __typename
... on Organization { ... on Organization {
trustCenterFiles(first: $first, after: $after, orderBy: $orderBy) { compliancePortalFiles(first: $first, after: $after, orderBy: $orderBy) {
totalCount totalCount
edges { edges {
node { node {
id id
name name
category category
trustCenterVisibility compliancePortalVisibility
createdAt createdAt
} }
} }
@@ -55,12 +55,12 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: TrustCenterFileOrder)
} }
` `
type trustCenterFile struct { type compliancePortalFile struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Category string `json:"category"` Category string `json:"category"`
TrustCenterVisibility string `json:"trustCenterVisibility"` CompliancePortalVisibility string `json:"compliancePortalVisibility"`
CreatedAt string `json:"createdAt"` CreatedAt string `json:"createdAt"`
} }
func NewCmdList(f *cmdutil.Factory) *cobra.Command { func NewCmdList(f *cmdutil.Factory) *cobra.Command {
@@ -74,13 +74,13 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "list", Use: "list",
Short: "List trust center files", Short: "List compliance portal files",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Example: ` # List files in the default organization Example: ` # List files in the default organization
prb trust-center file list prb compliance-portal file list
# List files sorted by name # List files sorted by name
prb trust-center file ls --order-by NAME`, prb compliance-portal file ls --order-by NAME`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil { if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
@@ -133,11 +133,11 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
listQuery, listQuery,
variables, variables,
flagLimit, flagLimit,
func(data json.RawMessage) (*api.Connection[trustCenterFile], error) { func(data json.RawMessage) (*api.Connection[compliancePortalFile], error) {
var resp struct { var resp struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
TrustCenterFiles api.Connection[trustCenterFile] `json:"trustCenterFiles"` CompliancePortalFiles api.Connection[compliancePortalFile] `json:"compliancePortalFiles"`
} `json:"node"` } `json:"node"`
} }
if err := json.Unmarshal(data, &resp); err != nil { if err := json.Unmarshal(data, &resp); err != nil {
@@ -152,7 +152,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename) return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
} }
return &resp.Node.TrustCenterFiles, nil return &resp.Node.CompliancePortalFiles, nil
}, },
) )
if err != nil { if err != nil {
@@ -174,7 +174,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
file.ID, file.ID,
file.Name, file.Name,
file.Category, file.Category,
file.TrustCenterVisibility, file.CompliancePortalVisibility,
}) })
} }

View File

@@ -30,12 +30,12 @@ import (
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
) )
const trustCenterQuery = ` const compliancePortalQuery = `
query($id: ID!) { query($id: ID!) {
node(id: $id) { node(id: $id) {
__typename __typename
... on Organization { ... on Organization {
trustCenter { compliancePortal {
id id
} }
} }
@@ -44,9 +44,9 @@ query($id: ID!) {
` `
const createMutation = ` const createMutation = `
mutation($input: CreateTrustCenterReferenceInput!) { mutation($input: CreateCompliancePortalReferenceInput!) {
createTrustCenterReference(input: $input) { createCompliancePortalReference(input: $input) {
trustCenterReferenceEdge { compliancePortalReferenceEdge {
node { node {
id id
name name
@@ -59,18 +59,18 @@ mutation($input: CreateTrustCenterReferenceInput!) {
} }
` `
type trustCenterQueryResponse struct { type compliancePortalQueryResponse struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
TrustCenter *struct { CompliancePortal *struct {
ID string `json:"id"` ID string `json:"id"`
} `json:"trustCenter"` } `json:"compliancePortal"`
} `json:"node"` } `json:"node"`
} }
type createResponse struct { type createResponse struct {
CreateTrustCenterReference struct { CreateCompliancePortalReference struct {
TrustCenterReferenceEdge struct { CompliancePortalReferenceEdge struct {
Node struct { Node struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
@@ -78,8 +78,8 @@ type createResponse struct {
WebsiteUrl *string `json:"websiteUrl"` WebsiteUrl *string `json:"websiteUrl"`
Rank int `json:"rank"` Rank int `json:"rank"`
} `json:"node"` } `json:"node"`
} `json:"trustCenterReferenceEdge"` } `json:"compliancePortalReferenceEdge"`
} `json:"createTrustCenterReference"` } `json:"createCompliancePortalReference"`
} }
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command { func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
@@ -92,12 +92,12 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "create", Use: "create",
Short: "Create a trust center reference", Short: "Create a compliance portal reference",
Example: ` # Create a reference interactively Example: ` # Create a reference interactively
prb trust-center reference create prb compliance-portal reference create
# Create a reference non-interactively # Create a reference non-interactively
prb trust-center ref create --name "Acme Corp" --description "Enterprise customer" --website "https://acme.com"`, prb compliance-portal ref create --name "Acme Corp" --description "Enterprise customer" --website "https://acme.com"`,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := f.Config() cfg, err := f.Config()
if err != nil { if err != nil {
@@ -125,16 +125,16 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("organization is required; pass --org or set a default with 'prb auth login'") return fmt.Errorf("organization is required; pass --org or set a default with 'prb auth login'")
} }
// Fetch trust center ID from organization. // Fetch compliance portal ID from organization.
data, err := client.Do( data, err := client.Do(
trustCenterQuery, compliancePortalQuery,
map[string]any{"id": flagOrg}, map[string]any{"id": flagOrg},
) )
if err != nil { if err != nil {
return err return err
} }
var tcResp trustCenterQueryResponse var tcResp compliancePortalQueryResponse
if err := json.Unmarshal(data, &tcResp); err != nil { if err := json.Unmarshal(data, &tcResp); err != nil {
return fmt.Errorf("cannot parse response: %w", err) return fmt.Errorf("cannot parse response: %w", err)
} }
@@ -147,8 +147,8 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("expected Organization node, got %s", tcResp.Node.Typename) return fmt.Errorf("expected Organization node, got %s", tcResp.Node.Typename)
} }
if tcResp.Node.TrustCenter == nil { if tcResp.Node.CompliancePortal == nil {
return fmt.Errorf("trust center not found for organization %s", flagOrg) return fmt.Errorf("compliance portal not found for organization %s", flagOrg)
} }
if f.IOStreams.IsInteractive() { if f.IOStreams.IsInteractive() {
@@ -188,8 +188,8 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
} }
input := map[string]any{ input := map[string]any{
"trustCenterId": tcResp.Node.TrustCenter.ID, "compliancePortalId": tcResp.Node.CompliancePortal.ID,
"name": flagName, "name": flagName,
} }
if flagDescription != "" { if flagDescription != "" {
@@ -213,7 +213,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("cannot parse response: %w", err) return fmt.Errorf("cannot parse response: %w", err)
} }
r := resp.CreateTrustCenterReference.TrustCenterReferenceEdge.Node r := resp.CreateCompliancePortalReference.CompliancePortalReferenceEdge.Node
_, _ = fmt.Fprintf( _, _ = fmt.Fprintf(
f.IOStreams.Out, f.IOStreams.Out,
"Created reference %s (%s)\n", "Created reference %s (%s)\n",

View File

@@ -30,9 +30,9 @@ import (
) )
const deleteMutation = ` const deleteMutation = `
mutation($input: DeleteTrustCenterReferenceInput!) { mutation($input: DeleteCompliancePortalReferenceInput!) {
deleteTrustCenterReference(input: $input) { deleteCompliancePortalReference(input: $input) {
deletedTrustCenterReferenceId deletedCompliancePortalReferenceId
} }
} }
` `
@@ -42,7 +42,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "delete <id>", Use: "delete <id>",
Short: "Delete a trust center reference", Short: "Delete a compliance portal reference",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if !flagYes { if !flagYes {

View File

@@ -30,11 +30,11 @@ import (
) )
const listQuery = ` const listQuery = `
query($id: ID!, $first: Int, $after: CursorKey, $orderBy: TrustCenterReferenceOrder) { query($id: ID!, $first: Int, $after: CursorKey, $orderBy: CompliancePortalReferenceOrder) {
node(id: $id) { node(id: $id) {
__typename __typename
... on Organization { ... on Organization {
trustCenter { compliancePortal {
references(first: $first, after: $after, orderBy: $orderBy) { references(first: $first, after: $after, orderBy: $orderBy) {
totalCount totalCount
edges { edges {
@@ -58,7 +58,7 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: TrustCenterReferenceOr
} }
` `
type trustCenterReference struct { type compliancePortalReference struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Description *string `json:"description"` Description *string `json:"description"`
@@ -78,13 +78,13 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "list", Use: "list",
Short: "List trust center references", Short: "List compliance portal references",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Example: ` # List references in the default organization Example: ` # List references in the default organization
prb trust-center reference list prb compliance-portal reference list
# List references sorted by rank # List references sorted by rank
prb trust-center ref ls --order-by RANK`, prb compliance-portal ref ls --order-by RANK`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil { if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
@@ -137,13 +137,13 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
listQuery, listQuery,
variables, variables,
flagLimit, flagLimit,
func(data json.RawMessage) (*api.Connection[trustCenterReference], error) { func(data json.RawMessage) (*api.Connection[compliancePortalReference], error) {
var resp struct { var resp struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
TrustCenter *struct { CompliancePortal *struct {
References api.Connection[trustCenterReference] `json:"references"` References api.Connection[compliancePortalReference] `json:"references"`
} `json:"trustCenter"` } `json:"compliancePortal"`
} `json:"node"` } `json:"node"`
} }
if err := json.Unmarshal(data, &resp); err != nil { if err := json.Unmarshal(data, &resp); err != nil {
@@ -158,11 +158,11 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename) return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
} }
if resp.Node.TrustCenter == nil { if resp.Node.CompliancePortal == nil {
return nil, fmt.Errorf("trust center not found for organization %s", flagOrg) return nil, fmt.Errorf("compliance portal not found for organization %s", flagOrg)
} }
return &resp.Node.TrustCenter.References, nil return &resp.Node.CompliancePortal.References, nil
}, },
) )
if err != nil { if err != nil {

View File

@@ -23,15 +23,15 @@ package reference
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/trust-center/reference/create" "go.probo.inc/probo/pkg/cmd/compliance-portal/reference/create"
"go.probo.inc/probo/pkg/cmd/trust-center/reference/delete" "go.probo.inc/probo/pkg/cmd/compliance-portal/reference/delete"
"go.probo.inc/probo/pkg/cmd/trust-center/reference/list" "go.probo.inc/probo/pkg/cmd/compliance-portal/reference/list"
) )
func NewCmdReference(f *cmdutil.Factory) *cobra.Command { func NewCmdReference(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "reference <command>", Use: "reference <command>",
Short: "Manage trust center references", Short: "Manage compliance portal references",
Aliases: []string{"ref"}, Aliases: []string{"ref"},
} }

View File

@@ -29,12 +29,12 @@ import (
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
) )
const trustCenterQuery = ` const compliancePortalQuery = `
query($id: ID!) { query($id: ID!) {
node(id: $id) { node(id: $id) {
__typename __typename
... on Organization { ... on Organization {
trustCenter { compliancePortal {
id id
} }
} }
@@ -43,9 +43,9 @@ query($id: ID!) {
` `
const updateMutation = ` const updateMutation = `
mutation($input: UpdateTrustCenterInput!) { mutation($input: UpdateCompliancePortalInput!) {
updateTrustCenter(input: $input) { updateCompliancePortal(input: $input) {
trustCenter { compliancePortal {
id id
active active
searchEngineIndexing searchEngineIndexing
@@ -59,18 +59,18 @@ mutation($input: UpdateTrustCenterInput!) {
} }
` `
type trustCenterQueryResponse struct { type compliancePortalQueryResponse struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
TrustCenter *struct { CompliancePortal *struct {
ID string `json:"id"` ID string `json:"id"`
} `json:"trustCenter"` } `json:"compliancePortal"`
} `json:"node"` } `json:"node"`
} }
type updateResponse struct { type updateResponse struct {
UpdateTrustCenter struct { UpdateCompliancePortal struct {
TrustCenter struct { CompliancePortal struct {
ID string `json:"id"` ID string `json:"id"`
Active bool `json:"active"` Active bool `json:"active"`
SearchEngineIndexing string `json:"searchEngineIndexing"` SearchEngineIndexing string `json:"searchEngineIndexing"`
@@ -79,8 +79,8 @@ type updateResponse struct {
WebsiteURL *string `json:"websiteUrl"` WebsiteURL *string `json:"websiteUrl"`
Email *string `json:"email"` Email *string `json:"email"`
HeadquarterAddress *string `json:"headquarterAddress"` HeadquarterAddress *string `json:"headquarterAddress"`
} `json:"trustCenter"` } `json:"compliancePortal"`
} `json:"updateTrustCenter"` } `json:"updateCompliancePortal"`
} }
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command { func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
@@ -97,12 +97,12 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "update", Use: "update",
Short: "Update trust center settings", Short: "Update compliance portal settings",
Example: ` # Enable the trust center Example: ` # Enable the compliance portal
prb trust-center update --active prb compliance-portal update --active
# Disable search engine indexing # Disable search engine indexing
prb trust-center update --search-engine-indexing NOT_INDEXABLE`, prb compliance-portal update --search-engine-indexing NOT_INDEXABLE`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := f.Config() cfg, err := f.Config()
@@ -131,16 +131,16 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("organization is required; pass --org or set a default with 'prb auth login'") return fmt.Errorf("organization is required; pass --org or set a default with 'prb auth login'")
} }
// Fetch trust center ID from organization. // Fetch compliance portal ID from organization.
data, err := client.Do( data, err := client.Do(
trustCenterQuery, compliancePortalQuery,
map[string]any{"id": flagOrg}, map[string]any{"id": flagOrg},
) )
if err != nil { if err != nil {
return err return err
} }
var tcResp trustCenterQueryResponse var tcResp compliancePortalQueryResponse
if err := json.Unmarshal(data, &tcResp); err != nil { if err := json.Unmarshal(data, &tcResp); err != nil {
return fmt.Errorf("cannot parse response: %w", err) return fmt.Errorf("cannot parse response: %w", err)
} }
@@ -153,12 +153,12 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("expected Organization node, got %s", tcResp.Node.Typename) return fmt.Errorf("expected Organization node, got %s", tcResp.Node.Typename)
} }
if tcResp.Node.TrustCenter == nil { if tcResp.Node.CompliancePortal == nil {
return fmt.Errorf("trust center not found for organization %s", flagOrg) return fmt.Errorf("compliance portal not found for organization %s", flagOrg)
} }
input := map[string]any{ input := map[string]any{
"trustCenterId": tcResp.Node.TrustCenter.ID, "compliancePortalId": tcResp.Node.CompliancePortal.ID,
} }
if cmd.Flags().Changed("active") { if cmd.Flags().Changed("active") {
@@ -214,10 +214,10 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("cannot parse response: %w", err) return fmt.Errorf("cannot parse response: %w", err)
} }
tc := resp.UpdateTrustCenter.TrustCenter tc := resp.UpdateCompliancePortal.CompliancePortal
_, _ = fmt.Fprintf( _, _ = fmt.Fprintf(
f.IOStreams.Out, f.IOStreams.Out,
"Updated trust center %s\n", "Updated compliance portal %s\n",
tc.ID, tc.ID,
) )
@@ -226,7 +226,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
} }
cmd.Flags().StringVar(&flagOrg, "org", "", "Organization ID") cmd.Flags().StringVar(&flagOrg, "org", "", "Organization ID")
cmd.Flags().BoolVar(&flagActive, "active", false, "Enable or disable the trust center") cmd.Flags().BoolVar(&flagActive, "active", false, "Enable or disable the compliance portal")
cmd.Flags().StringVar(&flagSearchEngineIndexing, "search-engine-indexing", "", "Search engine indexing: INDEXABLE, NOT_INDEXABLE") cmd.Flags().StringVar(&flagSearchEngineIndexing, "search-engine-indexing", "", "Search engine indexing: INDEXABLE, NOT_INDEXABLE")
cmd.Flags().StringVar(&flagDescription, "description", "", "Compliance page description") cmd.Flags().StringVar(&flagDescription, "description", "", "Compliance page description")
cmd.Flags().StringVar(&flagWebsiteURL, "website-url", "", "Compliance page website URL") cmd.Flags().StringVar(&flagWebsiteURL, "website-url", "", "Compliance page website URL")

View File

@@ -35,7 +35,7 @@ query($id: ID!) {
node(id: $id) { node(id: $id) {
__typename __typename
... on Organization { ... on Organization {
trustCenter { compliancePortal {
id id
active active
searchEngineIndexing searchEngineIndexing
@@ -53,8 +53,8 @@ query($id: ID!) {
type viewResponse struct { type viewResponse struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
TrustCenter *struct { CompliancePortal *struct {
ID string `json:"id"` ID string `json:"id"`
Active bool `json:"active"` Active bool `json:"active"`
SearchEngineIndexing string `json:"searchEngineIndexing"` SearchEngineIndexing string `json:"searchEngineIndexing"`
@@ -64,7 +64,7 @@ type viewResponse struct {
NdaFileUrl *string `json:"ndaFileUrl"` NdaFileUrl *string `json:"ndaFileUrl"`
CreatedAt string `json:"createdAt"` CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"` UpdatedAt string `json:"updatedAt"`
} `json:"trustCenter"` } `json:"compliancePortal"`
} `json:"node"` } `json:"node"`
} }
@@ -76,7 +76,7 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "view", Use: "view",
Short: "View trust center settings", Short: "View compliance portal settings",
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil { if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
@@ -130,11 +130,11 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
return fmt.Errorf("expected Organization node, got %s", resp.Node.Typename) return fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
} }
if resp.Node.TrustCenter == nil { if resp.Node.CompliancePortal == nil {
return fmt.Errorf("trust center not found for organization %s", flagOrg) return fmt.Errorf("compliance portal not found for organization %s", flagOrg)
} }
tc := resp.Node.TrustCenter tc := resp.Node.CompliancePortal
if *flagOutput == cmdutil.OutputJSON { if *flagOutput == cmdutil.OutputJSON {
return cmdutil.PrintJSON(f.IOStreams.Out, tc) return cmdutil.PrintJSON(f.IOStreams.Out, tc)
@@ -145,7 +145,7 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
bold := lipgloss.NewStyle().Bold(true) bold := lipgloss.NewStyle().Bold(true)
label := lipgloss.NewStyle().Foreground(lipgloss.Color("242")).Width(28) label := lipgloss.NewStyle().Foreground(lipgloss.Color("242")).Width(28)
_, _ = fmt.Fprintf(out, "%s\n\n", bold.Render("Trust Center")) _, _ = fmt.Fprintf(out, "%s\n\n", bold.Render("Compliance Portal"))
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("ID:"), tc.ID) _, _ = fmt.Fprintf(out, "%s%s\n", label.Render("ID:"), tc.ID)
_, _ = fmt.Fprintf(out, "%s%v\n", label.Render("Active:"), tc.Active) _, _ = fmt.Fprintf(out, "%s%v\n", label.Render("Active:"), tc.Active)

View File

@@ -68,12 +68,12 @@ type createResponse struct {
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command { func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
var ( var (
flagOrg string flagOrg string
flagTitle string flagTitle string
flagContent string flagContent string
flagDocumentType string flagDocumentType string
flagClassification string flagClassification string
flagTrustCenterVisibility string flagCompliancePortalVisibility string
) )
cmd := &cobra.Command{ cmd := &cobra.Command{
@@ -199,16 +199,16 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
input["content"] = flagContent input["content"] = flagContent
} }
if flagTrustCenterVisibility != "" { if flagCompliancePortalVisibility != "" {
if err := cmdutil.ValidateEnum( if err := cmdutil.ValidateEnum(
"trust-center-visibility", "compliance-portal-visibility",
flagTrustCenterVisibility, flagCompliancePortalVisibility,
[]string{"NONE", "PRIVATE", "PUBLIC"}, []string{"NONE", "PRIVATE", "PUBLIC"},
); err != nil { ); err != nil {
return err return err
} }
input["trustCenterVisibility"] = flagTrustCenterVisibility input["compliancePortalVisibility"] = flagCompliancePortalVisibility
} }
data, err := client.Do( 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(&flagContent, "content", "", "Document content")
cmd.Flags().StringVar(&flagDocumentType, "document-type", "", "Document type: OTHER, GOVERNANCE, POLICY, PROCEDURE, PLAN, REGISTER, RECORD, REPORT, TEMPLATE") 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(&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 return cmd
} }

View File

@@ -40,7 +40,7 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: DocumentOrder, $filter
node { node {
id id
status status
trustCenterVisibility compliancePortalVisibility
versions(first: 1) { versions(first: 1) {
edges { edges {
node { node {
@@ -63,10 +63,10 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: DocumentOrder, $filter
` `
type document struct { type document struct {
ID string `json:"id"` ID string `json:"id"`
Status string `json:"status"` Status string `json:"status"`
TrustCenterVisibility string `json:"trustCenterVisibility"` CompliancePortalVisibility string `json:"compliancePortalVisibility"`
Versions struct { Versions struct {
Edges []struct { Edges []struct {
Node struct { Node struct {
Title string `json:"title"` Title string `json:"title"`

View File

@@ -34,7 +34,7 @@ mutation($input: UpdateDocumentInput!) {
updateDocument(input: $input) { updateDocument(input: $input) {
document { document {
id id
trustCenterVisibility compliancePortalVisibility
} }
documentVersion { documentVersion {
id id
@@ -52,8 +52,8 @@ mutation($input: UpdateDocumentInput!) {
type updateResponse struct { type updateResponse struct {
UpdateDocument struct { UpdateDocument struct {
Document struct { Document struct {
ID string `json:"id"` ID string `json:"id"`
TrustCenterVisibility string `json:"trustCenterVisibility"` CompliancePortalVisibility string `json:"compliancePortalVisibility"`
} `json:"document"` } `json:"document"`
DocumentVersion *struct { DocumentVersion *struct {
ID string `json:"id"` ID string `json:"id"`
@@ -69,11 +69,11 @@ type updateResponse struct {
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command { func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
var ( var (
flagTitle string flagTitle string
flagContent string flagContent string
flagDocumentType string flagDocumentType string
flagClassification string flagClassification string
flagTrustCenterVisibility string flagCompliancePortalVisibility string
) )
cmd := &cobra.Command{ cmd := &cobra.Command{
@@ -134,16 +134,16 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
input["classification"] = flagClassification input["classification"] = flagClassification
} }
if cmd.Flags().Changed("trust-center-visibility") { if cmd.Flags().Changed("compliance-portal-visibility") {
if err := cmdutil.ValidateEnum( if err := cmdutil.ValidateEnum(
"trust-center-visibility", "compliance-portal-visibility",
flagTrustCenterVisibility, flagCompliancePortalVisibility,
[]string{"NONE", "PRIVATE", "PUBLIC"}, []string{"NONE", "PRIVATE", "PUBLIC"},
); err != nil { ); err != nil {
return err return err
} }
input["trustCenterVisibility"] = flagTrustCenterVisibility input["compliancePortalVisibility"] = flagCompliancePortalVisibility
} }
if len(input) == 1 { 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(&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(&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(&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 return cmd
} }

View File

@@ -37,7 +37,7 @@ query($id: ID!) {
... on Document { ... on Document {
id id
status status
trustCenterVisibility compliancePortalVisibility
currentPublishedMajor currentPublishedMajor
currentPublishedMinor currentPublishedMinor
versions(first: 1) { versions(first: 1) {
@@ -61,13 +61,13 @@ query($id: ID!) {
type viewResponse struct { type viewResponse struct {
Node *struct { Node *struct {
Typename string `json:"__typename"` Typename string `json:"__typename"`
ID string `json:"id"` ID string `json:"id"`
Status string `json:"status"` Status string `json:"status"`
TrustCenterVisibility string `json:"trustCenterVisibility"` CompliancePortalVisibility string `json:"compliancePortalVisibility"`
CurrentPublishedMajor *int `json:"currentPublishedMajor"` CurrentPublishedMajor *int `json:"currentPublishedMajor"`
CurrentPublishedMinor *int `json:"currentPublishedMinor"` CurrentPublishedMinor *int `json:"currentPublishedMinor"`
Versions struct { Versions struct {
Edges []struct { Edges []struct {
Node struct { Node struct {
Title string `json:"title"` 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("ID:"), doc.ID)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Status:"), doc.Status) _, _ = 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 { if len(doc.Versions.Edges) > 0 {
v := doc.Versions.Edges[0].Node v := doc.Versions.Edges[0].Node

View File

@@ -31,6 +31,7 @@ import (
"go.probo.inc/probo/pkg/cmd/browse" "go.probo.inc/probo/pkg/cmd/browse"
"go.probo.inc/probo/pkg/cmd/cmdutil" "go.probo.inc/probo/pkg/cmd/cmdutil"
"go.probo.inc/probo/pkg/cmd/completion" "go.probo.inc/probo/pkg/cmd/completion"
complianceportal "go.probo.inc/probo/pkg/cmd/compliance-portal"
cmdconfig "go.probo.inc/probo/pkg/cmd/config" cmdconfig "go.probo.inc/probo/pkg/cmd/config"
consentrecord "go.probo.inc/probo/pkg/cmd/consent-record" consentrecord "go.probo.inc/probo/pkg/cmd/consent-record"
cmdcontext "go.probo.inc/probo/pkg/cmd/context" cmdcontext "go.probo.inc/probo/pkg/cmd/context"
@@ -58,7 +59,6 @@ import (
"go.probo.inc/probo/pkg/cmd/tia" "go.probo.inc/probo/pkg/cmd/tia"
trackerpattern "go.probo.inc/probo/pkg/cmd/tracker-pattern" trackerpattern "go.probo.inc/probo/pkg/cmd/tracker-pattern"
trackerresource "go.probo.inc/probo/pkg/cmd/tracker-resource" trackerresource "go.probo.inc/probo/pkg/cmd/tracker-resource"
trustcenter "go.probo.inc/probo/pkg/cmd/trust-center"
"go.probo.inc/probo/pkg/cmd/user" "go.probo.inc/probo/pkg/cmd/user"
"go.probo.inc/probo/pkg/cmd/version" "go.probo.inc/probo/pkg/cmd/version"
"go.probo.inc/probo/pkg/cmd/webhook" "go.probo.inc/probo/pkg/cmd/webhook"
@@ -130,7 +130,7 @@ func NewCmdRoot(f *cmdutil.Factory) *cobra.Command {
cmd.AddCommand(soa.NewCmdSoa(f)) cmd.AddCommand(soa.NewCmdSoa(f))
cmd.AddCommand(task.NewCmdTask(f)) cmd.AddCommand(task.NewCmdTask(f))
cmd.AddCommand(tia.NewCmdTIA(f)) cmd.AddCommand(tia.NewCmdTIA(f))
cmd.AddCommand(trustcenter.NewCmdTrustCenter(f)) cmd.AddCommand(complianceportal.NewCmdCompliancePortal(f))
cmd.AddCommand(user.NewCmdUser(f)) cmd.AddCommand(user.NewCmdUser(f))
cmd.AddCommand(thirdpartymgmt.NewCmdThirdParty(f)) cmd.AddCommand(thirdpartymgmt.NewCmdThirdParty(f))
cmd.AddCommand(version.NewCmdVersion(f)) cmd.AddCommand(version.NewCmdVersion(f))