From 4eb7318189a1e7f9b2b422b712e3f4228680ab87 Mon Sep 17 00:00:00 2001 From: artaasadi Date: Thu, 19 Dec 2024 02:33:33 +0100 Subject: [PATCH] fix: udpate es file --- pkg/sdk/es/resources_clients.go | 28 +++---------- provider/resource_types.go | 24 +++++------ provider/resource_types/resource-types.json | 14 +++---- ...table_github_organization_collaborator.go} | 0 steampipe/table_index_map.go | 40 +++++++++---------- 5 files changed, 45 insertions(+), 61 deletions(-) rename steampipe-plugin-github/github/{table_github_organization_collaborators.go => table_github_organization_collaborator.go} (100%) diff --git a/pkg/sdk/es/resources_clients.go b/pkg/sdk/es/resources_clients.go index b9351874..d8b283e4 100644 --- a/pkg/sdk/es/resources_clients.go +++ b/pkg/sdk/es/resources_clients.go @@ -2838,7 +2838,7 @@ type OrgAlertDependabotPaginator struct { } func (k Client) NewOrgAlertDependabotPaginator(filters []essdk.BoolFilter, limit *int64) (OrgAlertDependabotPaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_organization_dependabotalert", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_organization_dependabot_alert", filters, limit) if err != nil { return OrgAlertDependabotPaginator{}, err } @@ -3075,7 +3075,7 @@ type OrgExternalIdentityPaginator struct { } func (k Client) NewOrgExternalIdentityPaginator(filters []essdk.BoolFilter, limit *int64) (OrgExternalIdentityPaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_organization_externalidentity", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_organization_external_identity", filters, limit) if err != nil { return OrgExternalIdentityPaginator{}, err } @@ -3867,10 +3867,6 @@ func (p RepositoryPaginator) NextPage(ctx context.Context) ([]Repository, error) var listRepositoryFilters = map[string]string{ "allow_update_branch": "Description.AllowUpdateBranch", "auto_merge_allowed": "Description.AutoMergeAllowed", - "can_administer": "Description.CanAdminister", - "can_create_projects": "Description.CanCreateProjects", - "can_subscribe": "Description.CanSubscribe", - "can_update_topics": "Description.CanUpdateTopics", "code_of_conduct": "Description.CodeOfConduct", "contact_links": "Description.ContactLinks", "default_branch_ref": "Description.DefaultBranchRef", @@ -3886,7 +3882,6 @@ var listRepositoryFilters = map[string]string{ "has_issues_enabled": "Description.HasIssuesEnabled", "has_pages": "Description.HasPages", "has_projects_enabled": "Description.HasProjectsEnabled", - "has_starred": "Description.HasStarred", "has_vulnerability_alerts_enabled": "Description.HasVulnerabilityAlertsEnabled", "has_wiki_enabled": "Description.HasWikiEnabled", "homepage_url": "Description.HomepageURL", @@ -3932,14 +3927,11 @@ var listRepositoryFilters = map[string]string{ "ssh_url": "Description.SSHURL", "stargazer_count": "Description.StargazerCount", "subscribers_count": "Description.SubscribersCount", - "subscription": "Description.Subscription", "topics": "Description.Topics", "url": "Description.URL", - "uses_custom_open_graph_image": "Description.UsesCustomOpenGraphImage", "visibility": "Description.Visibility", "watchers_total_count": "Description.WatchersTotalCount", "web_commit_signoff_required": "Description.WebCommitSignOffRequired", - "your_permission": "Description.YourPermission", } func ListRepository(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -4005,10 +3997,6 @@ func ListRepository(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateD var getRepositoryFilters = map[string]string{ "allow_update_branch": "Description.AllowUpdateBranch", "auto_merge_allowed": "Description.AutoMergeAllowed", - "can_administer": "Description.CanAdminister", - "can_create_projects": "Description.CanCreateProjects", - "can_subscribe": "Description.CanSubscribe", - "can_update_topics": "Description.CanUpdateTopics", "code_of_conduct": "Description.CodeOfConduct", "contact_links": "Description.ContactLinks", "default_branch_ref": "Description.DefaultBranchRef", @@ -4024,7 +4012,6 @@ var getRepositoryFilters = map[string]string{ "has_issues_enabled": "Description.HasIssuesEnabled", "has_pages": "Description.HasPages", "has_projects_enabled": "Description.HasProjectsEnabled", - "has_starred": "Description.HasStarred", "has_vulnerability_alerts_enabled": "Description.HasVulnerabilityAlertsEnabled", "has_wiki_enabled": "Description.HasWikiEnabled", "homepage_url": "Description.HomepageURL", @@ -4070,14 +4057,11 @@ var getRepositoryFilters = map[string]string{ "ssh_url": "Description.SSHURL", "stargazer_count": "Description.StargazerCount", "subscribers_count": "Description.SubscribersCount", - "subscription": "Description.Subscription", "topics": "Description.Topics", "url": "Description.URL", - "uses_custom_open_graph_image": "Description.UsesCustomOpenGraphImage", "visibility": "Description.Visibility", "watchers_total_count": "Description.WatchersTotalCount", "web_commit_signoff_required": "Description.WebCommitSignOffRequired", - "your_permission": "Description.YourPermission", } func GetRepository(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -7769,7 +7753,7 @@ type ContainerPackagePaginator struct { } func (k Client) NewContainerPackagePaginator(filters []essdk.BoolFilter, limit *int64) (ContainerPackagePaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_package_container", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_container_package", filters, limit) if err != nil { return ContainerPackagePaginator{}, err } @@ -7968,7 +7952,7 @@ type PackageDetailPaginator struct { } func (k Client) NewPackageDetailPaginator(filters []essdk.BoolFilter, limit *int64) (PackageDetailPaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_package_npm", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_npm_package", filters, limit) if err != nil { return PackageDetailPaginator{}, err } @@ -8167,7 +8151,7 @@ type PackagePaginator struct { } func (k Client) NewPackagePaginator(filters []essdk.BoolFilter, limit *int64) (PackagePaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_package_nuget", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_nuget_package", filters, limit) if err != nil { return PackagePaginator{}, err } @@ -8366,7 +8350,7 @@ type ArtifactDockerFilePaginator struct { } func (k Client) NewArtifactDockerFilePaginator(filters []essdk.BoolFilter, limit *int64) (ArtifactDockerFilePaginator, error) { - paginator, err := essdk.NewPaginator(k.ES(), "github_artifactdockerfile", filters, limit) + paginator, err := essdk.NewPaginator(k.ES(), "github_artifact_dockerfile", filters, limit) if err != nil { return ArtifactDockerFilePaginator{}, err } diff --git a/provider/resource_types.go b/provider/resource_types.go index 8c94a65b..4c05481d 100644 --- a/provider/resource_types.go +++ b/provider/resource_types.go @@ -174,9 +174,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: nil, }, - "Github/Organization/DependabotAlert": { + "Github/Organization/Dependabot/Alert": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/DependabotAlert", + ResourceName: "Github/Organization/Dependabot/Alert", Tags: map[string][]string{ "category": {"Organization"}, }, @@ -188,9 +188,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: nil, }, - "Github/Organization/ExternalIdentity": { + "Github/Organization/External/Identity": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/ExternalIdentity", + ResourceName: "Github/Organization/External/Identity", Tags: map[string][]string{ "category": {"Organization"}, }, @@ -468,9 +468,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: nil, }, - "Github/Package/Container": { + "Github/Container/Package": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/Package/Container", + ResourceName: "Github/Container/Package", Tags: map[string][]string{ "category": {"package"}, }, @@ -496,9 +496,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: nil, }, - "Github/Package/NPM": { + "Github/NPM/Package": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/Package/NPM", + ResourceName: "Github/NPM/Package", Tags: map[string][]string{ "category": {"package"}, }, @@ -510,9 +510,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: nil, }, - "Github/Package/Nuget": { + "Github/Nuget/Package": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/Package/Nuget", + ResourceName: "Github/Nuget/Package", Tags: map[string][]string{ "category": {"package"}, }, @@ -524,9 +524,9 @@ var ResourceTypes = map[string]model.ResourceType{ GetDescriber: DescribeSingleByRepo(describer.GetNugetPackage), }, - "Github/ArtifactDockerFile": { + "Github/Artifact/DockerFile": { IntegrationType: configs.IntegrationName, - ResourceName: "Github/ArtifactDockerFile", + ResourceName: "Github/Artifact/DockerFile", Tags: map[string][]string{ "category": {"artifact_dockerfile"}, }, diff --git a/provider/resource_types/resource-types.json b/provider/resource_types/resource-types.json index ffa8a7a7..38a803cf 100644 --- a/provider/resource_types/resource-types.json +++ b/provider/resource_types/resource-types.json @@ -140,11 +140,11 @@ }, "ListDescriber": "DescribeByGithub(describer.GetAllOrganizationsCollaborators)", "GetDescriber": "", - "SteampipeTable": "github_organization_collaborators", + "SteampipeTable": "github_organization_collaborator", "Model": "OrgCollaborators" }, { - "ResourceName": "Github/Organization/DependabotAlert", + "ResourceName": "Github/Organization/Dependabot/Alert", "Tags": { "category": [ "Organization" @@ -156,7 +156,7 @@ "Model": "OrgAlertDependabot" }, { - "ResourceName": "Github/Organization/ExternalIdentity", + "ResourceName": "Github/Organization/External/Identity", "Tags": { "category": [ "Organization" @@ -396,7 +396,7 @@ "Model": "CodeOwner" }, { - "ResourceName": "Github/Package/Container", + "ResourceName": "Github/Container/Package", "Tags": { "category": [ "package" @@ -420,7 +420,7 @@ "Model": "PackageDetail" }, { - "ResourceName": "Github/Package/NPM", + "ResourceName": "Github/NPM/Package", "Tags": { "category": [ "package" @@ -432,7 +432,7 @@ "Model": "PackageDetail" }, { - "ResourceName": "Github/Package/Nuget", + "ResourceName": "Github/Nuget/Package", "Tags": { "category": [ "package" @@ -444,7 +444,7 @@ "Model": "Package" }, { - "ResourceName": "Github/ArtifactDockerFile", + "ResourceName": "Github/Artifact/DockerFile", "Tags": { "category": [ "artifact_dockerfile" diff --git a/steampipe-plugin-github/github/table_github_organization_collaborators.go b/steampipe-plugin-github/github/table_github_organization_collaborator.go similarity index 100% rename from steampipe-plugin-github/github/table_github_organization_collaborators.go rename to steampipe-plugin-github/github/table_github_organization_collaborator.go diff --git a/steampipe/table_index_map.go b/steampipe/table_index_map.go index 3016eea7..eecae881 100644 --- a/steampipe/table_index_map.go +++ b/steampipe/table_index_map.go @@ -16,9 +16,9 @@ var Map = map[string]string{ "Github/Issue": "github_issue", "Github/License": "github_license", "Github/Organization": "github_organization", - "Github/Organization/Collaborator": "github_organization_collaborators", - "Github/Organization/DependabotAlert": "github_organization_dependabot_alert", - "Github/Organization/ExternalIdentity": "github_organization_external_identity", + "Github/Organization/Collaborator": "github_organization_collaborator", + "Github/Organization/Dependabot/Alert": "github_organization_dependabot_alert", + "Github/Organization/External/Identity": "github_organization_external_identity", "Github/Organization/Member": "github_organization_member", "Github/PullRequest": "github_pull_request", "Github/Release": "github_release", @@ -38,11 +38,11 @@ var Map = map[string]string{ "Github/User": "github_user", "Github/Workflow": "github_workflow", "Github/CodeOwner": "github_code_owner", - "Github/Package/Container": "github_container_package", + "Github/Container/Package": "github_container_package", "Github/Package/Maven": "github_maven_package", - "Github/Package/NPM": "github_npm_package", - "Github/Package/Nuget": "github_nuget_package", - "Github/ArtifactDockerFile": "github_artifact_dockerfile", + "Github/NPM/Package": "github_npm_package", + "Github/Nuget/Package": "github_nuget_package", + "Github/Artifact/DockerFile": "github_artifact_dockerfile", } var DescriptionMap = map[string]interface{}{ @@ -58,8 +58,8 @@ var DescriptionMap = map[string]interface{}{ "Github/License": opengovernance.License{}, "Github/Organization": opengovernance.Organization{}, "Github/Organization/Collaborator": opengovernance.OrgCollaborators{}, - "Github/Organization/DependabotAlert": opengovernance.OrgAlertDependabot{}, - "Github/Organization/ExternalIdentity": opengovernance.OrgExternalIdentity{}, + "Github/Organization/Dependabot/Alert": opengovernance.OrgAlertDependabot{}, + "Github/Organization/External/Identity": opengovernance.OrgExternalIdentity{}, "Github/Organization/Member": opengovernance.OrgMembers{}, "Github/PullRequest": opengovernance.PullRequest{}, "Github/Release": opengovernance.Release{}, @@ -79,11 +79,11 @@ var DescriptionMap = map[string]interface{}{ "Github/User": opengovernance.User{}, "Github/Workflow": opengovernance.Workflow{}, "Github/CodeOwner": opengovernance.CodeOwner{}, - "Github/Package/Container": opengovernance.ContainerPackage{}, + "Github/Container/Package": opengovernance.ContainerPackage{}, "Github/Package/Maven": opengovernance.PackageDetail{}, - "Github/Package/NPM": opengovernance.PackageDetail{}, - "Github/Package/Nuget": opengovernance.Package{}, - "Github/ArtifactDockerFile": opengovernance.ArtifactDockerFile{}, + "Github/NPM/Package": opengovernance.PackageDetail{}, + "Github/Nuget/Package": opengovernance.Package{}, + "Github/Artifact/DockerFile": opengovernance.ArtifactDockerFile{}, } var ReverseMap = map[string]string{ @@ -98,9 +98,9 @@ var ReverseMap = map[string]string{ "github_issue": "Github/Issue", "github_license": "Github/License", "github_organization": "Github/Organization", - "github_organization_collaborators": "Github/Organization/Collaborator", - "github_organization_dependabot_alert": "Github/Organization/DependabotAlert", - "github_organization_external_identity": "Github/Organization/ExternalIdentity", + "github_organization_collaborator": "Github/Organization/Collaborator", + "github_organization_dependabot_alert": "Github/Organization/Dependabot/Alert", + "github_organization_external_identity": "Github/Organization/External/Identity", "github_organization_member": "Github/Organization/Member", "github_pull_request": "Github/PullRequest", "github_release": "Github/Release", @@ -120,9 +120,9 @@ var ReverseMap = map[string]string{ "github_user": "Github/User", "github_workflow": "Github/Workflow", "github_code_owner": "Github/CodeOwner", - "github_container_package": "Github/Package/Container", + "github_container_package": "Github/Container/Package", "github_maven_package": "Github/Package/Maven", - "github_npm_package": "Github/Package/NPM", - "github_nuget_package": "Github/Package/Nuget", - "github_artifact_dockerfile": "Github/ArtifactDockerFile", + "github_npm_package": "Github/NPM/Package", + "github_nuget_package": "Github/Nuget/Package", + "github_artifact_dockerfile": "Github/Artifact/DockerFile", }