diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index fd79b92e619ea6..68259026eac7ee 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -28,6 +28,8 @@ okta: - plugins/source/okta/**/* terraform: - plugins/source/terraform/**/* +vercel: + - plugins/source/vercel/**/* postgresql: - plugins/destination/postgresql/**/* sqlite: diff --git a/.github/styles/Vocab/Base/accept.txt b/.github/styles/Vocab/Base/accept.txt index fc0e96b7b7a12f..1341d76d57dcb5 100644 --- a/.github/styles/Vocab/Base/accept.txt +++ b/.github/styles/Vocab/Base/accept.txt @@ -156,4 +156,5 @@ ELBs CMK CMKs serverless -tailnet \ No newline at end of file +tailnet +Vercel diff --git a/.github/workflows/source_vercel.yml b/.github/workflows/source_vercel.yml new file mode 100644 index 00000000000000..b543013e8b022f --- /dev/null +++ b/.github/workflows/source_vercel.yml @@ -0,0 +1,85 @@ +name: Source Plugin Vercel Workflow + +on: + pull_request: + paths: + - "plugins/source/vercel/**" + - ".github/workflows/source_vercel.yml" + push: + branches: + - main + paths: + - "plugins/source/vercel/**" + - ".github/workflows/source_vercel.yml" + +jobs: + plugins-source-vercel: + timeout-minutes: 30 + name: "plugins/source/vercel" + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./plugins/source/vercel + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version-file: plugins/source/vercel/go.mod + cache: true + cache-dependency-path: plugins/source/vercel/go.sum + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.50.1 + working-directory: plugins/source/vercel + args: "--config ../../.golangci.yml" + - name: Get dependencies + run: go get -t -d ./... + - name: Build + run: go build . + - name: Test + run: make test + - name: gen + if: github.event_name == 'pull_request' + run: make gen + - name: Fail if generation updated files + if: github.event_name == 'pull_request' + run: test "$(git status -s | wc -l)" -eq 0 + validate-release: + timeout-minutes: 30 + runs-on: ubuntu-latest + env: + CGO_ENABLED: 0 + steps: + - name: Checkout + if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' + uses: actions/checkout@v3 + - uses: actions/cache@v3 + if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-1.19.3-release-cache-${{ hashFiles('plugins/source/vercel/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-1.19.3-release-cache-plugins-source-vercel + - name: Set up Go + if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' + uses: actions/setup-go@v3 + with: + go-version-file: plugins/source/vercel/go.mod + - name: Install GoReleaser + if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' + uses: goreleaser/goreleaser-action@v3 + with: + distribution: goreleaser-pro + version: latest + install-only: true + - name: Run GoReleaser Dry-Run + if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' + run: goreleaser release --snapshot --rm-dist --skip-validate --skip-publish --skip-sign -f ./plugins/source/vercel/.goreleaser.yaml + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.github/workflows/wait_for_required_workflows.yml b/.github/workflows/wait_for_required_workflows.yml index aa944daa96084c..52a4fa8c8dcd88 100644 --- a/.github/workflows/wait_for_required_workflows.yml +++ b/.github/workflows/wait_for_required_workflows.yml @@ -56,6 +56,7 @@ jobs: "plugins/source/tailscale", "plugins/source/terraform", "plugins/source/test", + "plugins/source/vercel", "plugins/destination/postgresql", "plugins/destination/test", diff --git a/plugins/source/vercel/.gitignore b/plugins/source/vercel/.gitignore new file mode 100644 index 00000000000000..48e50526aede87 --- /dev/null +++ b/plugins/source/vercel/.gitignore @@ -0,0 +1 @@ +/vercel \ No newline at end of file diff --git a/plugins/source/vercel/.goreleaser.yaml b/plugins/source/vercel/.goreleaser.yaml new file mode 100644 index 00000000000000..9dff408eb8fff3 --- /dev/null +++ b/plugins/source/vercel/.goreleaser.yaml @@ -0,0 +1,14 @@ +variables: + component: source/vercel + binary: vercel + +project_name: plugins/source/vercel + +monorepo: + tag_prefix: plugins-source-vercel- + dir: plugins/source/vercel + +includes: + - from_file: + # Relative to the directory Go Releaser is run from (which is the root of the repository) + path: ./plugins/.goreleaser.yaml \ No newline at end of file diff --git a/plugins/source/vercel/CHANGELOG.md b/plugins/source/vercel/CHANGELOG.md new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/plugins/source/vercel/Makefile b/plugins/source/vercel/Makefile new file mode 100644 index 00000000000000..db0b77c2187514 --- /dev/null +++ b/plugins/source/vercel/Makefile @@ -0,0 +1,23 @@ +# Test unit +.PHONY: test +test: + go test -timeout 3m ./... + +.PHONY: gen-docs +gen-docs: + rm -rf ./docs/tables/* + go run main.go doc ./docs/tables + sed 's_(\(.*\))_(https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/\1)_' docs/tables/README.md > ../../../website/pages/docs/plugins/sources/vercel/tables.md + +.PHONY: lint +lint: + golangci-lint run --config ../../.golangci.yml + +.PHONY: gen-code +gen-code: + grep -rl '// Code generated by codegen; DO NOT EDIT.' resources/services/* | xargs rm + go run codegen/main.go + +# All gen targets +.PHONY: gen +gen: gen-code gen-docs diff --git a/plugins/source/vercel/README.md b/plugins/source/vercel/README.md new file mode 100644 index 00000000000000..3f1ddcfad9fa3a --- /dev/null +++ b/plugins/source/vercel/README.md @@ -0,0 +1,7 @@ +# Vercel Plugin + +The CloudQuery Vercel plugin pulls data out of Vercel resources and loads it into any supported CloudQuery destination (e.g. PostgreSQL). + +## Links + +- [User Guide](https://docs.cloudquery.io/docs/plugins/sources/vercel/overview) diff --git a/plugins/source/vercel/client/client.go b/plugins/source/vercel/client/client.go new file mode 100644 index 00000000000000..d03b5139dc5e90 --- /dev/null +++ b/plugins/source/vercel/client/client.go @@ -0,0 +1,121 @@ +package client + +import ( + "context" + "errors" + "fmt" + "net/http" + "strings" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" + "github.com/cloudquery/plugin-sdk/specs" + "github.com/rs/zerolog" +) + +type Client struct { + logger zerolog.Logger + sourceSpec specs.Source + veSpec Spec + + TeamID string + TeamIDs []string + Services *vercel.Client +} + +func New(logger zerolog.Logger, sourceSpec specs.Source, veSpec Spec, services *vercel.Client, teamIDs []string) Client { + return Client{ + logger: logger, + sourceSpec: sourceSpec, + veSpec: veSpec, + Services: services, + TeamIDs: teamIDs, + } +} + +func (c *Client) Logger() *zerolog.Logger { + return &c.logger +} + +func (c *Client) ID() string { + n := []string{c.sourceSpec.Name} + if c.TeamID != "" { + n = append(n, c.TeamID) + } + return strings.Join(n, "_") +} + +func (c *Client) WithTeamID(teamID string) schema.ClientMeta { + return &Client{ + logger: c.logger.With().Str("team_id", teamID).Logger(), + sourceSpec: c.sourceSpec, + veSpec: c.veSpec, + TeamID: teamID, + TeamIDs: c.TeamIDs, + Services: c.Services.WithTeamID(teamID), + } +} + +func Configure(ctx context.Context, logger zerolog.Logger, s specs.Source) (schema.ClientMeta, error) { + veSpec := &Spec{} + if err := s.UnmarshalSpec(veSpec); err != nil { + return nil, fmt.Errorf("failed to unmarshal vercel spec: %w", err) + } + + services, err := getServiceClient(veSpec, "") + if err != nil { + return nil, err + } + if len(veSpec.TeamIDs) == 0 { + veSpec.TeamIDs, err = getTeamIDs(ctx, services) + if err != nil { + return nil, fmt.Errorf("failed to discover team ids: %w", err) + } + } + + cl := New(logger, s, *veSpec, services, veSpec.TeamIDs) + return &cl, nil +} + +func getServiceClient(spec *Spec, teamID string) (*vercel.Client, error) { + if spec.AccessToken == "" { + return nil, errors.New("no access token provided") + } + if spec.EndpointURL == "" { + spec.EndpointURL = "https://api.vercel.com" + } + if spec.Timeout < 1 { + spec.Timeout = 5 + } + + return vercel.New(&http.Client{ + Timeout: time.Duration(spec.Timeout) * time.Second, + }, + spec.EndpointURL, + spec.AccessToken, + teamID, + ), nil +} + +func getTeamIDs(ctx context.Context, svc *vercel.Client) ([]string, error) { + var pg vercel.Paginator + var teams []string + + for { + list, p, err := svc.ListTeams(ctx, &pg) + if err != nil { + return nil, err + } + for _, t := range list { + teams = append(teams, t.ID) + } + + if p.Next == nil { + break + } + pg.Next = p.Next + } + + return teams, nil +} diff --git a/plugins/source/vercel/client/multiplexer.go b/plugins/source/vercel/client/multiplexer.go new file mode 100644 index 00000000000000..1bb0fe87eb68f7 --- /dev/null +++ b/plugins/source/vercel/client/multiplexer.go @@ -0,0 +1,16 @@ +package client + +import ( + "github.com/cloudquery/plugin-sdk/schema" +) + +func TeamMultiplex(meta schema.ClientMeta) []schema.ClientMeta { + c := meta.(*Client) + + l := make([]schema.ClientMeta, 0, len(c.TeamIDs)) + for _, o := range c.TeamIDs { + l = append(l, c.WithTeamID(o)) + } + + return l +} diff --git a/plugins/source/vercel/client/spec.go b/plugins/source/vercel/client/spec.go new file mode 100644 index 00000000000000..d33b44e5373e0b --- /dev/null +++ b/plugins/source/vercel/client/spec.go @@ -0,0 +1,9 @@ +package client + +type Spec struct { + AccessToken string `json:"access_token,omitempty"` + TeamIDs []string `json:"team_ids,omitempty"` + + EndpointURL string `json:"endpoint_url,omitempty"` + Timeout int64 `json:"timeout_secs,omitempty"` +} diff --git a/plugins/source/vercel/client/testing.go b/plugins/source/vercel/client/testing.go new file mode 100644 index 00000000000000..c20af32ea368bb --- /dev/null +++ b/plugins/source/vercel/client/testing.go @@ -0,0 +1,108 @@ +package client + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "net/http/httptest" + "net/url" + "os" + "testing" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/plugins" + "github.com/cloudquery/plugin-sdk/schema" + "github.com/cloudquery/plugin-sdk/specs" + "github.com/gorilla/mux" + "github.com/rs/zerolog" +) + +const testToken = "SomeToken" + +type MockHttpClient struct { + rootURL string + scheme string + host string + client *http.Client +} + +func NewMockHttpClient(cl *http.Client, rootURL string) *MockHttpClient { + u, err := url.Parse(rootURL) + if err != nil { + panic(err) + } + return &MockHttpClient{ + client: cl, + rootURL: rootURL, + scheme: u.Scheme, + host: u.Host, + } +} + +func (c *MockHttpClient) Do(req *http.Request) (*http.Response, error) { + if req.Header.Get("Authorization") != fmt.Sprintf("Bearer %s", testToken) { + return &http.Response{StatusCode: http.StatusUnauthorized, Status: "401 Unauthorized", Body: io.NopCloser(bytes.NewReader(nil))}, nil + } + + req.URL.Host = c.host + req.URL.Scheme = c.scheme + return c.client.Do(req) +} + +func MockTestHelper(t *testing.T, table *schema.Table, createServices func(*mux.Router) error) { + version := "vDev" + + t.Helper() + table.IgnoreInTests = false + + router := mux.NewRouter() + router.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + t.Logf("Router received request to %s", r.URL.String()) + http.Error(w, "not found", http.StatusNotFound) + }) + + h := httptest.NewServer(router) + defer h.Close() + mockClient := NewMockHttpClient(h.Client(), h.URL) + + logger := zerolog.New(zerolog.NewTestWriter(t)).Output( + zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.StampMicro}, + ).Level(zerolog.DebugLevel).With().Timestamp().Logger() + + newTestExecutionClient := func(ctx context.Context, _ zerolog.Logger, spec specs.Source) (schema.ClientMeta, error) { + var veSpec Spec + if err := spec.UnmarshalSpec(&veSpec); err != nil { + return nil, fmt.Errorf("failed to unmarshal vercel spec: %w", err) + } + veSpec.TeamIDs = []string{"test-team-id"} + + if err := createServices(router); err != nil { + return nil, err + } + + services := vercel.New(mockClient, h.URL, testToken, veSpec.TeamIDs[0]) + + c := New(logger, spec, veSpec, services, veSpec.TeamIDs) + return &c, nil + } + + p := plugins.NewSourcePlugin( + table.Name, + version, + []*schema.Table{ + table, + }, + newTestExecutionClient, + ) + p.SetLogger(logger) + plugins.TestSourcePluginSync(t, p, specs.Source{ + Name: "dev", + Path: "cloudquery/dev", + Version: version, + Tables: []string{table.Name}, + Destinations: []string{"mock-destination"}, + }) +} diff --git a/plugins/source/vercel/codegen/main.go b/plugins/source/vercel/codegen/main.go new file mode 100644 index 00000000000000..7e824debae73d8 --- /dev/null +++ b/plugins/source/vercel/codegen/main.go @@ -0,0 +1,123 @@ +package main + +import ( + "bytes" + "embed" + "fmt" + "go/format" + "log" + "os" + "path" + "reflect" + "runtime" + "strings" + "text/template" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/codegen/recipes" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/cloudquery/plugin-sdk/schema" +) + +//go:embed templates/*.go.tpl +var templatesFS embed.FS + +func main() { + var resources []*recipes.Resource + resources = append(resources, recipes.DomainResources()...) + resources = append(resources, recipes.TeamResources()...) + resources = append(resources, recipes.ProjectResources()...) + resources = append(resources, recipes.DeploymentResources()...) + + for _, r := range resources { + r.Infer() + } + if err := recipes.SetParentChildRelationships(resources); err != nil { + log.Fatal(err) + } + for _, r := range resources { + r.GenerateNames() + + _, filename, _, ok := runtime.Caller(0) + if !ok { + log.Fatal("Failed to get caller information") + } + codegenDir := path.Join(path.Dir(filename), "..", "resources", "services") + + generateTable(codegenDir, *r) + } +} + +func milliTimeTransformer(field reflect.StructField) (schema.ValueType, error) { + milliTime := vercel.MilliTime{} + switch field.Type { + case reflect.TypeOf(milliTime), reflect.TypeOf(&milliTime): + return schema.TypeTimestamp, nil + default: + return schema.TypeInvalid, nil + } +} + +func generateTable(basedir string, r recipes.Resource) { + var err error + + r.TableName = "vercel_" + r.TableName + + log.Println("Generating table", r.TableName) + opts := []codegen.TableOption{ + codegen.WithSkipFields(r.SkipFields), + codegen.WithExtraColumns(r.ExtraColumns), + codegen.WithPKColumns(r.PKColumns...), + codegen.WithTypeTransformer(milliTimeTransformer), + } + if r.UnwrapEmbeddedStructs { + opts = append(opts, codegen.WithUnwrapAllEmbeddedStructs()) + } + r.Table, err = codegen.NewTableFromStruct(r.TableName, r.DataStruct, opts...) + + if err != nil { + log.Fatal(err) + } + + r.Table.Resolver = r.ResolverFuncName + r.Table.Multiplex = r.Multiplex + r.ImportClient = strings.HasPrefix(r.Multiplex, "client.") + r.Table.Relations = r.Relations + r.Table.PreResourceResolver = r.PreResourceResolver + r.Table.PostResourceResolver = r.PostResourceResolver + + for _, c := range r.Table.Columns { + if strings.HasPrefix(c.Resolver, "client.") { + r.ImportClient = true + } + } + + mainTemplate := r.Template + ".go.tpl" + tpl, err := template.New(mainTemplate).ParseFS(templatesFS, "templates/"+mainTemplate) + if err != nil { + log.Fatal(fmt.Errorf("failed to parse vercel templates: %w", err)) + } + tpl, err = tpl.ParseFS(codegen.TemplatesFS, "templates/*.go.tpl") + if err != nil { + log.Fatal(fmt.Errorf("failed to parse recipes template: %w", err)) + } + var buff bytes.Buffer + if err := tpl.Execute(&buff, r); err != nil { + log.Fatal(fmt.Errorf("failed to execute template: %w", err)) + } + + pkgPath := path.Join(basedir, r.Service) + if err := os.Mkdir(pkgPath, 0755); err != nil && !os.IsExist(err) { + log.Fatal(err) + } + + filePath := path.Join(pkgPath, r.Filename) + content, err := format.Source(buff.Bytes()) + if err != nil { + fmt.Println(buff.String()) + log.Fatal(fmt.Errorf("failed to format code for %s: %w", filePath, err)) + } + if err := os.WriteFile(filePath, content, 0644); err != nil { + log.Fatal(fmt.Errorf("failed to write file %s: %w", filePath, err)) + } +} diff --git a/plugins/source/vercel/codegen/recipes/deployments.go b/plugins/source/vercel/codegen/recipes/deployments.go new file mode 100644 index 00000000000000..6cf7719007d6b4 --- /dev/null +++ b/plugins/source/vercel/codegen/recipes/deployments.go @@ -0,0 +1,32 @@ +package recipes + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/cloudquery/plugin-sdk/schema" +) + +func DeploymentResources() []*Resource { + return []*Resource{ + { + DataStruct: &vercel.Deployment{}, + Service: "deployment", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"uid"}, + Relations: []string{"DeploymentChecks()"}, + }, + { + DataStruct: &vercel.DeploymentCheck{}, + Service: "deployment", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"deployment_id", "id"}, + ExtraColumns: []codegen.ColumnDefinition{ + { + Name: "deployment_id", + Type: schema.TypeString, + Resolver: `schema.ParentColumnResolver("uid")`, + }, + }, + }, + } +} diff --git a/plugins/source/vercel/codegen/recipes/domains.go b/plugins/source/vercel/codegen/recipes/domains.go new file mode 100644 index 00000000000000..43189ece5fe9a7 --- /dev/null +++ b/plugins/source/vercel/codegen/recipes/domains.go @@ -0,0 +1,32 @@ +package recipes + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/cloudquery/plugin-sdk/schema" +) + +func DomainResources() []*Resource { + return []*Resource{ + { + DataStruct: &vercel.Domain{}, + Service: "domain", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"id"}, + Relations: []string{"DomainRecords()"}, + }, + { + DataStruct: &vercel.DomainRecord{}, + Service: "domain", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"domain_name", "id"}, + ExtraColumns: []codegen.ColumnDefinition{ + { + Name: "domain_name", + Type: schema.TypeString, + Resolver: `schema.ParentColumnResolver("name")`, + }, + }, + }, + } +} diff --git a/plugins/source/vercel/codegen/recipes/projects.go b/plugins/source/vercel/codegen/recipes/projects.go new file mode 100644 index 00000000000000..69e52e7c1d86ea --- /dev/null +++ b/plugins/source/vercel/codegen/recipes/projects.go @@ -0,0 +1,32 @@ +package recipes + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/cloudquery/plugin-sdk/schema" +) + +func ProjectResources() []*Resource { + return []*Resource{ + { + DataStruct: &vercel.Project{}, + Service: "project", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"id"}, + Relations: []string{"ProjectEnvs()"}, + }, + { + DataStruct: &vercel.ProjectEnv{}, + Service: "project", + Multiplex: "client.TeamMultiplex", + PKColumns: []string{"project_id", "id"}, + ExtraColumns: []codegen.ColumnDefinition{ + { + Name: "project_id", + Type: schema.TypeString, + Resolver: `schema.ParentColumnResolver("id")`, + }, + }, + }, + } +} diff --git a/plugins/source/vercel/codegen/recipes/recipes.go b/plugins/source/vercel/codegen/recipes/recipes.go new file mode 100644 index 00000000000000..f12ab11b1cd6e1 --- /dev/null +++ b/plugins/source/vercel/codegen/recipes/recipes.go @@ -0,0 +1,159 @@ +package recipes + +import ( + "fmt" + "log" + "reflect" + "strings" + + "github.com/cloudquery/plugin-sdk/caser" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/gertd/go-pluralize" +) + +type Resource struct { + // Table is the table definition that will be used to generate the cloudquery table + Table *codegen.TableDefinition + // DataStruct that will be used to generate the cloudquery table + DataStruct interface{} + // SkipFields fields in go struct to skip when generating the table from the go struct + SkipFields []string + Template string + Multiplex string + + ExtraColumns []codegen.ColumnDefinition + PKColumns []string + + PreResourceResolver string + PostResourceResolver string + Relations []string + UnwrapEmbeddedStructs bool + + SkipSubserviceName bool // Skip name of the subservice in auto generated table names (including relations) + + // These are inferred with reflection but can be overridden + Service string // Inferred from DataStruct package, pluralized + SubService string // Inferred from DataStruct name, singular + TableName string // singular Service + plural SubService + + // These are auto calculated + ImportClient bool // true if the resource/column resolvers use the client package + Filename string // Calculated from TableName + TableFuncName string // Calculated from TableName + ResolverFuncName string // Calculated from TableFuncName + + //used for generating better table names + parent *Resource + children []*Resource +} + +var ( + pluralizeClient *pluralize.Client + csr *caser.Caser +) + +func init() { + pluralizeClient = pluralize.NewClient() + csr = caser.New() +} + +func (r *Resource) Infer() { + // Set defaults and/or infer fields + if r.Template == "" { + r.Template = "resource" + } + + ds := reflect.TypeOf(r.DataStruct) + if ds.Kind() == reflect.Ptr { + ds = ds.Elem() + } + + if r.Service == "" { + log.Fatalf("Service is required for %s", r.SubService) + } + if r.SubService == "" { + r.SubService = csr.ToSnake(pluralizeClient.Singular(ds.Name())) + } +} + +func (r *Resource) GenerateNames() { + if r.TableName == "" { + // Table names are always in [...] format. Add everything in singular form and pluralize the last word later + + const sep = "_" + nParts := strings.Split(pluralizeClient.Singular(r.Service), sep) + p := r.parent + for p != nil { + nParts = appendNoRepeat(nParts, strings.Split(pluralizeClient.Singular(p.SubService), sep)...) + p = p.parent + } + nParts = appendNoRepeat(nParts, strings.Split(pluralizeClient.Singular(r.SubService), sep)...) + nParts[len(nParts)-1] = pluralizeClient.Plural(nParts[len(nParts)-1]) + + if r.TableName == "" { + if len(nParts) == 0 { + log.Fatalf("Could not generate table name for %s.%s", r.Service, r.SubService) + } + + r.TableName = strings.Join(nParts, sep) + } + } + + r.Filename = csr.ToSnake(r.TableName) + ".go" + r.TableFuncName = csr.ToPascal(r.TableName) + r.ResolverFuncName = "fetch" + r.TableFuncName +} + +// SetParentChildRelationships calculates and sets the parent and children fields on resources. +func SetParentChildRelationships(resources []*Resource) error { + m := map[string]*Resource{} + for _, r := range resources { + var key string + if r.TableName != "" { + key = r.TableName + } else { + key = r.Service + "_" + pluralizeClient.Plural(r.SubService) + } + //log.Printf("%s.%s => %s", r.Service, r.SubService, key) + m[key] = r + } + for _, r := range resources { + for _, ch := range r.Relations { + snakeChild := csr.ToSnake(strings.TrimSuffix(ch, "()")) + name := strings.TrimPrefix(snakeChild, r.Service+"_"+r.SubService+"_") + v, ok := m[r.Service+"_"+name] + if !ok { + v, ok = m[name] + } + if !ok { + return fmt.Errorf("child not found for %s.%s: %s missing", r.Service, r.SubService, name) + } + v.parent = r + } + } + return nil +} + +func appendNoRepeat(parts []string, addition ...string) []string { + // foo + bar = foo_bar + // foo + foo_bar = foo_bar + // foo_bar + bar_baz = foo_bar_baz + // foo_bar + baz_bax = foo_bar_baz_bax + // foo_bar_baz + bar_baz_bax = foo_bar_baz_bax + + for i := len(addition); i > 0; i-- { + // ever-increasing from long form to short: foo_bar_baz, foo_bar, foo + if sliceEndsWith(parts, addition[:i]) { + return append(parts, addition[i:]...) + } + } + return append(parts, addition...) +} + +func sliceEndsWith(haystack, needle []string) bool { + ln, lh := len(needle), len(haystack) + if ln > lh { + return false + } + return reflect.DeepEqual(needle, haystack[lh-ln:]) +} diff --git a/plugins/source/vercel/codegen/recipes/teams.go b/plugins/source/vercel/codegen/recipes/teams.go new file mode 100644 index 00000000000000..788805c78a8fda --- /dev/null +++ b/plugins/source/vercel/codegen/recipes/teams.go @@ -0,0 +1,30 @@ +package recipes + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/codegen" + "github.com/cloudquery/plugin-sdk/schema" +) + +func TeamResources() []*Resource { + return []*Resource{ + { + DataStruct: &vercel.Team{}, + Service: "team", + PKColumns: []string{"id"}, + Relations: []string{"TeamMembers()"}, + }, + { + DataStruct: &vercel.TeamMember{}, + Service: "team", + PKColumns: []string{"team_id", "uid"}, + ExtraColumns: []codegen.ColumnDefinition{ + { + Name: "team_id", + Type: schema.TypeString, + Resolver: `schema.ParentColumnResolver("id")`, + }, + }, + }, + } +} diff --git a/plugins/source/vercel/codegen/templates/resource.go.tpl b/plugins/source/vercel/codegen/templates/resource.go.tpl new file mode 100644 index 00000000000000..7e5b0ef0d03626 --- /dev/null +++ b/plugins/source/vercel/codegen/templates/resource.go.tpl @@ -0,0 +1,14 @@ +// Code generated by codegen; DO NOT EDIT. + +package {{.Service}} + +import ( + "github.com/cloudquery/plugin-sdk/schema" +{{- if .ImportClient}} + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" +{{- end}} +) + +func {{.TableFuncName}}() *schema.Table { + return &schema.Table{{template "table.go.tpl" .Table}} +} diff --git a/plugins/source/vercel/docs/configuration.md b/plugins/source/vercel/docs/configuration.md new file mode 100644 index 00000000000000..707c47294c5718 --- /dev/null +++ b/plugins/source/vercel/docs/configuration.md @@ -0,0 +1,3 @@ +# CloudQuery Vercel Source Plugin Configuration Reference + +Moved to [https://cloudquery.io/docs/plugins/sources/vercel/configuration](https://cloudquery.io/docs/plugins/sources/vercel/configuration) \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/README.md b/plugins/source/vercel/docs/tables/README.md new file mode 100644 index 00000000000000..00dfd70c04f2ef --- /dev/null +++ b/plugins/source/vercel/docs/tables/README.md @@ -0,0 +1,10 @@ +# Source Plugin: vercel +## Tables +- [vercel_domains](vercel_domains.md) + - [vercel_domain_records](vercel_domain_records.md) +- [vercel_teams](vercel_teams.md) + - [vercel_team_members](vercel_team_members.md) +- [vercel_projects](vercel_projects.md) + - [vercel_project_envs](vercel_project_envs.md) +- [vercel_deployments](vercel_deployments.md) + - [vercel_deployment_checks](vercel_deployment_checks.md) \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_deployment_checks.md b/plugins/source/vercel/docs/tables/vercel_deployment_checks.md new file mode 100644 index 00000000000000..2d018acac69778 --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_deployment_checks.md @@ -0,0 +1,30 @@ +# Table: vercel_deployment_checks + + + +The composite primary key for this table is (**deployment_id**, **id**). + +## Relations +This table depends on [vercel_deployments](vercel_deployments.md). + + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|deployment_id (PK)|String| +|id (PK)|String| +|created_at|Timestamp| +|completed_at|Timestamp| +|conclusion|String| +|details_url|String| +|integration_id|String| +|name|String| +|path|String| +|rererequestable|Bool| +|started_at|Timestamp| +|updated_at|Timestamp| +|status|String| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_deployments.md b/plugins/source/vercel/docs/tables/vercel_deployments.md new file mode 100644 index 00000000000000..8dd93f79fc2480 --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_deployments.md @@ -0,0 +1,31 @@ +# Table: vercel_deployments + + + +The primary key for this table is **uid**. + +## Relations + +The following tables depend on vercel_deployments: + - [vercel_deployment_checks](vercel_deployment_checks.md) + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|uid (PK)|String| +|name|String| +|url|String| +|source|String| +|state|String| +|type|String| +|inspector_url|String| +|is_rollback_candidate|Bool| +|ready|Timestamp| +|checks_state|String| +|checks_conclusion|String| +|created_at|Timestamp| +|building_at|Timestamp| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_domain_records.md b/plugins/source/vercel/docs/tables/vercel_domain_records.md new file mode 100644 index 00000000000000..d4d1213e33ce3a --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_domain_records.md @@ -0,0 +1,29 @@ +# Table: vercel_domain_records + + + +The composite primary key for this table is (**domain_name**, **id**). + +## Relations +This table depends on [vercel_domains](vercel_domains.md). + + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|domain_name (PK)|String| +|id (PK)|String| +|slug|String| +|name|String| +|type|String| +|value|String| +|mx_priority|Int| +|priority|Int| +|creator|String| +|created_at|Timestamp| +|updated_at|Timestamp| +|ttl|Int| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_domains.md b/plugins/source/vercel/docs/tables/vercel_domains.md new file mode 100644 index 00000000000000..ccb2c6fb0824fb --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_domains.md @@ -0,0 +1,39 @@ +# Table: vercel_domains + + + +The primary key for this table is **id**. + +## Relations + +The following tables depend on vercel_domains: + - [vercel_domain_records](vercel_domain_records.md) + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|bought_at|Timestamp| +|cdn_enabled|Bool| +|config_verified_at|Timestamp| +|created_at|Timestamp| +|expires_at|Timestamp| +|id (PK)|String| +|intended_nameservers|StringArray| +|custom_nameservers|StringArray| +|name|String| +|nameservers|StringArray| +|ns_verified_at|Timestamp| +|ordered_at|Timestamp| +|renew|Bool| +|service_type|String| +|transfer_started_at|Timestamp| +|transferred_at|Timestamp| +|txt_verified_at|Timestamp| +|verification_record|String| +|verified|Bool| +|zone|Bool| +|creator|JSON| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_project_envs.md b/plugins/source/vercel/docs/tables/vercel_project_envs.md new file mode 100644 index 00000000000000..15a6e096a650ea --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_project_envs.md @@ -0,0 +1,33 @@ +# Table: vercel_project_envs + + + +The composite primary key for this table is (**project_id**, **id**). + +## Relations +This table depends on [vercel_projects](vercel_projects.md). + + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|project_id (PK)|String| +|id (PK)|String| +|target|String| +|type|String| +|key|String| +|value|String| +|configuration_id|String| +|git_branch|String| +|edge_config_id|String| +|edge_config_token_id|String| +|decrypted|Bool| +|system|Bool| +|created_at|Timestamp| +|created_by|String| +|updated_at|Timestamp| +|updated_by|String| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_projects.md b/plugins/source/vercel/docs/tables/vercel_projects.md new file mode 100644 index 00000000000000..db59d4fa499fce --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_projects.md @@ -0,0 +1,43 @@ +# Table: vercel_projects + + + +The primary key for this table is **id**. + +## Relations + +The following tables depend on vercel_projects: + - [vercel_project_envs](vercel_project_envs.md) + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|account_id|String| +|auto_expose_system_envs|Bool| +|build_command|String| +|command_for_ignoring_build_step|String| +|created_at|Timestamp| +|dev_command|String| +|directory_listing|Bool| +|env|JSON| +|framework|String| +|git_fork_protection|Bool| +|id (PK)|String| +|install_command|String| +|name|String| +|node_version|String| +|output_directory|String| +|public_source|Bool| +|root_directory|String| +|serverless_function_region|String| +|source_files_outside_root_directory|Bool| +|updated_at|Timestamp| +|live|Bool| +|latest_deployments|JSON| +|transfer_started_at|Timestamp| +|transfer_completed_at|Timestamp| +|transferred_from_account_id|String| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_team_members.md b/plugins/source/vercel/docs/tables/vercel_team_members.md new file mode 100644 index 00000000000000..2db87e8600934c --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_team_members.md @@ -0,0 +1,30 @@ +# Table: vercel_team_members + + + +The composite primary key for this table is (**team_id**, **uid**). + +## Relations +This table depends on [vercel_teams](vercel_teams.md). + + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|team_id (PK)|String| +|avatar|String| +|confirmed|Bool| +|email|String| +|github|JSON| +|gitlab|JSON| +|bitbucket|JSON| +|role|String| +|uid (PK)|String| +|username|String| +|name|String| +|created_at|Timestamp| +|access_requested_at|Timestamp| \ No newline at end of file diff --git a/plugins/source/vercel/docs/tables/vercel_teams.md b/plugins/source/vercel/docs/tables/vercel_teams.md new file mode 100644 index 00000000000000..5030dd52ca0317 --- /dev/null +++ b/plugins/source/vercel/docs/tables/vercel_teams.md @@ -0,0 +1,27 @@ +# Table: vercel_teams + + + +The primary key for this table is **id**. + +## Relations + +The following tables depend on vercel_teams: + - [vercel_team_members](vercel_team_members.md) + +## Columns +| Name | Type | +| ------------- | ------------- | +|_cq_source_name|String| +|_cq_sync_time|Timestamp| +|_cq_id|UUID| +|_cq_parent_id|UUID| +|id (PK)|String| +|slug|String| +|name|String| +|avatar|String| +|created_at|Timestamp| +|creator_id|String| +|updated_at|Timestamp| +|profiles|JSON| +|staging_prefix|String| \ No newline at end of file diff --git a/plugins/source/vercel/go.mod b/plugins/source/vercel/go.mod new file mode 100644 index 00000000000000..8a7eaa7eb0bda0 --- /dev/null +++ b/plugins/source/vercel/go.mod @@ -0,0 +1,36 @@ +module github.com/cloudquery/cloudquery/plugins/source/vercel + +go 1.19 + +require ( + github.com/cloudquery/plugin-sdk v1.11.2 + github.com/gertd/go-pluralize v0.2.1 + github.com/gorilla/mux v1.8.0 + github.com/rs/zerolog v1.28.0 +) + +require ( + github.com/getsentry/sentry-go v0.15.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cobra v1.6.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/thoas/go-funk v0.9.3-0.20221027085339-5573bc209e28 // indirect + golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/text v0.4.0 // indirect + google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect + google.golang.org/grpc v1.51.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/plugins/source/vercel/go.sum b/plugins/source/vercel/go.sum new file mode 100644 index 00000000000000..51190572963584 --- /dev/null +++ b/plugins/source/vercel/go.sum @@ -0,0 +1,469 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/avast/retry-go/v4 v4.3.1 h1:Mtg11F9PdAIMkMiio2RKcYauoVHjl2aB3zQJJlzD4cE= +github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudquery/plugin-sdk v1.11.2 h1:JNztDHEqi1GoClHgfJhyojYJbgRP+yiWyFAhIuEHLug= +github.com/cloudquery/plugin-sdk v1.11.2/go.mod h1:PKne4lmvDFCEbTAS8EQzPohkXchwi/7NSvu77l07hCg= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= +github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= +github.com/getsentry/sentry-go v0.15.0 h1:CP9bmA7pralrVUedYZsmIHWpq/pBtXTSew7xvVpfLaA= +github.com/getsentry/sentry-go v0.15.0/go.mod h1:RZPJKSw+adu8PBNygiri/A98FqVr2HtRckJk9XVxJ9I= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.3 h1:hRcWZ7716+E1tkMSZJ/QeeC2dPGGB1R/4z4m9RsL8Qg= +github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.3/go.mod h1:54asssGY3Bohr5FRbew+bjfuQTT2WS9V7hW7gPqmcKM= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201002093600-73cf2ae9d891/go.mod h1:GhphxcdlaRyAuBSvo6rV71BvQcvB/vuX8ugCyybuS2k= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 h1:o95KDiV/b1xdkumY5YbLR0/n2+wBxUpgf3HgfKgTyLI= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3/go.mod h1:hTxjzRcX49ogbTGVJ1sM5mz5s+SSgiGIyL3jjPxl32E= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= +github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/schollz/progressbar/v3 v3.12.1 h1:JAhtIrLWAn6/p7i82SrpSG3fgAwlAxi+Sy12r4AzBvQ= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/thoas/go-funk v0.9.3-0.20221027085339-5573bc209e28 h1:xQnb8OgtW7FLvEtONmA0M13f04+fhhoBiYjWyCkqfDg= +github.com/thoas/go-funk v0.9.3-0.20221027085339-5573bc209e28/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 h1:yZNXmy+j/JpX19vZkVktWqAo7Gny4PBWYYK3zskGpx4= +golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e h1:azcyH5lGzGy7pkLCbhPe0KkKxsM7c6UA/FZIXImKE7M= +google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc/examples v0.0.0-20210424002626-9572fd6faeae/go.mod h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/plugins/source/vercel/internal/vercel/deployment.go b/plugins/source/vercel/internal/vercel/deployment.go new file mode 100644 index 00000000000000..39fc2951079133 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/deployment.go @@ -0,0 +1,88 @@ +package vercel + +import ( + "context" + "fmt" +) + +const ( + deploymentsURL = "/v6/deployments" + deploymentChecksURL = "/v1/deployments/%s/checks" +) + +type Deployment struct { + UID string `json:"uid"` + Name string `json:"name"` + URL *string `json:"url,omitempty"` + Source *string `json:"source,omitempty"` + State *string `json:"state,omitempty"` + Type string `json:"type"` + Creator interface{} `json:"creator"` + InspectorURL string `json:"inspectorUrl"` + Meta interface{} `json:"meta"` + Target interface{} `json:"target"` + AliasError interface{} `json:"aliasError"` + AliasAssigned interface{} `json:"aliasAssigned"` + IsRollbackCandidate *bool `json:"isRollbackCandidate,omitempty"` + Ready *MilliTime `json:"ready,omitempty"` + ChecksState *string `json:"checksState,omitempty"` + ChecksConclusion *string `json:"checksConclusion,omitempty"` + + // duplicate: Created MilliTime `json:"created"` + CreatedAt MilliTime `json:"createdAt"` + BuildingAt MilliTime `json:"buildingAt"` +} + +type DeploymentCheck struct { + ID string `json:"id"` + CreatedAt MilliTime `json:"createdAt"` + CompletedAt *MilliTime `json:"completedAt,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + DetailsURL *string `json:"detailsUrl,omitempty"` + IntegrationID *string `json:"integrationId,omitempty"` + Name *string `json:"name,omitempty"` + Output interface{} `json:"output"` + Path *string `json:"path,omitempty"` + Rerequestable bool `json:"rererequestable"` + StartedAt *MilliTime `json:"startedAt,omitempty"` + UpdatedAt *MilliTime `json:"updatedAt,omitempty"` + Status string `json:"status"` +} + +func (v *Client) ListDeployments(ctx context.Context, pag *Paginator) ([]Deployment, *Paginator, error) { + var list struct { + Deployments []Deployment `json:"deployments"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, deploymentsURL, until, &list) + if err != nil { + return nil, nil, err + } + return list.Deployments, &list.Pagination, nil +} + +func (v *Client) ListDeploymentChecks(ctx context.Context, deploymentId string, pag *Paginator) ([]DeploymentCheck, *Paginator, error) { + u := fmt.Sprintf(deploymentChecksURL, deploymentId) + + var list struct { + Checks []DeploymentCheck `json:"checks"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, u, until, &list) + if err != nil { + return nil, nil, err + } + return list.Checks, &list.Pagination, nil +} diff --git a/plugins/source/vercel/internal/vercel/domain.go b/plugins/source/vercel/internal/vercel/domain.go new file mode 100644 index 00000000000000..cd59521c21aa18 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/domain.go @@ -0,0 +1,95 @@ +package vercel + +import ( + "context" + "fmt" +) + +const ( + domainsURL = "/v5/domains" + domainRecordsURL = "/v4/domains/%s/records" +) + +type Domain struct { + BoughtAt *MilliTime `json:"boughtAt"` + CdnEnabled bool `json:"cdnEnabled"` // undocumented + ConfigVerifiedAt *MilliTime `json:"configVerifiedAt"` // undocumented + CreatedAt MilliTime `json:"createdAt"` + ExpiresAt *MilliTime `json:"expiresAt"` + ID string `json:"id"` + IntendedNameservers []string `json:"intendedNameservers"` + CustomNameservers []string `json:"customNameservers"` + Name string `json:"name"` + Nameservers []string `json:"nameservers"` + NsVerifiedAt *MilliTime `json:"nsVerifiedAt"` // undocumented + OrderedAt *MilliTime `json:"orderedAt"` + Renew bool `json:"renew"` + ServiceType string `json:"serviceType"` + TransferStartedAt *MilliTime `json:"transferStartedAt"` + TransferredAt *MilliTime `json:"transferredAt"` + TxtVerifiedAt *MilliTime `json:"txtVerifiedAt"` // undocumented + VerificationRecord string `json:"verificationRecord"` // undocumented + Verified bool `json:"verified"` + Zone bool `json:"zone"` // undocumented + Creator struct { + CustomerID *string `json:"customerId"` + Email string `json:"email"` + ID string `json:"id"` + IsDomainReseller *bool `json:"isDomainReseller"` + Username string `json:"username"` + } `json:"creator"` +} + +type DomainRecord struct { + ID string `json:"id"` + Slug string `json:"slug"` + Name string `json:"name"` + Type string `json:"type"` + Value string `json:"value"` + MxPriority *int64 `json:"mxPriority"` + Priority *int64 `json:"priority"` + Creator string `json:"creator"` + // duplicate: Created *MilliTime `json:"created"` + // duplicate: Updated *MilliTime `json:"updated"` + CreatedAt *MilliTime `json:"createdAt"` + UpdatedAt *MilliTime `json:"updatedAt"` + TTL int64 `json:"ttl"` // undocumented +} + +func (v *Client) ListDomains(ctx context.Context, pag *Paginator) ([]Domain, *Paginator, error) { + var list struct { + Domains []Domain `json:"domains"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, domainsURL, until, &list) + if err != nil { + return nil, nil, err + } + return list.Domains, &list.Pagination, nil +} + +func (v *Client) ListDomainRecords(ctx context.Context, domainName string, pag *Paginator) ([]DomainRecord, *Paginator, error) { + u := fmt.Sprintf(domainRecordsURL, domainName) + + var list struct { + Records []DomainRecord `json:"records"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, u, until, &list) + if err != nil { + return nil, nil, err + } + return list.Records, &list.Pagination, nil +} diff --git a/plugins/source/vercel/internal/vercel/millitime.go b/plugins/source/vercel/internal/vercel/millitime.go new file mode 100644 index 00000000000000..f687ab1c248405 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/millitime.go @@ -0,0 +1,31 @@ +package vercel + +import ( + "strconv" + "time" +) + +type MilliTime time.Time + +func (t *MilliTime) MarshalJSON() ([]byte, error) { + if t == nil || time.Time(*t).IsZero() { + return []byte("null"), nil + } + u := time.Time(*t).UnixMilli() + return []byte(strconv.FormatInt(u, 10)), nil +} + +func (t *MilliTime) UnmarshalJSON(data []byte) error { + if string(data) == "null" { + tt := MilliTime(time.Time{}) + *t = tt + return nil + } + + millis, err := strconv.ParseInt(string(data), 10, 64) + if err != nil { + return err + } + *t = MilliTime(time.Unix(0, millis*int64(time.Millisecond))) + return nil +} diff --git a/plugins/source/vercel/internal/vercel/project.go b/plugins/source/vercel/internal/vercel/project.go new file mode 100644 index 00000000000000..dae9b2fd226395 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/project.go @@ -0,0 +1,99 @@ +package vercel + +import ( + "context" + "fmt" +) + +const ( + projectsURL = "/v9/projects" + projectEnvsURL = "/v9/projects/%s/env" +) + +type Project struct { + AccountID string `json:"accountId"` + Analytics interface{} `json:"analytics,omitempty"` + AutoExposeSystemEnvs bool `json:"autoExposeSystemEnvs,omitempty"` + BuildCommand *string `json:"buildCommand,omitempty"` + CommandForIgnoringBuildStep *string `json:"commandForIgnoringBuildStep,omitempty"` + CreatedAt MilliTime `json:"createdAt"` + DevCommand *string `json:"devCommand,omitempty"` + DirectoryListing bool `json:"directoryListing"` + Env []interface{} `json:"env"` + Framework *string `json:"framework,omitempty"` + GitForkProtection *bool `json:"gitForkProtection,omitempty"` + ID string `json:"id"` + InstallCommand *string `json:"installCommand,omitempty"` + Name string `json:"name"` + NodeVersion string `json:"nodeVersion"` + OutputDirectory *string `json:"outputDirectory,omitempty"` + PasswordProtection interface{} `json:"passwordProtection"` + PublicSource *bool `json:"publicSource,omitempty"` + RootDirectory *string `json:"rootDirectory,omitempty"` + ServerlessFunctionRegion *string `json:"serverlessFunctionRegion,omitempty"` + SourceFilesOutsideRootDirectory *bool `json:"sourceFilesOutsideRootDirectory,omitempty"` + UpdatedAt MilliTime `json:"updatedAt"` + Live *bool `json:"live,omitempty"` + Link interface{} `json:"link"` + LatestDeployments []interface{} `json:"latestDeployments"` + Targets interface{} `json:"targets"` + TransferStartedAt *MilliTime `json:"transferStartedAt"` + TransferCompletedAt *MilliTime `json:"transferCompletedAt"` + TransferredFromAccountID *string `json:"transferredFromAccountId"` +} + +type ProjectEnv struct { + ID string `json:"id"` + Target *string `json:"target,omitempty"` + Type *string `json:"type,omitempty"` + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ConfigurationId *string `json:"configurationId,omitempty"` + GitBranch *string `json:"gitBranch,omitempty"` + EdgeConfigId *string `json:"edgeConfigId,omitempty"` + EdgeConfigTokenId *string `json:"edgeConfigTokenId,omitempty"` + Decrypted *bool `json:"decrypted,omitempty"` + System *bool `json:"system,omitempty"` + CreatedAt MilliTime `json:"createdAt"` + CreatedBy string `json:"createdBy"` + UpdatedAt *MilliTime `json:"updatedAt,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` +} + +func (v *Client) ListProjects(ctx context.Context, pag *Paginator) ([]Project, *Paginator, error) { + var list struct { + Projects []Project `json:"projects"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, projectsURL, until, &list) + if err != nil { + return nil, nil, err + } + return list.Projects, &list.Pagination, nil +} + +func (v *Client) ListProjectEnvs(ctx context.Context, projectId string, pag *Paginator) ([]ProjectEnv, *Paginator, error) { + u := fmt.Sprintf(projectEnvsURL, projectId) + + var list struct { + Envs []ProjectEnv `json:"envs"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, u, until, &list) + if err != nil { + return nil, nil, err + } + return list.Envs, &list.Pagination, nil +} diff --git a/plugins/source/vercel/internal/vercel/team.go b/plugins/source/vercel/internal/vercel/team.go new file mode 100644 index 00000000000000..d5ba6dca8d2532 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/team.go @@ -0,0 +1,98 @@ +package vercel + +import ( + "context" + "fmt" +) + +const ( + teamsURL = "/v2/teams" + teamMembersURL = "/v2/teams/%s/members" +) + +type Team struct { + ID string `json:"id"` + Slug string `json:"slug"` + Name *string `json:"name"` + Avatar *string `json:"avatar"` + CreatedAt MilliTime `json:"createdAt"` + // duplicate: Created time.Time `json:"created"` + + Membership interface{} `json:"membership"` + EnablePreviewFeedback interface{} `json:"enablePreviewFeedback"` + CreatorID string `json:"creatorId"` + UpdatedAt *MilliTime `json:"updatedAt"` + PlatformVersion interface{} `json:"platformVersion"` + Billing interface{} `json:"billing"` + Description interface{} `json:"description"` + Profiles []interface{} `json:"profiles"` + StagingPrefix string `json:"stagingPrefix"` + ResourceConfig interface{} `json:"resourceConfig"` + PreviewDeploymentSuffix interface{} `json:"previewDeploymentSuffix"` + SoftBlock interface{} `json:"softBlock"` + RemoteCaching interface{} `json:"remoteCaching"` + EnabledInvoiceItems interface{} `json:"enabledInvoiceItems"` +} + +type TeamMember struct { + Avatar *string `json:"avatar"` + Confirmed bool `json:"confirmed"` + Email string `json:"email"` + Github *MemberSubAccount `json:"github"` + Gitlab *MemberSubAccount `json:"gitlab"` + Bitbucket *MemberSubAccount `json:"bitbucket"` + + Role string `json:"role"` + UID string `json:"uid"` + Username string `json:"username"` + Name *string `json:"name"` + + CreatedAt MilliTime `json:"createdAt"` + AccessRequestedAt *MilliTime `json:"accessRequestedAt"` + JoinedFrom interface{} `json:"joinedFrom"` +} + +type MemberSubAccount struct { + AccountID *string `json:"accountId,omitempty"` + Email *string `json:"email,omitempty"` + Login *string `json:"login,omitempty"` + UserID *int64 `json:"userId,omitempty"` +} + +func (v *Client) ListTeams(ctx context.Context, pag *Paginator) ([]Team, *Paginator, error) { + var list struct { + Teams []Team `json:"teams"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, teamsURL, until, &list) + if err != nil { + return nil, nil, err + } + return list.Teams, &list.Pagination, nil +} + +func (v *Client) ListTeamMembers(ctx context.Context, teamID string, pag *Paginator) ([]TeamMember, *Paginator, error) { + u := fmt.Sprintf(teamMembersURL, teamID) + + var list struct { + TeamMembers []TeamMember `json:"members"` + Pagination Paginator `json:"pagination"` + } + + var until *int64 + if pag != nil { + until = pag.Next + } + + err := v.Request(ctx, u, until, &list) + if err != nil { + return nil, nil, err + } + return list.TeamMembers, &list.Pagination, nil +} diff --git a/plugins/source/vercel/internal/vercel/vercel.go b/plugins/source/vercel/internal/vercel/vercel.go new file mode 100644 index 00000000000000..c0d2ad420ee5c4 --- /dev/null +++ b/plugins/source/vercel/internal/vercel/vercel.go @@ -0,0 +1,101 @@ +package vercel + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "time" +) + +type Client struct { + hc HTTPDoer + baseURL string + token string + teamID string +} + +type Paginator struct { + Count int64 `json:"count"` + Next *int64 `json:"next"` + Prev *int64 `json:"prev"` +} + +type HTTPDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +func New(hc HTTPDoer, baseURL, token, teamID string) *Client { + return &Client{ + hc: hc, + baseURL: baseURL, + token: token, + teamID: teamID, + } +} + +func (v *Client) WithTeamID(teamID string) *Client { + vv := *v + vv.teamID = teamID + return &vv +} + +func (v *Client) Request(ctx context.Context, path string, until *int64, fill interface{}) error { + body, err := v.request(ctx, path, until) + if err != nil { + return err + } + defer body.Close() + + //b, _ := io.ReadAll(body) + //fmt.Println(path, "\n", string(b), "\n") + //return json.Unmarshal(b, &fill) + return json.NewDecoder(body).Decode(&fill) +} + +func (v *Client) request(ctx context.Context, path string, until *int64) (io.ReadCloser, error) { + u := v.baseURL + path + uv := url.Values{} + uv.Set("limit", "100") // Maximum limit + if until != nil { + uv.Set("until", strconv.FormatInt(*until, 10)) + } + if v.teamID != "" { + uv.Set("teamId", v.teamID) + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u+"?"+uv.Encode(), nil) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+v.token) + res, err := v.hc.Do(req) + if err != nil { + return nil, err + } + + if res.StatusCode != http.StatusOK { + defer res.Body.Close() + + if res.StatusCode == http.StatusTooManyRequests { + val := res.Header.Get("X-Ratelimit-Reset") + if val != "" { + t, err := strconv.ParseInt(val, 10, 64) + if err == nil && t > 0 { + ts := time.Unix(t, 0) + val = ts.Format(time.RFC3339) + fmt.Sprintf(" (in %s)", time.Until(ts).Round(time.Second)) + } + + return nil, fmt.Errorf("request to %s failed: %s. Rate limit will reset at: %s", path, res.Status, val) + } + } + + return nil, fmt.Errorf("request to %s failed: %s", path, res.Status) + } + + return res.Body, nil +} diff --git a/plugins/source/vercel/main.go b/plugins/source/vercel/main.go new file mode 100644 index 00000000000000..db1629fe7603af --- /dev/null +++ b/plugins/source/vercel/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/resources/plugin" + "github.com/cloudquery/plugin-sdk/serve" +) + +const sentryDSN = "https://236c9fd8bbe247ab9a10901438d57641@o1396617.ingest.sentry.io/4504316330901504" + +func main() { + serve.Source(plugin.Plugin(), serve.WithSourceSentryDSN(sentryDSN)) +} diff --git a/plugins/source/vercel/resources/plugin/plugin.go b/plugins/source/vercel/resources/plugin/plugin.go new file mode 100644 index 00000000000000..80b60304b59d0d --- /dev/null +++ b/plugins/source/vercel/resources/plugin/plugin.go @@ -0,0 +1,29 @@ +package plugin + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/resources/services/deployment" + "github.com/cloudquery/cloudquery/plugins/source/vercel/resources/services/domain" + "github.com/cloudquery/cloudquery/plugins/source/vercel/resources/services/project" + "github.com/cloudquery/cloudquery/plugins/source/vercel/resources/services/team" + "github.com/cloudquery/plugin-sdk/plugins" + "github.com/cloudquery/plugin-sdk/schema" +) + +var ( + Version = "development" +) + +func Plugin() *plugins.SourcePlugin { + return plugins.NewSourcePlugin( + "vercel", + Version, + []*schema.Table{ + domain.Domains(), + team.Teams(), + project.Projects(), + deployment.Deployments(), + }, + client.Configure, + ) +} diff --git a/plugins/source/vercel/resources/services/deployment/deployment_checks.go b/plugins/source/vercel/resources/services/deployment/deployment_checks.go new file mode 100644 index 00000000000000..e311b708d1b9ca --- /dev/null +++ b/plugins/source/vercel/resources/services/deployment/deployment_checks.go @@ -0,0 +1,89 @@ +// Code generated by codegen; DO NOT EDIT. + +package deployment + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func DeploymentChecks() *schema.Table { + return &schema.Table{ + Name: "vercel_deployment_checks", + Resolver: fetchDeploymentChecks, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "deployment_id", + Type: schema.TypeString, + Resolver: schema.ParentColumnResolver("uid"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "completed_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CompletedAt"), + }, + { + Name: "conclusion", + Type: schema.TypeString, + Resolver: schema.PathResolver("Conclusion"), + }, + { + Name: "details_url", + Type: schema.TypeString, + Resolver: schema.PathResolver("DetailsURL"), + }, + { + Name: "integration_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("IntegrationID"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "path", + Type: schema.TypeString, + Resolver: schema.PathResolver("Path"), + }, + { + Name: "rererequestable", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Rerequestable"), + }, + { + Name: "started_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("StartedAt"), + }, + { + Name: "updated_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("UpdatedAt"), + }, + { + Name: "status", + Type: schema.TypeString, + Resolver: schema.PathResolver("Status"), + }, + }, + } +} diff --git a/plugins/source/vercel/resources/services/deployment/deployment_checks_fetch.go b/plugins/source/vercel/resources/services/deployment/deployment_checks_fetch.go new file mode 100644 index 00000000000000..736529bbc0f266 --- /dev/null +++ b/plugins/source/vercel/resources/services/deployment/deployment_checks_fetch.go @@ -0,0 +1,31 @@ +package deployment + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchDeploymentChecks(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + d := parent.Item.(vercel.Deployment) + + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListDeploymentChecks(ctx, d.UID, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/deployment/deployments.go b/plugins/source/vercel/resources/services/deployment/deployments.go new file mode 100644 index 00000000000000..423b9004a8ec31 --- /dev/null +++ b/plugins/source/vercel/resources/services/deployment/deployments.go @@ -0,0 +1,90 @@ +// Code generated by codegen; DO NOT EDIT. + +package deployment + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func Deployments() *schema.Table { + return &schema.Table{ + Name: "vercel_deployments", + Resolver: fetchDeployments, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "uid", + Type: schema.TypeString, + Resolver: schema.PathResolver("UID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "url", + Type: schema.TypeString, + Resolver: schema.PathResolver("URL"), + }, + { + Name: "source", + Type: schema.TypeString, + Resolver: schema.PathResolver("Source"), + }, + { + Name: "state", + Type: schema.TypeString, + Resolver: schema.PathResolver("State"), + }, + { + Name: "type", + Type: schema.TypeString, + Resolver: schema.PathResolver("Type"), + }, + { + Name: "inspector_url", + Type: schema.TypeString, + Resolver: schema.PathResolver("InspectorURL"), + }, + { + Name: "is_rollback_candidate", + Type: schema.TypeBool, + Resolver: schema.PathResolver("IsRollbackCandidate"), + }, + { + Name: "ready", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("Ready"), + }, + { + Name: "checks_state", + Type: schema.TypeString, + Resolver: schema.PathResolver("ChecksState"), + }, + { + Name: "checks_conclusion", + Type: schema.TypeString, + Resolver: schema.PathResolver("ChecksConclusion"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "building_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("BuildingAt"), + }, + }, + + Relations: []*schema.Table{ + DeploymentChecks(), + }, + } +} diff --git a/plugins/source/vercel/resources/services/deployment/deployments_fetch.go b/plugins/source/vercel/resources/services/deployment/deployments_fetch.go new file mode 100644 index 00000000000000..adbeefc4e272df --- /dev/null +++ b/plugins/source/vercel/resources/services/deployment/deployments_fetch.go @@ -0,0 +1,29 @@ +package deployment + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchDeployments(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListDeployments(ctx, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/deployment/deployments_mock_test.go b/plugins/source/vercel/resources/services/deployment/deployments_mock_test.go new file mode 100644 index 00000000000000..dfe881b8044693 --- /dev/null +++ b/plugins/source/vercel/resources/services/deployment/deployments_mock_test.go @@ -0,0 +1,77 @@ +package deployment + +import ( + "encoding/json" + "net/http" + "testing" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/faker" + "github.com/gorilla/mux" +) + +func createDeployments(router *mux.Router) error { + var vd vercel.Deployment + if err := faker.FakeObject(&vd); err != nil { + return err + } + t := vercel.MilliTime(time.Now()) + vd.CreatedAt = t + vd.Ready = &t + vd.BuildingAt = t + + var vc vercel.DeploymentCheck + if err := faker.FakeObject(&vc); err != nil { + return err + } + vc.CreatedAt = t + vc.UpdatedAt = &t + vc.StartedAt = &t + vc.CompletedAt = &t + + router.HandleFunc("/v6/deployments", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Deployments []vercel.Deployment `json:"deployments"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Deployments: []vercel.Deployment{vd}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + router.HandleFunc("/v1/deployments/"+vd.UID+"/checks", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Checks []vercel.DeploymentCheck `json:"checks"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Checks: []vercel.DeploymentCheck{vc}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + return nil +} + +func TestDeployments(t *testing.T) { + client.MockTestHelper(t, Deployments(), createDeployments) +} diff --git a/plugins/source/vercel/resources/services/domain/domain_records.go b/plugins/source/vercel/resources/services/domain/domain_records.go new file mode 100644 index 00000000000000..185454d6288b57 --- /dev/null +++ b/plugins/source/vercel/resources/services/domain/domain_records.go @@ -0,0 +1,84 @@ +// Code generated by codegen; DO NOT EDIT. + +package domain + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func DomainRecords() *schema.Table { + return &schema.Table{ + Name: "vercel_domain_records", + Resolver: fetchDomainRecords, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "domain_name", + Type: schema.TypeString, + Resolver: schema.ParentColumnResolver("name"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "slug", + Type: schema.TypeString, + Resolver: schema.PathResolver("Slug"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "type", + Type: schema.TypeString, + Resolver: schema.PathResolver("Type"), + }, + { + Name: "value", + Type: schema.TypeString, + Resolver: schema.PathResolver("Value"), + }, + { + Name: "mx_priority", + Type: schema.TypeInt, + Resolver: schema.PathResolver("MxPriority"), + }, + { + Name: "priority", + Type: schema.TypeInt, + Resolver: schema.PathResolver("Priority"), + }, + { + Name: "creator", + Type: schema.TypeString, + Resolver: schema.PathResolver("Creator"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "updated_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("UpdatedAt"), + }, + { + Name: "ttl", + Type: schema.TypeInt, + Resolver: schema.PathResolver("TTL"), + }, + }, + } +} diff --git a/plugins/source/vercel/resources/services/domain/domain_records_fetch.go b/plugins/source/vercel/resources/services/domain/domain_records_fetch.go new file mode 100644 index 00000000000000..42978b6c2512c6 --- /dev/null +++ b/plugins/source/vercel/resources/services/domain/domain_records_fetch.go @@ -0,0 +1,31 @@ +package domain + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchDomainRecords(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + dom := parent.Item.(vercel.Domain) + + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListDomainRecords(ctx, dom.Name, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/domain/domains.go b/plugins/source/vercel/resources/services/domain/domains.go new file mode 100644 index 00000000000000..9dfadb56f90601 --- /dev/null +++ b/plugins/source/vercel/resources/services/domain/domains.go @@ -0,0 +1,130 @@ +// Code generated by codegen; DO NOT EDIT. + +package domain + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func Domains() *schema.Table { + return &schema.Table{ + Name: "vercel_domains", + Resolver: fetchDomains, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "bought_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("BoughtAt"), + }, + { + Name: "cdn_enabled", + Type: schema.TypeBool, + Resolver: schema.PathResolver("CdnEnabled"), + }, + { + Name: "config_verified_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("ConfigVerifiedAt"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "expires_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("ExpiresAt"), + }, + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "intended_nameservers", + Type: schema.TypeStringArray, + Resolver: schema.PathResolver("IntendedNameservers"), + }, + { + Name: "custom_nameservers", + Type: schema.TypeStringArray, + Resolver: schema.PathResolver("CustomNameservers"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "nameservers", + Type: schema.TypeStringArray, + Resolver: schema.PathResolver("Nameservers"), + }, + { + Name: "ns_verified_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("NsVerifiedAt"), + }, + { + Name: "ordered_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("OrderedAt"), + }, + { + Name: "renew", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Renew"), + }, + { + Name: "service_type", + Type: schema.TypeString, + Resolver: schema.PathResolver("ServiceType"), + }, + { + Name: "transfer_started_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("TransferStartedAt"), + }, + { + Name: "transferred_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("TransferredAt"), + }, + { + Name: "txt_verified_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("TxtVerifiedAt"), + }, + { + Name: "verification_record", + Type: schema.TypeString, + Resolver: schema.PathResolver("VerificationRecord"), + }, + { + Name: "verified", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Verified"), + }, + { + Name: "zone", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Zone"), + }, + { + Name: "creator", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Creator"), + }, + }, + + Relations: []*schema.Table{ + DomainRecords(), + }, + } +} diff --git a/plugins/source/vercel/resources/services/domain/domains_fetch.go b/plugins/source/vercel/resources/services/domain/domains_fetch.go new file mode 100644 index 00000000000000..e8e6814cd616ae --- /dev/null +++ b/plugins/source/vercel/resources/services/domain/domains_fetch.go @@ -0,0 +1,29 @@ +package domain + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchDomains(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListDomains(ctx, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/domain/domains_mock_test.go b/plugins/source/vercel/resources/services/domain/domains_mock_test.go new file mode 100644 index 00000000000000..b7202d7bb5bd0b --- /dev/null +++ b/plugins/source/vercel/resources/services/domain/domains_mock_test.go @@ -0,0 +1,81 @@ +package domain + +import ( + "encoding/json" + "net/http" + "testing" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/faker" + "github.com/gorilla/mux" +) + +func createDomains(router *mux.Router) error { + var vd vercel.Domain + if err := faker.FakeObject(&vd); err != nil { + return err + } + t := vercel.MilliTime(time.Now()) + vd.CreatedAt = t + vd.BoughtAt = &t + vd.ConfigVerifiedAt = &t + vd.ExpiresAt = &t + vd.NsVerifiedAt = &t + vd.OrderedAt = &t + vd.TransferStartedAt = &t + vd.TransferredAt = &t + vd.TxtVerifiedAt = &t + + var vr vercel.DomainRecord + if err := faker.FakeObject(&vr); err != nil { + return err + } + vr.CreatedAt = &t + vr.UpdatedAt = &t + + router.HandleFunc("/v5/domains", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Domains []vercel.Domain `json:"domains"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Domains: []vercel.Domain{vd}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + router.HandleFunc("/v4/domains/"+vd.Name+"/records", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Records []vercel.DomainRecord `json:"records"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Records: []vercel.DomainRecord{vr}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + return nil +} + +func TestDomains(t *testing.T) { + client.MockTestHelper(t, Domains(), createDomains) +} diff --git a/plugins/source/vercel/resources/services/project/project_envs.go b/plugins/source/vercel/resources/services/project/project_envs.go new file mode 100644 index 00000000000000..4cf3d59dcb185e --- /dev/null +++ b/plugins/source/vercel/resources/services/project/project_envs.go @@ -0,0 +1,104 @@ +// Code generated by codegen; DO NOT EDIT. + +package project + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func ProjectEnvs() *schema.Table { + return &schema.Table{ + Name: "vercel_project_envs", + Resolver: fetchProjectEnvs, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "project_id", + Type: schema.TypeString, + Resolver: schema.ParentColumnResolver("id"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "target", + Type: schema.TypeString, + Resolver: schema.PathResolver("Target"), + }, + { + Name: "type", + Type: schema.TypeString, + Resolver: schema.PathResolver("Type"), + }, + { + Name: "key", + Type: schema.TypeString, + Resolver: schema.PathResolver("Key"), + }, + { + Name: "value", + Type: schema.TypeString, + Resolver: schema.PathResolver("Value"), + }, + { + Name: "configuration_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ConfigurationId"), + }, + { + Name: "git_branch", + Type: schema.TypeString, + Resolver: schema.PathResolver("GitBranch"), + }, + { + Name: "edge_config_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("EdgeConfigId"), + }, + { + Name: "edge_config_token_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("EdgeConfigTokenId"), + }, + { + Name: "decrypted", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Decrypted"), + }, + { + Name: "system", + Type: schema.TypeBool, + Resolver: schema.PathResolver("System"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "created_by", + Type: schema.TypeString, + Resolver: schema.PathResolver("CreatedBy"), + }, + { + Name: "updated_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("UpdatedAt"), + }, + { + Name: "updated_by", + Type: schema.TypeString, + Resolver: schema.PathResolver("UpdatedBy"), + }, + }, + } +} diff --git a/plugins/source/vercel/resources/services/project/project_envs_fetch.go b/plugins/source/vercel/resources/services/project/project_envs_fetch.go new file mode 100644 index 00000000000000..7c09daaa386871 --- /dev/null +++ b/plugins/source/vercel/resources/services/project/project_envs_fetch.go @@ -0,0 +1,31 @@ +package project + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchProjectEnvs(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + proj := parent.Item.(vercel.Project) + + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListProjectEnvs(ctx, proj.ID, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/project/projects.go b/plugins/source/vercel/resources/services/project/projects.go new file mode 100644 index 00000000000000..978204dab93ffa --- /dev/null +++ b/plugins/source/vercel/resources/services/project/projects.go @@ -0,0 +1,150 @@ +// Code generated by codegen; DO NOT EDIT. + +package project + +import ( + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/plugin-sdk/schema" +) + +func Projects() *schema.Table { + return &schema.Table{ + Name: "vercel_projects", + Resolver: fetchProjects, + Multiplex: client.TeamMultiplex, + Columns: []schema.Column{ + { + Name: "account_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("AccountID"), + }, + { + Name: "auto_expose_system_envs", + Type: schema.TypeBool, + Resolver: schema.PathResolver("AutoExposeSystemEnvs"), + }, + { + Name: "build_command", + Type: schema.TypeString, + Resolver: schema.PathResolver("BuildCommand"), + }, + { + Name: "command_for_ignoring_build_step", + Type: schema.TypeString, + Resolver: schema.PathResolver("CommandForIgnoringBuildStep"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "dev_command", + Type: schema.TypeString, + Resolver: schema.PathResolver("DevCommand"), + }, + { + Name: "directory_listing", + Type: schema.TypeBool, + Resolver: schema.PathResolver("DirectoryListing"), + }, + { + Name: "env", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Env"), + }, + { + Name: "framework", + Type: schema.TypeString, + Resolver: schema.PathResolver("Framework"), + }, + { + Name: "git_fork_protection", + Type: schema.TypeBool, + Resolver: schema.PathResolver("GitForkProtection"), + }, + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "install_command", + Type: schema.TypeString, + Resolver: schema.PathResolver("InstallCommand"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "node_version", + Type: schema.TypeString, + Resolver: schema.PathResolver("NodeVersion"), + }, + { + Name: "output_directory", + Type: schema.TypeString, + Resolver: schema.PathResolver("OutputDirectory"), + }, + { + Name: "public_source", + Type: schema.TypeBool, + Resolver: schema.PathResolver("PublicSource"), + }, + { + Name: "root_directory", + Type: schema.TypeString, + Resolver: schema.PathResolver("RootDirectory"), + }, + { + Name: "serverless_function_region", + Type: schema.TypeString, + Resolver: schema.PathResolver("ServerlessFunctionRegion"), + }, + { + Name: "source_files_outside_root_directory", + Type: schema.TypeBool, + Resolver: schema.PathResolver("SourceFilesOutsideRootDirectory"), + }, + { + Name: "updated_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("UpdatedAt"), + }, + { + Name: "live", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Live"), + }, + { + Name: "latest_deployments", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("LatestDeployments"), + }, + { + Name: "transfer_started_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("TransferStartedAt"), + }, + { + Name: "transfer_completed_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("TransferCompletedAt"), + }, + { + Name: "transferred_from_account_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("TransferredFromAccountID"), + }, + }, + + Relations: []*schema.Table{ + ProjectEnvs(), + }, + } +} diff --git a/plugins/source/vercel/resources/services/project/projects_fetch.go b/plugins/source/vercel/resources/services/project/projects_fetch.go new file mode 100644 index 00000000000000..d8cedb53d42364 --- /dev/null +++ b/plugins/source/vercel/resources/services/project/projects_fetch.go @@ -0,0 +1,29 @@ +package project + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchProjects(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListProjects(ctx, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/project/projects_mock_test.go b/plugins/source/vercel/resources/services/project/projects_mock_test.go new file mode 100644 index 00000000000000..30bab4f78aa5a4 --- /dev/null +++ b/plugins/source/vercel/resources/services/project/projects_mock_test.go @@ -0,0 +1,76 @@ +package project + +import ( + "encoding/json" + "net/http" + "testing" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/faker" + "github.com/gorilla/mux" +) + +func createProjects(router *mux.Router) error { + var vp vercel.Project + if err := faker.FakeObject(&vp); err != nil { + return err + } + t := vercel.MilliTime(time.Now()) + vp.CreatedAt = t + vp.UpdatedAt = t + vp.TransferStartedAt = &t + vp.TransferCompletedAt = &t + + var ve vercel.ProjectEnv + if err := faker.FakeObject(&ve); err != nil { + return err + } + ve.CreatedAt = t + ve.UpdatedAt = &t + + router.HandleFunc("/v9/projects", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Projects []vercel.Project `json:"projects"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Projects: []vercel.Project{vp}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + router.HandleFunc("/v9/projects/"+vp.ID+"/env", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Envs []vercel.ProjectEnv `json:"envs"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Envs: []vercel.ProjectEnv{ve}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + return nil +} + +func TestProjects(t *testing.T) { + client.MockTestHelper(t, Projects(), createProjects) +} diff --git a/plugins/source/vercel/resources/services/team/team_members.go b/plugins/source/vercel/resources/services/team/team_members.go new file mode 100644 index 00000000000000..1d04c279d66552 --- /dev/null +++ b/plugins/source/vercel/resources/services/team/team_members.go @@ -0,0 +1,87 @@ +// Code generated by codegen; DO NOT EDIT. + +package team + +import ( + "github.com/cloudquery/plugin-sdk/schema" +) + +func TeamMembers() *schema.Table { + return &schema.Table{ + Name: "vercel_team_members", + Resolver: fetchTeamMembers, + Columns: []schema.Column{ + { + Name: "team_id", + Type: schema.TypeString, + Resolver: schema.ParentColumnResolver("id"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "avatar", + Type: schema.TypeString, + Resolver: schema.PathResolver("Avatar"), + }, + { + Name: "confirmed", + Type: schema.TypeBool, + Resolver: schema.PathResolver("Confirmed"), + }, + { + Name: "email", + Type: schema.TypeString, + Resolver: schema.PathResolver("Email"), + }, + { + Name: "github", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Github"), + }, + { + Name: "gitlab", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Gitlab"), + }, + { + Name: "bitbucket", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Bitbucket"), + }, + { + Name: "role", + Type: schema.TypeString, + Resolver: schema.PathResolver("Role"), + }, + { + Name: "uid", + Type: schema.TypeString, + Resolver: schema.PathResolver("UID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "username", + Type: schema.TypeString, + Resolver: schema.PathResolver("Username"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "access_requested_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("AccessRequestedAt"), + }, + }, + } +} diff --git a/plugins/source/vercel/resources/services/team/team_members_fetch.go b/plugins/source/vercel/resources/services/team/team_members_fetch.go new file mode 100644 index 00000000000000..97bbe1e85a0802 --- /dev/null +++ b/plugins/source/vercel/resources/services/team/team_members_fetch.go @@ -0,0 +1,31 @@ +package team + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchTeamMembers(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + team := parent.Item.(vercel.Team) + + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListTeamMembers(ctx, team.ID, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/team/teams.go b/plugins/source/vercel/resources/services/team/teams.go new file mode 100644 index 00000000000000..2f6c98049029f5 --- /dev/null +++ b/plugins/source/vercel/resources/services/team/teams.go @@ -0,0 +1,68 @@ +// Code generated by codegen; DO NOT EDIT. + +package team + +import ( + "github.com/cloudquery/plugin-sdk/schema" +) + +func Teams() *schema.Table { + return &schema.Table{ + Name: "vercel_teams", + Resolver: fetchTeams, + Columns: []schema.Column{ + { + Name: "id", + Type: schema.TypeString, + Resolver: schema.PathResolver("ID"), + CreationOptions: schema.ColumnCreationOptions{ + PrimaryKey: true, + }, + }, + { + Name: "slug", + Type: schema.TypeString, + Resolver: schema.PathResolver("Slug"), + }, + { + Name: "name", + Type: schema.TypeString, + Resolver: schema.PathResolver("Name"), + }, + { + Name: "avatar", + Type: schema.TypeString, + Resolver: schema.PathResolver("Avatar"), + }, + { + Name: "created_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("CreatedAt"), + }, + { + Name: "creator_id", + Type: schema.TypeString, + Resolver: schema.PathResolver("CreatorID"), + }, + { + Name: "updated_at", + Type: schema.TypeTimestamp, + Resolver: schema.PathResolver("UpdatedAt"), + }, + { + Name: "profiles", + Type: schema.TypeJSON, + Resolver: schema.PathResolver("Profiles"), + }, + { + Name: "staging_prefix", + Type: schema.TypeString, + Resolver: schema.PathResolver("StagingPrefix"), + }, + }, + + Relations: []*schema.Table{ + TeamMembers(), + }, + } +} diff --git a/plugins/source/vercel/resources/services/team/teams_fetch.go b/plugins/source/vercel/resources/services/team/teams_fetch.go new file mode 100644 index 00000000000000..a3d1f67fba02da --- /dev/null +++ b/plugins/source/vercel/resources/services/team/teams_fetch.go @@ -0,0 +1,29 @@ +package team + +import ( + "context" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/schema" +) + +func fetchTeams(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { + cl := meta.(*client.Client) + + var pg vercel.Paginator + + for { + list, p, err := cl.Services.ListTeams(ctx, &pg) + if err != nil { + return err + } + res <- list + + if p.Next == nil { + break + } + pg.Next = p.Next + } + return nil +} diff --git a/plugins/source/vercel/resources/services/team/teams_mock_test.go b/plugins/source/vercel/resources/services/team/teams_mock_test.go new file mode 100644 index 00000000000000..8cf8ff758901ed --- /dev/null +++ b/plugins/source/vercel/resources/services/team/teams_mock_test.go @@ -0,0 +1,74 @@ +package team + +import ( + "encoding/json" + "net/http" + "testing" + "time" + + "github.com/cloudquery/cloudquery/plugins/source/vercel/client" + "github.com/cloudquery/cloudquery/plugins/source/vercel/internal/vercel" + "github.com/cloudquery/plugin-sdk/faker" + "github.com/gorilla/mux" +) + +func createTeams(router *mux.Router) error { + var vt vercel.Team + if err := faker.FakeObject(&vt); err != nil { + return err + } + t := vercel.MilliTime(time.Now()) + vt.CreatedAt = t + vt.UpdatedAt = &t + + var vm vercel.TeamMember + if err := faker.FakeObject(&vm); err != nil { + return err + } + vm.CreatedAt = t + vm.AccessRequestedAt = &t + + router.HandleFunc("/v2/teams", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Teams []vercel.Team `json:"teams"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Teams: []vercel.Team{vt}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + router.HandleFunc("/v2/teams/"+vt.ID+"/members", func(w http.ResponseWriter, r *http.Request) { + list := struct { + Members []vercel.TeamMember `json:"members"` + Pagination vercel.Paginator `json:"pagination"` + }{ + Members: []vercel.TeamMember{vm}, + } + + b, err := json.Marshal(&list) + if err != nil { + http.Error(w, "unable to marshal request: "+err.Error(), http.StatusBadRequest) + return + } + if _, err := w.Write(b); err != nil { + http.Error(w, "failed to write", http.StatusBadRequest) + return + } + }) + + return nil +} + +func TestTeams(t *testing.T) { + client.MockTestHelper(t, Teams(), createTeams) +} diff --git a/website/pages/docs/plugins/sources/_meta.json b/website/pages/docs/plugins/sources/_meta.json index 9b0f776d589e69..fa87abdb98c485 100644 --- a/website/pages/docs/plugins/sources/_meta.json +++ b/website/pages/docs/plugins/sources/_meta.json @@ -11,5 +11,6 @@ "heroku": "Heroku", "k8s": "Kubernetes", "okta": "Okta", - "terraform": "Terraform" + "terraform": "Terraform", + "vercel": "Vercel" } diff --git a/website/pages/docs/plugins/sources/overview.mdx b/website/pages/docs/plugins/sources/overview.mdx index c9801bc9937585..e7f2030dac6c52 100644 --- a/website/pages/docs/plugins/sources/overview.mdx +++ b/website/pages/docs/plugins/sources/overview.mdx @@ -29,6 +29,7 @@ Official source plugins follow [release stages](#source-plugin-release-stages). { name: "Gandi", stage:"Preview" }, { name: "Datadog", stage:"Preview" }, { name: "Tailscale", stage:"Preview" }, + { name: "Vercel", stage:"Preview" }, ] } /> diff --git a/website/pages/docs/plugins/sources/vercel/_meta.json b/website/pages/docs/plugins/sources/vercel/_meta.json new file mode 100644 index 00000000000000..5ac830ef109958 --- /dev/null +++ b/website/pages/docs/plugins/sources/vercel/_meta.json @@ -0,0 +1,5 @@ +{ + "overview": "Overview", + "configuration": "Configuration", + "tables": "Tables" +} diff --git a/website/pages/docs/plugins/sources/vercel/configuration.md b/website/pages/docs/plugins/sources/vercel/configuration.md new file mode 100644 index 00000000000000..c97f22e14d835b --- /dev/null +++ b/website/pages/docs/plugins/sources/vercel/configuration.md @@ -0,0 +1,42 @@ +# Vercel Source Plugin Configuration Reference + +## Example + +This example syncs from Vercel to a Postgres destination, using API Key authentication. The (top level) source spec section is described in the [Source Spec Reference](https://www.cloudquery.io/docs/reference/source-spec). + +```yaml +kind: source +# Common source-plugin configuration +spec: + name: vercel + path: cloudquery/vercel + version: "v1.0.0" # latest version of vercel plugin + tables: ["*"] + destinations: ["postgresql"] + skip_tables: + - vercel_deployment_checks + + # Vercel specific configuration + spec: + access_token: "" + team_ids: + - "" + - "" + +``` + +## Vercel Spec + +This is the (nested) spec used by the Vercel source plugin: + +- `access_token` (string, required): + An access token for your Vercel account. Get yours from [Vercel's Account Tokens Page](https://vercel.com/account/tokens). + +- `team_ids` (list of string, optional): + A list of team IDs to sync. If not specified, all teams will be synced. To find the ID of a specific team, refer to [Vercel Docs](https://vercel.com/docs/teams-and-accounts/create-or-join-a-team#find-your-team-id). + +- `endpoint_url` (string, optional. Default: `https://api.vercel.com`): + API endpoint URL to use. For Vercel's production API, this should be `https://api.vercel.com`. + +- `timeout_secs` (integer in seconds, optional. Default: 5): + Timeout for requests against the Vercel REST API. diff --git a/website/pages/docs/plugins/sources/vercel/overview.md b/website/pages/docs/plugins/sources/vercel/overview.md new file mode 100644 index 00000000000000..053dc375e23bf4 --- /dev/null +++ b/website/pages/docs/plugins/sources/vercel/overview.md @@ -0,0 +1,43 @@ +# Vercel Source Plugin + +import { getLatestVersion } from "../../../../../utils/versions"; +import { Badge } from "../../../../../components/Badge"; + + + +The CloudQuery Vercel plugin pulls configuration out of Vercel resources and loads it into any supported CloudQuery destination (e.g. PostgreSQL). + +## Authentication + +In order to fetch information from Vercel, `cloudquery` needs to be authenticated. An access token is required for authentication. You can create a new access token in [Vercel's Account Tokens Page](https://vercel.com/account/tokens). + +## Query Examples + +### Detect domain registrations that will expire soon + +```sql +select name, expires_at, date_trunc('day', expires_at - current_timestamp) as days_left from vercel_domains where (expires_at - interval '90 day') < current_timestamp order by 1; +``` + +### Get all name servers in Vercel domains + +```sql +select name, intended_nameservers, custom_nameservers, nameservers from vercel_domains order by 1; +``` + +### Get all Vercel team members + +```sql +select t.name, u.username, u.name, u.role from vercel_teams t join vercel_team_members u on u.team_id=t.id order by 1, 2; +``` + +### Get all Vercel projects + +```sql +select name from vercel_projects order by 1; +``` +### Get Vercel deployment statistics + +```sql +select state, count(1) from vercel_deployments group by 1 order by 2 desc; +``` diff --git a/website/pages/docs/plugins/sources/vercel/tables.md b/website/pages/docs/plugins/sources/vercel/tables.md new file mode 100644 index 00000000000000..3aea3a9f6477b0 --- /dev/null +++ b/website/pages/docs/plugins/sources/vercel/tables.md @@ -0,0 +1,10 @@ +# Source Plugin: vercel +## Tables +- [vercel_domains](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_domains.md) + - [vercel_domain_records](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_domain_records.md) +- [vercel_teams](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_teams.md) + - [vercel_team_members](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_team_members.md) +- [vercel_projects](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_projects.md) + - [vercel_project_envs](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_project_envs.md) +- [vercel_deployments](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_deployments.md) + - [vercel_deployment_checks](https://github.com/cloudquery/cloudquery/blob/main/plugins/source/vercel/docs/tables/vercel_deployment_checks.md) \ No newline at end of file