Rename vendors to third parties
Renames the user-facing 'vendor' concept to 'third party' across the entire codebase. The shared common_third_parties reference table is unchanged. Migration. Renames the vendor_category enum, the vendors and vendor_<entity> tables (contacts, services, compliance_reports, business_associate_agreements, data_privacy_agreements, risk_assessments) and their vendor_id columns, the asset_vendors / data_vendors / processing_activity_vendors junction tables, generated_documents.vendors_document_id, the webhook_event_type 'vendor:<verb>' values, and the snapshots_type 'VENDORS' value. Backend. Renames coredata models and SQL queries, probo services, GraphQL / MCP API surface, console / trust / webhook resolvers and types, the CLI (prb vendor* -> prb third-party*; pkg/cmd/vendormgmt -> pkg/cmd/thirdpartymgmt), the document generator, vetting agent prompts, and the common-third-parties-import command. Frontend, packages, n8n, e2e. Renames apps/console pages, components, hooks, routes, dialogs, and tabs; the shared @probo/vendors package (now @probo/third-parties); the @probo/ui Vendors atoms (now ThirdParties, VendorLogo -> ThirdPartyLogo); the n8n community node actions/vendor folder (now actions/thirdParty); and the e2e Go test suite (console and MCP). Filesystem and URL paths use kebab-case (third-parties), GraphQL fields and TypeScript identifiers use camelCase (thirdParty / thirdParties), Go types use PascalCase (ThirdParty), and human-facing text uses 'third party' with a space. Co-authored-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -60,7 +60,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
flagAmount int
|
||||
flagOwner string
|
||||
flagDataTypesStored string
|
||||
flagVendorIDs []string
|
||||
flagThirdPartyIDs []string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -146,8 +146,8 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
if flagDataTypesStored != "" {
|
||||
input["dataTypesStored"] = flagDataTypesStored
|
||||
}
|
||||
if len(flagVendorIDs) > 0 {
|
||||
input["vendorIds"] = flagVendorIDs
|
||||
if len(flagThirdPartyIDs) > 0 {
|
||||
input["thirdPartyIds"] = flagThirdPartyIDs
|
||||
}
|
||||
|
||||
data, err := client.Do(
|
||||
@@ -181,7 +181,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().IntVar(&flagAmount, "amount", 0, "Asset amount")
|
||||
cmd.Flags().StringVar(&flagOwner, "owner", "", "Owner profile ID")
|
||||
cmd.Flags().StringVar(&flagDataTypesStored, "data-types-stored", "", "Data types stored")
|
||||
cmd.Flags().StringSliceVar(&flagVendorIDs, "vendor-ids", nil, "Vendor IDs (comma-separated)")
|
||||
cmd.Flags().StringSliceVar(&flagThirdPartyIDs, "thirdParty-ids", nil, "ThirdParty IDs (comma-separated)")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
flagAmount int
|
||||
flagOwner string
|
||||
flagDataTypesStored string
|
||||
flagVendorIDs []string
|
||||
flagThirdPartyIDs []string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -103,8 +103,8 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
if cmd.Flags().Changed("data-types-stored") {
|
||||
input["dataTypesStored"] = flagDataTypesStored
|
||||
}
|
||||
if cmd.Flags().Changed("vendor-ids") {
|
||||
input["vendorIds"] = flagVendorIDs
|
||||
if cmd.Flags().Changed("thirdParty-ids") {
|
||||
input["thirdPartyIds"] = flagThirdPartyIDs
|
||||
}
|
||||
|
||||
if len(input) == 1 {
|
||||
@@ -141,7 +141,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().IntVar(&flagAmount, "amount", 0, "Asset amount")
|
||||
cmd.Flags().StringVar(&flagOwner, "owner", "", "Owner profile ID")
|
||||
cmd.Flags().StringVar(&flagDataTypesStored, "data-types-stored", "", "Data types stored")
|
||||
cmd.Flags().StringSliceVar(&flagVendorIDs, "vendor-ids", nil, "Vendor IDs (comma-separated)")
|
||||
cmd.Flags().StringSliceVar(&flagThirdPartyIDs, "thirdParty-ids", nil, "ThirdParty IDs (comma-separated)")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
Short: "List audit log entries",
|
||||
Aliases: []string{"ls"},
|
||||
Example: ` prb audit-log list
|
||||
prb audit-log list --action core:vendor:create
|
||||
prb audit-log list --resource-type Vendor --limit 50`,
|
||||
prb audit-log list --action core:thirdParty:create
|
||||
prb audit-log list --resource-type ThirdParty --limit 50`,
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
|
||||
@@ -218,9 +218,9 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().IntVarP(&flagLimit, "limit", "L", 30, "Maximum number of entries to list")
|
||||
cmd.Flags().StringVar(&flagOrderBy, "order-by", "", "Order by field (CREATED_AT)")
|
||||
cmd.Flags().StringVar(&flagOrderDir, "order-direction", "DESC", "Sort direction (ASC, DESC)")
|
||||
cmd.Flags().StringVar(&flagAction, "action", "", "Filter by action (e.g. core:vendor:create)")
|
||||
cmd.Flags().StringVar(&flagAction, "action", "", "Filter by action (e.g. core:thirdParty:create)")
|
||||
cmd.Flags().StringVar(&flagActorID, "actor-id", "", "Filter by actor ID")
|
||||
cmd.Flags().StringVar(&flagResourceType, "resource-type", "", "Filter by resource type (e.g. Vendor)")
|
||||
cmd.Flags().StringVar(&flagResourceType, "resource-type", "", "Filter by resource type (e.g. ThirdParty)")
|
||||
cmd.Flags().StringVar(&flagResourceID, "resource-id", "", "Filter by resource ID")
|
||||
flagOutput = cmdutil.AddOutputFlag(cmd)
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
flagName string
|
||||
flagClassification string
|
||||
flagOwner string
|
||||
flagVendorIDs []string
|
||||
flagThirdPartyIDs []string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -138,8 +138,8 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
if flagOwner != "" {
|
||||
input["ownerId"] = flagOwner
|
||||
}
|
||||
if len(flagVendorIDs) > 0 {
|
||||
input["vendorIds"] = flagVendorIDs
|
||||
if len(flagThirdPartyIDs) > 0 {
|
||||
input["thirdPartyIds"] = flagThirdPartyIDs
|
||||
}
|
||||
|
||||
data, err := client.Do(
|
||||
@@ -171,7 +171,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "Datum name (required)")
|
||||
cmd.Flags().StringVar(&flagClassification, "data-classification", "", "Data classification: PUBLIC, INTERNAL, CONFIDENTIAL, SECRET (required)")
|
||||
cmd.Flags().StringVar(&flagOwner, "owner", "", "Owner profile ID")
|
||||
cmd.Flags().StringSliceVar(&flagVendorIDs, "vendor-ids", nil, "Vendor IDs (comma-separated)")
|
||||
cmd.Flags().StringSliceVar(&flagThirdPartyIDs, "thirdParty-ids", nil, "ThirdParty IDs (comma-separated)")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
flagName string
|
||||
flagClassification string
|
||||
flagOwner string
|
||||
flagVendorIDs []string
|
||||
flagThirdPartyIDs []string
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@@ -93,8 +93,8 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
input["ownerId"] = flagOwner
|
||||
}
|
||||
}
|
||||
if cmd.Flags().Changed("vendor-ids") {
|
||||
input["vendorIds"] = flagVendorIDs
|
||||
if cmd.Flags().Changed("thirdParty-ids") {
|
||||
input["thirdPartyIds"] = flagThirdPartyIDs
|
||||
}
|
||||
|
||||
if len(input) == 1 {
|
||||
@@ -129,7 +129,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "Datum name")
|
||||
cmd.Flags().StringVar(&flagClassification, "data-classification", "", "Data classification: PUBLIC, INTERNAL, CONFIDENTIAL, SECRET")
|
||||
cmd.Flags().StringVar(&flagOwner, "owner", "", "Owner profile ID")
|
||||
cmd.Flags().StringSliceVar(&flagVendorIDs, "vendor-ids", nil, "Vendor IDs (comma-separated)")
|
||||
cmd.Flags().StringSliceVar(&flagThirdPartyIDs, "thirdParty-ids", nil, "ThirdParty IDs (comma-separated)")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ import (
|
||||
"go.probo.inc/probo/pkg/cmd/scim"
|
||||
"go.probo.inc/probo/pkg/cmd/soa"
|
||||
"go.probo.inc/probo/pkg/cmd/task"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt"
|
||||
"go.probo.inc/probo/pkg/cmd/tia"
|
||||
trackerpattern "go.probo.inc/probo/pkg/cmd/tracker-pattern"
|
||||
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/vendormgmt"
|
||||
"go.probo.inc/probo/pkg/cmd/version"
|
||||
"go.probo.inc/probo/pkg/cmd/webhook"
|
||||
)
|
||||
@@ -120,7 +120,7 @@ func NewCmdRoot(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd.AddCommand(tia.NewCmdTIA(f))
|
||||
cmd.AddCommand(trustcenter.NewCmdTrustCenter(f))
|
||||
cmd.AddCommand(user.NewCmdUser(f))
|
||||
cmd.AddCommand(vendormgmt.NewCmdVendor(f))
|
||||
cmd.AddCommand(thirdpartymgmt.NewCmdThirdParty(f))
|
||||
cmd.AddCommand(version.NewCmdVersion(f))
|
||||
cmd.AddCommand(webhook.NewCmdWebhook(f))
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ import (
|
||||
)
|
||||
|
||||
const assessMutation = `
|
||||
mutation($input: AssessVendorInput!) {
|
||||
assessVendor(input: $input) {
|
||||
mutation($input: AssessThirdPartyInput!) {
|
||||
assessThirdParty(input: $input) {
|
||||
report
|
||||
subprocessors {
|
||||
name
|
||||
country
|
||||
purpose
|
||||
}
|
||||
vendor {
|
||||
third_party {
|
||||
id
|
||||
name
|
||||
}
|
||||
@@ -43,18 +43,18 @@ mutation($input: AssessVendorInput!) {
|
||||
`
|
||||
|
||||
type assessResponse struct {
|
||||
AssessVendor struct {
|
||||
AssessThirdParty struct {
|
||||
Report string `json:"report"`
|
||||
Subprocessors []struct {
|
||||
Name string `json:"name"`
|
||||
Country string `json:"country"`
|
||||
Purpose string `json:"purpose"`
|
||||
} `json:"subprocessors"`
|
||||
Vendor struct {
|
||||
ThirdParty struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
} `json:"vendor"`
|
||||
} `json:"assessVendor"`
|
||||
} `json:"third_party"`
|
||||
} `json:"assessThirdParty"`
|
||||
}
|
||||
|
||||
func NewCmdAssess(f *cmdutil.Factory) *cobra.Command {
|
||||
@@ -63,17 +63,17 @@ func NewCmdAssess(f *cmdutil.Factory) *cobra.Command {
|
||||
)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "assess <vendor-id> --url <website-url>",
|
||||
Short: "Run AI assessment on a vendor from its website",
|
||||
Long: "Analyze a vendor's website using AI agents to extract security, compliance, and business information.",
|
||||
Example: ` # Assess a vendor by website URL
|
||||
prb vendor assess VND_123 --url https://example.com
|
||||
Use: "assess <thirdParty-id> --url <website-url>",
|
||||
Short: "Run AI assessment on a thirdParty from its website",
|
||||
Long: "Analyze a thirdParty's website using AI agents to extract security, compliance, and business information.",
|
||||
Example: ` # Assess a third_party by website URL
|
||||
prb third_party assess VND_123 --url https://example.com
|
||||
|
||||
# Assess with a custom procedure file
|
||||
prb vendor assess VND_123 --url https://example.com --procedure-file ./my-procedure.txt
|
||||
prb third_party assess VND_123 --url https://example.com --procedure-file ./my-procedure.txt
|
||||
|
||||
# Output as JSON
|
||||
prb vendor assess VND_123 --url https://example.com -o json`,
|
||||
prb third_party assess VND_123 --url https://example.com -o json`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
|
||||
@@ -115,7 +115,7 @@ func NewCmdAssess(f *cmdutil.Factory) *cobra.Command {
|
||||
22*time.Minute,
|
||||
)
|
||||
|
||||
_, _ = fmt.Fprintf(f.IOStreams.ErrOut, "Assessing vendor from %s (this may take a few minutes)...\n", flagURL)
|
||||
_, _ = fmt.Fprintf(f.IOStreams.ErrOut, "Assessing thirdParty from %s (this may take a few minutes)...\n", flagURL)
|
||||
|
||||
data, err := client.Do(
|
||||
assessMutation,
|
||||
@@ -133,16 +133,16 @@ func NewCmdAssess(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
if *flagOutput == cmdutil.OutputJSON {
|
||||
return cmdutil.PrintJSON(f.IOStreams.Out, resp.AssessVendor)
|
||||
return cmdutil.PrintJSON(f.IOStreams.Out, resp.AssessThirdParty)
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, resp.AssessVendor.Report)
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, resp.AssessThirdParty.Report)
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().String("url", "", "Vendor website URL to assess (required)")
|
||||
cmd.Flags().String("url", "", "ThirdParty website URL to assess (required)")
|
||||
_ = cmd.MarkFlagRequired("url")
|
||||
cmd.Flags().String("procedure-file", "", "Path to a custom assessment procedure file")
|
||||
flagOutput = cmdutil.AddOutputFlag(cmd)
|
||||
@@ -25,9 +25,9 @@ import (
|
||||
)
|
||||
|
||||
const createMutation = `
|
||||
mutation($input: CreateVendorInput!) {
|
||||
createVendor(input: $input) {
|
||||
vendorEdge {
|
||||
mutation($input: CreateThirdPartyInput!) {
|
||||
createThirdParty(input: $input) {
|
||||
thirdPartyEdge {
|
||||
node {
|
||||
id
|
||||
name
|
||||
@@ -39,15 +39,15 @@ mutation($input: CreateVendorInput!) {
|
||||
`
|
||||
|
||||
type createResponse struct {
|
||||
CreateVendor struct {
|
||||
VendorEdge struct {
|
||||
CreateThirdParty struct {
|
||||
ThirdPartyEdge struct {
|
||||
Node struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Category string `json:"category"`
|
||||
} `json:"node"`
|
||||
} `json:"vendorEdge"`
|
||||
} `json:"createVendor"`
|
||||
} `json:"thirdPartyEdge"`
|
||||
} `json:"createThirdParty"`
|
||||
}
|
||||
|
||||
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
@@ -63,12 +63,12 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "create",
|
||||
Short: "Create a new vendor",
|
||||
Example: ` # Create a vendor interactively
|
||||
prb vendor create
|
||||
Short: "Create a new thirdParty",
|
||||
Example: ` # Create a third_party interactively
|
||||
prb third_party create
|
||||
|
||||
# Create a vendor non-interactively
|
||||
prb vendor create --name "Acme Corp" --category CLOUD_PROVIDER`,
|
||||
# Create a third_party non-interactively
|
||||
prb third_party create --name "Acme Corp" --category CLOUD_PROVIDER`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cfg, err := f.Config()
|
||||
if err != nil {
|
||||
@@ -99,7 +99,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
if f.IOStreams.IsInteractive() {
|
||||
if flagName == "" {
|
||||
err := huh.NewInput().
|
||||
Title("Vendor name").
|
||||
Title("ThirdParty name").
|
||||
Value(&flagName).
|
||||
Run()
|
||||
if err != nil {
|
||||
@@ -109,7 +109,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
if flagCategory == "" {
|
||||
err := huh.NewSelect[string]().
|
||||
Title("Vendor category").
|
||||
Title("ThirdParty category").
|
||||
Options(
|
||||
huh.NewOption("Analytics", "ANALYTICS"),
|
||||
huh.NewOption("Cloud Monitoring", "CLOUD_MONITORING"),
|
||||
@@ -181,10 +181,10 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
return fmt.Errorf("cannot parse response: %w", err)
|
||||
}
|
||||
|
||||
v := resp.CreateVendor.VendorEdge.Node
|
||||
v := resp.CreateThirdParty.ThirdPartyEdge.Node
|
||||
_, _ = fmt.Fprintf(
|
||||
f.IOStreams.Out,
|
||||
"Created vendor %s (%s)\n",
|
||||
"Created thirdParty %s (%s)\n",
|
||||
v.ID,
|
||||
v.Name,
|
||||
)
|
||||
@@ -194,9 +194,9 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
cmd.Flags().StringVar(&flagOrg, "org", "", "Organization ID")
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "Vendor name (required)")
|
||||
cmd.Flags().StringVar(&flagCategory, "category", "", "Vendor category (required)")
|
||||
cmd.Flags().StringVar(&flagDescription, "description", "", "Vendor description")
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "ThirdParty name (required)")
|
||||
cmd.Flags().StringVar(&flagCategory, "category", "", "ThirdParty category (required)")
|
||||
cmd.Flags().StringVar(&flagDescription, "description", "", "ThirdParty description")
|
||||
cmd.Flags().StringVar(&flagLegalName, "legal-name", "", "Legal name")
|
||||
cmd.Flags().StringVar(&flagAddress, "address", "", "Headquarter address")
|
||||
cmd.Flags().StringVar(&flagWebsite, "website", "", "Website URL")
|
||||
@@ -24,9 +24,9 @@ import (
|
||||
)
|
||||
|
||||
const deleteMutation = `
|
||||
mutation($input: DeleteVendorInput!) {
|
||||
deleteVendor(input: $input) {
|
||||
deletedVendorId
|
||||
mutation($input: DeleteThirdPartyInput!) {
|
||||
deleteThirdParty(input: $input) {
|
||||
deletedThirdPartyId
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -36,17 +36,17 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete <id>",
|
||||
Short: "Delete a vendor",
|
||||
Short: "Delete a thirdParty",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if !flagYes {
|
||||
if !f.IOStreams.IsInteractive() {
|
||||
return fmt.Errorf("cannot delete vendor: confirmation required, use --yes to confirm")
|
||||
return fmt.Errorf("cannot delete thirdParty: confirmation required, use --yes to confirm")
|
||||
}
|
||||
|
||||
var confirmed bool
|
||||
err := huh.NewConfirm().
|
||||
Title(fmt.Sprintf("Delete vendor %s?", args[0])).
|
||||
Title(fmt.Sprintf("Delete thirdParty %s?", args[0])).
|
||||
Value(&confirmed).
|
||||
Run()
|
||||
if err != nil {
|
||||
@@ -79,7 +79,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
deleteMutation,
|
||||
map[string]any{
|
||||
"input": map[string]any{
|
||||
"vendorId": args[0],
|
||||
"thirdPartyId": args[0],
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -89,7 +89,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
_, _ = fmt.Fprintf(
|
||||
f.IOStreams.Out,
|
||||
"Deleted vendor %s\n",
|
||||
"Deleted thirdParty %s\n",
|
||||
args[0],
|
||||
)
|
||||
|
||||
@@ -24,11 +24,11 @@ import (
|
||||
)
|
||||
|
||||
const listQuery = `
|
||||
query($id: ID!, $first: Int, $after: CursorKey, $orderBy: VendorOrder) {
|
||||
query($id: ID!, $first: Int, $after: CursorKey, $orderBy: ThirdPartyOrder) {
|
||||
node(id: $id) {
|
||||
__typename
|
||||
... on Organization {
|
||||
vendors(first: $first, after: $after, orderBy: $orderBy) {
|
||||
third_parties(first: $first, after: $after, orderBy: $orderBy) {
|
||||
totalCount
|
||||
edges {
|
||||
node {
|
||||
@@ -47,7 +47,7 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: VendorOrder) {
|
||||
}
|
||||
`
|
||||
|
||||
type vendor struct {
|
||||
type thirdParty struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Category string `json:"category"`
|
||||
@@ -64,13 +64,13 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List vendors in an organization",
|
||||
Short: "List thirdParties in an organization",
|
||||
Aliases: []string{"ls"},
|
||||
Example: ` # List vendors in the default organization
|
||||
prb vendor list
|
||||
Example: ` # List third_parties in the default organization
|
||||
prb third_party list
|
||||
|
||||
# List vendors sorted by name
|
||||
prb vendor ls --order-by NAME --json`,
|
||||
# List third_parties sorted by name
|
||||
prb third_party ls --order-by NAME --json`,
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
|
||||
@@ -117,16 +117,16 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
}
|
||||
|
||||
vendors, totalCount, err := api.Paginate(
|
||||
thirdParties, totalCount, err := api.Paginate(
|
||||
client,
|
||||
listQuery,
|
||||
variables,
|
||||
flagLimit,
|
||||
func(data json.RawMessage) (*api.Connection[vendor], error) {
|
||||
func(data json.RawMessage) (*api.Connection[thirdParty], error) {
|
||||
var resp struct {
|
||||
Node *struct {
|
||||
Typename string `json:"__typename"`
|
||||
Vendors api.Connection[vendor] `json:"vendors"`
|
||||
Typename string `json:"__typename"`
|
||||
ThirdParties api.Connection[thirdParty] `json:"third_parties"`
|
||||
} `json:"node"`
|
||||
}
|
||||
if err := json.Unmarshal(data, &resp); err != nil {
|
||||
@@ -138,7 +138,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if resp.Node.Typename != "Organization" {
|
||||
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
|
||||
}
|
||||
return &resp.Node.Vendors, nil
|
||||
return &resp.Node.ThirdParties, nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -146,16 +146,16 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
if *flagOutput == cmdutil.OutputJSON {
|
||||
return cmdutil.PrintJSON(f.IOStreams.Out, vendors)
|
||||
return cmdutil.PrintJSON(f.IOStreams.Out, thirdParties)
|
||||
}
|
||||
|
||||
if len(vendors) == 0 {
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, "No vendors found.")
|
||||
if len(thirdParties) == 0 {
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, "No thirdParties found.")
|
||||
return nil
|
||||
}
|
||||
|
||||
rows := make([][]string, 0, len(vendors))
|
||||
for _, v := range vendors {
|
||||
rows := make([][]string, 0, len(thirdParties))
|
||||
for _, v := range thirdParties {
|
||||
rows = append(rows, []string{
|
||||
v.ID,
|
||||
v.Name,
|
||||
@@ -167,11 +167,11 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, t)
|
||||
|
||||
if totalCount > len(vendors) {
|
||||
if totalCount > len(thirdParties) {
|
||||
_, _ = fmt.Fprintf(
|
||||
f.IOStreams.ErrOut,
|
||||
"\nShowing %d of %d vendors\n",
|
||||
len(vendors),
|
||||
"\nShowing %d of %d thirdParties\n",
|
||||
len(thirdParties),
|
||||
totalCount,
|
||||
)
|
||||
}
|
||||
@@ -181,7 +181,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
cmd.Flags().StringVar(&flagOrg, "org", "", "Organization ID")
|
||||
cmd.Flags().IntVarP(&flagLimit, "limit", "L", 30, "Maximum number of vendors to list")
|
||||
cmd.Flags().IntVarP(&flagLimit, "limit", "L", 30, "Maximum number of thirdParties to list")
|
||||
cmd.Flags().StringVar(&flagOrderBy, "order-by", "", "Order by field (NAME, CREATED_AT, UPDATED_AT)")
|
||||
cmd.Flags().StringVar(&flagOrderDir, "order-direction", "DESC", "Sort direction (ASC, DESC)")
|
||||
flagOutput = cmdutil.AddOutputFlag(cmd)
|
||||
@@ -24,8 +24,8 @@ import (
|
||||
)
|
||||
|
||||
const publishMutation = `
|
||||
mutation($input: PublishVendorListInput!) {
|
||||
publishVendorList(input: $input) {
|
||||
mutation($input: PublishThirdPartyListInput!) {
|
||||
publishThirdPartyList(input: $input) {
|
||||
documentEdge {
|
||||
node {
|
||||
id
|
||||
@@ -47,7 +47,7 @@ mutation($input: PublishVendorListInput!) {
|
||||
`
|
||||
|
||||
type publishResponse struct {
|
||||
PublishVendorList struct {
|
||||
PublishThirdPartyList struct {
|
||||
DocumentEdge struct {
|
||||
Node struct {
|
||||
ID string `json:"id"`
|
||||
@@ -64,7 +64,7 @@ type publishResponse struct {
|
||||
Status string `json:"status"`
|
||||
} `json:"node"`
|
||||
} `json:"documentVersionEdge"`
|
||||
} `json:"publishVendorList"`
|
||||
} `json:"publishThirdPartyList"`
|
||||
}
|
||||
|
||||
func NewCmdPublish(f *cmdutil.Factory) *cobra.Command {
|
||||
@@ -76,12 +76,12 @@ func NewCmdPublish(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "publish",
|
||||
Short: "Publish the vendor register as a document version",
|
||||
Example: ` # Publish the vendor register
|
||||
prb vendor publish --org ORG_ID
|
||||
Short: "Publish the thirdParty register as a document version",
|
||||
Example: ` # Publish the third_party register
|
||||
prb third_party publish --org ORG_ID
|
||||
|
||||
# Publish with approvers
|
||||
prb vendor publish --org ORG_ID --approver PROFILE_ID1 --approver PROFILE_ID2`,
|
||||
prb third_party publish --org ORG_ID --approver PROFILE_ID1 --approver PROFILE_ID2`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cfg, err := f.Config()
|
||||
if err != nil {
|
||||
@@ -130,10 +130,10 @@ func NewCmdPublish(f *cmdutil.Factory) *cobra.Command {
|
||||
return fmt.Errorf("cannot parse response: %w", err)
|
||||
}
|
||||
|
||||
v := resp.PublishVendorList.DocumentVersionEdge.Node
|
||||
v := resp.PublishThirdPartyList.DocumentVersionEdge.Node
|
||||
_, _ = fmt.Fprintf(
|
||||
f.IOStreams.Out,
|
||||
"Published vendor register %s (v%d.%d)\n",
|
||||
"Published thirdParty register %s (v%d.%d)\n",
|
||||
v.Title,
|
||||
v.Major,
|
||||
v.Minor,
|
||||
@@ -12,24 +12,24 @@
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package vendormgmt
|
||||
package thirdpartymgmt
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"go.probo.inc/probo/pkg/cmd/cmdutil"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/assess"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/create"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/delete"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/list"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/publish"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/update"
|
||||
"go.probo.inc/probo/pkg/cmd/vendormgmt/view"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/assess"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/create"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/delete"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/list"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/publish"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/update"
|
||||
"go.probo.inc/probo/pkg/cmd/thirdpartymgmt/view"
|
||||
)
|
||||
|
||||
func NewCmdVendor(f *cmdutil.Factory) *cobra.Command {
|
||||
func NewCmdThirdParty(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "vendor <command>",
|
||||
Short: "Manage vendors",
|
||||
Use: "thirdParty <command>",
|
||||
Short: "Manage thirdParties",
|
||||
}
|
||||
|
||||
cmd.AddCommand(list.NewCmdList(f))
|
||||
@@ -24,9 +24,9 @@ import (
|
||||
)
|
||||
|
||||
const updateMutation = `
|
||||
mutation($input: UpdateVendorInput!) {
|
||||
updateVendor(input: $input) {
|
||||
vendor {
|
||||
mutation($input: UpdateThirdPartyInput!) {
|
||||
updateThirdParty(input: $input) {
|
||||
third_party {
|
||||
id
|
||||
name
|
||||
category
|
||||
@@ -36,13 +36,13 @@ mutation($input: UpdateVendorInput!) {
|
||||
`
|
||||
|
||||
type updateResponse struct {
|
||||
UpdateVendor struct {
|
||||
Vendor struct {
|
||||
UpdateThirdParty struct {
|
||||
ThirdParty struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Category string `json:"category"`
|
||||
} `json:"vendor"`
|
||||
} `json:"updateVendor"`
|
||||
} `json:"third_party"`
|
||||
} `json:"updateThirdParty"`
|
||||
}
|
||||
|
||||
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
@@ -57,7 +57,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "update <id>",
|
||||
Short: "Update a vendor",
|
||||
Short: "Update a thirdParty",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cfg, err := f.Config()
|
||||
@@ -118,10 +118,10 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
return fmt.Errorf("cannot parse response: %w", err)
|
||||
}
|
||||
|
||||
v := resp.UpdateVendor.Vendor
|
||||
v := resp.UpdateThirdParty.ThirdParty
|
||||
_, _ = fmt.Fprintf(
|
||||
f.IOStreams.Out,
|
||||
"Updated vendor %s (%s)\n",
|
||||
"Updated thirdParty %s (%s)\n",
|
||||
v.ID,
|
||||
v.Name,
|
||||
)
|
||||
@@ -130,9 +130,9 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "Vendor name")
|
||||
cmd.Flags().StringVar(&flagDescription, "description", "", "Vendor description")
|
||||
cmd.Flags().StringVar(&flagCategory, "category", "", "Vendor category")
|
||||
cmd.Flags().StringVar(&flagName, "name", "", "ThirdParty name")
|
||||
cmd.Flags().StringVar(&flagDescription, "description", "", "ThirdParty description")
|
||||
cmd.Flags().StringVar(&flagCategory, "category", "", "ThirdParty category")
|
||||
cmd.Flags().StringVar(&flagLegalName, "legal-name", "", "Legal name")
|
||||
cmd.Flags().StringVar(&flagAddress, "address", "", "Headquarter address")
|
||||
cmd.Flags().StringVar(&flagWebsite, "website", "", "Website URL")
|
||||
@@ -28,7 +28,7 @@ const viewQuery = `
|
||||
query($id: ID!) {
|
||||
node(id: $id) {
|
||||
__typename
|
||||
... on Vendor {
|
||||
... on ThirdParty {
|
||||
id
|
||||
name
|
||||
description
|
||||
@@ -63,7 +63,7 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "view <id>",
|
||||
Short: "View a vendor",
|
||||
Short: "View a thirdParty",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cmdutil.ValidateOutputFlag(flagOutput); err != nil {
|
||||
@@ -102,11 +102,11 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
if resp.Node == nil {
|
||||
return fmt.Errorf("vendor %s not found", args[0])
|
||||
return fmt.Errorf("thirdParty %s not found", args[0])
|
||||
}
|
||||
|
||||
if resp.Node.Typename != "Vendor" {
|
||||
return fmt.Errorf("expected Vendor node, got %s", resp.Node.Typename)
|
||||
if resp.Node.Typename != "ThirdParty" {
|
||||
return fmt.Errorf("expected ThirdParty node, got %s", resp.Node.Typename)
|
||||
}
|
||||
|
||||
if *flagOutput == cmdutil.OutputJSON {
|
||||
@@ -62,11 +62,11 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "create",
|
||||
Short: "Create a webhook subscription",
|
||||
Example: ` # Create a webhook for vendor events
|
||||
prb webhook create --url https://example.com/webhook --event VENDOR_CREATED --event VENDOR_UPDATED
|
||||
Example: ` # Create a webhook for thirdParty events
|
||||
prb webhook create --url https://example.com/webhook --event THIRD_PARTY_CREATED --event THIRD_PARTY_UPDATED
|
||||
|
||||
# Create a webhook for all supported events
|
||||
prb webhook create --url https://example.com/webhook --event VENDOR_CREATED --event VENDOR_UPDATED --event VENDOR_DELETED --event USER_CREATED --event USER_UPDATED --event USER_DELETED --event OBLIGATION_CREATED --event OBLIGATION_UPDATED --event OBLIGATION_DELETED`,
|
||||
prb webhook create --url https://example.com/webhook --event THIRD_PARTY_CREATED --event THIRD_PARTY_UPDATED --event THIRD_PARTY_DELETED --event USER_CREATED --event USER_UPDATED --event USER_DELETED --event OBLIGATION_CREATED --event OBLIGATION_UPDATED --event OBLIGATION_DELETED`,
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
for _, e := range flagEvents {
|
||||
|
||||
@@ -21,9 +21,9 @@ var ValidEvents = []string{
|
||||
"MEETING_CREATED",
|
||||
"MEETING_UPDATED",
|
||||
"MEETING_DELETED",
|
||||
"VENDOR_CREATED",
|
||||
"VENDOR_UPDATED",
|
||||
"VENDOR_DELETED",
|
||||
"THIRD_PARTY_CREATED",
|
||||
"THIRD_PARTY_UPDATED",
|
||||
"THIRD_PARTY_DELETED",
|
||||
"USER_CREATED",
|
||||
"USER_UPDATED",
|
||||
"USER_DELETED",
|
||||
|
||||
Reference in New Issue
Block a user