Skip to content

Commit f52d35d

Browse files
authored
chore(integration): expose integration registered output render functions (#2737)
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent c9d9f5f commit f52d35d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/cli/cmd/attached_integration_add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func newAttachedIntegrationAttachCmd() *cobra.Command {
4848
}
4949

5050
// Parse and validate options
51-
opts, err := parseAndValidateOpts(options, item.Attachment)
51+
opts, err := ParseAndValidateOpts(options, item.Attachment)
5252
if err != nil {
5353
// Show schema table if validation fails
5454
if err := RenderSchemaTable("Available options", item.Attachment.Properties); err != nil {

app/cli/cmd/registered_integration_add.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func newRegisteredIntegrationAddCmd() *cobra.Command {
4949
}
5050

5151
// Parse and validate options
52-
opts, err := parseAndValidateOpts(options, item.Registration)
52+
opts, err := ParseAndValidateOpts(options, item.Registration)
5353
if err != nil {
5454
// Show schema table if validation fails
5555
if err := RenderSchemaTable("Available options", item.Registration.Properties); err != nil {
@@ -79,9 +79,9 @@ func newRegisteredIntegrationAddCmd() *cobra.Command {
7979
return cmd
8080
}
8181

82-
func parseAndValidateOpts(opts []string, schema *action.JSONSchema) (map[string]any, error) {
82+
func ParseAndValidateOpts(opts []string, schema *action.JSONSchema) (map[string]any, error) {
8383
// Parse
84-
res, err := parseKeyValOpts(opts, schema.Properties)
84+
res, err := ParseKeyValOpts(opts, schema.Properties)
8585
if err != nil {
8686
return nil, fmt.Errorf("failed to parse options: %w", err)
8787
}
@@ -101,10 +101,10 @@ func parseAndValidateOpts(opts []string, schema *action.JSONSchema) (map[string]
101101
return res, nil
102102
}
103103

104-
// parseKeyValOpts performs two steps
104+
// ParseKeyValOpts performs two steps
105105
// 1 - Split the options into key/value pairs
106106
// 2 - Cast the values to the expected type defined in the schema
107-
func parseKeyValOpts(opts []string, propertiesMap sdk.SchemaPropertiesMap) (map[string]any, error) {
107+
func ParseKeyValOpts(opts []string, propertiesMap sdk.SchemaPropertiesMap) (map[string]any, error) {
108108
// 1 - Split the options into key/value pairs
109109
var options = make(map[string]any)
110110
for _, opt := range opts {

0 commit comments

Comments
 (0)