Skip to content

Commit

Permalink
fix: confluence_content column transforms (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisvalentiner authored Jan 3, 2022
1 parent 552e7ec commit b1e8342
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
28 changes: 2 additions & 26 deletions confluence/table_confluence_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/plugin"
"github.com/turbot/steampipe-plugin-sdk/plugin/transform"
)

//// TABLE DEFINITION
Expand Down Expand Up @@ -38,34 +37,11 @@ func tableConfluenceContent() *plugin.Table {
Name: "child_types",
Type: proto.ColumnType_JSON,
Description: "Shows whether a piece of content has attachments, comments, or child pages. Note, this doesn't actually contain the child objects.",
Transform: transform.FromField("Fields.childTypes"),
},
{
Name: "expandable",
Type: proto.ColumnType_JSON,
Description: "",
Transform: transform.FromField("Fields._expandable"),
},
{
Name: "extensions",
Type: proto.ColumnType_JSON,
Description: "",
},
{
Name: "metadata",
Type: proto.ColumnType_JSON,
Description: "Metadata object for page, blogpost, comment content",
},
{
Name: "links",
Type: proto.ColumnType_JSON,
Description: "",
Transform: transform.FromField("Fields._links"),
},
{
Name: "operations",
Type: proto.ColumnType_JSON,
Description: "An operation and the target entity that it applies to, e.g. create page",
},
{
Name: "space",
Expand Down Expand Up @@ -121,7 +97,7 @@ func listContent(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData
// maxResults := 50

options := &confluence.GetContentOptionsScheme{
Expand: []string{"childTypes.all", "body.storage"},
Expand: []string{"childTypes.all", "body.storage", "space", "version"},
}

pagesLeft := true
Expand Down Expand Up @@ -160,7 +136,7 @@ func getContent(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData)
id := quals["id"].GetStringValue()
logger.Warn("getContent", "id", id)

expand := []string{"any"}
expand := []string{"childTypes.all", "body.storage", "space", "version"}
version := 1

content, _, err := instance.Content.Get(context.Background(), id, expand, version)
Expand Down
6 changes: 3 additions & 3 deletions confluence/table_confluence_content_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ func tableConfluenceContentBody() *plugin.Table {
{
Name: "id",
Type: proto.ColumnType_STRING,
Description: "",
Description: "The ID of the content.",
},
{
Name: "view",
Type: proto.ColumnType_JSON,
Description: "",
Description: "The body of content in view format.",
},
{
Name: "export_view",
Expand All @@ -43,7 +43,7 @@ func tableConfluenceContentBody() *plugin.Table {
{
Name: "storage",
Type: proto.ColumnType_JSON,
Description: "",
Description: "The body of content in storage format",
},
{
Name: "editor2",
Expand Down

0 comments on commit b1e8342

Please sign in to comment.