diff --git a/.github/workflows/lunatrace.yaml b/.github/workflows/lunatrace.yaml index ed9f412b2..09899ca9a 100644 --- a/.github/workflows/lunatrace.yaml +++ b/.github/workflows/lunatrace.yaml @@ -77,20 +77,24 @@ jobs: - run: docker-compose logs working-directory: lunatrace/bsl - - run: |- + - name: Generate Files + run: |- git status (cd lunatrace/bsl/backend && yarn generate) (cd lunatrace/bsl/frontend && yarn generate) go generate ./... || true git status - + + - name: Check Generated Files + run: |- DIFF=`git diff -p -- . ':(exclude)lunatrace/schema.graphql'` if [[ ! -z "$DIFF" ]]; then echo "# Generated files don't match" >> $GITHUB_STEP_SUMMARY echo "run yarn generate" >> $GITHUB_STEP_SUMMARY echo '```diff' >> $GITHUB_STEP_SUMMARY - echo "$DIFF" >> $GITHUB_STEP_SUMMARY + echo "$DIFF" | tee -a $GITHUB_STEP_SUMMARY + echo "::error Generated files do not match. See job summary for diff." echo '```' >> $GITHUB_STEP_SUMMARY exit 1 fi diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 156ae2aaa..ef66760be 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,29 +1,18 @@ - - - - - - - - - - - + + + + - \ No newline at end of file + diff --git a/go.mod b/go.mod index 464a4b633..7a5788051 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,10 @@ module github.com/lunasec-io/lunasec -go 1.17 +go 1.18 + +// genqlient doesn't have support for omitempty yet, use a patched version +// https://github.com/Khan/genqlient/issues/190 +replace github.com/Khan/genqlient => github.com/ajvpot/genqlient v0.4.1-0.20220601222338-9a6fa43de94e require ( github.com/Joker/jade v1.1.3 @@ -21,7 +25,6 @@ require ( github.com/google/go-containerregistry v0.8.1-0.20220209165246-a44adc326839 github.com/google/licensecheck v0.3.1 github.com/google/uuid v1.3.0 - github.com/ipfans/fxlogger v0.1.0 github.com/jpillora/backoff v1.0.0 github.com/likexian/whois-parser v1.22.0 github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 @@ -69,7 +72,7 @@ require ( github.com/ThalesIgnite/crypto11 v1.2.5 // indirect github.com/acobaugh/osrelease v0.1.0 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect - github.com/agnivade/levenshtein v1.1.0 // indirect + github.com/agnivade/levenshtein v1.1.1 // indirect github.com/alexflint/go-arg v1.4.2 // indirect github.com/alexflint/go-scalar v1.0.0 // indirect github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb // indirect @@ -234,7 +237,7 @@ require ( github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect github.com/ulikunitz/xz v0.5.10 // indirect github.com/vbatts/tar-split v0.11.2 // indirect - github.com/vektah/gqlparser/v2 v2.3.1 // indirect + github.com/vektah/gqlparser/v2 v2.4.1 // indirect github.com/vifraa/gopom v0.1.0 // indirect github.com/wagoodman/go-partybus v0.0.0-20210627031916-db1f5573bbc5 // indirect github.com/wagoodman/go-progress v0.0.0-20200807221327-51d465df1451 // indirect diff --git a/go.sum b/go.sum index 277e62398..669a3e823 100644 --- a/go.sum +++ b/go.sum @@ -109,7 +109,7 @@ cuelang.org/go v0.4.2/go.mod h1:P09/R4UfAEzLkV9DXxwlxQnIZbkaT4uIhiEgs6Vsz2Q= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/99designs/gqlgen v0.14.0/go.mod h1:S7z4boV+Nx4VvzMUpVrY/YuHjFX4n7rDyuTqvAkuoRE= +github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o= github.com/AdaLogics/go-fuzz-headers v0.0.0-20211102141018-f7be0cbad29c/go.mod h1:WpB7kf89yJUETZxQnP1kgYPNwlT2jjdDYUCoxVggM3g= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Antonboom/errname v0.1.5/go.mod h1:DugbBstvPFQbv/5uLcRRzfrNqKE9tVdVCqWCLp6Cifo= @@ -203,8 +203,6 @@ github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= -github.com/Khan/genqlient v0.4.0 h1:4XImbzhBtaIFmwGPwEKdnx3TuGOX0GZ0hcW/idTzwts= -github.com/Khan/genqlient v0.4.0/go.mod h1:te6aw+Ronw1j+PRVKmVPEFA36IsLG2wK0Uy6jPZ55To= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -277,9 +275,12 @@ github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/agnivade/levenshtein v1.1.0 h1:n6qGwyHG61v3ABce1rPVZklEYRT8NFpCMrpZdBUbYGM= github.com/agnivade/levenshtein v1.1.0/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajvpot/genqlient v0.4.1-0.20220601222338-9a6fa43de94e h1:BH26CidysvtVEIhkuPun1gMGuzQnk+w52q0vBAaCKBQ= +github.com/ajvpot/genqlient v0.4.1-0.20220601222338-9a6fa43de94e/go.mod h1:zV+Ip2a2/xaPCdLm09qvNyNqKQGLXSqvfQs591IPiJE= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/jsonschema v0.0.0-20180308105923-f2c93856175a/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= github.com/alecthomas/jsonschema v0.0.0-20210301060011-54c507b6f074/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= @@ -1314,11 +1315,9 @@ github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254/go.mod h1: github.com/goreleaser/goreleaser v0.134.0/go.mod h1:ZT6Y2rSYa6NxQzIsdfWWNWAlYGXGbreo66NmE+3X3WQ= github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= -github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -1494,8 +1493,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a/go.mod h1:9GkyshztGufsdPQWjH+ifgnIr3xNUL5syI70g2dzU1o= -github.com/ipfans/fxlogger v0.1.0 h1:eWyl5LIzQ8kzrBDsPGklmFoRgNNfz2h/MBpmkoyl7vU= -github.com/ipfans/fxlogger v0.1.0/go.mod h1:w5ps0NJnl3sSkvv0PSGQEwMtDL8upORfThYbdQREBXo= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= @@ -1614,6 +1611,7 @@ github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -1696,6 +1694,7 @@ github.com/likexian/whois-parser v1.22.0/go.mod h1:2bJqtH4tNPanBvOp/3Kj3Sd12S9vx github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc= github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 h1:wIONC+HMNRqmWBjuMxhatuSzHaljStc4gjDeKycxy0A= github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3/go.mod h1:37YR9jabpiIxsb8X9VCIx8qFOjTDIIrIHHODa8C4gz0= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= @@ -1730,7 +1729,7 @@ github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859 github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= -github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/matryer/moq v0.2.3/go.mod h1:9RtPYjTnH1bSBIkpvtHkFN7nbWAnO7oRpdJkEIn6UtE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -1821,8 +1820,8 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4 github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -2116,7 +2115,6 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= @@ -2125,7 +2123,6 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc= github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -2176,9 +2173,7 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sigstore/cosign v1.7.2 h1:kFC0jmPUDfoMOhuL1hHGi+ZdJkeF0qpPYZWmMqKMV+4= github.com/sigstore/cosign v1.7.2/go.mod h1:v7UKVCOvw9HD5WlApAotoVfjwUzddwg6InJTTshkaOg= github.com/sigstore/fulcio v0.1.2-0.20220114150912-86a2036f9bc7/go.mod h1:ANQivY/lfOp9hN92S813LEthkm/kit96hzeIF3SNoZA= @@ -2282,7 +2277,6 @@ github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -2379,12 +2373,11 @@ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= -github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= github.com/vektah/gqlparser v1.1.2 h1:ZsyLGn7/7jDNI+y4SEhI4yAxRChlv15pUHMjijT+e68= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vektah/gqlparser/v2 v2.2.0/go.mod h1:i3mQIGIrbK2PD1RrCeMTlVbkF2FJ6WkU1KJlJlC+3F4= -github.com/vektah/gqlparser/v2 v2.3.1 h1:blIC0fCxGIr9pVjsc+BVI8XjYUtc2nCFRfnmP7FuFMk= -github.com/vektah/gqlparser/v2 v2.3.1/go.mod h1:i3mQIGIrbK2PD1RrCeMTlVbkF2FJ6WkU1KJlJlC+3F4= +github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= +github.com/vektah/gqlparser/v2 v2.4.1 h1:QOyEn8DAPMUMARGMeshKDkDgNmVoEaEGiDB0uWxcSlQ= +github.com/vektah/gqlparser/v2 v2.4.1/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= github.com/vifraa/gopom v0.1.0 h1:v897eVxf6lflkEXzPmKbo4YhX2oS/LGjz7cqjWnSmCU= github.com/vifraa/gopom v0.1.0/go.mod h1:oPa1dcrGrtlO37WPDBm5SqHAT+wTgF8An1Q71Z6Vv4o= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= @@ -2566,10 +2559,8 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/config v1.4.0 h1:upnMPpMm6WlbZtXoasNkK4f0FhxwS+W4Iqz5oNznehQ= go.uber.org/config v1.4.0/go.mod h1:aCyrMHmUAc/s2h9sv1koP84M9ZF/4K+g2oleyESO/Ig= -go.uber.org/dig v1.12.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/dig v1.14.0 h1:VmGvIH45/aapXPQkaOrK5u4B5B7jxZB98HM/utx0eME= go.uber.org/dig v1.14.0/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= -go.uber.org/fx v1.14.0/go.mod h1:rwjmT7CaZIiLgflUER9FCWCSkDGiRv/VDBxg32Inoy8= go.uber.org/fx v1.17.1 h1:S42dZ6Pok8hQ3jxKwo6ZMYcCgHQA/wAS/gnpRa1Pksg= go.uber.org/fx v1.17.1/go.mod h1:yO7KN5rhlARljyo4LR047AjaV6J+KFzd/Z7rnTbEn0A= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= @@ -3057,7 +3048,6 @@ golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -3077,7 +3067,6 @@ golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191030062658-86caa796c7ab/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191104232314-dc038396d1f0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3129,6 +3118,7 @@ golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc 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-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200815165600-90abf76919f3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= @@ -3713,4 +3703,3 @@ sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/lunatrace/bsl/backend/src/hasura-api/generated.ts b/lunatrace/bsl/backend/src/hasura-api/generated.ts index c2b02e5c4..1c94583d1 100644 --- a/lunatrace/bsl/backend/src/hasura-api/generated.ts +++ b/lunatrace/bsl/backend/src/hasura-api/generated.ts @@ -18,8 +18,10 @@ export type Scalars = { date: any; fix_state_enum: any; jsonb: any; + license_source: any; numeric: any; organization_user_role: any; + package_manager: any; severity_enum: any; timestamp: any; timestamptz: any; @@ -928,9 +930,11 @@ export type Fix_State_Enum_Comparison_Exp = { export type Github_Repositories = { __typename?: 'github_repositories'; authenticated_clone_url?: Maybe; + default_branch?: Maybe; git_url: Scalars['String']; github_id?: Maybe; github_node_id?: Maybe; + id: Scalars['uuid']; /** An object relationship */ project: Projects; project_id: Scalars['uuid']; @@ -980,9 +984,11 @@ export type Github_Repositories_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; + id?: InputMaybe; project?: InputMaybe; project_id?: InputMaybe; traits?: InputMaybe; @@ -1031,17 +1037,21 @@ export type Github_Repositories_Insert_Input = { /** order by max() on columns of table "github_repositories" */ export type Github_Repositories_Max_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; + id?: InputMaybe; project_id?: InputMaybe; }; /** order by min() on columns of table "github_repositories" */ export type Github_Repositories_Min_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; + id?: InputMaybe; project_id?: InputMaybe; }; @@ -1070,14 +1080,21 @@ export type Github_Repositories_On_Conflict = { /** Ordering options when selecting data from "github_repositories". */ export type Github_Repositories_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; + id?: InputMaybe; project?: InputMaybe; project_id?: InputMaybe; traits?: InputMaybe; }; +/** primary key columns input for table: github_repositories */ +export type Github_Repositories_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + /** prepend existing jsonb value of filtered columns with new jsonb value */ export type Github_Repositories_Prepend_Input = { traits?: InputMaybe; @@ -1085,6 +1102,8 @@ export type Github_Repositories_Prepend_Input = { /** select columns of table "github_repositories" */ export enum Github_Repositories_Select_Column { + /** column name */ + DefaultBranch = 'default_branch', /** column name */ GitUrl = 'git_url', /** column name */ @@ -1092,6 +1111,8 @@ export enum Github_Repositories_Select_Column { /** column name */ GithubNodeId = 'github_node_id', /** column name */ + Id = 'id', + /** column name */ ProjectId = 'project_id', /** column name */ Traits = 'traits' @@ -1859,6 +1880,19 @@ export type Jsonb_Comparison_Exp = { _nin?: InputMaybe>; }; +/** Boolean expression to compare columns of type "license_source". All fields are combined with logical 'AND'. */ +export type License_Source_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + /** columns and relationships of "manifests" */ export type Manifests = { __typename?: 'manifests'; @@ -2100,6 +2134,34 @@ export type Mutation_Root = { insert_organizations?: Maybe; /** insert a single row into the table: "organizations" */ insert_organizations_one?: Maybe; + /** insert data into the table: "package.package" */ + insert_package?: Maybe; + /** insert data into the table: "package.license" */ + insert_package_license?: Maybe; + /** insert a single row into the table: "package.license" */ + insert_package_license_one?: Maybe; + /** insert data into the table: "package.maintainer" */ + insert_package_maintainer?: Maybe; + /** insert a single row into the table: "package.maintainer" */ + insert_package_maintainer_one?: Maybe; + /** insert a single row into the table: "package.package" */ + insert_package_one?: Maybe; + /** insert data into the table: "package.package_maintainer" */ + insert_package_package_maintainer?: Maybe; + /** insert a single row into the table: "package.package_maintainer" */ + insert_package_package_maintainer_one?: Maybe; + /** insert data into the table: "package.release" */ + insert_package_release?: Maybe; + /** insert data into the table: "package.release_dependency" */ + insert_package_release_dependency?: Maybe; + /** insert a single row into the table: "package.release_dependency" */ + insert_package_release_dependency_one?: Maybe; + /** insert data into the table: "package.release_license" */ + insert_package_release_license?: Maybe; + /** insert a single row into the table: "package.release_license" */ + insert_package_release_license_one?: Maybe; + /** insert a single row into the table: "package.release" */ + insert_package_release_one?: Maybe; /** insert data into the table: "package_versions" */ insert_package_versions?: Maybe; /** insert a single row into the table: "package_versions" */ @@ -2140,6 +2202,8 @@ export type Mutation_Root = { update_findings_by_pk?: Maybe; /** update data of the table: "github_repositories" */ update_github_repositories?: Maybe; + /** update single row of the table: "github_repositories" */ + update_github_repositories_by_pk?: Maybe; /** update data of the table: "guide_related_guides" */ update_guide_related_guides?: Maybe; /** update single row of the table: "guide_related_guides" */ @@ -2162,6 +2226,32 @@ export type Mutation_Root = { update_organizations?: Maybe; /** update single row of the table: "organizations" */ update_organizations_by_pk?: Maybe; + /** update data of the table: "package.package" */ + update_package?: Maybe; + /** update single row of the table: "package.package" */ + update_package_by_pk?: Maybe; + /** update data of the table: "package.license" */ + update_package_license?: Maybe; + /** update single row of the table: "package.license" */ + update_package_license_by_pk?: Maybe; + /** update data of the table: "package.maintainer" */ + update_package_maintainer?: Maybe; + /** update single row of the table: "package.maintainer" */ + update_package_maintainer_by_pk?: Maybe; + /** update data of the table: "package.package_maintainer" */ + update_package_package_maintainer?: Maybe; + /** update data of the table: "package.release" */ + update_package_release?: Maybe; + /** update single row of the table: "package.release" */ + update_package_release_by_pk?: Maybe; + /** update data of the table: "package.release_dependency" */ + update_package_release_dependency?: Maybe; + /** update single row of the table: "package.release_dependency" */ + update_package_release_dependency_by_pk?: Maybe; + /** update data of the table: "package.release_license" */ + update_package_release_license?: Maybe; + /** update single row of the table: "package.release_license" */ + update_package_release_license_by_pk?: Maybe; /** update data of the table: "package_versions" */ update_package_versions?: Maybe; /** update single row of the table: "package_versions" */ @@ -2348,6 +2438,104 @@ export type Mutation_RootInsert_Organizations_OneArgs = { }; +/** mutation root */ +export type Mutation_RootInsert_PackageArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_LicenseArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_License_OneArgs = { + object: Package_License_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_MaintainerArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Maintainer_OneArgs = { + object: Package_Maintainer_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_OneArgs = { + object: Package_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Package_MaintainerArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Package_Maintainer_OneArgs = { + object: Package_Package_Maintainer_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_ReleaseArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Release_DependencyArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Release_Dependency_OneArgs = { + object: Package_Release_Dependency_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Release_LicenseArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Release_License_OneArgs = { + object: Package_Release_License_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Package_Release_OneArgs = { + object: Package_Release_Insert_Input; + on_conflict?: InputMaybe; +}; + + /** mutation root */ export type Mutation_RootInsert_Package_VersionsArgs = { objects: Array; @@ -2495,6 +2683,19 @@ export type Mutation_RootUpdate_Github_RepositoriesArgs = { }; +/** mutation root */ +export type Mutation_RootUpdate_Github_Repositories_By_PkArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _inc?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + pk_columns: Github_Repositories_Pk_Columns_Input; +}; + + /** mutation root */ export type Mutation_RootUpdate_Guide_Related_GuidesArgs = { _set?: InputMaybe; @@ -2580,6 +2781,117 @@ export type Mutation_RootUpdate_Organizations_By_PkArgs = { }; +/** mutation root */ +export type Mutation_RootUpdate_PackageArgs = { + _set?: InputMaybe; + where: Package_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Package_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_LicenseArgs = { + _set?: InputMaybe; + where: Package_License_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_License_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Package_License_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_MaintainerArgs = { + _set?: InputMaybe; + where: Package_Maintainer_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Maintainer_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Package_Maintainer_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Package_MaintainerArgs = { + _set?: InputMaybe; + where: Package_Package_Maintainer_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_ReleaseArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + where: Package_Release_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Release_By_PkArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + pk_columns: Package_Release_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Release_DependencyArgs = { + _set?: InputMaybe; + where: Package_Release_Dependency_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Release_Dependency_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Package_Release_Dependency_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Release_LicenseArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + where: Package_Release_License_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Package_Release_License_By_PkArgs = { + _append?: InputMaybe; + _delete_at_path?: InputMaybe; + _delete_elem?: InputMaybe; + _delete_key?: InputMaybe; + _prepend?: InputMaybe; + _set?: InputMaybe; + pk_columns: Package_Release_License_Pk_Columns_Input; +}; + + /** mutation root */ export type Mutation_RootUpdate_Package_VersionsArgs = { _set?: InputMaybe; @@ -3193,134 +3505,1280 @@ export type Organizations_Variance_Fields = { installation_id?: Maybe; }; -/** columns and relationships of "package_versions" */ -export type Package_Versions = { - __typename?: 'package_versions'; - cpes: Scalars['_text']; - /** An array relationship */ - findings: Array; - fix_state: Scalars['String']; - fixed_in_versions: Scalars['_text']; +/** columns and relationships of "package.package" */ +export type Package = { + __typename?: 'package'; + custom_registry: Scalars['String']; + description?: Maybe; + fetched_time?: Maybe; id: Scalars['uuid']; - pkg_slug: Scalars['String']; - slug: Scalars['String']; - version_constraint: Scalars['String']; - version_format: Scalars['String']; - /** An object relationship */ - vulnerability_package: Vulnerability_Packages; + name: Scalars['String']; + /** An array relationship */ + package_maintainers: Array; + package_manager: Scalars['package_manager']; + /** An array relationship */ + releases: Array; }; -/** columns and relationships of "package_versions" */ -export type Package_VersionsFindingsArgs = { - distinct_on?: InputMaybe>; +/** columns and relationships of "package.package" */ +export type PackagePackage_MaintainersArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -/** order by aggregate values of table "package_versions" */ -export type Package_Versions_Aggregate_Order_By = { - count?: InputMaybe; - max?: InputMaybe; - min?: InputMaybe; -}; -/** input type for inserting array relation for remote table "package_versions" */ -export type Package_Versions_Arr_Rel_Insert_Input = { - data: Array; - /** upsert condition */ - on_conflict?: InputMaybe; +/** columns and relationships of "package.package" */ +export type PackageReleasesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -/** Boolean expression to filter rows from the table "package_versions". All fields are combined with a logical 'AND'. */ -export type Package_Versions_Bool_Exp = { - _and?: InputMaybe>; - _not?: InputMaybe; - _or?: InputMaybe>; - cpes?: InputMaybe<_Text_Comparison_Exp>; - findings?: InputMaybe; - fix_state?: InputMaybe; - fixed_in_versions?: InputMaybe<_Text_Comparison_Exp>; +/** Boolean expression to filter rows from the table "package.package". All fields are combined with a logical 'AND'. */ +export type Package_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + custom_registry?: InputMaybe; + description?: InputMaybe; + fetched_time?: InputMaybe; id?: InputMaybe; - pkg_slug?: InputMaybe; - slug?: InputMaybe; - version_constraint?: InputMaybe; - version_format?: InputMaybe; - vulnerability_package?: InputMaybe; + name?: InputMaybe; + package_maintainers?: InputMaybe; + package_manager?: InputMaybe; + releases?: InputMaybe; }; -/** unique or primary key constraints on table "package_versions" */ -export enum Package_Versions_Constraint { +/** unique or primary key constraints on table "package.package" */ +export enum Package_Constraint { /** unique or primary key constraint */ - PackageVersionsPkey = 'package_versions_pkey', + PackagePackageManagerCustomRegistryNameIdx = 'package_package_manager_custom_registry_name_idx', /** unique or primary key constraint */ - PackageVersionsSlugKey = 'package_versions_slug_key' + PackagePkey = 'package_pkey' } -/** input type for inserting data into table "package_versions" */ -export type Package_Versions_Insert_Input = { - findings?: InputMaybe; - slug?: InputMaybe; - vulnerability_package?: InputMaybe; +/** input type for inserting data into table "package.package" */ +export type Package_Insert_Input = { + custom_registry?: InputMaybe; + description?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_maintainers?: InputMaybe; + package_manager?: InputMaybe; + releases?: InputMaybe; }; -/** order by max() on columns of table "package_versions" */ -export type Package_Versions_Max_Order_By = { - fix_state?: InputMaybe; - id?: InputMaybe; - pkg_slug?: InputMaybe; - slug?: InputMaybe; - version_constraint?: InputMaybe; - version_format?: InputMaybe; +/** columns and relationships of "package.license" */ +export type Package_License = { + __typename?: 'package_license'; + id: Scalars['uuid']; + name: Scalars['String']; + /** An array relationship */ + release_licenses: Array; }; -/** order by min() on columns of table "package_versions" */ -export type Package_Versions_Min_Order_By = { - fix_state?: InputMaybe; - id?: InputMaybe; - pkg_slug?: InputMaybe; - slug?: InputMaybe; - version_constraint?: InputMaybe; - version_format?: InputMaybe; + +/** columns and relationships of "package.license" */ +export type Package_LicenseRelease_LicensesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -/** response of any mutation on the table "package_versions" */ -export type Package_Versions_Mutation_Response = { - __typename?: 'package_versions_mutation_response'; +/** Boolean expression to filter rows from the table "package.license". All fields are combined with a logical 'AND'. */ +export type Package_License_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + id?: InputMaybe; + name?: InputMaybe; + release_licenses?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.license" */ +export enum Package_License_Constraint { + /** unique or primary key constraint */ + LicenseNameIdx = 'license_name_idx', + /** unique or primary key constraint */ + LicensePkey = 'license_pkey' +} + +/** input type for inserting data into table "package.license" */ +export type Package_License_Insert_Input = { + id?: InputMaybe; + name?: InputMaybe; + release_licenses?: InputMaybe; +}; + +/** response of any mutation on the table "package.license" */ +export type Package_License_Mutation_Response = { + __typename?: 'package_license_mutation_response'; /** number of rows affected by the mutation */ affected_rows: Scalars['Int']; /** data from the rows affected by the mutation */ - returning: Array; + returning: Array; }; -/** input type for inserting object relation for remote table "package_versions" */ -export type Package_Versions_Obj_Rel_Insert_Input = { - data: Package_Versions_Insert_Input; +/** input type for inserting object relation for remote table "package.license" */ +export type Package_License_Obj_Rel_Insert_Input = { + data: Package_License_Insert_Input; /** upsert condition */ - on_conflict?: InputMaybe; + on_conflict?: InputMaybe; }; -/** on_conflict condition type for table "package_versions" */ -export type Package_Versions_On_Conflict = { - constraint: Package_Versions_Constraint; - update_columns?: Array; - where?: InputMaybe; +/** on_conflict condition type for table "package.license" */ +export type Package_License_On_Conflict = { + constraint: Package_License_Constraint; + update_columns?: Array; + where?: InputMaybe; }; -/** Ordering options when selecting data from "package_versions". */ -export type Package_Versions_Order_By = { - cpes?: InputMaybe; - findings_aggregate?: InputMaybe; - fix_state?: InputMaybe; - fixed_in_versions?: InputMaybe; +/** Ordering options when selecting data from "package.license". */ +export type Package_License_Order_By = { id?: InputMaybe; - pkg_slug?: InputMaybe; - slug?: InputMaybe; - version_constraint?: InputMaybe; - version_format?: InputMaybe; - vulnerability_package?: InputMaybe; + name?: InputMaybe; + release_licenses_aggregate?: InputMaybe; +}; + +/** primary key columns input for table: package_license */ +export type Package_License_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** select columns of table "package.license" */ +export enum Package_License_Select_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} + +/** input type for updating data in table "package.license" */ +export type Package_License_Set_Input = { + id?: InputMaybe; + name?: InputMaybe; +}; + +/** update columns of table "package.license" */ +export enum Package_License_Update_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} + +/** columns and relationships of "package.maintainer" */ +export type Package_Maintainer = { + __typename?: 'package_maintainer'; + email: Scalars['String']; + id: Scalars['uuid']; + name?: Maybe; + /** An array relationship */ + package_maintainers: Array; + package_manager?: Maybe; + /** An array relationship */ + published_releases: Array; +}; + + +/** columns and relationships of "package.maintainer" */ +export type Package_MaintainerPackage_MaintainersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "package.maintainer" */ +export type Package_MaintainerPublished_ReleasesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package.maintainer". All fields are combined with a logical 'AND'. */ +export type Package_Maintainer_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + email?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_maintainers?: InputMaybe; + package_manager?: InputMaybe; + published_releases?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.maintainer" */ +export enum Package_Maintainer_Constraint { + /** unique or primary key constraint */ + MaintainerPackageManagerEmailIdx = 'maintainer_package_manager_email_idx', + /** unique or primary key constraint */ + MaintainerPkey = 'maintainer_pkey' +} + +/** input type for inserting data into table "package.maintainer" */ +export type Package_Maintainer_Insert_Input = { + email?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_maintainers?: InputMaybe; + package_manager?: InputMaybe; + published_releases?: InputMaybe; +}; + +/** response of any mutation on the table "package.maintainer" */ +export type Package_Maintainer_Mutation_Response = { + __typename?: 'package_maintainer_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "package.maintainer" */ +export type Package_Maintainer_Obj_Rel_Insert_Input = { + data: Package_Maintainer_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "package.maintainer" */ +export type Package_Maintainer_On_Conflict = { + constraint: Package_Maintainer_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.maintainer". */ +export type Package_Maintainer_Order_By = { + email?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_maintainers_aggregate?: InputMaybe; + package_manager?: InputMaybe; + published_releases_aggregate?: InputMaybe; +}; + +/** primary key columns input for table: package_maintainer */ +export type Package_Maintainer_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** select columns of table "package.maintainer" */ +export enum Package_Maintainer_Select_Column { + /** column name */ + Email = 'email', + /** column name */ + Id = 'id', + /** column name */ + Name = 'name', + /** column name */ + PackageManager = 'package_manager' +} + +/** input type for updating data in table "package.maintainer" */ +export type Package_Maintainer_Set_Input = { + email?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_manager?: InputMaybe; +}; + +/** update columns of table "package.maintainer" */ +export enum Package_Maintainer_Update_Column { + /** column name */ + Email = 'email', + /** column name */ + Id = 'id', + /** column name */ + Name = 'name', + /** column name */ + PackageManager = 'package_manager' +} + +/** Boolean expression to compare columns of type "package_manager". All fields are combined with logical 'AND'. */ +export type Package_Manager_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + +/** response of any mutation on the table "package.package" */ +export type Package_Mutation_Response = { + __typename?: 'package_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "package.package" */ +export type Package_Obj_Rel_Insert_Input = { + data: Package_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "package.package" */ +export type Package_On_Conflict = { + constraint: Package_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.package". */ +export type Package_Order_By = { + custom_registry?: InputMaybe; + description?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_maintainers_aggregate?: InputMaybe; + package_manager?: InputMaybe; + releases_aggregate?: InputMaybe; +}; + +/** columns and relationships of "package.package_maintainer" */ +export type Package_Package_Maintainer = { + __typename?: 'package_package_maintainer'; + /** An object relationship */ + maintainer?: Maybe; + maintainer_id?: Maybe; + /** An object relationship */ + package?: Maybe; + package_id?: Maybe; +}; + +/** order by aggregate values of table "package.package_maintainer" */ +export type Package_Package_Maintainer_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "package.package_maintainer" */ +export type Package_Package_Maintainer_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package.package_maintainer". All fields are combined with a logical 'AND'. */ +export type Package_Package_Maintainer_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + maintainer?: InputMaybe; + maintainer_id?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.package_maintainer" */ +export enum Package_Package_Maintainer_Constraint { + /** unique or primary key constraint */ + PackageMaintainerPackageIdMaintainerIdIdx = 'package_maintainer_package_id_maintainer_id_idx' +} + +/** input type for inserting data into table "package.package_maintainer" */ +export type Package_Package_Maintainer_Insert_Input = { + maintainer?: InputMaybe; + maintainer_id?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; +}; + +/** order by max() on columns of table "package.package_maintainer" */ +export type Package_Package_Maintainer_Max_Order_By = { + maintainer_id?: InputMaybe; + package_id?: InputMaybe; +}; + +/** order by min() on columns of table "package.package_maintainer" */ +export type Package_Package_Maintainer_Min_Order_By = { + maintainer_id?: InputMaybe; + package_id?: InputMaybe; +}; + +/** response of any mutation on the table "package.package_maintainer" */ +export type Package_Package_Maintainer_Mutation_Response = { + __typename?: 'package_package_maintainer_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "package.package_maintainer" */ +export type Package_Package_Maintainer_On_Conflict = { + constraint: Package_Package_Maintainer_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.package_maintainer". */ +export type Package_Package_Maintainer_Order_By = { + maintainer?: InputMaybe; + maintainer_id?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; +}; + +/** select columns of table "package.package_maintainer" */ +export enum Package_Package_Maintainer_Select_Column { + /** column name */ + MaintainerId = 'maintainer_id', + /** column name */ + PackageId = 'package_id' +} + +/** input type for updating data in table "package.package_maintainer" */ +export type Package_Package_Maintainer_Set_Input = { + maintainer_id?: InputMaybe; + package_id?: InputMaybe; +}; + +/** update columns of table "package.package_maintainer" */ +export enum Package_Package_Maintainer_Update_Column { + /** column name */ + MaintainerId = 'maintainer_id', + /** column name */ + PackageId = 'package_id' +} + +/** primary key columns input for table: package */ +export type Package_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** columns and relationships of "package.release" */ +export type Package_Release = { + __typename?: 'package_release'; + blob_hash?: Maybe; + fetched_time?: Maybe; + id: Scalars['uuid']; + mirrored_blob_url?: Maybe; + observed_time: Scalars['timestamptz']; + /** An object relationship */ + package?: Maybe; + package_id?: Maybe; + /** An object relationship */ + publishing_maintainer?: Maybe; + publishing_maintainer_id?: Maybe; + /** An array relationship */ + release_dependencies: Array; + /** An array relationship */ + release_dependents: Array; + /** An array relationship */ + release_licenses: Array; + release_time?: Maybe; + upstream_blob_url?: Maybe; + upstream_data?: Maybe; + version: Scalars['String']; +}; + + +/** columns and relationships of "package.release" */ +export type Package_ReleaseRelease_DependenciesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "package.release" */ +export type Package_ReleaseRelease_DependentsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "package.release" */ +export type Package_ReleaseRelease_LicensesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "package.release" */ +export type Package_ReleaseUpstream_DataArgs = { + path?: InputMaybe; +}; + +/** order by aggregate values of table "package.release" */ +export type Package_Release_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** append existing jsonb value of filtered columns with new jsonb value */ +export type Package_Release_Append_Input = { + upstream_data?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "package.release" */ +export type Package_Release_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package.release". All fields are combined with a logical 'AND'. */ +export type Package_Release_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_dependencies?: InputMaybe; + release_dependents?: InputMaybe; + release_licenses?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + upstream_data?: InputMaybe; + version?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.release" */ +export enum Package_Release_Constraint { + /** unique or primary key constraint */ + ReleasePackageIdVersionIdx = 'release_package_id_version_idx', + /** unique or primary key constraint */ + ReleasePkey = 'release_pkey' +} + +/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ +export type Package_Release_Delete_At_Path_Input = { + upstream_data?: InputMaybe>; +}; + +/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ +export type Package_Release_Delete_Elem_Input = { + upstream_data?: InputMaybe; +}; + +/** delete key/value pair or string element. key/value pairs are matched based on their key value */ +export type Package_Release_Delete_Key_Input = { + upstream_data?: InputMaybe; +}; + +/** columns and relationships of "package.release_dependency" */ +export type Package_Release_Dependency = { + __typename?: 'package_release_dependency'; + /** An object relationship */ + dependency_package?: Maybe; + dependency_package_id?: Maybe; + /** An object relationship */ + dependency_release?: Maybe; + dependency_release_id?: Maybe; + id: Scalars['uuid']; + package_name: Scalars['String']; + package_version_query: Scalars['String']; + /** An object relationship */ + release: Package_Release; + release_id: Scalars['uuid']; +}; + +/** order by aggregate values of table "package.release_dependency" */ +export type Package_Release_Dependency_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "package.release_dependency" */ +export type Package_Release_Dependency_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package.release_dependency". All fields are combined with a logical 'AND'. */ +export type Package_Release_Dependency_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + dependency_package?: InputMaybe; + dependency_package_id?: InputMaybe; + dependency_release?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release?: InputMaybe; + release_id?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.release_dependency" */ +export enum Package_Release_Dependency_Constraint { + /** unique or primary key constraint */ + ReleaseDependencyPkey = 'release_dependency_pkey', + /** unique or primary key constraint */ + ReleaseDependencyReleaseIdPackageNamePackageVersionIdx = 'release_dependency_release_id_package_name_package_version__idx' +} + +/** input type for inserting data into table "package.release_dependency" */ +export type Package_Release_Dependency_Insert_Input = { + dependency_package?: InputMaybe; + dependency_package_id?: InputMaybe; + dependency_release?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release?: InputMaybe; + release_id?: InputMaybe; +}; + +/** order by max() on columns of table "package.release_dependency" */ +export type Package_Release_Dependency_Max_Order_By = { + dependency_package_id?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release_id?: InputMaybe; +}; + +/** order by min() on columns of table "package.release_dependency" */ +export type Package_Release_Dependency_Min_Order_By = { + dependency_package_id?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release_id?: InputMaybe; +}; + +/** response of any mutation on the table "package.release_dependency" */ +export type Package_Release_Dependency_Mutation_Response = { + __typename?: 'package_release_dependency_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "package.release_dependency" */ +export type Package_Release_Dependency_On_Conflict = { + constraint: Package_Release_Dependency_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.release_dependency". */ +export type Package_Release_Dependency_Order_By = { + dependency_package?: InputMaybe; + dependency_package_id?: InputMaybe; + dependency_release?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release?: InputMaybe; + release_id?: InputMaybe; +}; + +/** primary key columns input for table: package_release_dependency */ +export type Package_Release_Dependency_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** select columns of table "package.release_dependency" */ +export enum Package_Release_Dependency_Select_Column { + /** column name */ + DependencyPackageId = 'dependency_package_id', + /** column name */ + DependencyReleaseId = 'dependency_release_id', + /** column name */ + Id = 'id', + /** column name */ + PackageName = 'package_name', + /** column name */ + PackageVersionQuery = 'package_version_query', + /** column name */ + ReleaseId = 'release_id' +} + +/** input type for updating data in table "package.release_dependency" */ +export type Package_Release_Dependency_Set_Input = { + dependency_package_id?: InputMaybe; + dependency_release_id?: InputMaybe; + id?: InputMaybe; + package_name?: InputMaybe; + package_version_query?: InputMaybe; + release_id?: InputMaybe; +}; + +/** update columns of table "package.release_dependency" */ +export enum Package_Release_Dependency_Update_Column { + /** column name */ + DependencyPackageId = 'dependency_package_id', + /** column name */ + DependencyReleaseId = 'dependency_release_id', + /** column name */ + Id = 'id', + /** column name */ + PackageName = 'package_name', + /** column name */ + PackageVersionQuery = 'package_version_query', + /** column name */ + ReleaseId = 'release_id' +} + +/** input type for inserting data into table "package.release" */ +export type Package_Release_Insert_Input = { + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_dependencies?: InputMaybe; + release_dependents?: InputMaybe; + release_licenses?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + upstream_data?: InputMaybe; + version?: InputMaybe; +}; + +/** columns and relationships of "package.release_license" */ +export type Package_Release_License = { + __typename?: 'package_release_license'; + id: Scalars['uuid']; + /** An object relationship */ + license: Package_License; + license_id: Scalars['uuid']; + release_id: Scalars['uuid']; + scan_metadata?: Maybe; + scan_time: Scalars['timestamptz']; + source: Scalars['license_source']; +}; + + +/** columns and relationships of "package.release_license" */ +export type Package_Release_LicenseScan_MetadataArgs = { + path?: InputMaybe; +}; + +/** order by aggregate values of table "package.release_license" */ +export type Package_Release_License_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** append existing jsonb value of filtered columns with new jsonb value */ +export type Package_Release_License_Append_Input = { + scan_metadata?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "package.release_license" */ +export type Package_Release_License_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package.release_license". All fields are combined with a logical 'AND'. */ +export type Package_Release_License_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + id?: InputMaybe; + license?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_metadata?: InputMaybe; + scan_time?: InputMaybe; + source?: InputMaybe; +}; + +/** unique or primary key constraints on table "package.release_license" */ +export enum Package_Release_License_Constraint { + /** unique or primary key constraint */ + ReleaseLicensePkey = 'release_license_pkey' +} + +/** delete the field or element with specified path (for JSON arrays, negative integers count from the end) */ +export type Package_Release_License_Delete_At_Path_Input = { + scan_metadata?: InputMaybe>; +}; + +/** delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array */ +export type Package_Release_License_Delete_Elem_Input = { + scan_metadata?: InputMaybe; +}; + +/** delete key/value pair or string element. key/value pairs are matched based on their key value */ +export type Package_Release_License_Delete_Key_Input = { + scan_metadata?: InputMaybe; +}; + +/** input type for inserting data into table "package.release_license" */ +export type Package_Release_License_Insert_Input = { + id?: InputMaybe; + license?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_metadata?: InputMaybe; + scan_time?: InputMaybe; + source?: InputMaybe; +}; + +/** order by max() on columns of table "package.release_license" */ +export type Package_Release_License_Max_Order_By = { + id?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_time?: InputMaybe; +}; + +/** order by min() on columns of table "package.release_license" */ +export type Package_Release_License_Min_Order_By = { + id?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_time?: InputMaybe; +}; + +/** response of any mutation on the table "package.release_license" */ +export type Package_Release_License_Mutation_Response = { + __typename?: 'package_release_license_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "package.release_license" */ +export type Package_Release_License_On_Conflict = { + constraint: Package_Release_License_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.release_license". */ +export type Package_Release_License_Order_By = { + id?: InputMaybe; + license?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_metadata?: InputMaybe; + scan_time?: InputMaybe; + source?: InputMaybe; +}; + +/** primary key columns input for table: package_release_license */ +export type Package_Release_License_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** prepend existing jsonb value of filtered columns with new jsonb value */ +export type Package_Release_License_Prepend_Input = { + scan_metadata?: InputMaybe; +}; + +/** select columns of table "package.release_license" */ +export enum Package_Release_License_Select_Column { + /** column name */ + Id = 'id', + /** column name */ + LicenseId = 'license_id', + /** column name */ + ReleaseId = 'release_id', + /** column name */ + ScanMetadata = 'scan_metadata', + /** column name */ + ScanTime = 'scan_time', + /** column name */ + Source = 'source' +} + +/** input type for updating data in table "package.release_license" */ +export type Package_Release_License_Set_Input = { + id?: InputMaybe; + license_id?: InputMaybe; + release_id?: InputMaybe; + scan_metadata?: InputMaybe; + scan_time?: InputMaybe; + source?: InputMaybe; +}; + +/** update columns of table "package.release_license" */ +export enum Package_Release_License_Update_Column { + /** column name */ + Id = 'id', + /** column name */ + LicenseId = 'license_id', + /** column name */ + ReleaseId = 'release_id', + /** column name */ + ScanMetadata = 'scan_metadata', + /** column name */ + ScanTime = 'scan_time', + /** column name */ + Source = 'source' +} + +/** order by max() on columns of table "package.release" */ +export type Package_Release_Max_Order_By = { + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + version?: InputMaybe; +}; + +/** order by min() on columns of table "package.release" */ +export type Package_Release_Min_Order_By = { + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + version?: InputMaybe; +}; + +/** response of any mutation on the table "package.release" */ +export type Package_Release_Mutation_Response = { + __typename?: 'package_release_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "package.release" */ +export type Package_Release_Obj_Rel_Insert_Input = { + data: Package_Release_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "package.release" */ +export type Package_Release_On_Conflict = { + constraint: Package_Release_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package.release". */ +export type Package_Release_Order_By = { + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_dependencies_aggregate?: InputMaybe; + release_dependents_aggregate?: InputMaybe; + release_licenses_aggregate?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + upstream_data?: InputMaybe; + version?: InputMaybe; +}; + +/** primary key columns input for table: package_release */ +export type Package_Release_Pk_Columns_Input = { + id: Scalars['uuid']; +}; + +/** prepend existing jsonb value of filtered columns with new jsonb value */ +export type Package_Release_Prepend_Input = { + upstream_data?: InputMaybe; +}; + +/** select columns of table "package.release" */ +export enum Package_Release_Select_Column { + /** column name */ + BlobHash = 'blob_hash', + /** column name */ + FetchedTime = 'fetched_time', + /** column name */ + Id = 'id', + /** column name */ + MirroredBlobUrl = 'mirrored_blob_url', + /** column name */ + ObservedTime = 'observed_time', + /** column name */ + PackageId = 'package_id', + /** column name */ + PublishingMaintainerId = 'publishing_maintainer_id', + /** column name */ + ReleaseTime = 'release_time', + /** column name */ + UpstreamBlobUrl = 'upstream_blob_url', + /** column name */ + UpstreamData = 'upstream_data', + /** column name */ + Version = 'version' +} + +/** input type for updating data in table "package.release" */ +export type Package_Release_Set_Input = { + blob_hash?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + mirrored_blob_url?: InputMaybe; + observed_time?: InputMaybe; + package_id?: InputMaybe; + publishing_maintainer_id?: InputMaybe; + release_time?: InputMaybe; + upstream_blob_url?: InputMaybe; + upstream_data?: InputMaybe; + version?: InputMaybe; +}; + +/** update columns of table "package.release" */ +export enum Package_Release_Update_Column { + /** column name */ + BlobHash = 'blob_hash', + /** column name */ + FetchedTime = 'fetched_time', + /** column name */ + Id = 'id', + /** column name */ + MirroredBlobUrl = 'mirrored_blob_url', + /** column name */ + ObservedTime = 'observed_time', + /** column name */ + PackageId = 'package_id', + /** column name */ + PublishingMaintainerId = 'publishing_maintainer_id', + /** column name */ + ReleaseTime = 'release_time', + /** column name */ + UpstreamBlobUrl = 'upstream_blob_url', + /** column name */ + UpstreamData = 'upstream_data', + /** column name */ + Version = 'version' +} + +/** select columns of table "package.package" */ +export enum Package_Select_Column { + /** column name */ + CustomRegistry = 'custom_registry', + /** column name */ + Description = 'description', + /** column name */ + FetchedTime = 'fetched_time', + /** column name */ + Id = 'id', + /** column name */ + Name = 'name', + /** column name */ + PackageManager = 'package_manager' +} + +/** input type for updating data in table "package.package" */ +export type Package_Set_Input = { + custom_registry?: InputMaybe; + description?: InputMaybe; + fetched_time?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + package_manager?: InputMaybe; +}; + +/** update columns of table "package.package" */ +export enum Package_Update_Column { + /** column name */ + CustomRegistry = 'custom_registry', + /** column name */ + Description = 'description', + /** column name */ + FetchedTime = 'fetched_time', + /** column name */ + Id = 'id', + /** column name */ + Name = 'name', + /** column name */ + PackageManager = 'package_manager' +} + +/** columns and relationships of "package_versions" */ +export type Package_Versions = { + __typename?: 'package_versions'; + cpes: Scalars['_text']; + /** An array relationship */ + findings: Array; + fix_state: Scalars['String']; + fixed_in_versions: Scalars['_text']; + id: Scalars['uuid']; + pkg_slug: Scalars['String']; + slug: Scalars['String']; + version_constraint: Scalars['String']; + version_format: Scalars['String']; + /** An object relationship */ + vulnerability_package: Vulnerability_Packages; +}; + + +/** columns and relationships of "package_versions" */ +export type Package_VersionsFindingsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** order by aggregate values of table "package_versions" */ +export type Package_Versions_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "package_versions" */ +export type Package_Versions_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "package_versions". All fields are combined with a logical 'AND'. */ +export type Package_Versions_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + cpes?: InputMaybe<_Text_Comparison_Exp>; + findings?: InputMaybe; + fix_state?: InputMaybe; + fixed_in_versions?: InputMaybe<_Text_Comparison_Exp>; + id?: InputMaybe; + pkg_slug?: InputMaybe; + slug?: InputMaybe; + version_constraint?: InputMaybe; + version_format?: InputMaybe; + vulnerability_package?: InputMaybe; +}; + +/** unique or primary key constraints on table "package_versions" */ +export enum Package_Versions_Constraint { + /** unique or primary key constraint */ + PackageVersionsPkey = 'package_versions_pkey', + /** unique or primary key constraint */ + PackageVersionsSlugKey = 'package_versions_slug_key' +} + +/** input type for inserting data into table "package_versions" */ +export type Package_Versions_Insert_Input = { + findings?: InputMaybe; + slug?: InputMaybe; + vulnerability_package?: InputMaybe; +}; + +/** order by max() on columns of table "package_versions" */ +export type Package_Versions_Max_Order_By = { + fix_state?: InputMaybe; + id?: InputMaybe; + pkg_slug?: InputMaybe; + slug?: InputMaybe; + version_constraint?: InputMaybe; + version_format?: InputMaybe; +}; + +/** order by min() on columns of table "package_versions" */ +export type Package_Versions_Min_Order_By = { + fix_state?: InputMaybe; + id?: InputMaybe; + pkg_slug?: InputMaybe; + slug?: InputMaybe; + version_constraint?: InputMaybe; + version_format?: InputMaybe; +}; + +/** response of any mutation on the table "package_versions" */ +export type Package_Versions_Mutation_Response = { + __typename?: 'package_versions_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "package_versions" */ +export type Package_Versions_Obj_Rel_Insert_Input = { + data: Package_Versions_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "package_versions" */ +export type Package_Versions_On_Conflict = { + constraint: Package_Versions_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "package_versions". */ +export type Package_Versions_Order_By = { + cpes?: InputMaybe; + findings_aggregate?: InputMaybe; + fix_state?: InputMaybe; + fixed_in_versions?: InputMaybe; + id?: InputMaybe; + pkg_slug?: InputMaybe; + slug?: InputMaybe; + version_constraint?: InputMaybe; + version_format?: InputMaybe; + vulnerability_package?: InputMaybe; }; /** primary key columns input for table: package_versions */ @@ -3752,6 +5210,8 @@ export type Query_Root = { findings_by_pk?: Maybe; /** An array relationship */ github_repositories: Array; + /** fetch data from the table: "github_repositories" using primary key columns */ + github_repositories_by_pk?: Maybe; /** fetch data from the table: "guide_related_guides" */ guide_related_guides: Array; /** fetch data from the table: "guide_related_guides" using primary key columns */ @@ -3786,6 +5246,32 @@ export type Query_Root = { organizations_aggregate: Organizations_Aggregate; /** fetch data from the table: "organizations" using primary key columns */ organizations_by_pk?: Maybe; + /** fetch data from the table: "package.package" */ + package: Array; + /** fetch data from the table: "package.package" using primary key columns */ + package_by_pk?: Maybe; + /** fetch data from the table: "package.license" */ + package_license: Array; + /** fetch data from the table: "package.license" using primary key columns */ + package_license_by_pk?: Maybe; + /** fetch data from the table: "package.maintainer" */ + package_maintainer: Array; + /** fetch data from the table: "package.maintainer" using primary key columns */ + package_maintainer_by_pk?: Maybe; + /** fetch data from the table: "package.package_maintainer" */ + package_package_maintainer: Array; + /** fetch data from the table: "package.release" */ + package_release: Array; + /** fetch data from the table: "package.release" using primary key columns */ + package_release_by_pk?: Maybe; + /** fetch data from the table: "package.release_dependency" */ + package_release_dependency: Array; + /** fetch data from the table: "package.release_dependency" using primary key columns */ + package_release_dependency_by_pk?: Maybe; + /** fetch data from the table: "package.release_license" */ + package_release_license: Array; + /** fetch data from the table: "package.release_license" using primary key columns */ + package_release_license_by_pk?: Maybe; /** An array relationship */ package_versions: Array; /** fetch data from the table: "package_versions" using primary key columns */ @@ -3887,6 +5373,11 @@ export type Query_RootGithub_RepositoriesArgs = { }; +export type Query_RootGithub_Repositories_By_PkArgs = { + id: Scalars['uuid']; +}; + + export type Query_RootGuide_Related_GuidesArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4008,6 +5499,99 @@ export type Query_RootOrganizations_By_PkArgs = { }; +export type Query_RootPackageArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Query_RootPackage_LicenseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_License_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Query_RootPackage_MaintainerArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_Maintainer_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Query_RootPackage_Package_MaintainerArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_ReleaseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_Release_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Query_RootPackage_Release_DependencyArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_Release_Dependency_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Query_RootPackage_Release_LicenseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootPackage_Release_License_By_PkArgs = { + id: Scalars['uuid']; +}; + + export type Query_RootPackage_VersionsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4587,6 +6171,8 @@ export type Subscription_Root = { findings_by_pk?: Maybe; /** An array relationship */ github_repositories: Array; + /** fetch data from the table: "github_repositories" using primary key columns */ + github_repositories_by_pk?: Maybe; /** fetch data from the table: "guide_related_guides" */ guide_related_guides: Array; /** fetch data from the table: "guide_related_guides" using primary key columns */ @@ -4621,6 +6207,32 @@ export type Subscription_Root = { organizations_aggregate: Organizations_Aggregate; /** fetch data from the table: "organizations" using primary key columns */ organizations_by_pk?: Maybe; + /** fetch data from the table: "package.package" */ + package: Array; + /** fetch data from the table: "package.package" using primary key columns */ + package_by_pk?: Maybe; + /** fetch data from the table: "package.license" */ + package_license: Array; + /** fetch data from the table: "package.license" using primary key columns */ + package_license_by_pk?: Maybe; + /** fetch data from the table: "package.maintainer" */ + package_maintainer: Array; + /** fetch data from the table: "package.maintainer" using primary key columns */ + package_maintainer_by_pk?: Maybe; + /** fetch data from the table: "package.package_maintainer" */ + package_package_maintainer: Array; + /** fetch data from the table: "package.release" */ + package_release: Array; + /** fetch data from the table: "package.release" using primary key columns */ + package_release_by_pk?: Maybe; + /** fetch data from the table: "package.release_dependency" */ + package_release_dependency: Array; + /** fetch data from the table: "package.release_dependency" using primary key columns */ + package_release_dependency_by_pk?: Maybe; + /** fetch data from the table: "package.release_license" */ + package_release_license: Array; + /** fetch data from the table: "package.release_license" using primary key columns */ + package_release_license_by_pk?: Maybe; /** An array relationship */ package_versions: Array; /** fetch data from the table: "package_versions" using primary key columns */ @@ -4714,6 +6326,11 @@ export type Subscription_RootGithub_RepositoriesArgs = { }; +export type Subscription_RootGithub_Repositories_By_PkArgs = { + id: Scalars['uuid']; +}; + + export type Subscription_RootGuide_Related_GuidesArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4835,6 +6452,99 @@ export type Subscription_RootOrganizations_By_PkArgs = { }; +export type Subscription_RootPackageArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootPackage_LicenseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_License_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootPackage_MaintainerArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_Maintainer_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootPackage_Package_MaintainerArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_ReleaseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_Release_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootPackage_Release_DependencyArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_Release_Dependency_By_PkArgs = { + id: Scalars['uuid']; +}; + + +export type Subscription_RootPackage_Release_LicenseArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootPackage_Release_License_By_PkArgs = { + id: Scalars['uuid']; +}; + + export type Subscription_RootPackage_VersionsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; diff --git a/lunatrace/bsl/frontend/src/api/generated.ts b/lunatrace/bsl/frontend/src/api/generated.ts index 5cb8f7f83..7da4104fd 100644 --- a/lunatrace/bsl/frontend/src/api/generated.ts +++ b/lunatrace/bsl/frontend/src/api/generated.ts @@ -781,6 +781,7 @@ export type Fix_State_Enum_Comparison_Exp = { export type Github_Repositories = { __typename?: 'github_repositories'; authenticated_clone_url?: Maybe; + default_branch?: Maybe; git_url: Scalars['String']; github_id?: Maybe; github_node_id?: Maybe; @@ -822,6 +823,7 @@ export type Github_Repositories_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; @@ -833,6 +835,7 @@ export type Github_Repositories_Bool_Exp = { /** order by max() on columns of table "github_repositories" */ export type Github_Repositories_Max_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; @@ -842,6 +845,7 @@ export type Github_Repositories_Max_Order_By = { /** order by min() on columns of table "github_repositories" */ export type Github_Repositories_Min_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; @@ -851,6 +855,7 @@ export type Github_Repositories_Min_Order_By = { /** Ordering options when selecting data from "github_repositories". */ export type Github_Repositories_Order_By = { + default_branch?: InputMaybe; git_url?: InputMaybe; github_id?: InputMaybe; github_node_id?: InputMaybe; @@ -862,6 +867,8 @@ export type Github_Repositories_Order_By = { /** select columns of table "github_repositories" */ export enum Github_Repositories_Select_Column { + /** column name */ + DefaultBranch = 'default_branch', /** column name */ GitUrl = 'git_url', /** column name */ diff --git a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_package.yaml b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_package.yaml index e741f0b0a..a6fcc471d 100644 --- a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_package.yaml +++ b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_package.yaml @@ -28,9 +28,10 @@ insert_permissions: columns: - custom_registry - description + - fetched_time + - id - name - package_manager - - id backend_only: false select_permissions: - role: service @@ -38,9 +39,10 @@ select_permissions: columns: - custom_registry - description + - fetched_time + - id - name - package_manager - - id filter: {} update_permissions: - role: service @@ -48,8 +50,9 @@ update_permissions: columns: - custom_registry - description + - fetched_time + - id - name - package_manager - - id filter: {} check: {} diff --git a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_release.yaml b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_release.yaml index b3193ac8d..204e4215d 100644 --- a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_release.yaml +++ b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/package_release.yaml @@ -12,14 +12,14 @@ array_relationships: - name: release_dependencies using: foreign_key_constraint_on: - column: dependency_release_id + column: release_id table: schema: package name: release_dependency - name: release_dependents using: foreign_key_constraint_on: - column: release_id + column: dependency_release_id table: schema: package name: release_dependency @@ -35,45 +35,48 @@ insert_permissions: permission: check: {} columns: - - upstream_data - blob_hash + - fetched_time + - id - mirrored_blob_url - - upstream_blob_url - - version - observed_time - - release_time - - id - package_id - publishing_maintainer_id + - release_time + - upstream_blob_url + - upstream_data + - version backend_only: false select_permissions: - role: service permission: columns: - - upstream_data - blob_hash + - fetched_time + - id - mirrored_blob_url - - upstream_blob_url - - version - observed_time - - release_time - - id - package_id - publishing_maintainer_id + - release_time + - upstream_blob_url + - upstream_data + - version filter: {} update_permissions: - role: service permission: columns: - - upstream_data - blob_hash + - fetched_time + - id - mirrored_blob_url - - upstream_blob_url - - version - observed_time - - release_time - - id - package_id - publishing_maintainer_id + - release_time + - upstream_blob_url + - upstream_data + - version filter: {} check: {} diff --git a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/tables.yaml b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/tables.yaml index 63686120a..e9d6215d0 100644 --- a/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/tables.yaml +++ b/lunatrace/bsl/hasura/metadata/databases/lunatrace/tables/tables.yaml @@ -1,3 +1,10 @@ +- "!include package_license.yaml" +- "!include package_maintainer.yaml" +- "!include package_package.yaml" +- "!include package_package_maintainer.yaml" +- "!include package_release.yaml" +- "!include package_release_dependency.yaml" +- "!include package_release_license.yaml" - "!include public_builds.yaml" - "!include public_findings.yaml" - "!include public_github_repositories.yaml" @@ -22,10 +29,3 @@ - "!include public_vulnerabilities.yaml" - "!include public_vulnerability_packages.yaml" - "!include public_webhook_cache.yaml" -- "!include package_license.yaml" -- "!include package_maintainer.yaml" -- "!include package_package.yaml" -- "!include package_package_maintainer.yaml" -- "!include package_release.yaml" -- "!include package_release_dependency.yaml" -- "!include package_release_license.yaml" diff --git a/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/down.sql b/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/down.sql new file mode 100644 index 000000000..980c1a944 --- /dev/null +++ b/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/down.sql @@ -0,0 +1,52 @@ +CREATE TYPE package.license_source AS ENUM ('manual', 'scan_repo', 'scan_binary', 'api_npm'); + +CREATE TYPE package.package_manager AS ENUM ('npm'); + +ALTER TABLE package.release_license + ALTER COLUMN source TYPE package.license_source USING source::TEXT::package.license_source; + +ALTER TABLE package.package + ALTER COLUMN package_manager TYPE package.package_manager USING package_manager::TEXT::package.package_manager; + +ALTER TABLE package.maintainer + ALTER COLUMN package_manager TYPE package.package_manager USING package_manager::TEXT::package.package_manager; + +DROP TYPE public.license_source; + +DROP TYPE public.package_manager; + +CREATE UNIQUE INDEX ON package.maintainer (package_manager, email); +ALTER TABLE package.maintainer + DROP CONSTRAINT maintainer_package_manager_email_idx; + +CREATE UNIQUE INDEX ON package.package_maintainer (package_id, maintainer_id); +ALTER TABLE package.package_maintainer + DROP CONSTRAINT package_maintainer_package_id_maintainer_id_idx; + +CREATE UNIQUE INDEX ON package.package (package_manager, custom_registry, name); +ALTER TABLE package.package + DROP CONSTRAINT package_package_manager_custom_registry_name_idx; + +CREATE UNIQUE INDEX ON package.release (package_id, version); +ALTER TABLE package.release + DROP CONSTRAINT release_package_id_version_idx; + +CREATE UNIQUE INDEX ON package.release_dependency (release_id, package_name, package_version_query); +ALTER TABLE package.release_dependency + DROP CONSTRAINT release_dependency_release_id_package_name_package_version__idx; + +CREATE UNIQUE INDEX ON package.license (name); +ALTER TABLE package.license + DROP CONSTRAINT license_name_idx; + +ALTER TABLE package.package + DROP COLUMN fetched_time; + +ALTER TABLE package.release + DROP COLUMN fetched_time; + +ALTER TABLE package.package + ALTER COLUMN custom_registry DROP NOT NULL; + +ALTER TABLE package.package + ALTER COLUMN custom_registry DROP DEFAULT; diff --git a/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/up.sql b/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/up.sql new file mode 100644 index 000000000..950ef398a --- /dev/null +++ b/lunatrace/bsl/hasura/migrations/lunatrace/1654107375714_move_enums/up.sql @@ -0,0 +1,52 @@ +CREATE TYPE public.license_source AS ENUM ('manual', 'scan_repo', 'scan_binary', 'api_npm'); + +CREATE TYPE public.package_manager AS ENUM ('npm'); + +ALTER TABLE package.release_license + ALTER COLUMN source TYPE public.license_source USING source::TEXT::public.license_source; + +ALTER TABLE package.package + ALTER COLUMN package_manager TYPE public.package_manager USING package_manager::TEXT::public.package_manager; + +ALTER TABLE package.maintainer + ALTER COLUMN package_manager TYPE public.package_manager USING package_manager::TEXT::public.package_manager; + +DROP TYPE package.license_source; + +DROP TYPE package.package_manager; + +DROP INDEX IF EXISTS package.release_dependency_release_id_package_name_package_version__idx; +ALTER TABLE package.release_dependency + ADD CONSTRAINT release_dependency_release_id_package_name_package_version__idx UNIQUE (release_id, package_name, package_version_query); + +DROP INDEX IF EXISTS package.release_package_id_version_idx; +ALTER TABLE package.release + ADD CONSTRAINT release_package_id_version_idx UNIQUE (package_id, version); + +DROP INDEX IF EXISTS package.package_maintainer_package_id_maintainer_id_idx; +ALTER TABLE package.package_maintainer + ADD CONSTRAINT package_maintainer_package_id_maintainer_id_idx UNIQUE (package_id, maintainer_id); + +DROP INDEX IF EXISTS package.package_package_manager_custom_registry_name_idx; +ALTER TABLE package.package + ADD CONSTRAINT package_package_manager_custom_registry_name_idx UNIQUE (package_manager, custom_registry, name); + +DROP INDEX IF EXISTS package.maintainer_package_manager_email_idx; +ALTER TABLE package.maintainer + ADD CONSTRAINT maintainer_package_manager_email_idx UNIQUE (package_manager, email); + +DROP INDEX IF EXISTS package.license_name_idx; +ALTER TABLE package.license + ADD CONSTRAINT license_name_idx UNIQUE (name); + +ALTER TABLE package.package + ADD fetched_time timestamptz; + +ALTER TABLE package.release + ADD fetched_time timestamptz; + +ALTER TABLE package.package + ALTER COLUMN custom_registry SET NOT NULL; + +ALTER TABLE package.package + ALTER COLUMN custom_registry SET DEFAULT ''; diff --git a/lunatrace/bsl/license-worker/cmd/lpt/ingest/ingest.go b/lunatrace/bsl/license-worker/cmd/lpt/ingest/ingest.go index 805ebe592..40f5afe3c 100644 --- a/lunatrace/bsl/license-worker/cmd/lpt/ingest/ingest.go +++ b/lunatrace/bsl/license-worker/cmd/lpt/ingest/ingest.go @@ -12,22 +12,19 @@ package ingest import ( - "github.com/Khan/genqlient/graphql" + "fmt" + "github.com/urfave/cli/v2" "go.uber.org/fx" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/clifx" - "github.com/lunasec-io/lunasec/lunatrace/cli/gql" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata" ) type Params struct { fx.In - Fetcher fetcher.Fetcher - GQLClient graphql.Client + Ingester metadata.Ingester } func NewCommand(p Params) clifx.CommandResult { @@ -38,20 +35,26 @@ func NewCommand(p Params) clifx.CommandResult { Action: func(ctx *cli.Context) error { packageName := ctx.Args().First() - pkg, err := p.Fetcher.Fetch(ctx.Context, packageName) - if err != nil { - return err + pkgs := []string{packageName} + for fetchedPkgs := 0; len(pkgs) > fetchedPkgs; fetchedPkgs++ { + fmt.Println(pkgs[fetchedPkgs]) + newPkgs, err := p.Ingester.Ingest(ctx.Context, pkgs[fetchedPkgs]) + fmt.Println(newPkgs) + if err != nil { + fmt.Println(err) + } + out: + for _, newPkg := range newPkgs { + for _, oldPkg := range pkgs { + if newPkg == oldPkg { + continue out + } + } + pkgs = append(pkgs, newPkg) + } + fmt.Println(len(pkgs) - fetchedPkgs) } - gqlPkg, err := mapper.Map(pkg) - if err != nil { - return err - } - - _, err = gql.UpsertPackage(ctx.Context, p.GQLClient, gqlPkg, gql.PackageOnConflict) - if err != nil { - return err - } return nil }, }, diff --git a/lunatrace/bsl/license-worker/cmd/lpt/ingest/upsert_test.go b/lunatrace/bsl/license-worker/cmd/lpt/ingest/upsert_test.go deleted file mode 100644 index 933c1b976..000000000 --- a/lunatrace/bsl/license-worker/cmd/lpt/ingest/upsert_test.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package ingest - -import ( - "context" - "testing" - "time" - - "github.com/rs/zerolog" - "github.com/stretchr/testify/assert" - - "github.com/lunasec-io/lunasec/lunatrace/cli/gql" - "github.com/lunasec-io/lunasec/lunatrace/cli/gql/types" - "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/command" - "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/config" - "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/constants" - lunatypes "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/types" -) - -func TestUpsert(t *testing.T) { - // upsert package metadata - - globalFlags := lunatypes.NewLunaTraceGlobalFlags() - - command.EnableGlobalFlags(globalFlags) - - appConfig, err := config.LoadLunaTraceConfig() - assert.NoError(t, err) - - if appConfig.Stage == constants.DevelopmentEnv { - zerolog.SetGlobalLevel(zerolog.DebugLevel) - } - - const packageName = "test_package" - const dependencyName = "test_dependency" - - res, err := gql.UpsertPackage(context.Background(), gql.LocalClient, &gql.Package_insert_input{ - Custom_registry: "", - Description: "", - Name: packageName, - Package_maintainers: &gql.Package_package_maintainer_arr_rel_insert_input{ - Data: []*gql.Package_package_maintainer_insert_input{ - // slice of join table - { - Maintainer: &gql.Package_maintainer_obj_rel_insert_input{ - Data: &gql.Package_maintainer_insert_input{ - Email: "", - Name: "", - Package_manager: types.NPM, - }, - On_conflict: gql.MaintainerOnConflict, - }, - }, - }, - On_conflict: gql.PackageMaintainerOnConflict, - }, - Package_manager: types.NPM, - Releases: &gql.Package_release_arr_rel_insert_input{ - Data: []*gql.Package_release_insert_input{ - // slice of release - { - Publishing_maintainer: &gql.Package_maintainer_obj_rel_insert_input{ - Data: &gql.Package_maintainer_insert_input{ - Email: "", - Name: "", - Package_manager: types.NPM, - }, - On_conflict: gql.MaintainerOnConflict, - }, - Release_dependencies: &gql.Package_release_dependency_arr_rel_insert_input{ - Data: []*gql.Package_release_dependency_insert_input{ - // slice of deps - { - // create a stub entry for packages which are not yet analyzed. - Dependency_package: &gql.Package_obj_rel_insert_input{ - Data: &gql.Package_insert_input{ - Name: dependencyName, - Package_manager: types.NPM, - }, - On_conflict: gql.PackageOnConflict, - }, - // todo we dont have resolved versions maybe so idk - Dependency_release: nil, - Package_name: dependencyName, - Package_version_query: "", - }, - }, - On_conflict: gql.PackageReleaseDependencyOnConflict, - }, - - Release_time: time.Time{}, - - Blob_hash: "", - Mirrored_blob_url: "", - Upstream_blob_url: "", - - Upstream_data: nil, - - Version: "", - }, - }, - On_conflict: gql.ReleaseOnConflict, - }, - }, gql.PackageOnConflict) - - assert.NoError(t, err) - assert.NotNil(t, res) - t.Log(res) - -} diff --git a/lunatrace/bsl/license-worker/cmd/lpt/main.go b/lunatrace/bsl/license-worker/cmd/lpt/main.go index 6d47bb7e5..3caa12ae6 100644 --- a/lunatrace/bsl/license-worker/cmd/lpt/main.go +++ b/lunatrace/bsl/license-worker/cmd/lpt/main.go @@ -22,7 +22,8 @@ import ( "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/clifx" "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/license/scanner/licensecheck" "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/license/scanner/packagejson" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester" "github.com/lunasec-io/lunasec/lunatrace/cli/fx/lunatracefx" "github.com/lunasec-io/lunasec/lunatrace/cli/gql" "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/types" @@ -51,7 +52,8 @@ func main() { license.NewCommand, ), fx.Provide( - npm2.NewNPMFetcher, + npm.NewNPMFetcher, + ingester.NewHasuraIngester, ingest.NewCommand, ), ) diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/fetcher.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher.go similarity index 80% rename from lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/fetcher.go rename to lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher.go index daa643893..f9b9a8d9e 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/fetcher.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher.go @@ -1,6 +1,6 @@ // Copyright by LunaSec (owned by Refinery Labs, Inc) // -// Licensed under the Business Source License v1.1 +// Licensed under the Business Source License v1.1 // (the "License"); you may not use this file except in compliance with the // License. You may obtain a copy of the License at // @@ -9,7 +9,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -package fetcher +package metadata import ( "context" @@ -55,6 +55,9 @@ type Dependency struct { IsDev bool } +// Fetcher fetches packages from a package metadata source. +// Each metadata source must implement this interface. +// Each Fetcher should adapt the data from the metadata source into the intermediate type PackageMetadata. type Fetcher interface { Fetch(ctx context.Context, pkgName string) (*PackageMetadata, error) } diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/constants.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/constants.go index bd993cd97..f5c4d6384 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/constants.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/constants.go @@ -9,20 +9,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// package npm import "path" @@ -75,10 +61,6 @@ var NpmRegistryMirrors = []string{ const ( archiveDir = "../archive" - - packageMetadataFilename = "package_metadata.json" - - fsPerm = 0755 ) var ( diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/graph.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/graph.go deleted file mode 100644 index a418f83b8..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/graph.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - //. "asset-engine/.gen/assets/public/table" - "database/sql" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "path" - "strings" - "sync" - "time" - - whoisparser "github.com/likexian/whois-parser" - "github.com/rs/zerolog/log" - whois "github.com/undiabler/golang-whois" -) - -var ( - db *sql.DB -) - -// func init() { -// var err error - -// db, err = sql.Open("postgres", "postgres://postgres:postgrespassword@localhost:5431/assets?sslmode=disable") -// if err != nil { -// log.Error().Err(err).Msg("unable to open database") -// panic(err) -// } -// } - -type packageGraphJob struct { - name string - packageName string -} - -func LoadNpmPackageMetadata(packageName, packageDir string) (packageManifest NpmPackageMetadata, err error) { - packageJsonFilepath := path.Join(packageDir, packageMetadataFilename) - - content, err := ioutil.ReadFile(packageJsonFilepath) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to save package metadata") - return - } - - err = json.Unmarshal(content, &packageManifest) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to decode package metadata") - return - } - return -} - -func parseEmail(email string) (username, domain string, err error) { - at := strings.LastIndex(email, "@") - if at >= 0 { - username, domain = email[:at], email[at+1:] - } else { - err = errors.New("unable to parse email address") - } - return -} - -func generatePackageGraph(packageName string) (err error) { - packageDir := path.Join(npmPackageDir, packageName) - meta, err := LoadNpmPackageMetadata(packageName, packageDir) - if err != nil { - return - } - - for _, author := range meta.Maintainers { - _, domain, err := parseEmail(author.Email) - if err != nil { - continue - } - whoisResult, err := whois.GetWhois(domain) - if err != nil { - continue - } - - result, err := whoisparser.Parse(whoisResult) - if err == nil { - // Print the domain status - // fmt.Println(result.Domain.Status) - - // // Print the domain created date - // fmt.Println(result.Domain.CreatedDate) - - // Print the domain expiration date - // fmt.Println(result.Domain.ExpirationDate) - - RFC3339local := "2006-01-02T15:04:05Z" - - loc, err := time.LoadLocation("America/New_York") - if err != nil { - continue - } - - t1, _ := time.ParseInLocation(RFC3339local, result.Domain.ExpirationDate, loc) - if time.Now().After(t1) { - log.Info(). - Str("package", meta.Name). - Str("email", author.Email). - Str("expired", result.Domain.ExpirationDate). - Err(err). - Msg("email returned error") - } - - // if result.Registrar != nil { - // // Print the registrar name - // fmt.Println(result.Registrar.Name) - // } - - // if result.Registrant != nil { - // // Print the registrant name - // fmt.Println(result.Registrant.Name) - - // // Print the registrant email address - // fmt.Println(result.Registrant.Email) - // } - } - } - - // latest, err := GetLatestNpmPackageVersion(meta) - // if err != nil { - // return - // } - // for depName, depVersion := range latest.Dependencies { - // stmt := Packages. - // INSERT(Packages.From, Packages.FromSemver, Packages.To, Packages.ToSemver). - // VALUES(latest.Name, latest.Version, depName, depVersion). - // ON_CONFLICT(Packages.From, Packages.FromSemver, Packages.To, Packages.ToSemver). - // DO_NOTHING() - // _, err = stmt.Exec(db) - // if err != nil { - // log.Error().Err(err).Msg("unable to insert into db") - // } - // } - return -} - -func generatePackageGraphWorker(id int, j packageGraphJob) { - log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker started job") - - defer log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker completed job") - - err := generatePackageGraph(j.packageName) - if err != nil { - log.Error(). - Err(err). - Str("packageName", j.packageName). - Msg("unable to generate package graph") - } -} - -func CreatePackageGraph(packages []string) { - // channel for jobs - jobs := make(chan packageGraphJob) - - // start workers - wg := &sync.WaitGroup{} - wg.Add(maxWorkers) - for i := 1; i <= maxWorkers; i++ { - go func(i int) { - defer wg.Done() - - for j := range jobs { - generatePackageGraphWorker(i, j) - } - }(i) - } - - // add jobs - for i := 0; i < len(packages); i++ { - packageName := packages[i] - name := fmt.Sprintf("job-%d", i) - log.Debug(). - Int("worker", i). - Str("job", name). - Str("packageName", packageName). - Msg("adding job to worker") - jobs <- packageGraphJob{name, packageName} - } - close(jobs) - - // wait for workers to complete - wg.Wait() -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/init.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/init.go deleted file mode 100644 index eb2cc71b8..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/init.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import "os" - -func init() { - err := os.MkdirAll(npmPackageDir, fsPerm) - if err != nil { - panic(err) - } -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/mapper.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/mapper.go similarity index 63% rename from lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/mapper.go rename to lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/mapper.go index 8a559ee46..dedfd3729 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/mapper.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/mapper.go @@ -9,25 +9,24 @@ // See the License for the specific language governing permissions and // limitations under the License. // -package npm2 +package npm import ( "encoding/json" "time" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata" ) -func adapt(n *npm.NpmPackageMetadataWithRawVersion, raw []byte) (*fetcher.PackageMetadata, error) { +func adapt(n *NpmPackageMetadataWithRawVersion, raw []byte) (*metadata.PackageMetadata, error) { releases, err := mapReleases(n.VersionsRaw) if err != nil { return nil, err } - r := &fetcher.PackageMetadata{ + r := &metadata.PackageMetadata{ Name: n.Name, Description: n.Description, - Registry: npm.NpmRegistry, + Registry: NpmRegistry, Maintainers: mapMaintainers(n.Maintainers), Releases: releases, UpstreamData: raw, @@ -36,10 +35,10 @@ func adapt(n *npm.NpmPackageMetadataWithRawVersion, raw []byte) (*fetcher.Packag return r, nil } -func mapMaintainers(a []npm.Author) []fetcher.Maintainer { - m := make([]fetcher.Maintainer, len(a)) +func mapMaintainers(a []Author) []metadata.Maintainer { + m := make([]metadata.Maintainer, len(a)) for i, mt := range a { - m[i] = fetcher.Maintainer{ + m[i] = metadata.Maintainer{ Name: mt.Name, Email: mt.Email, } @@ -48,21 +47,21 @@ func mapMaintainers(a []npm.Author) []fetcher.Maintainer { return m } -func mapReleases(r map[string]json.RawMessage) ([]fetcher.Release, error) { - m := make([]fetcher.Release, 0, len(r)) +func mapReleases(r map[string]json.RawMessage) ([]metadata.Release, error) { + m := make([]metadata.Release, 0, len(r)) for rv, rrl := range r { - var rl npm.Version + var rl Version err := json.Unmarshal(rrl, &rl) if err != nil { return nil, err } - m = append(m, fetcher.Release{ + m = append(m, metadata.Release{ Version: rv, - PublishingMaintainer: fetcher.Maintainer{ + PublishingMaintainer: metadata.Maintainer{ Name: rl.NpmUser.Name, Email: rl.NpmUser.Email, }, @@ -74,7 +73,7 @@ func mapReleases(r map[string]json.RawMessage) ([]fetcher.Release, error) { UpstreamData: rrl, - //todo + //todo make releasetime nullable ReleaseTime: time.Time{}, }) @@ -82,17 +81,17 @@ func mapReleases(r map[string]json.RawMessage) ([]fetcher.Release, error) { return m, nil } -func mapDependencies(deps, devdeps map[string]string) []fetcher.Dependency { - m := make([]fetcher.Dependency, 0, len(deps)+len(devdeps)) +func mapDependencies(deps, devdeps map[string]string) []metadata.Dependency { + m := make([]metadata.Dependency, 0, len(deps)+len(devdeps)) for dep, ver := range deps { - m = append(m, fetcher.Dependency{ + m = append(m, metadata.Dependency{ Name: dep, Version: ver, IsDev: false, }) } for dep, ver := range devdeps { - m = append(m, fetcher.Dependency{ + m = append(m, metadata.Dependency{ Name: dep, Version: ver, IsDev: true, diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/npm.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/npm.go similarity index 75% rename from lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/npm.go rename to lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/npm.go index 9fd62b706..714c37ca9 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm2/npm.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/npm.go @@ -9,7 +9,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -package npm2 +package npm import ( "context" @@ -20,8 +20,7 @@ import ( "go.uber.org/fx" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher" - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata" ) type npmFetcherDeps struct { @@ -33,8 +32,8 @@ type npmFetcher struct { deps npmFetcherDeps } -func (n *npmFetcher) Fetch(ctx context.Context, pkgName string) (*fetcher.PackageMetadata, error) { - req, err := http.NewRequestWithContext(ctx, http.MethodGet, npm.NpmRegistry+"/"+pkgName, nil) +func (n *npmFetcher) Fetch(ctx context.Context, pkgName string) (*metadata.PackageMetadata, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, NpmRegistry+"/"+pkgName, nil) if err != nil { return nil, err } @@ -51,7 +50,7 @@ func (n *npmFetcher) Fetch(ctx context.Context, pkgName string) (*fetcher.Packag return nil, err } - var pkgMeta npm.NpmPackageMetadataWithRawVersion + var pkgMeta NpmPackageMetadataWithRawVersion err = json.Unmarshal(pkgMetaRaw, &pkgMeta) if err != nil { return nil, err @@ -60,6 +59,6 @@ func (n *npmFetcher) Fetch(ctx context.Context, pkgName string) (*fetcher.Packag return adapt(&pkgMeta, pkgMetaRaw) } -func NewNPMFetcher(d npmFetcherDeps) fetcher.Fetcher { +func NewNPMFetcher(d npmFetcherDeps) metadata.Fetcher { return &npmFetcher{deps: d} } diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/packages.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/packages.go deleted file mode 100644 index 318eb49ab..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/packages.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - "encoding/json" - "errors" - _ "expvar" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "os" - "path" - "sync" - "time" - - "github.com/jpillora/backoff" - "github.com/rs/zerolog/log" -) - -const maxWorkers = 10 - -type job struct { - name string - packageName string - onlyPullMetadata bool -} - -func GetLatestNpmPackageVersion(packageManifest NpmPackageMetadata) (version Version, err error) { - latestDistTag := packageManifest.DistTags.Latest - latestVersion, ok := packageManifest.Versions[latestDistTag] - if !ok { - err = errors.New("no latest version for package") - log.Error(). - Err(err). - Str("latestDistTag", latestDistTag). - Str("packageName", packageManifest.Name). - Msg("unable to get latest dist version") - return - } - version = latestVersion - return -} - -func PullNpmPackageMetadata(packageName, packageDir string) (packageManifest NpmPackageMetadata, err error) { - url := NpmRegistry + "/" + packageName - r, err := http.Get(url) - if err != nil { - log.Error(). - Err(err). - Str("url", url). - Str("packageName", packageName). - Msg("unable to request package metadata") - return - } - defer r.Body.Close() - - body, err := ioutil.ReadAll(r.Body) - if err != nil { - log.Error(). - Err(err). - Str("url", url). - Str("packageName", packageName). - Msg("unable to read package metadata body") - return - } - - packageJsonFilepath := path.Join(packageDir, packageMetadataFilename) - - err = ioutil.WriteFile(packageJsonFilepath, body, fsPerm) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to save package metadata") - return - } - - err = json.Unmarshal(body, &packageManifest) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to decode package metadata") - return - } - return -} - -func savePackageInformation(packageName string, onlyPullMetadata bool) (retry bool, err error) { - packageDir := path.Join(npmPackageDir, packageName) - err = os.MkdirAll(packageDir, fsPerm) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to create package dir") - return - } - - packageMetadata, err := PullNpmPackageMetadata(packageName, packageDir) - if err != nil { - return - } - - if onlyPullMetadata { - log.Info(). - Str("packageName", packageMetadata.Name). - Msg("downloaded metadata for package") - return - } - - latestVersion, err := GetLatestNpmPackageVersion(packageMetadata) - if err != nil { - return - } - - tarballUrl, err := url.Parse(latestVersion.Dist.Tarball) - if err != nil { - log.Error(). - Err(err). - Str("tarball", latestVersion.Dist.Tarball). - Str("packageName", packageMetadata.Name). - Msg("unable to parse tarball url") - return - } - - tarballFilename := path.Base(tarballUrl.Path) - tarFile := path.Join(packageDir, tarballFilename) - - if _, err = os.Stat(tarFile); err != nil { - log.Info(). - Str("tarFile", tarFile). - Str("packageName", packageMetadata.Name). - Msg("skipping download, file already downloaded") - return - } - - err = DownloadFile(tarFile, latestVersion.Dist.Tarball) - if err != nil { - log.Error(). - Err(err). - Str("tarFile", tarFile). - Str("url", latestVersion.Dist.Tarball). - Msg("unable to download tarball") - return - } - log.Info(). - Str("tarFile", tarFile). - Msg("saved package version tarball") - return -} - -func doWork(id int, j job, b *backoff.Backoff) { - log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker started job") - - defer log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker completed job") - - var ( - err error - attempt = true - ) - - for attempt { - attempt, err = savePackageInformation(j.packageName, j.onlyPullMetadata) - if attempt { - duration := b.Duration() - log.Warn(). - Err(err). - Float64("duration (in seconds)", duration.Seconds()). - Msg("encountered retriable error, backing off") - time.Sleep(duration) - } - } - - if err != nil { - log.Error(). - Err(err). - Str("packageName", j.packageName). - Msg("unable to archive package information") - } - b.Reset() -} - -func ArchiveNpmPackages(packages []string, onlyPullMetadata bool) { - // channel for jobs - jobs := make(chan job) - - // start workers - wg := &sync.WaitGroup{} - wg.Add(maxWorkers) - for i := 1; i <= maxWorkers; i++ { - go func(i int) { - defer wg.Done() - - b := &backoff.Backoff{ - Max: time.Minute, - } - for j := range jobs { - doWork(i, j, b) - } - }(i) - } - - // add jobs - for i := 0; i < len(packages); i++ { - packageName := packages[i] - name := fmt.Sprintf("job-%d", i) - log.Debug(). - Int("worker", i). - Str("job", name). - Str("packageName", packageName). - Msg("adding job to worker") - jobs <- job{name, packageName, onlyPullMetadata} - } - close(jobs) - - // wait for workers to complete - wg.Wait() -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/types.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/types.go index f8ec2d2cd..8016e13af 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/types.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/types.go @@ -1,6 +1,6 @@ // Copyright by LunaSec (owned by Refinery Labs, Inc) // -// Licensed under the Business Source License v1.1 +// Licensed under the Business Source License v1.1 // (the "License"); you may not use this file except in compliance with the // License. You may obtain a copy of the License at // @@ -9,20 +9,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// package npm import "encoding/json" diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/util.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/util.go deleted file mode 100644 index 3e10b2cdb..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher/npm/util.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - "io" - "net/http" - "os" -) - -// DownloadFile will download a url to a local file. It's efficient because it will -// write as it downloads and not load the whole file into memory. -func DownloadFile(filepath string, url string) error { - - // Get the data - resp, err := http.Get(url) - if err != nil { - return err - } - defer resp.Body.Close() - - // Create the file - out, err := os.Create(filepath) - if err != nil { - return err - } - defer out.Close() - - // Write the body to file - _, err = io.Copy(out, resp.Body) - return err -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester.go new file mode 100644 index 000000000..0b913dbb0 --- /dev/null +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester.go @@ -0,0 +1,22 @@ +// Copyright by LunaSec (owned by Refinery Labs, Inc) +// +// Licensed under the Business Source License v1.1 +// (the "License"); you may not use this file except in compliance with the +// License. You may obtain a copy of the License at +// +// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +package metadata + +import ( + "context" +) + +// Ingester ingests and upserts a single package from a datasource. +// It may return a list of suggestions for further packages to fetch. +type Ingester interface { + Ingest(ctx context.Context, packageName string) ([]string, error) +} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester/hasura.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester/hasura.go new file mode 100644 index 000000000..099416f2b --- /dev/null +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/ingester/hasura.go @@ -0,0 +1,99 @@ +// Copyright by LunaSec (owned by Refinery Labs, Inc) +// +// Licensed under the Business Source License v1.1 +// (the "License"); you may not use this file except in compliance with the +// License. You may obtain a copy of the License at +// +// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +package ingester + +import ( + "context" + "fmt" + "time" + + "github.com/Khan/genqlient/graphql" + "go.uber.org/fx" + + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata" + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper" + "github.com/lunasec-io/lunasec/lunatrace/cli/gql" + "github.com/lunasec-io/lunasec/lunatrace/cli/gql/types" + "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/util" +) + +// todo tune date +const refetchDays = 7 + +type Params struct { + fx.In + + Fetcher metadata.Fetcher + GQLClient graphql.Client +} + +type hasuraNPMIngester struct { + deps Params +} + +var npmV types.PackageManager = types.NPM + +func (h *hasuraNPMIngester) Ingest(ctx context.Context, packageName string) ([]string, error) { + // todo make sure this isn't too restrictive + // check if we've already fetched this package + checkRes, err := gql.PackageFetchTime(ctx, h.deps.GQLClient, &npmV, util.Ptr(""), util.Ptr(packageName)) + if err != nil { + return nil, err + } + for _, pkg := range checkRes.Package { + fmt.Println(pkg) + if pkg.Fetched_time != nil && + pkg.Fetched_time.After(time.Now().AddDate(0, 0, -refetchDays)) { + // bail out early + fmt.Println("bail out because we already have package") + return nil, nil + } + } + + pkg, err := h.deps.Fetcher.Fetch(ctx, packageName) + if err != nil { + return nil, err + } + + gqlPkg, err := mapper.Map(pkg) + if err != nil { + return nil, err + } + + res, err := gql.UpsertPackage(ctx, h.deps.GQLClient, gqlPkg, gql.PackageOnConflict) + if err != nil { + return nil, err + } + + needToCheck := make(map[string]struct{}) + + for _, rel := range res.Insert_package_one.Releases { + for _, dep := range rel.Release_dependencies { + if dep.Dependency_package == nil || + dep.Dependency_package.Fetched_time == nil || + dep.Dependency_package.Fetched_time.Before(time.Now().AddDate(0, 0, -refetchDays)) { + needToCheck[dep.Dependency_package.Name] = struct{}{} + } + } + } + + checkList := make([]string, 0, len(needToCheck)) + for pkgName, _ := range needToCheck { + checkList = append(checkList, pkgName) + } + + return checkList, nil +} + +func NewHasuraIngester(p Params) (metadata.Ingester, error) { + return &hasuraNPMIngester{deps: p}, nil +} diff --git a/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper/upsert.go b/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper/upsert.go index 019567d94..1bd3255dd 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper/upsert.go +++ b/lunatrace/bsl/license-worker/internal/pkg/metadata/mapper/upsert.go @@ -12,21 +12,28 @@ package mapper import ( - "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata/fetcher" + "time" + + "github.com/lunasec-io/lunasec/lunatrace/bsl/license-worker/internal/pkg/metadata" "github.com/lunasec-io/lunasec/lunatrace/cli/gql" "github.com/lunasec-io/lunasec/lunatrace/cli/gql/types" + "github.com/lunasec-io/lunasec/lunatrace/cli/pkg/util" ) -func Map(p *fetcher.PackageMetadata) (*gql.Package_insert_input, error) { +var npmV types.PackageManager = types.NPM + +// Map converts a fetcher.PackageMetadata into the struct required by GraphQL codegen. +func Map(p *metadata.PackageMetadata) (*gql.Package_insert_input, error) { r := &gql.Package_insert_input{ - Custom_registry: p.Registry, - Description: p.Description, - Name: p.Name, + Custom_registry: util.Ptr(""), + Description: util.Ptr(p.Description), + Name: util.Ptr(p.Name), + Fetched_time: util.Ptr(time.Now()), Package_maintainers: &gql.Package_package_maintainer_arr_rel_insert_input{ Data: mapMaintainers(p.Maintainers), On_conflict: gql.PackageMaintainerOnConflict, }, - Package_manager: types.NPM, + Package_manager: &npmV, Releases: &gql.Package_release_arr_rel_insert_input{ Data: mapReleases(p.Releases), On_conflict: gql.ReleaseOnConflict, @@ -35,19 +42,19 @@ func Map(p *fetcher.PackageMetadata) (*gql.Package_insert_input, error) { return r, nil } -func mapReleases(r []fetcher.Release) []*gql.Package_release_insert_input { +func mapReleases(r []metadata.Release) []*gql.Package_release_insert_input { m := make([]*gql.Package_release_insert_input, len(r)) for i, rl := range r { m[i] = &gql.Package_release_insert_input{ Publishing_maintainer: mapMaintainer(rl.PublishingMaintainer), - Release_time: rl.ReleaseTime, - Blob_hash: rl.BlobHash, - Upstream_blob_url: rl.UpstreamBlobUrl, - Upstream_data: rl.UpstreamData, - Version: rl.Version, + Release_time: util.Ptr(rl.ReleaseTime), + Blob_hash: util.Ptr(rl.BlobHash), + Upstream_blob_url: util.Ptr(rl.UpstreamBlobUrl), + Upstream_data: util.Ptr(rl.UpstreamData), + Version: util.Ptr(rl.Version), - Mirrored_blob_url: "", + Fetched_time: util.Ptr(time.Now()), Release_dependencies: &gql.Package_release_dependency_arr_rel_insert_input{ Data: mapDependencies(rl.Dependencies), @@ -60,28 +67,26 @@ func mapReleases(r []fetcher.Release) []*gql.Package_release_insert_input { return m } -func mapDependencies(ds []fetcher.Dependency) []*gql.Package_release_dependency_insert_input { +func mapDependencies(ds []metadata.Dependency) []*gql.Package_release_dependency_insert_input { m := make([]*gql.Package_release_dependency_insert_input, len(ds)) for i, dep := range ds { m[i] = &gql.Package_release_dependency_insert_input{ // create a stub entry for packages which are not yet analyzed. Dependency_package: &gql.Package_obj_rel_insert_input{ Data: &gql.Package_insert_input{ - Name: dep.Name, - Package_manager: types.NPM, + Name: util.Ptr(dep.Name), + Package_manager: &npmV, }, On_conflict: gql.PackageOnConflict, }, - // todo we dont have resolved versions maybe so idk - Dependency_release: nil, - Package_name: dep.Name, - Package_version_query: dep.Version, + Package_name: util.Ptr(dep.Name), + Package_version_query: util.Ptr(dep.Version), } } return m } -func mapMaintainers(p []fetcher.Maintainer) []*gql.Package_package_maintainer_insert_input { +func mapMaintainers(p []metadata.Maintainer) []*gql.Package_package_maintainer_insert_input { m := make([]*gql.Package_package_maintainer_insert_input, len(p)) for i, pm := range p { m[i] = &gql.Package_package_maintainer_insert_input{ @@ -92,12 +97,12 @@ func mapMaintainers(p []fetcher.Maintainer) []*gql.Package_package_maintainer_in return m } -func mapMaintainer(pm fetcher.Maintainer) *gql.Package_maintainer_obj_rel_insert_input { +func mapMaintainer(pm metadata.Maintainer) *gql.Package_maintainer_obj_rel_insert_input { return &gql.Package_maintainer_obj_rel_insert_input{ Data: &gql.Package_maintainer_insert_input{ - Email: pm.Email, - Name: pm.Name, - Package_manager: types.NPM, + Email: util.Ptr(pm.Email), + Name: util.Ptr(pm.Name), + Package_manager: &npmV, }, On_conflict: gql.MaintainerOnConflict, } diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/constants.go b/lunatrace/bsl/license-worker/internal/pkg/npm/constants.go deleted file mode 100644 index bd993cd97..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/constants.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import "path" - -const ( - /** - * npm registry - * - * @see {@link https://registry.npmjs.org} - */ - NpmRegistry = "https://registry.npmjs.org" - - /** - * npm registry mirror by Cloudflare - * - * @remarks - * This registry has CORS enabled and can be used to retrieve - * package manifests and packuments in the browser. - * - * @see {@link https://npmjs.cf} - * @see {@link https://registry.npmjs.cf} - */ - CloudflareRegistry = "https://registry.npmjs.cf" - - /** - * npm registry mirror by Yarn - * - * @see {@link https://registry.yarnpkg.com} - */ - YarnRegistry = "https://registry.yarnpkg.com" - - /** - * Downloads API for the npm registry - * - * @see {@link https://api.npmjs.org} - */ - NpmRegistryDownloadsAPI = "https://api.npmjs.org" -) - -/** - * Mirrors of the npm registry. - * - * @see {@link cloudflareRegistry} - * @see {@link yarnRegistry} - */ -var NpmRegistryMirrors = []string{ - CloudflareRegistry, - YarnRegistry, -} - -const ( - archiveDir = "../archive" - - packageMetadataFilename = "package_metadata.json" - - fsPerm = 0755 -) - -var ( - npmArchiveDir = path.Join(archiveDir, "npm") - npmPackageDir = path.Join(npmArchiveDir, "packages") -) diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/graph.go b/lunatrace/bsl/license-worker/internal/pkg/npm/graph.go deleted file mode 100644 index a418f83b8..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/graph.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - //. "asset-engine/.gen/assets/public/table" - "database/sql" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "path" - "strings" - "sync" - "time" - - whoisparser "github.com/likexian/whois-parser" - "github.com/rs/zerolog/log" - whois "github.com/undiabler/golang-whois" -) - -var ( - db *sql.DB -) - -// func init() { -// var err error - -// db, err = sql.Open("postgres", "postgres://postgres:postgrespassword@localhost:5431/assets?sslmode=disable") -// if err != nil { -// log.Error().Err(err).Msg("unable to open database") -// panic(err) -// } -// } - -type packageGraphJob struct { - name string - packageName string -} - -func LoadNpmPackageMetadata(packageName, packageDir string) (packageManifest NpmPackageMetadata, err error) { - packageJsonFilepath := path.Join(packageDir, packageMetadataFilename) - - content, err := ioutil.ReadFile(packageJsonFilepath) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to save package metadata") - return - } - - err = json.Unmarshal(content, &packageManifest) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to decode package metadata") - return - } - return -} - -func parseEmail(email string) (username, domain string, err error) { - at := strings.LastIndex(email, "@") - if at >= 0 { - username, domain = email[:at], email[at+1:] - } else { - err = errors.New("unable to parse email address") - } - return -} - -func generatePackageGraph(packageName string) (err error) { - packageDir := path.Join(npmPackageDir, packageName) - meta, err := LoadNpmPackageMetadata(packageName, packageDir) - if err != nil { - return - } - - for _, author := range meta.Maintainers { - _, domain, err := parseEmail(author.Email) - if err != nil { - continue - } - whoisResult, err := whois.GetWhois(domain) - if err != nil { - continue - } - - result, err := whoisparser.Parse(whoisResult) - if err == nil { - // Print the domain status - // fmt.Println(result.Domain.Status) - - // // Print the domain created date - // fmt.Println(result.Domain.CreatedDate) - - // Print the domain expiration date - // fmt.Println(result.Domain.ExpirationDate) - - RFC3339local := "2006-01-02T15:04:05Z" - - loc, err := time.LoadLocation("America/New_York") - if err != nil { - continue - } - - t1, _ := time.ParseInLocation(RFC3339local, result.Domain.ExpirationDate, loc) - if time.Now().After(t1) { - log.Info(). - Str("package", meta.Name). - Str("email", author.Email). - Str("expired", result.Domain.ExpirationDate). - Err(err). - Msg("email returned error") - } - - // if result.Registrar != nil { - // // Print the registrar name - // fmt.Println(result.Registrar.Name) - // } - - // if result.Registrant != nil { - // // Print the registrant name - // fmt.Println(result.Registrant.Name) - - // // Print the registrant email address - // fmt.Println(result.Registrant.Email) - // } - } - } - - // latest, err := GetLatestNpmPackageVersion(meta) - // if err != nil { - // return - // } - // for depName, depVersion := range latest.Dependencies { - // stmt := Packages. - // INSERT(Packages.From, Packages.FromSemver, Packages.To, Packages.ToSemver). - // VALUES(latest.Name, latest.Version, depName, depVersion). - // ON_CONFLICT(Packages.From, Packages.FromSemver, Packages.To, Packages.ToSemver). - // DO_NOTHING() - // _, err = stmt.Exec(db) - // if err != nil { - // log.Error().Err(err).Msg("unable to insert into db") - // } - // } - return -} - -func generatePackageGraphWorker(id int, j packageGraphJob) { - log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker started job") - - defer log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker completed job") - - err := generatePackageGraph(j.packageName) - if err != nil { - log.Error(). - Err(err). - Str("packageName", j.packageName). - Msg("unable to generate package graph") - } -} - -func CreatePackageGraph(packages []string) { - // channel for jobs - jobs := make(chan packageGraphJob) - - // start workers - wg := &sync.WaitGroup{} - wg.Add(maxWorkers) - for i := 1; i <= maxWorkers; i++ { - go func(i int) { - defer wg.Done() - - for j := range jobs { - generatePackageGraphWorker(i, j) - } - }(i) - } - - // add jobs - for i := 0; i < len(packages); i++ { - packageName := packages[i] - name := fmt.Sprintf("job-%d", i) - log.Debug(). - Int("worker", i). - Str("job", name). - Str("packageName", packageName). - Msg("adding job to worker") - jobs <- packageGraphJob{name, packageName} - } - close(jobs) - - // wait for workers to complete - wg.Wait() -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/packages.go b/lunatrace/bsl/license-worker/internal/pkg/npm/packages.go deleted file mode 100644 index 318eb49ab..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/packages.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - "encoding/json" - "errors" - _ "expvar" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "os" - "path" - "sync" - "time" - - "github.com/jpillora/backoff" - "github.com/rs/zerolog/log" -) - -const maxWorkers = 10 - -type job struct { - name string - packageName string - onlyPullMetadata bool -} - -func GetLatestNpmPackageVersion(packageManifest NpmPackageMetadata) (version Version, err error) { - latestDistTag := packageManifest.DistTags.Latest - latestVersion, ok := packageManifest.Versions[latestDistTag] - if !ok { - err = errors.New("no latest version for package") - log.Error(). - Err(err). - Str("latestDistTag", latestDistTag). - Str("packageName", packageManifest.Name). - Msg("unable to get latest dist version") - return - } - version = latestVersion - return -} - -func PullNpmPackageMetadata(packageName, packageDir string) (packageManifest NpmPackageMetadata, err error) { - url := NpmRegistry + "/" + packageName - r, err := http.Get(url) - if err != nil { - log.Error(). - Err(err). - Str("url", url). - Str("packageName", packageName). - Msg("unable to request package metadata") - return - } - defer r.Body.Close() - - body, err := ioutil.ReadAll(r.Body) - if err != nil { - log.Error(). - Err(err). - Str("url", url). - Str("packageName", packageName). - Msg("unable to read package metadata body") - return - } - - packageJsonFilepath := path.Join(packageDir, packageMetadataFilename) - - err = ioutil.WriteFile(packageJsonFilepath, body, fsPerm) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to save package metadata") - return - } - - err = json.Unmarshal(body, &packageManifest) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to decode package metadata") - return - } - return -} - -func savePackageInformation(packageName string, onlyPullMetadata bool) (retry bool, err error) { - packageDir := path.Join(npmPackageDir, packageName) - err = os.MkdirAll(packageDir, fsPerm) - if err != nil { - log.Error(). - Err(err). - Str("packageName", packageName). - Msg("unable to create package dir") - return - } - - packageMetadata, err := PullNpmPackageMetadata(packageName, packageDir) - if err != nil { - return - } - - if onlyPullMetadata { - log.Info(). - Str("packageName", packageMetadata.Name). - Msg("downloaded metadata for package") - return - } - - latestVersion, err := GetLatestNpmPackageVersion(packageMetadata) - if err != nil { - return - } - - tarballUrl, err := url.Parse(latestVersion.Dist.Tarball) - if err != nil { - log.Error(). - Err(err). - Str("tarball", latestVersion.Dist.Tarball). - Str("packageName", packageMetadata.Name). - Msg("unable to parse tarball url") - return - } - - tarballFilename := path.Base(tarballUrl.Path) - tarFile := path.Join(packageDir, tarballFilename) - - if _, err = os.Stat(tarFile); err != nil { - log.Info(). - Str("tarFile", tarFile). - Str("packageName", packageMetadata.Name). - Msg("skipping download, file already downloaded") - return - } - - err = DownloadFile(tarFile, latestVersion.Dist.Tarball) - if err != nil { - log.Error(). - Err(err). - Str("tarFile", tarFile). - Str("url", latestVersion.Dist.Tarball). - Msg("unable to download tarball") - return - } - log.Info(). - Str("tarFile", tarFile). - Msg("saved package version tarball") - return -} - -func doWork(id int, j job, b *backoff.Backoff) { - log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker started job") - - defer log.Debug(). - Int("worker", id). - Str("job", j.name). - Str("packageName", j.packageName). - Msg("worker completed job") - - var ( - err error - attempt = true - ) - - for attempt { - attempt, err = savePackageInformation(j.packageName, j.onlyPullMetadata) - if attempt { - duration := b.Duration() - log.Warn(). - Err(err). - Float64("duration (in seconds)", duration.Seconds()). - Msg("encountered retriable error, backing off") - time.Sleep(duration) - } - } - - if err != nil { - log.Error(). - Err(err). - Str("packageName", j.packageName). - Msg("unable to archive package information") - } - b.Reset() -} - -func ArchiveNpmPackages(packages []string, onlyPullMetadata bool) { - // channel for jobs - jobs := make(chan job) - - // start workers - wg := &sync.WaitGroup{} - wg.Add(maxWorkers) - for i := 1; i <= maxWorkers; i++ { - go func(i int) { - defer wg.Done() - - b := &backoff.Backoff{ - Max: time.Minute, - } - for j := range jobs { - doWork(i, j, b) - } - }(i) - } - - // add jobs - for i := 0; i < len(packages); i++ { - packageName := packages[i] - name := fmt.Sprintf("job-%d", i) - log.Debug(). - Int("worker", i). - Str("job", name). - Str("packageName", packageName). - Msg("adding job to worker") - jobs <- job{name, packageName, onlyPullMetadata} - } - close(jobs) - - // wait for workers to complete - wg.Wait() -} diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/types.go b/lunatrace/bsl/license-worker/internal/pkg/npm/types.go deleted file mode 100644 index 360e35758..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/types.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import "encoding/json" - -type NpmPackageMetadata struct { - Attachments Attachments `json:"_attachments"` - ID string `json:"_id"` - Rev string `json:"_rev"` - // either Author or string - Author json.RawMessage `json:"author"` - Description string `json:"description"` - DistTags DistTags `json:"dist-tags"` - License json.RawMessage `json:"license"` - Maintainers []Author `json:"maintainers"` - Name string `json:"name"` - Readme string `json:"readme"` - ReadmeFilename string `json:"readmeFilename"` - Time Time `json:"time"` - Versions map[string]Version `json:"versions"` -} - -type Attachments struct { -} - -type Author struct { - Email string `json:"email"` - Name string `json:"name"` -} - -type DistTags struct { - Latest string `json:"latest"` -} - -// either string or -// {"_id":"dsr-rollback-parry-virid-vespa-kiley","name":"dsr-rollback-parry-virid-vespa-kiley","time":{"created":"2021-12-14T08:24:16.841Z","1.0.0":"2021-12-14T08:24:17.035Z","modified":"2021-12-14T08:24:37.596Z","unpublished":{"time":"2021-12-14T08:24:37.596Z","versions":["1.0.0"]}}} -type Time map[string]json.RawMessage - -//type Time struct { -// The100 string `json:"1.0.0"` -// Created string `json:"created"` -// Modified string `json:"modified"` -//} - -type Version struct { - Name string `json:"name"` - Version string `json:"version"` - Description string `json:"description"` - Main json.RawMessage `json:"main"` - Files []string `json:"files"` - Dependencies map[string]string `json:"dependencies"` - DevDependencies map[string]json.RawMessage `json:"devDependencies"` - Scripts map[string]json.RawMessage `json:"scripts"` - Repository json.RawMessage `json:"repository"` - Standard Standard `json:"standard"` - Keywords json.RawMessage `json:"keywords"` - // Can be either Author or set to an empty string - Author json.RawMessage `json:"author"` - Contributors json.RawMessage `json:"contributors"` - License json.RawMessage `json:"license"` - Engine json.RawMessage `json:"engine"` - GitHead string `json:"gitHead"` - Bugs json.RawMessage `json:"bugs"` - Homepage json.RawMessage `json:"homepage"` - ID string `json:"_id"` - Shasum string `json:"_shasum"` - From string `json:"_from"` - NpmVersion string `json:"_npmVersion"` - NodeVersion string `json:"_nodeVersion"` - NpmUser Author `json:"_npmUser"` - Dist Dist `json:"dist"` - Maintainers []Author `json:"maintainers"` - Directories json.RawMessage `json:"directories"` -} - -type Engine struct { - Node string `json:"node"` -} - -type Bugs struct { - URL string `json:"url"` -} - -type Repository struct { - Type string `json:"type"` - URL string `json:"url"` -} - -type Standard struct { - Ignore json.RawMessage `json:"ignore"` - Globals []string `json:"globals"` -} - -type Dist struct { - Shasum string `json:"shasum"` - Tarball string `json:"tarball"` -} - -type Scripts map[string]string diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/util.go b/lunatrace/bsl/license-worker/internal/pkg/npm/util.go deleted file mode 100644 index 3e10b2cdb..000000000 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/util.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -package npm - -import ( - "io" - "net/http" - "os" -) - -// DownloadFile will download a url to a local file. It's efficient because it will -// write as it downloads and not load the whole file into memory. -func DownloadFile(filepath string, url string) error { - - // Get the data - resp, err := http.Get(url) - if err != nil { - return err - } - defer resp.Body.Close() - - // Create the file - out, err := os.Create(filepath) - if err != nil { - return err - } - defer out.Close() - - // Write the body to file - _, err = io.Copy(out, resp.Body) - return err -} diff --git a/lunatrace/cli/fx/lunatracefx/module.go b/lunatrace/cli/fx/lunatracefx/module.go index 1340a2c72..6b6e72050 100644 --- a/lunatrace/cli/fx/lunatracefx/module.go +++ b/lunatrace/cli/fx/lunatracefx/module.go @@ -43,8 +43,9 @@ var Module = fx.Options( fx.Provide( types.NewLunaTraceGlobalFlags, config.LoadLunaTraceConfig, - NewGraphQLClient, ), + // todo instrument me + fx.Supply(http.DefaultClient), // todo remove all global stuff fx.Invoke(command.EnableGlobalFlags), fx.Invoke(func(lc fx.Lifecycle) { diff --git a/lunatrace/cli/genqlient.yaml b/lunatrace/cli/genqlient.yaml index 9793931e8..039bf8b04 100644 --- a/lunatrace/cli/genqlient.yaml +++ b/lunatrace/cli/genqlient.yaml @@ -8,6 +8,8 @@ package: gql use_struct_references: true +optional: pointer + bindings: DateTime: type: time.Time diff --git a/lunatrace/cli/gql/gen.go b/lunatrace/cli/gql/gen.go index 01f16cbde..c1f97419b 100644 --- a/lunatrace/cli/gql/gen.go +++ b/lunatrace/cli/gql/gen.go @@ -53,12 +53,12 @@ func (v *GetProjectInfoQueryProject_access_tokens) GetProject() *GetProjectInfoQ // // columns and relationships of "projects" type GetProjectInfoQueryProject_access_tokensProjectProjects struct { - Organization_id uuid.UUID `json:"organization_id"` - Id uuid.UUID `json:"id"` + Organization_id *uuid.UUID `json:"organization_id"` + Id uuid.UUID `json:"id"` } // GetOrganization_id returns GetProjectInfoQueryProject_access_tokensProjectProjects.Organization_id, and is useful for accessing the field via an interface. -func (v *GetProjectInfoQueryProject_access_tokensProjectProjects) GetOrganization_id() uuid.UUID { +func (v *GetProjectInfoQueryProject_access_tokensProjectProjects) GetOrganization_id() *uuid.UUID { return v.Organization_id } @@ -115,46 +115,46 @@ func (v *Jsonb_cast_exp) GetString() *String_comparison_exp { return v.String } type Jsonb_comparison_exp struct { Cast *Jsonb_cast_exp `json:"_cast,omitempty"` // is the column contained in the given json value - Contained_in json.RawMessage `json:"_contained_in"` + Contained_in *json.RawMessage `json:"_contained_in,omitempty"` // does the column contain the given json value at the top level - Contains json.RawMessage `json:"_contains"` - Eq json.RawMessage `json:"_eq"` - Gt json.RawMessage `json:"_gt"` - Gte json.RawMessage `json:"_gte"` + Contains *json.RawMessage `json:"_contains,omitempty"` + Eq *json.RawMessage `json:"_eq,omitempty"` + Gt *json.RawMessage `json:"_gt,omitempty"` + Gte *json.RawMessage `json:"_gte,omitempty"` // does the string exist as a top-level key in the column - Has_key string `json:"_has_key"` + Has_key *string `json:"_has_key,omitempty"` // do all of these strings exist as top-level keys in the column - Has_keys_all []string `json:"_has_keys_all"` + Has_keys_all []string `json:"_has_keys_all,omitempty"` // do any of these strings exist as top-level keys in the column - Has_keys_any []string `json:"_has_keys_any"` - In []json.RawMessage `json:"_in"` - Is_null bool `json:"_is_null"` - Lt json.RawMessage `json:"_lt"` - Lte json.RawMessage `json:"_lte"` - Neq json.RawMessage `json:"_neq"` - Nin []json.RawMessage `json:"_nin"` + Has_keys_any []string `json:"_has_keys_any,omitempty"` + In []json.RawMessage `json:"_in,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` + Lt *json.RawMessage `json:"_lt,omitempty"` + Lte *json.RawMessage `json:"_lte,omitempty"` + Neq *json.RawMessage `json:"_neq,omitempty"` + Nin []json.RawMessage `json:"_nin,omitempty"` } // GetCast returns Jsonb_comparison_exp.Cast, and is useful for accessing the field via an interface. func (v *Jsonb_comparison_exp) GetCast() *Jsonb_cast_exp { return v.Cast } // GetContained_in returns Jsonb_comparison_exp.Contained_in, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetContained_in() json.RawMessage { return v.Contained_in } +func (v *Jsonb_comparison_exp) GetContained_in() *json.RawMessage { return v.Contained_in } // GetContains returns Jsonb_comparison_exp.Contains, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetContains() json.RawMessage { return v.Contains } +func (v *Jsonb_comparison_exp) GetContains() *json.RawMessage { return v.Contains } // GetEq returns Jsonb_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetEq() json.RawMessage { return v.Eq } +func (v *Jsonb_comparison_exp) GetEq() *json.RawMessage { return v.Eq } // GetGt returns Jsonb_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetGt() json.RawMessage { return v.Gt } +func (v *Jsonb_comparison_exp) GetGt() *json.RawMessage { return v.Gt } // GetGte returns Jsonb_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetGte() json.RawMessage { return v.Gte } +func (v *Jsonb_comparison_exp) GetGte() *json.RawMessage { return v.Gte } // GetHas_key returns Jsonb_comparison_exp.Has_key, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetHas_key() string { return v.Has_key } +func (v *Jsonb_comparison_exp) GetHas_key() *string { return v.Has_key } // GetHas_keys_all returns Jsonb_comparison_exp.Has_keys_all, and is useful for accessing the field via an interface. func (v *Jsonb_comparison_exp) GetHas_keys_all() []string { return v.Has_keys_all } @@ -166,60 +166,80 @@ func (v *Jsonb_comparison_exp) GetHas_keys_any() []string { return v.Has_keys_an func (v *Jsonb_comparison_exp) GetIn() []json.RawMessage { return v.In } // GetIs_null returns Jsonb_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *Jsonb_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLt returns Jsonb_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetLt() json.RawMessage { return v.Lt } +func (v *Jsonb_comparison_exp) GetLt() *json.RawMessage { return v.Lt } // GetLte returns Jsonb_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetLte() json.RawMessage { return v.Lte } +func (v *Jsonb_comparison_exp) GetLte() *json.RawMessage { return v.Lte } // GetNeq returns Jsonb_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *Jsonb_comparison_exp) GetNeq() json.RawMessage { return v.Neq } +func (v *Jsonb_comparison_exp) GetNeq() *json.RawMessage { return v.Neq } // GetNin returns Jsonb_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *Jsonb_comparison_exp) GetNin() []json.RawMessage { return v.Nin } // Boolean expression to compare columns of type "license_source". All fields are combined with logical 'AND'. type License_source_comparison_exp struct { - Eq types.LicenseSource `json:"_eq"` - Gt types.LicenseSource `json:"_gt"` - Gte types.LicenseSource `json:"_gte"` - In []types.LicenseSource `json:"_in"` - Is_null bool `json:"_is_null"` - Lt types.LicenseSource `json:"_lt"` - Lte types.LicenseSource `json:"_lte"` - Neq types.LicenseSource `json:"_neq"` - Nin []types.LicenseSource `json:"_nin"` + Eq *types.LicenseSource `json:"_eq,omitempty"` + Gt *types.LicenseSource `json:"_gt,omitempty"` + Gte *types.LicenseSource `json:"_gte,omitempty"` + In []types.LicenseSource `json:"_in,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` + Lt *types.LicenseSource `json:"_lt,omitempty"` + Lte *types.LicenseSource `json:"_lte,omitempty"` + Neq *types.LicenseSource `json:"_neq,omitempty"` + Nin []types.LicenseSource `json:"_nin,omitempty"` } // GetEq returns License_source_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetEq() types.LicenseSource { return v.Eq } +func (v *License_source_comparison_exp) GetEq() *types.LicenseSource { return v.Eq } // GetGt returns License_source_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetGt() types.LicenseSource { return v.Gt } +func (v *License_source_comparison_exp) GetGt() *types.LicenseSource { return v.Gt } // GetGte returns License_source_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetGte() types.LicenseSource { return v.Gte } +func (v *License_source_comparison_exp) GetGte() *types.LicenseSource { return v.Gte } // GetIn returns License_source_comparison_exp.In, and is useful for accessing the field via an interface. func (v *License_source_comparison_exp) GetIn() []types.LicenseSource { return v.In } // GetIs_null returns License_source_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *License_source_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLt returns License_source_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetLt() types.LicenseSource { return v.Lt } +func (v *License_source_comparison_exp) GetLt() *types.LicenseSource { return v.Lt } // GetLte returns License_source_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetLte() types.LicenseSource { return v.Lte } +func (v *License_source_comparison_exp) GetLte() *types.LicenseSource { return v.Lte } // GetNeq returns License_source_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *License_source_comparison_exp) GetNeq() types.LicenseSource { return v.Neq } +func (v *License_source_comparison_exp) GetNeq() *types.LicenseSource { return v.Neq } // GetNin returns License_source_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *License_source_comparison_exp) GetNin() []types.LicenseSource { return v.Nin } +// PackageFetchTimePackage includes the requested fields of the GraphQL type package. +// The GraphQL type's documentation follows. +// +// columns and relationships of "package.package" +type PackageFetchTimePackage struct { + Fetched_time *time.Time `json:"fetched_time"` +} + +// GetFetched_time returns PackageFetchTimePackage.Fetched_time, and is useful for accessing the field via an interface. +func (v *PackageFetchTimePackage) GetFetched_time() *time.Time { return v.Fetched_time } + +// PackageFetchTimeResponse is returned by PackageFetchTime on success. +type PackageFetchTimeResponse struct { + // fetch data from the table: "package.package" + Package []*PackageFetchTimePackage `json:"package"` +} + +// GetPackage returns PackageFetchTimeResponse.Package, and is useful for accessing the field via an interface. +func (v *PackageFetchTimeResponse) GetPackage() []*PackageFetchTimePackage { return v.Package } + // Boolean expression to filter rows from the table "package.package". All fields are combined with a logical 'AND'. type Package_bool_exp struct { And []*Package_bool_exp `json:"_and,omitempty"` @@ -227,6 +247,7 @@ type Package_bool_exp struct { Or []*Package_bool_exp `json:"_or,omitempty"` Custom_registry *String_comparison_exp `json:"custom_registry,omitempty"` Description *String_comparison_exp `json:"description,omitempty"` + Fetched_time *Timestamptz_comparison_exp `json:"fetched_time,omitempty"` Id *Uuid_comparison_exp `json:"id,omitempty"` Name *String_comparison_exp `json:"name,omitempty"` Package_maintainers *Package_package_maintainer_bool_exp `json:"package_maintainers,omitempty"` @@ -249,6 +270,9 @@ func (v *Package_bool_exp) GetCustom_registry() *String_comparison_exp { return // GetDescription returns Package_bool_exp.Description, and is useful for accessing the field via an interface. func (v *Package_bool_exp) GetDescription() *String_comparison_exp { return v.Description } +// GetFetched_time returns Package_bool_exp.Fetched_time, and is useful for accessing the field via an interface. +func (v *Package_bool_exp) GetFetched_time() *Timestamptz_comparison_exp { return v.Fetched_time } + // GetId returns Package_bool_exp.Id, and is useful for accessing the field via an interface. func (v *Package_bool_exp) GetId() *Uuid_comparison_exp { return v.Id } @@ -280,26 +304,30 @@ const ( // input type for inserting data into table "package.package" type Package_insert_input struct { - Custom_registry string `json:"custom_registry"` - Description string `json:"description"` - Id uuid.UUID `json:"id"` - Name string `json:"name"` + Custom_registry *string `json:"custom_registry,omitempty"` + Description *string `json:"description,omitempty"` + Fetched_time *time.Time `json:"fetched_time,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` Package_maintainers *Package_package_maintainer_arr_rel_insert_input `json:"package_maintainers,omitempty"` - Package_manager types.PackageManager `json:"package_manager"` + Package_manager *types.PackageManager `json:"package_manager,omitempty"` Releases *Package_release_arr_rel_insert_input `json:"releases,omitempty"` } // GetCustom_registry returns Package_insert_input.Custom_registry, and is useful for accessing the field via an interface. -func (v *Package_insert_input) GetCustom_registry() string { return v.Custom_registry } +func (v *Package_insert_input) GetCustom_registry() *string { return v.Custom_registry } // GetDescription returns Package_insert_input.Description, and is useful for accessing the field via an interface. -func (v *Package_insert_input) GetDescription() string { return v.Description } +func (v *Package_insert_input) GetDescription() *string { return v.Description } + +// GetFetched_time returns Package_insert_input.Fetched_time, and is useful for accessing the field via an interface. +func (v *Package_insert_input) GetFetched_time() *time.Time { return v.Fetched_time } // GetId returns Package_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_insert_input) GetId() *uuid.UUID { return v.Id } // GetName returns Package_insert_input.Name, and is useful for accessing the field via an interface. -func (v *Package_insert_input) GetName() string { return v.Name } +func (v *Package_insert_input) GetName() *string { return v.Name } // GetPackage_maintainers returns Package_insert_input.Package_maintainers, and is useful for accessing the field via an interface. func (v *Package_insert_input) GetPackage_maintainers() *Package_package_maintainer_arr_rel_insert_input { @@ -307,7 +335,7 @@ func (v *Package_insert_input) GetPackage_maintainers() *Package_package_maintai } // GetPackage_manager returns Package_insert_input.Package_manager, and is useful for accessing the field via an interface. -func (v *Package_insert_input) GetPackage_manager() types.PackageManager { return v.Package_manager } +func (v *Package_insert_input) GetPackage_manager() *types.PackageManager { return v.Package_manager } // GetReleases returns Package_insert_input.Releases, and is useful for accessing the field via an interface. func (v *Package_insert_input) GetReleases() *Package_release_arr_rel_insert_input { return v.Releases } @@ -354,16 +382,16 @@ const ( // input type for inserting data into table "package.license" type Package_license_insert_input struct { - Id uuid.UUID `json:"id"` - Name string `json:"name"` + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` Release_licenses *Package_release_license_arr_rel_insert_input `json:"release_licenses,omitempty"` } // GetId returns Package_license_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_license_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_license_insert_input) GetId() *uuid.UUID { return v.Id } // GetName returns Package_license_insert_input.Name, and is useful for accessing the field via an interface. -func (v *Package_license_insert_input) GetName() string { return v.Name } +func (v *Package_license_insert_input) GetName() *string { return v.Name } // GetRelease_licenses returns Package_license_insert_input.Release_licenses, and is useful for accessing the field via an interface. func (v *Package_license_insert_input) GetRelease_licenses() *Package_release_license_arr_rel_insert_input { @@ -387,8 +415,8 @@ func (v *Package_license_obj_rel_insert_input) GetOn_conflict() *Package_license // on_conflict condition type for table "package.license" type Package_license_on_conflict struct { - Constraint Package_license_constraint `json:"constraint"` - Update_columns []Package_license_update_column `json:"update_columns"` + Constraint Package_license_constraint `json:"constraint,omitempty"` + Update_columns []Package_license_update_column `json:"update_columns,omitempty"` Where *Package_license_bool_exp `json:"where,omitempty"` } @@ -471,22 +499,22 @@ const ( // input type for inserting data into table "package.maintainer" type Package_maintainer_insert_input struct { - Email string `json:"email"` - Id uuid.UUID `json:"id"` - Name string `json:"name"` + Email *string `json:"email,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` Package_maintainers *Package_package_maintainer_arr_rel_insert_input `json:"package_maintainers,omitempty"` - Package_manager types.PackageManager `json:"package_manager"` + Package_manager *types.PackageManager `json:"package_manager,omitempty"` Published_releases *Package_release_arr_rel_insert_input `json:"published_releases,omitempty"` } // GetEmail returns Package_maintainer_insert_input.Email, and is useful for accessing the field via an interface. -func (v *Package_maintainer_insert_input) GetEmail() string { return v.Email } +func (v *Package_maintainer_insert_input) GetEmail() *string { return v.Email } // GetId returns Package_maintainer_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_maintainer_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_maintainer_insert_input) GetId() *uuid.UUID { return v.Id } // GetName returns Package_maintainer_insert_input.Name, and is useful for accessing the field via an interface. -func (v *Package_maintainer_insert_input) GetName() string { return v.Name } +func (v *Package_maintainer_insert_input) GetName() *string { return v.Name } // GetPackage_maintainers returns Package_maintainer_insert_input.Package_maintainers, and is useful for accessing the field via an interface. func (v *Package_maintainer_insert_input) GetPackage_maintainers() *Package_package_maintainer_arr_rel_insert_input { @@ -494,7 +522,7 @@ func (v *Package_maintainer_insert_input) GetPackage_maintainers() *Package_pack } // GetPackage_manager returns Package_maintainer_insert_input.Package_manager, and is useful for accessing the field via an interface. -func (v *Package_maintainer_insert_input) GetPackage_manager() types.PackageManager { +func (v *Package_maintainer_insert_input) GetPackage_manager() *types.PackageManager { return v.Package_manager } @@ -522,8 +550,8 @@ func (v *Package_maintainer_obj_rel_insert_input) GetOn_conflict() *Package_main // on_conflict condition type for table "package.maintainer" type Package_maintainer_on_conflict struct { - Constraint Package_maintainer_constraint `json:"constraint"` - Update_columns []Package_maintainer_update_column `json:"update_columns"` + Constraint Package_maintainer_constraint `json:"constraint,omitempty"` + Update_columns []Package_maintainer_update_column `json:"update_columns,omitempty"` Where *Package_maintainer_bool_exp `json:"where,omitempty"` } @@ -556,40 +584,40 @@ const ( // Boolean expression to compare columns of type "package_manager". All fields are combined with logical 'AND'. type Package_manager_comparison_exp struct { - Eq types.PackageManager `json:"_eq"` - Gt types.PackageManager `json:"_gt"` - Gte types.PackageManager `json:"_gte"` - In []types.PackageManager `json:"_in"` - Is_null bool `json:"_is_null"` - Lt types.PackageManager `json:"_lt"` - Lte types.PackageManager `json:"_lte"` - Neq types.PackageManager `json:"_neq"` - Nin []types.PackageManager `json:"_nin"` + Eq *types.PackageManager `json:"_eq,omitempty"` + Gt *types.PackageManager `json:"_gt,omitempty"` + Gte *types.PackageManager `json:"_gte,omitempty"` + In []types.PackageManager `json:"_in,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` + Lt *types.PackageManager `json:"_lt,omitempty"` + Lte *types.PackageManager `json:"_lte,omitempty"` + Neq *types.PackageManager `json:"_neq,omitempty"` + Nin []types.PackageManager `json:"_nin,omitempty"` } // GetEq returns Package_manager_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetEq() types.PackageManager { return v.Eq } +func (v *Package_manager_comparison_exp) GetEq() *types.PackageManager { return v.Eq } // GetGt returns Package_manager_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetGt() types.PackageManager { return v.Gt } +func (v *Package_manager_comparison_exp) GetGt() *types.PackageManager { return v.Gt } // GetGte returns Package_manager_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetGte() types.PackageManager { return v.Gte } +func (v *Package_manager_comparison_exp) GetGte() *types.PackageManager { return v.Gte } // GetIn returns Package_manager_comparison_exp.In, and is useful for accessing the field via an interface. func (v *Package_manager_comparison_exp) GetIn() []types.PackageManager { return v.In } // GetIs_null returns Package_manager_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *Package_manager_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLt returns Package_manager_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetLt() types.PackageManager { return v.Lt } +func (v *Package_manager_comparison_exp) GetLt() *types.PackageManager { return v.Lt } // GetLte returns Package_manager_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetLte() types.PackageManager { return v.Lte } +func (v *Package_manager_comparison_exp) GetLte() *types.PackageManager { return v.Lte } // GetNeq returns Package_manager_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *Package_manager_comparison_exp) GetNeq() types.PackageManager { return v.Neq } +func (v *Package_manager_comparison_exp) GetNeq() *types.PackageManager { return v.Neq } // GetNin returns Package_manager_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *Package_manager_comparison_exp) GetNin() []types.PackageManager { return v.Nin } @@ -609,8 +637,8 @@ func (v *Package_obj_rel_insert_input) GetOn_conflict() *Package_on_conflict { r // on_conflict condition type for table "package.package" type Package_on_conflict struct { - Constraint Package_constraint `json:"constraint"` - Update_columns []Package_update_column `json:"update_columns"` + Constraint Package_constraint `json:"constraint,omitempty"` + Update_columns []Package_update_column `json:"update_columns,omitempty"` Where *Package_bool_exp `json:"where,omitempty"` } @@ -695,9 +723,9 @@ const ( // input type for inserting data into table "package.package_maintainer" type Package_package_maintainer_insert_input struct { Maintainer *Package_maintainer_obj_rel_insert_input `json:"maintainer,omitempty"` - Maintainer_id uuid.UUID `json:"maintainer_id"` + Maintainer_id *uuid.UUID `json:"maintainer_id,omitempty"` Package *Package_obj_rel_insert_input `json:"package,omitempty"` - Package_id uuid.UUID `json:"package_id"` + Package_id *uuid.UUID `json:"package_id,omitempty"` } // GetMaintainer returns Package_package_maintainer_insert_input.Maintainer, and is useful for accessing the field via an interface. @@ -706,7 +734,7 @@ func (v *Package_package_maintainer_insert_input) GetMaintainer() *Package_maint } // GetMaintainer_id returns Package_package_maintainer_insert_input.Maintainer_id, and is useful for accessing the field via an interface. -func (v *Package_package_maintainer_insert_input) GetMaintainer_id() uuid.UUID { +func (v *Package_package_maintainer_insert_input) GetMaintainer_id() *uuid.UUID { return v.Maintainer_id } @@ -716,12 +744,12 @@ func (v *Package_package_maintainer_insert_input) GetPackage() *Package_obj_rel_ } // GetPackage_id returns Package_package_maintainer_insert_input.Package_id, and is useful for accessing the field via an interface. -func (v *Package_package_maintainer_insert_input) GetPackage_id() uuid.UUID { return v.Package_id } +func (v *Package_package_maintainer_insert_input) GetPackage_id() *uuid.UUID { return v.Package_id } // on_conflict condition type for table "package.package_maintainer" type Package_package_maintainer_on_conflict struct { - Constraint Package_package_maintainer_constraint `json:"constraint"` - Update_columns []Package_package_maintainer_update_column `json:"update_columns"` + Constraint Package_package_maintainer_constraint `json:"constraint,omitempty"` + Update_columns []Package_package_maintainer_update_column `json:"update_columns,omitempty"` Where *Package_package_maintainer_bool_exp `json:"where,omitempty"` } @@ -773,6 +801,7 @@ type Package_release_bool_exp struct { Not *Package_release_bool_exp `json:"_not,omitempty"` Or []*Package_release_bool_exp `json:"_or,omitempty"` Blob_hash *String_comparison_exp `json:"blob_hash,omitempty"` + Fetched_time *Timestamptz_comparison_exp `json:"fetched_time,omitempty"` Id *Uuid_comparison_exp `json:"id,omitempty"` Mirrored_blob_url *String_comparison_exp `json:"mirrored_blob_url,omitempty"` Observed_time *Timestamptz_comparison_exp `json:"observed_time,omitempty"` @@ -801,6 +830,11 @@ func (v *Package_release_bool_exp) GetOr() []*Package_release_bool_exp { return // GetBlob_hash returns Package_release_bool_exp.Blob_hash, and is useful for accessing the field via an interface. func (v *Package_release_bool_exp) GetBlob_hash() *String_comparison_exp { return v.Blob_hash } +// GetFetched_time returns Package_release_bool_exp.Fetched_time, and is useful for accessing the field via an interface. +func (v *Package_release_bool_exp) GetFetched_time() *Timestamptz_comparison_exp { + return v.Fetched_time +} + // GetId returns Package_release_bool_exp.Id, and is useful for accessing the field via an interface. func (v *Package_release_bool_exp) GetId() *Uuid_comparison_exp { return v.Id } @@ -975,14 +1009,14 @@ const ( // input type for inserting data into table "package.release_dependency" type Package_release_dependency_insert_input struct { Dependency_package *Package_obj_rel_insert_input `json:"dependency_package,omitempty"` - Dependency_package_id uuid.UUID `json:"dependency_package_id"` + Dependency_package_id *uuid.UUID `json:"dependency_package_id,omitempty"` Dependency_release *Package_release_obj_rel_insert_input `json:"dependency_release,omitempty"` - Dependency_release_id uuid.UUID `json:"dependency_release_id"` - Id uuid.UUID `json:"id"` - Package_name string `json:"package_name"` - Package_version_query string `json:"package_version_query"` + Dependency_release_id *uuid.UUID `json:"dependency_release_id,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Package_name *string `json:"package_name,omitempty"` + Package_version_query *string `json:"package_version_query,omitempty"` Release *Package_release_obj_rel_insert_input `json:"release,omitempty"` - Release_id uuid.UUID `json:"release_id"` + Release_id *uuid.UUID `json:"release_id,omitempty"` } // GetDependency_package returns Package_release_dependency_insert_input.Dependency_package, and is useful for accessing the field via an interface. @@ -991,7 +1025,7 @@ func (v *Package_release_dependency_insert_input) GetDependency_package() *Packa } // GetDependency_package_id returns Package_release_dependency_insert_input.Dependency_package_id, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetDependency_package_id() uuid.UUID { +func (v *Package_release_dependency_insert_input) GetDependency_package_id() *uuid.UUID { return v.Dependency_package_id } @@ -1001,18 +1035,18 @@ func (v *Package_release_dependency_insert_input) GetDependency_release() *Packa } // GetDependency_release_id returns Package_release_dependency_insert_input.Dependency_release_id, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetDependency_release_id() uuid.UUID { +func (v *Package_release_dependency_insert_input) GetDependency_release_id() *uuid.UUID { return v.Dependency_release_id } // GetId returns Package_release_dependency_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_release_dependency_insert_input) GetId() *uuid.UUID { return v.Id } // GetPackage_name returns Package_release_dependency_insert_input.Package_name, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetPackage_name() string { return v.Package_name } +func (v *Package_release_dependency_insert_input) GetPackage_name() *string { return v.Package_name } // GetPackage_version_query returns Package_release_dependency_insert_input.Package_version_query, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetPackage_version_query() string { +func (v *Package_release_dependency_insert_input) GetPackage_version_query() *string { return v.Package_version_query } @@ -1022,12 +1056,12 @@ func (v *Package_release_dependency_insert_input) GetRelease() *Package_release_ } // GetRelease_id returns Package_release_dependency_insert_input.Release_id, and is useful for accessing the field via an interface. -func (v *Package_release_dependency_insert_input) GetRelease_id() uuid.UUID { return v.Release_id } +func (v *Package_release_dependency_insert_input) GetRelease_id() *uuid.UUID { return v.Release_id } // on_conflict condition type for table "package.release_dependency" type Package_release_dependency_on_conflict struct { - Constraint Package_release_dependency_constraint `json:"constraint"` - Update_columns []Package_release_dependency_update_column `json:"update_columns"` + Constraint Package_release_dependency_constraint `json:"constraint,omitempty"` + Update_columns []Package_release_dependency_update_column `json:"update_columns,omitempty"` Where *Package_release_dependency_bool_exp `json:"where,omitempty"` } @@ -1066,40 +1100,44 @@ const ( // input type for inserting data into table "package.release" type Package_release_insert_input struct { - Blob_hash string `json:"blob_hash"` - Id uuid.UUID `json:"id"` - Mirrored_blob_url string `json:"mirrored_blob_url"` - Observed_time time.Time `json:"observed_time"` + Blob_hash *string `json:"blob_hash,omitempty"` + Fetched_time *time.Time `json:"fetched_time,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Mirrored_blob_url *string `json:"mirrored_blob_url,omitempty"` + Observed_time *time.Time `json:"observed_time,omitempty"` Package *Package_obj_rel_insert_input `json:"package,omitempty"` - Package_id uuid.UUID `json:"package_id"` + Package_id *uuid.UUID `json:"package_id,omitempty"` Publishing_maintainer *Package_maintainer_obj_rel_insert_input `json:"publishing_maintainer,omitempty"` - Publishing_maintainer_id uuid.UUID `json:"publishing_maintainer_id"` + Publishing_maintainer_id *uuid.UUID `json:"publishing_maintainer_id,omitempty"` Release_dependencies *Package_release_dependency_arr_rel_insert_input `json:"release_dependencies,omitempty"` Release_dependents *Package_release_dependency_arr_rel_insert_input `json:"release_dependents,omitempty"` Release_licenses *Package_release_license_arr_rel_insert_input `json:"release_licenses,omitempty"` - Release_time time.Time `json:"release_time"` - Upstream_blob_url string `json:"upstream_blob_url"` - Upstream_data json.RawMessage `json:"upstream_data"` - Version string `json:"version"` + Release_time *time.Time `json:"release_time,omitempty"` + Upstream_blob_url *string `json:"upstream_blob_url,omitempty"` + Upstream_data *json.RawMessage `json:"upstream_data,omitempty"` + Version *string `json:"version,omitempty"` } // GetBlob_hash returns Package_release_insert_input.Blob_hash, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetBlob_hash() string { return v.Blob_hash } +func (v *Package_release_insert_input) GetBlob_hash() *string { return v.Blob_hash } + +// GetFetched_time returns Package_release_insert_input.Fetched_time, and is useful for accessing the field via an interface. +func (v *Package_release_insert_input) GetFetched_time() *time.Time { return v.Fetched_time } // GetId returns Package_release_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_release_insert_input) GetId() *uuid.UUID { return v.Id } // GetMirrored_blob_url returns Package_release_insert_input.Mirrored_blob_url, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetMirrored_blob_url() string { return v.Mirrored_blob_url } +func (v *Package_release_insert_input) GetMirrored_blob_url() *string { return v.Mirrored_blob_url } // GetObserved_time returns Package_release_insert_input.Observed_time, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetObserved_time() time.Time { return v.Observed_time } +func (v *Package_release_insert_input) GetObserved_time() *time.Time { return v.Observed_time } // GetPackage returns Package_release_insert_input.Package, and is useful for accessing the field via an interface. func (v *Package_release_insert_input) GetPackage() *Package_obj_rel_insert_input { return v.Package } // GetPackage_id returns Package_release_insert_input.Package_id, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetPackage_id() uuid.UUID { return v.Package_id } +func (v *Package_release_insert_input) GetPackage_id() *uuid.UUID { return v.Package_id } // GetPublishing_maintainer returns Package_release_insert_input.Publishing_maintainer, and is useful for accessing the field via an interface. func (v *Package_release_insert_input) GetPublishing_maintainer() *Package_maintainer_obj_rel_insert_input { @@ -1107,7 +1145,7 @@ func (v *Package_release_insert_input) GetPublishing_maintainer() *Package_maint } // GetPublishing_maintainer_id returns Package_release_insert_input.Publishing_maintainer_id, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetPublishing_maintainer_id() uuid.UUID { +func (v *Package_release_insert_input) GetPublishing_maintainer_id() *uuid.UUID { return v.Publishing_maintainer_id } @@ -1127,16 +1165,16 @@ func (v *Package_release_insert_input) GetRelease_licenses() *Package_release_li } // GetRelease_time returns Package_release_insert_input.Release_time, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetRelease_time() time.Time { return v.Release_time } +func (v *Package_release_insert_input) GetRelease_time() *time.Time { return v.Release_time } // GetUpstream_blob_url returns Package_release_insert_input.Upstream_blob_url, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetUpstream_blob_url() string { return v.Upstream_blob_url } +func (v *Package_release_insert_input) GetUpstream_blob_url() *string { return v.Upstream_blob_url } // GetUpstream_data returns Package_release_insert_input.Upstream_data, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetUpstream_data() json.RawMessage { return v.Upstream_data } +func (v *Package_release_insert_input) GetUpstream_data() *json.RawMessage { return v.Upstream_data } // GetVersion returns Package_release_insert_input.Version, and is useful for accessing the field via an interface. -func (v *Package_release_insert_input) GetVersion() string { return v.Version } +func (v *Package_release_insert_input) GetVersion() *string { return v.Version } // input type for inserting array relation for remote table "package.release_license" type Package_release_license_arr_rel_insert_input struct { @@ -1215,17 +1253,17 @@ const ( // input type for inserting data into table "package.release_license" type Package_release_license_insert_input struct { - Id uuid.UUID `json:"id"` + Id *uuid.UUID `json:"id,omitempty"` License *Package_license_obj_rel_insert_input `json:"license,omitempty"` - License_id uuid.UUID `json:"license_id"` - Release_id uuid.UUID `json:"release_id"` - Scan_metadata json.RawMessage `json:"scan_metadata"` - Scan_time time.Time `json:"scan_time"` - Source types.LicenseSource `json:"source"` + License_id *uuid.UUID `json:"license_id,omitempty"` + Release_id *uuid.UUID `json:"release_id,omitempty"` + Scan_metadata *json.RawMessage `json:"scan_metadata,omitempty"` + Scan_time *time.Time `json:"scan_time,omitempty"` + Source *types.LicenseSource `json:"source,omitempty"` } // GetId returns Package_release_license_insert_input.Id, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetId() uuid.UUID { return v.Id } +func (v *Package_release_license_insert_input) GetId() *uuid.UUID { return v.Id } // GetLicense returns Package_release_license_insert_input.License, and is useful for accessing the field via an interface. func (v *Package_release_license_insert_input) GetLicense() *Package_license_obj_rel_insert_input { @@ -1233,26 +1271,26 @@ func (v *Package_release_license_insert_input) GetLicense() *Package_license_obj } // GetLicense_id returns Package_release_license_insert_input.License_id, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetLicense_id() uuid.UUID { return v.License_id } +func (v *Package_release_license_insert_input) GetLicense_id() *uuid.UUID { return v.License_id } // GetRelease_id returns Package_release_license_insert_input.Release_id, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetRelease_id() uuid.UUID { return v.Release_id } +func (v *Package_release_license_insert_input) GetRelease_id() *uuid.UUID { return v.Release_id } // GetScan_metadata returns Package_release_license_insert_input.Scan_metadata, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetScan_metadata() json.RawMessage { +func (v *Package_release_license_insert_input) GetScan_metadata() *json.RawMessage { return v.Scan_metadata } // GetScan_time returns Package_release_license_insert_input.Scan_time, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetScan_time() time.Time { return v.Scan_time } +func (v *Package_release_license_insert_input) GetScan_time() *time.Time { return v.Scan_time } // GetSource returns Package_release_license_insert_input.Source, and is useful for accessing the field via an interface. -func (v *Package_release_license_insert_input) GetSource() types.LicenseSource { return v.Source } +func (v *Package_release_license_insert_input) GetSource() *types.LicenseSource { return v.Source } // on_conflict condition type for table "package.release_license" type Package_release_license_on_conflict struct { - Constraint Package_release_license_constraint `json:"constraint"` - Update_columns []Package_release_license_update_column `json:"update_columns"` + Constraint Package_release_license_constraint `json:"constraint,omitempty"` + Update_columns []Package_release_license_update_column `json:"update_columns,omitempty"` Where *Package_release_license_bool_exp `json:"where,omitempty"` } @@ -1306,8 +1344,8 @@ func (v *Package_release_obj_rel_insert_input) GetOn_conflict() *Package_release // on_conflict condition type for table "package.release" type Package_release_on_conflict struct { - Constraint Package_release_constraint `json:"constraint"` - Update_columns []Package_release_update_column `json:"update_columns"` + Constraint Package_release_constraint `json:"constraint,omitempty"` + Update_columns []Package_release_update_column `json:"update_columns,omitempty"` Where *Package_release_bool_exp `json:"where,omitempty"` } @@ -1329,6 +1367,8 @@ const ( // column name Package_release_update_columnBlobHash Package_release_update_column = "blob_hash" // column name + Package_release_update_columnFetchedTime Package_release_update_column = "fetched_time" + // column name Package_release_update_columnId Package_release_update_column = "id" // column name Package_release_update_columnMirroredBlobUrl Package_release_update_column = "mirrored_blob_url" @@ -1357,6 +1397,8 @@ const ( // column name Package_update_columnDescription Package_update_column = "description" // column name + Package_update_columnFetchedTime Package_update_column = "fetched_time" + // column name Package_update_columnId Package_update_column = "id" // column name Package_update_columnName Package_update_column = "name" @@ -1388,130 +1430,130 @@ func (v *SetBuildS3UrlUpdate_builds_by_pkBuilds) GetId() uuid.UUID { return v.Id // Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. type String_comparison_exp struct { - Eq string `json:"_eq"` - Gt string `json:"_gt"` - Gte string `json:"_gte"` + Eq *string `json:"_eq,omitempty"` + Gt *string `json:"_gt,omitempty"` + Gte *string `json:"_gte,omitempty"` // does the column match the given case-insensitive pattern - Ilike string `json:"_ilike"` - In []string `json:"_in"` + Ilike *string `json:"_ilike,omitempty"` + In []string `json:"_in,omitempty"` // does the column match the given POSIX regular expression, case insensitive - Iregex string `json:"_iregex"` - Is_null bool `json:"_is_null"` + Iregex *string `json:"_iregex,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` // does the column match the given pattern - Like string `json:"_like"` - Lt string `json:"_lt"` - Lte string `json:"_lte"` - Neq string `json:"_neq"` + Like *string `json:"_like,omitempty"` + Lt *string `json:"_lt,omitempty"` + Lte *string `json:"_lte,omitempty"` + Neq *string `json:"_neq,omitempty"` // does the column NOT match the given case-insensitive pattern - Nilike string `json:"_nilike"` - Nin []string `json:"_nin"` + Nilike *string `json:"_nilike,omitempty"` + Nin []string `json:"_nin,omitempty"` // does the column NOT match the given POSIX regular expression, case insensitive - Niregex string `json:"_niregex"` + Niregex *string `json:"_niregex,omitempty"` // does the column NOT match the given pattern - Nlike string `json:"_nlike"` + Nlike *string `json:"_nlike,omitempty"` // does the column NOT match the given POSIX regular expression, case sensitive - Nregex string `json:"_nregex"` + Nregex *string `json:"_nregex,omitempty"` // does the column NOT match the given SQL regular expression - Nsimilar string `json:"_nsimilar"` + Nsimilar *string `json:"_nsimilar,omitempty"` // does the column match the given POSIX regular expression, case sensitive - Regex string `json:"_regex"` + Regex *string `json:"_regex,omitempty"` // does the column match the given SQL regular expression - Similar string `json:"_similar"` + Similar *string `json:"_similar,omitempty"` } // GetEq returns String_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetEq() string { return v.Eq } +func (v *String_comparison_exp) GetEq() *string { return v.Eq } // GetGt returns String_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetGt() string { return v.Gt } +func (v *String_comparison_exp) GetGt() *string { return v.Gt } // GetGte returns String_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetGte() string { return v.Gte } +func (v *String_comparison_exp) GetGte() *string { return v.Gte } // GetIlike returns String_comparison_exp.Ilike, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetIlike() string { return v.Ilike } +func (v *String_comparison_exp) GetIlike() *string { return v.Ilike } // GetIn returns String_comparison_exp.In, and is useful for accessing the field via an interface. func (v *String_comparison_exp) GetIn() []string { return v.In } // GetIregex returns String_comparison_exp.Iregex, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetIregex() string { return v.Iregex } +func (v *String_comparison_exp) GetIregex() *string { return v.Iregex } // GetIs_null returns String_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *String_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLike returns String_comparison_exp.Like, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetLike() string { return v.Like } +func (v *String_comparison_exp) GetLike() *string { return v.Like } // GetLt returns String_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetLt() string { return v.Lt } +func (v *String_comparison_exp) GetLt() *string { return v.Lt } // GetLte returns String_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetLte() string { return v.Lte } +func (v *String_comparison_exp) GetLte() *string { return v.Lte } // GetNeq returns String_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNeq() string { return v.Neq } +func (v *String_comparison_exp) GetNeq() *string { return v.Neq } // GetNilike returns String_comparison_exp.Nilike, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNilike() string { return v.Nilike } +func (v *String_comparison_exp) GetNilike() *string { return v.Nilike } // GetNin returns String_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *String_comparison_exp) GetNin() []string { return v.Nin } // GetNiregex returns String_comparison_exp.Niregex, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNiregex() string { return v.Niregex } +func (v *String_comparison_exp) GetNiregex() *string { return v.Niregex } // GetNlike returns String_comparison_exp.Nlike, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNlike() string { return v.Nlike } +func (v *String_comparison_exp) GetNlike() *string { return v.Nlike } // GetNregex returns String_comparison_exp.Nregex, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNregex() string { return v.Nregex } +func (v *String_comparison_exp) GetNregex() *string { return v.Nregex } // GetNsimilar returns String_comparison_exp.Nsimilar, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetNsimilar() string { return v.Nsimilar } +func (v *String_comparison_exp) GetNsimilar() *string { return v.Nsimilar } // GetRegex returns String_comparison_exp.Regex, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetRegex() string { return v.Regex } +func (v *String_comparison_exp) GetRegex() *string { return v.Regex } // GetSimilar returns String_comparison_exp.Similar, and is useful for accessing the field via an interface. -func (v *String_comparison_exp) GetSimilar() string { return v.Similar } +func (v *String_comparison_exp) GetSimilar() *string { return v.Similar } // Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. type Timestamptz_comparison_exp struct { - Eq time.Time `json:"_eq"` - Gt time.Time `json:"_gt"` - Gte time.Time `json:"_gte"` - In []time.Time `json:"_in"` - Is_null bool `json:"_is_null"` - Lt time.Time `json:"_lt"` - Lte time.Time `json:"_lte"` - Neq time.Time `json:"_neq"` - Nin []time.Time `json:"_nin"` + Eq *time.Time `json:"_eq,omitempty"` + Gt *time.Time `json:"_gt,omitempty"` + Gte *time.Time `json:"_gte,omitempty"` + In []time.Time `json:"_in,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` + Lt *time.Time `json:"_lt,omitempty"` + Lte *time.Time `json:"_lte,omitempty"` + Neq *time.Time `json:"_neq,omitempty"` + Nin []time.Time `json:"_nin,omitempty"` } // GetEq returns Timestamptz_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetEq() time.Time { return v.Eq } +func (v *Timestamptz_comparison_exp) GetEq() *time.Time { return v.Eq } // GetGt returns Timestamptz_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetGt() time.Time { return v.Gt } +func (v *Timestamptz_comparison_exp) GetGt() *time.Time { return v.Gt } // GetGte returns Timestamptz_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetGte() time.Time { return v.Gte } +func (v *Timestamptz_comparison_exp) GetGte() *time.Time { return v.Gte } // GetIn returns Timestamptz_comparison_exp.In, and is useful for accessing the field via an interface. func (v *Timestamptz_comparison_exp) GetIn() []time.Time { return v.In } // GetIs_null returns Timestamptz_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *Timestamptz_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLt returns Timestamptz_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetLt() time.Time { return v.Lt } +func (v *Timestamptz_comparison_exp) GetLt() *time.Time { return v.Lt } // GetLte returns Timestamptz_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetLte() time.Time { return v.Lte } +func (v *Timestamptz_comparison_exp) GetLte() *time.Time { return v.Lte } // GetNeq returns Timestamptz_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *Timestamptz_comparison_exp) GetNeq() time.Time { return v.Neq } +func (v *Timestamptz_comparison_exp) GetNeq() *time.Time { return v.Neq } // GetNin returns Timestamptz_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *Timestamptz_comparison_exp) GetNin() []time.Time { return v.Nin } @@ -1542,8 +1584,6 @@ type UpsertPackageInsert_package_onePackageReleasesPackage_release struct { Id uuid.UUID `json:"id"` // An array relationship Release_dependencies []*UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency `json:"release_dependencies"` - // An array relationship - Release_licenses []*UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license `json:"release_licenses"` } // GetId returns UpsertPackageInsert_package_onePackageReleasesPackage_release.Id, and is useful for accessing the field via an interface. @@ -1556,17 +1596,14 @@ func (v *UpsertPackageInsert_package_onePackageReleasesPackage_release) GetRelea return v.Release_dependencies } -// GetRelease_licenses returns UpsertPackageInsert_package_onePackageReleasesPackage_release.Release_licenses, and is useful for accessing the field via an interface. -func (v *UpsertPackageInsert_package_onePackageReleasesPackage_release) GetRelease_licenses() []*UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license { - return v.Release_licenses -} - // UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency includes the requested fields of the GraphQL type package_release_dependency. // The GraphQL type's documentation follows. // // columns and relationships of "package.release_dependency" type UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency struct { Id uuid.UUID `json:"id"` + // An object relationship + Dependency_package *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage `json:"dependency_package"` } // GetId returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency.Id, and is useful for accessing the field via an interface. @@ -1574,37 +1611,34 @@ func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_de return v.Id } -// UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license includes the requested fields of the GraphQL type package_release_license. +// GetDependency_package returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency.Dependency_package, and is useful for accessing the field via an interface. +func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependency) GetDependency_package() *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage { + return v.Dependency_package +} + +// UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage includes the requested fields of the GraphQL type package. // The GraphQL type's documentation follows. // -// columns and relationships of "package.release_license" -type UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license struct { - Id uuid.UUID `json:"id"` - // An object relationship - License *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license `json:"license"` +// columns and relationships of "package.package" +type UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage struct { + Id uuid.UUID `json:"id"` + Name string `json:"name"` + Fetched_time *time.Time `json:"fetched_time"` } -// GetId returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license.Id, and is useful for accessing the field via an interface. -func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license) GetId() uuid.UUID { +// GetId returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage.Id, and is useful for accessing the field via an interface. +func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage) GetId() uuid.UUID { return v.Id } -// GetLicense returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license.License, and is useful for accessing the field via an interface. -func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_license) GetLicense() *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license { - return v.License +// GetName returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage.Name, and is useful for accessing the field via an interface. +func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage) GetName() string { + return v.Name } -// UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license includes the requested fields of the GraphQL type package_license. -// The GraphQL type's documentation follows. -// -// columns and relationships of "package.license" -type UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license struct { - Id uuid.UUID `json:"id"` -} - -// GetId returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license.Id, and is useful for accessing the field via an interface. -func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_licensesPackage_release_licenseLicensePackage_license) GetId() uuid.UUID { - return v.Id +// GetFetched_time returns UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage.Fetched_time, and is useful for accessing the field via an interface. +func (v *UpsertPackageInsert_package_onePackageReleasesPackage_releaseRelease_dependenciesPackage_release_dependencyDependency_packagePackage) GetFetched_time() *time.Time { + return v.Fetched_time } // UpsertPackageResponse is returned by UpsertPackage on success. @@ -1620,47 +1654,47 @@ func (v *UpsertPackageResponse) GetInsert_package_one() *UpsertPackageInsert_pac // Boolean expression to compare columns of type "uuid". All fields are combined with logical 'AND'. type Uuid_comparison_exp struct { - Eq uuid.UUID `json:"_eq"` - Gt uuid.UUID `json:"_gt"` - Gte uuid.UUID `json:"_gte"` - In []uuid.UUID `json:"_in"` - Is_null bool `json:"_is_null"` - Lt uuid.UUID `json:"_lt"` - Lte uuid.UUID `json:"_lte"` - Neq uuid.UUID `json:"_neq"` - Nin []uuid.UUID `json:"_nin"` + Eq *uuid.UUID `json:"_eq,omitempty"` + Gt *uuid.UUID `json:"_gt,omitempty"` + Gte *uuid.UUID `json:"_gte,omitempty"` + In []uuid.UUID `json:"_in,omitempty"` + Is_null *bool `json:"_is_null,omitempty"` + Lt *uuid.UUID `json:"_lt,omitempty"` + Lte *uuid.UUID `json:"_lte,omitempty"` + Neq *uuid.UUID `json:"_neq,omitempty"` + Nin []uuid.UUID `json:"_nin,omitempty"` } // GetEq returns Uuid_comparison_exp.Eq, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetEq() uuid.UUID { return v.Eq } +func (v *Uuid_comparison_exp) GetEq() *uuid.UUID { return v.Eq } // GetGt returns Uuid_comparison_exp.Gt, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetGt() uuid.UUID { return v.Gt } +func (v *Uuid_comparison_exp) GetGt() *uuid.UUID { return v.Gt } // GetGte returns Uuid_comparison_exp.Gte, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetGte() uuid.UUID { return v.Gte } +func (v *Uuid_comparison_exp) GetGte() *uuid.UUID { return v.Gte } // GetIn returns Uuid_comparison_exp.In, and is useful for accessing the field via an interface. func (v *Uuid_comparison_exp) GetIn() []uuid.UUID { return v.In } // GetIs_null returns Uuid_comparison_exp.Is_null, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetIs_null() bool { return v.Is_null } +func (v *Uuid_comparison_exp) GetIs_null() *bool { return v.Is_null } // GetLt returns Uuid_comparison_exp.Lt, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetLt() uuid.UUID { return v.Lt } +func (v *Uuid_comparison_exp) GetLt() *uuid.UUID { return v.Lt } // GetLte returns Uuid_comparison_exp.Lte, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetLte() uuid.UUID { return v.Lte } +func (v *Uuid_comparison_exp) GetLte() *uuid.UUID { return v.Lte } // GetNeq returns Uuid_comparison_exp.Neq, and is useful for accessing the field via an interface. -func (v *Uuid_comparison_exp) GetNeq() uuid.UUID { return v.Neq } +func (v *Uuid_comparison_exp) GetNeq() *uuid.UUID { return v.Neq } // GetNin returns Uuid_comparison_exp.Nin, and is useful for accessing the field via an interface. func (v *Uuid_comparison_exp) GetNin() []uuid.UUID { return v.Nin } // __DeleteBuildInput is used internally by genqlient type __DeleteBuildInput struct { - Id uuid.UUID `json:"id"` + Id uuid.UUID `json:"id,omitempty"` } // GetId returns __DeleteBuildInput.Id, and is useful for accessing the field via an interface. @@ -1668,32 +1702,50 @@ func (v *__DeleteBuildInput) GetId() uuid.UUID { return v.Id } // __InsertNewBuildQueryInput is used internally by genqlient type __InsertNewBuildQueryInput struct { - Project_id uuid.UUID `json:"project_id"` - S3_url string `json:"s3_url"` - Git_remote string `json:"git_remote"` - Git_branch string `json:"git_branch"` - Git_hash string `json:"git_hash"` + Project_id *uuid.UUID `json:"project_id,omitempty"` + S3_url *string `json:"s3_url,omitempty"` + Git_remote *string `json:"git_remote,omitempty"` + Git_branch *string `json:"git_branch,omitempty"` + Git_hash *string `json:"git_hash,omitempty"` } // GetProject_id returns __InsertNewBuildQueryInput.Project_id, and is useful for accessing the field via an interface. -func (v *__InsertNewBuildQueryInput) GetProject_id() uuid.UUID { return v.Project_id } +func (v *__InsertNewBuildQueryInput) GetProject_id() *uuid.UUID { return v.Project_id } // GetS3_url returns __InsertNewBuildQueryInput.S3_url, and is useful for accessing the field via an interface. -func (v *__InsertNewBuildQueryInput) GetS3_url() string { return v.S3_url } +func (v *__InsertNewBuildQueryInput) GetS3_url() *string { return v.S3_url } // GetGit_remote returns __InsertNewBuildQueryInput.Git_remote, and is useful for accessing the field via an interface. -func (v *__InsertNewBuildQueryInput) GetGit_remote() string { return v.Git_remote } +func (v *__InsertNewBuildQueryInput) GetGit_remote() *string { return v.Git_remote } // GetGit_branch returns __InsertNewBuildQueryInput.Git_branch, and is useful for accessing the field via an interface. -func (v *__InsertNewBuildQueryInput) GetGit_branch() string { return v.Git_branch } +func (v *__InsertNewBuildQueryInput) GetGit_branch() *string { return v.Git_branch } // GetGit_hash returns __InsertNewBuildQueryInput.Git_hash, and is useful for accessing the field via an interface. -func (v *__InsertNewBuildQueryInput) GetGit_hash() string { return v.Git_hash } +func (v *__InsertNewBuildQueryInput) GetGit_hash() *string { return v.Git_hash } + +// __PackageFetchTimeInput is used internally by genqlient +type __PackageFetchTimeInput struct { + Package_manager *types.PackageManager `json:"package_manager,omitempty"` + Custom_registry *string `json:"custom_registry,omitempty"` + Name *string `json:"name,omitempty"` +} + +// GetPackage_manager returns __PackageFetchTimeInput.Package_manager, and is useful for accessing the field via an interface. +func (v *__PackageFetchTimeInput) GetPackage_manager() *types.PackageManager { + return v.Package_manager +} + +// GetCustom_registry returns __PackageFetchTimeInput.Custom_registry, and is useful for accessing the field via an interface. +func (v *__PackageFetchTimeInput) GetCustom_registry() *string { return v.Custom_registry } + +// GetName returns __PackageFetchTimeInput.Name, and is useful for accessing the field via an interface. +func (v *__PackageFetchTimeInput) GetName() *string { return v.Name } // __SetBuildS3UrlInput is used internally by genqlient type __SetBuildS3UrlInput struct { - Id uuid.UUID `json:"id"` - S3_url string `json:"s3_url"` + Id uuid.UUID `json:"id,omitempty"` + S3_url string `json:"s3_url,omitempty"` } // GetId returns __SetBuildS3UrlInput.Id, and is useful for accessing the field via an interface. @@ -1719,39 +1771,40 @@ func DeleteBuild( client graphql.Client, id uuid.UUID, ) (*DeleteBuildResponse, error) { - __input := __DeleteBuildInput{ - Id: id, - } - var err error - - var retval DeleteBuildResponse - err = client.MakeRequest( - ctx, - "DeleteBuild", - ` + req := &graphql.Request{ + OpName: "DeleteBuild", + Query: ` mutation DeleteBuild ($id: uuid!) { delete_builds_by_pk(id: $id) { id } } `, - &retval, - &__input, + Variables: &__DeleteBuildInput{ + Id: id, + }, + } + var err error + + var data DeleteBuildResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + ctx, + req, + resp, ) - return &retval, err + + return &data, err } func GetProjectInfoQuery( ctx context.Context, client graphql.Client, ) (*GetProjectInfoQueryResponse, error) { - var err error - - var retval GetProjectInfoQueryResponse - err = client.MakeRequest( - ctx, - "GetProjectInfoQuery", - ` + req := &graphql.Request{ + OpName: "GetProjectInfoQuery", + Query: ` query GetProjectInfoQuery { project_access_tokens { project { @@ -1761,35 +1814,33 @@ query GetProjectInfoQuery { } } `, - &retval, - nil, + } + var err error + + var data GetProjectInfoQueryResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + ctx, + req, + resp, ) - return &retval, err + + return &data, err } func InsertNewBuildQuery( ctx context.Context, client graphql.Client, - project_id uuid.UUID, - s3_url string, - git_remote string, - git_branch string, - git_hash string, + project_id *uuid.UUID, + s3_url *string, + git_remote *string, + git_branch *string, + git_hash *string, ) (*InsertNewBuildQueryResponse, error) { - __input := __InsertNewBuildQueryInput{ - Project_id: project_id, - S3_url: s3_url, - Git_remote: git_remote, - Git_branch: git_branch, - Git_hash: git_hash, - } - var err error - - var retval InsertNewBuildQueryResponse - err = client.MakeRequest( - ctx, - "InsertNewBuildQuery", - ` + req := &graphql.Request{ + OpName: "InsertNewBuildQuery", + Query: ` mutation InsertNewBuildQuery ($project_id: uuid, $s3_url: String, $git_remote: String, $git_branch: String, $git_hash: String) { insert_builds_one(object: {project_id:$project_id,s3_url:$s3_url,git_remote:$git_remote,git_branch:$git_branch,git_hash:$git_hash}) { id @@ -1797,39 +1848,96 @@ mutation InsertNewBuildQuery ($project_id: uuid, $s3_url: String, $git_remote: S } } `, - &retval, - &__input, + Variables: &__InsertNewBuildQueryInput{ + Project_id: project_id, + S3_url: s3_url, + Git_remote: git_remote, + Git_branch: git_branch, + Git_hash: git_hash, + }, + } + var err error + + var data InsertNewBuildQueryResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + ctx, + req, + resp, ) - return &retval, err + + return &data, err } -func SetBuildS3Url( +func PackageFetchTime( ctx context.Context, client graphql.Client, - id uuid.UUID, - s3_url string, -) (*SetBuildS3UrlResponse, error) { - __input := __SetBuildS3UrlInput{ - Id: id, - S3_url: s3_url, + package_manager *types.PackageManager, + custom_registry *string, + name *string, +) (*PackageFetchTimeResponse, error) { + req := &graphql.Request{ + OpName: "PackageFetchTime", + Query: ` +query PackageFetchTime ($package_manager: package_manager, $custom_registry: String, $name: String) { + package(where: {custom_registry:{_eq:$custom_registry},name:{_eq:$name},package_manager:{_eq:$package_manager},fetched_time:{_is_null:false}}, limit: 1) { + fetched_time + } +} +`, + Variables: &__PackageFetchTimeInput{ + Package_manager: package_manager, + Custom_registry: custom_registry, + Name: name, + }, } var err error - var retval SetBuildS3UrlResponse + var data PackageFetchTimeResponse + resp := &graphql.Response{Data: &data} + err = client.MakeRequest( ctx, - "SetBuildS3Url", - ` + req, + resp, + ) + + return &data, err +} + +func SetBuildS3Url( + ctx context.Context, + client graphql.Client, + id uuid.UUID, + s3_url string, +) (*SetBuildS3UrlResponse, error) { + req := &graphql.Request{ + OpName: "SetBuildS3Url", + Query: ` mutation SetBuildS3Url ($id: uuid!, $s3_url: String!) { update_builds_by_pk(pk_columns: {id:$id}, _set: {s3_url:$s3_url}) { id } } `, - &retval, - &__input, + Variables: &__SetBuildS3UrlInput{ + Id: id, + S3_url: s3_url, + }, + } + var err error + + var data SetBuildS3UrlResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + ctx, + req, + resp, ) - return &retval, err + + return &data, err } func UpsertPackage( @@ -1838,17 +1946,9 @@ func UpsertPackage( object *Package_insert_input, on_conflict *Package_on_conflict, ) (*UpsertPackageResponse, error) { - __input := __UpsertPackageInput{ - Object: object, - On_conflict: on_conflict, - } - var err error - - var retval UpsertPackageResponse - err = client.MakeRequest( - ctx, - "UpsertPackage", - ` + req := &graphql.Request{ + OpName: "UpsertPackage", + Query: ` mutation UpsertPackage ($object: package_insert_input!, $on_conflict: package_on_conflict!) { insert_package_one(object: $object, on_conflict: $on_conflict) { id @@ -1856,19 +1956,31 @@ mutation UpsertPackage ($object: package_insert_input!, $on_conflict: package_on id release_dependencies { id - } - release_licenses { - id - license { + dependency_package { id + name + fetched_time } } } } } `, - &retval, - &__input, + Variables: &__UpsertPackageInput{ + Object: object, + On_conflict: on_conflict, + }, + } + var err error + + var data UpsertPackageResponse + resp := &graphql.Response{Data: &data} + + err = client.MakeRequest( + ctx, + req, + resp, ) - return &retval, err + + return &data, err } diff --git a/lunatrace/cli/gql/statements.go b/lunatrace/cli/gql/statements.go index 77d65a760..fe3411a6f 100644 --- a/lunatrace/cli/gql/statements.go +++ b/lunatrace/cli/gql/statements.go @@ -21,6 +21,7 @@ var PackageOnConflict = &Package_on_conflict{ Package_update_columnDescription, Package_update_columnName, Package_update_columnPackageManager, + Package_update_columnFetchedTime, }, } @@ -35,6 +36,7 @@ var ReleaseOnConflict = &Package_release_on_conflict{ Package_release_update_columnUpstreamBlobUrl, Package_release_update_columnUpstreamData, Package_release_update_columnVersion, + Package_release_update_columnFetchedTime, }, } @@ -55,9 +57,7 @@ var PackageMaintainerOnConflict = &Package_package_maintainer_on_conflict{ var PackageReleaseDependencyOnConflict = &Package_release_dependency_on_conflict{ Constraint: Package_release_dependency_constraintReleaseDependencyReleaseIdPackageNamePackageVersionIdx, Update_columns: []Package_release_dependency_update_column{ - //todo is this right? Package_release_dependency_update_columnDependencyPackageId, - Package_release_dependency_update_columnDependencyReleaseId, Package_release_dependency_update_columnPackageName, Package_release_dependency_update_columnPackageVersionQuery, }, diff --git a/lunatrace/cli/gql/types/types.go b/lunatrace/cli/gql/types/types.go index 6866c12e7..740f59b14 100644 --- a/lunatrace/cli/gql/types/types.go +++ b/lunatrace/cli/gql/types/types.go @@ -14,17 +14,19 @@ // package types +type UUID string + type PackageManager string const ( - NPM = "NPM" + NPM = "npm" ) -type LicenseSource int +type LicenseSource string const ( - Manual LicenseSource = iota - ScanRepo - ScanBinary - ApiNpm + Manual LicenseSource = "manual" + ScanRepo LicenseSource = "scan_repo" + ScanBinary LicenseSource = "scan_binary" + ApiNpm LicenseSource = "api_npm" ) diff --git a/lunatrace/cli/gql/upsertPackage.graphql b/lunatrace/cli/gql/upsertPackage.graphql index 13b94ac80..ac6188e08 100644 --- a/lunatrace/cli/gql/upsertPackage.graphql +++ b/lunatrace/cli/gql/upsertPackage.graphql @@ -5,13 +5,18 @@ mutation UpsertPackage($object: package_insert_input!, $on_conflict: package_on_ id release_dependencies { id - } - release_licenses { - id - license { + dependency_package { id + name + fetched_time } } } } } + +query PackageFetchTime($package_manager: package_manager, $custom_registry: String, $name: String) { + package(where: {custom_registry: {_eq: $custom_registry}, name: {_eq: $name}, package_manager: {_eq: $package_manager}, fetched_time: {_is_null: false}}, limit: 1) { + fetched_time + } +} diff --git a/lunatrace/bsl/license-worker/internal/pkg/npm/init.go b/lunatrace/cli/pkg/util/ptr.go similarity index 53% rename from lunatrace/bsl/license-worker/internal/pkg/npm/init.go rename to lunatrace/cli/pkg/util/ptr.go index eb2cc71b8..53d4c1f96 100644 --- a/lunatrace/bsl/license-worker/internal/pkg/npm/init.go +++ b/lunatrace/cli/pkg/util/ptr.go @@ -1,14 +1,3 @@ -// Copyright by LunaSec (owned by Refinery Labs, Inc) -// -// Licensed under the Business Source License v1.1 -// (the "License"); you may not use this file except in compliance with the -// License. You may obtain a copy of the License at -// -// https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt -// -// See the License for the specific language governing permissions and -// limitations under the License. -// // Copyright 2022 by LunaSec (owned by Refinery Labs, Inc) // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,13 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. // -package npm - -import "os" +package util -func init() { - err := os.MkdirAll(npmPackageDir, fsPerm) - if err != nil { - panic(err) - } +func Ptr[T any](t T) *T { + return &t } diff --git a/lunatrace/schema.graphql b/lunatrace/schema.graphql index 93ffcacd0..173403b1c 100644 --- a/lunatrace/schema.graphql +++ b/lunatrace/schema.graphql @@ -1093,9 +1093,11 @@ input fix_state_enum_comparison_exp { """Metadata about a github repository and where to find it.""" type github_repositories { authenticated_clone_url: AuthenticatedRepoCloneUrlOutput + default_branch: String git_url: String! github_id: Int github_node_id: String + id: uuid! """An object relationship""" project: projects! @@ -1152,9 +1154,11 @@ input github_repositories_bool_exp { _and: [github_repositories_bool_exp!] _not: github_repositories_bool_exp _or: [github_repositories_bool_exp!] + default_branch: String_comparison_exp git_url: String_comparison_exp github_id: Int_comparison_exp github_node_id: String_comparison_exp + id: uuid_comparison_exp project: projects_bool_exp project_id: uuid_comparison_exp traits: jsonb_comparison_exp @@ -1219,9 +1223,11 @@ input github_repositories_insert_input { order by max() on columns of table "github_repositories" """ input github_repositories_max_order_by { + default_branch: order_by git_url: order_by github_id: order_by github_node_id: order_by + id: order_by project_id: order_by } @@ -1229,9 +1235,11 @@ input github_repositories_max_order_by { order by min() on columns of table "github_repositories" """ input github_repositories_min_order_by { + default_branch: order_by git_url: order_by github_id: order_by github_node_id: order_by + id: order_by project_id: order_by } @@ -1267,14 +1275,21 @@ input github_repositories_on_conflict { """Ordering options when selecting data from "github_repositories".""" input github_repositories_order_by { + default_branch: order_by git_url: order_by github_id: order_by github_node_id: order_by + id: order_by project: projects_order_by project_id: order_by traits: order_by } +"""primary key columns input for table: github_repositories""" +input github_repositories_pk_columns_input { + id: uuid! +} + """prepend existing jsonb value of filtered columns with new jsonb value""" input github_repositories_prepend_input { traits: jsonb @@ -1284,6 +1299,9 @@ input github_repositories_prepend_input { select columns of table "github_repositories" """ enum github_repositories_select_column { + """column name""" + default_branch + """column name""" git_url @@ -1293,6 +1311,9 @@ enum github_repositories_select_column { """column name""" github_node_id + """column name""" + id + """column name""" project_id @@ -2250,6 +2271,23 @@ input jsonb_comparison_exp { _nin: [jsonb!] } +scalar license_source + +""" +Boolean expression to compare columns of type "license_source". All fields are combined with logical 'AND'. +""" +input license_source_comparison_exp { + _eq: license_source + _gt: license_source + _gte: license_source + _in: [license_source!] + _is_null: Boolean + _lt: license_source + _lte: license_source + _neq: license_source + _nin: [license_source!] +} + """ columns and relationships of "manifests" """ @@ -2714,6 +2752,160 @@ type mutation_root { on_conflict: organizations_on_conflict ): organizations + """ + insert data into the table: "package.package" + """ + insert_package( + """the rows to be inserted""" + objects: [package_insert_input!]! + + """upsert condition""" + on_conflict: package_on_conflict + ): package_mutation_response + + """ + insert data into the table: "package.license" + """ + insert_package_license( + """the rows to be inserted""" + objects: [package_license_insert_input!]! + + """upsert condition""" + on_conflict: package_license_on_conflict + ): package_license_mutation_response + + """ + insert a single row into the table: "package.license" + """ + insert_package_license_one( + """the row to be inserted""" + object: package_license_insert_input! + + """upsert condition""" + on_conflict: package_license_on_conflict + ): package_license + + """ + insert data into the table: "package.maintainer" + """ + insert_package_maintainer( + """the rows to be inserted""" + objects: [package_maintainer_insert_input!]! + + """upsert condition""" + on_conflict: package_maintainer_on_conflict + ): package_maintainer_mutation_response + + """ + insert a single row into the table: "package.maintainer" + """ + insert_package_maintainer_one( + """the row to be inserted""" + object: package_maintainer_insert_input! + + """upsert condition""" + on_conflict: package_maintainer_on_conflict + ): package_maintainer + + """ + insert a single row into the table: "package.package" + """ + insert_package_one( + """the row to be inserted""" + object: package_insert_input! + + """upsert condition""" + on_conflict: package_on_conflict + ): package + + """ + insert data into the table: "package.package_maintainer" + """ + insert_package_package_maintainer( + """the rows to be inserted""" + objects: [package_package_maintainer_insert_input!]! + + """upsert condition""" + on_conflict: package_package_maintainer_on_conflict + ): package_package_maintainer_mutation_response + + """ + insert a single row into the table: "package.package_maintainer" + """ + insert_package_package_maintainer_one( + """the row to be inserted""" + object: package_package_maintainer_insert_input! + + """upsert condition""" + on_conflict: package_package_maintainer_on_conflict + ): package_package_maintainer + + """ + insert data into the table: "package.release" + """ + insert_package_release( + """the rows to be inserted""" + objects: [package_release_insert_input!]! + + """upsert condition""" + on_conflict: package_release_on_conflict + ): package_release_mutation_response + + """ + insert data into the table: "package.release_dependency" + """ + insert_package_release_dependency( + """the rows to be inserted""" + objects: [package_release_dependency_insert_input!]! + + """upsert condition""" + on_conflict: package_release_dependency_on_conflict + ): package_release_dependency_mutation_response + + """ + insert a single row into the table: "package.release_dependency" + """ + insert_package_release_dependency_one( + """the row to be inserted""" + object: package_release_dependency_insert_input! + + """upsert condition""" + on_conflict: package_release_dependency_on_conflict + ): package_release_dependency + + """ + insert data into the table: "package.release_license" + """ + insert_package_release_license( + """the rows to be inserted""" + objects: [package_release_license_insert_input!]! + + """upsert condition""" + on_conflict: package_release_license_on_conflict + ): package_release_license_mutation_response + + """ + insert a single row into the table: "package.release_license" + """ + insert_package_release_license_one( + """the row to be inserted""" + object: package_release_license_insert_input! + + """upsert condition""" + on_conflict: package_release_license_on_conflict + ): package_release_license + + """ + insert a single row into the table: "package.release" + """ + insert_package_release_one( + """the row to be inserted""" + object: package_release_insert_input! + + """upsert condition""" + on_conflict: package_release_on_conflict + ): package_release + """ insert data into the table: "package_versions" """ @@ -2952,6 +3144,39 @@ type mutation_root { where: github_repositories_bool_exp! ): github_repositories_mutation_response + """ + update single row of the table: "github_repositories" + """ + update_github_repositories_by_pk( + """append existing jsonb value of filtered columns with new jsonb value""" + _append: github_repositories_append_input + + """ + delete the field or element with specified path (for JSON arrays, negative integers count from the end) + """ + _delete_at_path: github_repositories_delete_at_path_input + + """ + delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array + """ + _delete_elem: github_repositories_delete_elem_input + + """ + delete key/value pair or string element. key/value pairs are matched based on their key value + """ + _delete_key: github_repositories_delete_key_input + + """increments the numeric columns with given value of the filtered values""" + _inc: github_repositories_inc_input + + """prepend existing jsonb value of filtered columns with new jsonb value""" + _prepend: github_repositories_prepend_input + + """sets the columns of the filtered rows to the given values""" + _set: github_repositories_set_input + pk_columns: github_repositories_pk_columns_input! + ): github_repositories + """ update data of the table: "guide_related_guides" """ @@ -3094,141 +3319,356 @@ type mutation_root { ): organizations """ - update data of the table: "package_versions" + update data of the table: "package.package" """ - update_package_versions( + update_package( """sets the columns of the filtered rows to the given values""" - _set: package_versions_set_input + _set: package_set_input """filter the rows which have to be updated""" - where: package_versions_bool_exp! - ): package_versions_mutation_response + where: package_bool_exp! + ): package_mutation_response """ - update single row of the table: "package_versions" + update single row of the table: "package.package" """ - update_package_versions_by_pk( + update_package_by_pk( """sets the columns of the filtered rows to the given values""" - _set: package_versions_set_input - pk_columns: package_versions_pk_columns_input! - ): package_versions + _set: package_set_input + pk_columns: package_pk_columns_input! + ): package """ - update data of the table: "projects" + update data of the table: "package.license" """ - update_projects( + update_package_license( """sets the columns of the filtered rows to the given values""" - _set: projects_set_input + _set: package_license_set_input """filter the rows which have to be updated""" - where: projects_bool_exp! - ): projects_mutation_response + where: package_license_bool_exp! + ): package_license_mutation_response """ - update single row of the table: "projects" + update single row of the table: "package.license" """ - update_projects_by_pk( + update_package_license_by_pk( """sets the columns of the filtered rows to the given values""" - _set: projects_set_input - pk_columns: projects_pk_columns_input! - ): projects + _set: package_license_set_input + pk_columns: package_license_pk_columns_input! + ): package_license """ - update data of the table: "scans" + update data of the table: "package.maintainer" """ - update_scans( - """increments the numeric columns with given value of the filtered values""" - _inc: scans_inc_input - + update_package_maintainer( """sets the columns of the filtered rows to the given values""" - _set: scans_set_input + _set: package_maintainer_set_input """filter the rows which have to be updated""" - where: scans_bool_exp! - ): scans_mutation_response + where: package_maintainer_bool_exp! + ): package_maintainer_mutation_response """ - update single row of the table: "scans" + update single row of the table: "package.maintainer" """ - update_scans_by_pk( - """increments the numeric columns with given value of the filtered values""" - _inc: scans_inc_input - + update_package_maintainer_by_pk( """sets the columns of the filtered rows to the given values""" - _set: scans_set_input - pk_columns: scans_pk_columns_input! - ): scans + _set: package_maintainer_set_input + pk_columns: package_maintainer_pk_columns_input! + ): package_maintainer """ - update data of the table: "users" + update data of the table: "package.package_maintainer" """ - update_users( + update_package_package_maintainer( """sets the columns of the filtered rows to the given values""" - _set: users_set_input + _set: package_package_maintainer_set_input """filter the rows which have to be updated""" - where: users_bool_exp! - ): users_mutation_response + where: package_package_maintainer_bool_exp! + ): package_package_maintainer_mutation_response """ - update single row of the table: "users" + update data of the table: "package.release" """ - update_users_by_pk( - """sets the columns of the filtered rows to the given values""" - _set: users_set_input - pk_columns: users_pk_columns_input! - ): users + update_package_release( + """append existing jsonb value of filtered columns with new jsonb value""" + _append: package_release_append_input + + """ + delete the field or element with specified path (for JSON arrays, negative integers count from the end) + """ + _delete_at_path: package_release_delete_at_path_input + + """ + delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array + """ + _delete_elem: package_release_delete_elem_input + + """ + delete key/value pair or string element. key/value pairs are matched based on their key value + """ + _delete_key: package_release_delete_key_input + + """prepend existing jsonb value of filtered columns with new jsonb value""" + _prepend: package_release_prepend_input - """ - update data of the table: "vulnerabilities" - """ - update_vulnerabilities( """sets the columns of the filtered rows to the given values""" - _set: vulnerabilities_set_input + _set: package_release_set_input """filter the rows which have to be updated""" - where: vulnerabilities_bool_exp! - ): vulnerabilities_mutation_response + where: package_release_bool_exp! + ): package_release_mutation_response """ - update single row of the table: "vulnerabilities" + update single row of the table: "package.release" """ - update_vulnerabilities_by_pk( + update_package_release_by_pk( + """append existing jsonb value of filtered columns with new jsonb value""" + _append: package_release_append_input + + """ + delete the field or element with specified path (for JSON arrays, negative integers count from the end) + """ + _delete_at_path: package_release_delete_at_path_input + + """ + delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array + """ + _delete_elem: package_release_delete_elem_input + + """ + delete key/value pair or string element. key/value pairs are matched based on their key value + """ + _delete_key: package_release_delete_key_input + + """prepend existing jsonb value of filtered columns with new jsonb value""" + _prepend: package_release_prepend_input + """sets the columns of the filtered rows to the given values""" - _set: vulnerabilities_set_input - pk_columns: vulnerabilities_pk_columns_input! - ): vulnerabilities + _set: package_release_set_input + pk_columns: package_release_pk_columns_input! + ): package_release """ - update data of the table: "vulnerability_packages" + update data of the table: "package.release_dependency" """ - update_vulnerability_packages( + update_package_release_dependency( """sets the columns of the filtered rows to the given values""" - _set: vulnerability_packages_set_input + _set: package_release_dependency_set_input """filter the rows which have to be updated""" - where: vulnerability_packages_bool_exp! - ): vulnerability_packages_mutation_response + where: package_release_dependency_bool_exp! + ): package_release_dependency_mutation_response """ - update single row of the table: "vulnerability_packages" + update single row of the table: "package.release_dependency" """ - update_vulnerability_packages_by_pk( + update_package_release_dependency_by_pk( """sets the columns of the filtered rows to the given values""" - _set: vulnerability_packages_set_input - pk_columns: vulnerability_packages_pk_columns_input! - ): vulnerability_packages + _set: package_release_dependency_set_input + pk_columns: package_release_dependency_pk_columns_input! + ): package_release_dependency """ - update data of the table: "webhook_cache" + update data of the table: "package.release_license" """ - update_webhook_cache( + update_package_release_license( + """append existing jsonb value of filtered columns with new jsonb value""" + _append: package_release_license_append_input + + """ + delete the field or element with specified path (for JSON arrays, negative integers count from the end) + """ + _delete_at_path: package_release_license_delete_at_path_input + + """ + delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array + """ + _delete_elem: package_release_license_delete_elem_input + + """ + delete key/value pair or string element. key/value pairs are matched based on their key value + """ + _delete_key: package_release_license_delete_key_input + + """prepend existing jsonb value of filtered columns with new jsonb value""" + _prepend: package_release_license_prepend_input + """sets the columns of the filtered rows to the given values""" - _set: webhook_cache_set_input + _set: package_release_license_set_input """filter the rows which have to be updated""" - where: webhook_cache_bool_exp! - ): webhook_cache_mutation_response + where: package_release_license_bool_exp! + ): package_release_license_mutation_response + + """ + update single row of the table: "package.release_license" + """ + update_package_release_license_by_pk( + """append existing jsonb value of filtered columns with new jsonb value""" + _append: package_release_license_append_input + + """ + delete the field or element with specified path (for JSON arrays, negative integers count from the end) + """ + _delete_at_path: package_release_license_delete_at_path_input + + """ + delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array + """ + _delete_elem: package_release_license_delete_elem_input + + """ + delete key/value pair or string element. key/value pairs are matched based on their key value + """ + _delete_key: package_release_license_delete_key_input + + """prepend existing jsonb value of filtered columns with new jsonb value""" + _prepend: package_release_license_prepend_input + + """sets the columns of the filtered rows to the given values""" + _set: package_release_license_set_input + pk_columns: package_release_license_pk_columns_input! + ): package_release_license + + """ + update data of the table: "package_versions" + """ + update_package_versions( + """sets the columns of the filtered rows to the given values""" + _set: package_versions_set_input + + """filter the rows which have to be updated""" + where: package_versions_bool_exp! + ): package_versions_mutation_response + + """ + update single row of the table: "package_versions" + """ + update_package_versions_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: package_versions_set_input + pk_columns: package_versions_pk_columns_input! + ): package_versions + + """ + update data of the table: "projects" + """ + update_projects( + """sets the columns of the filtered rows to the given values""" + _set: projects_set_input + + """filter the rows which have to be updated""" + where: projects_bool_exp! + ): projects_mutation_response + + """ + update single row of the table: "projects" + """ + update_projects_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: projects_set_input + pk_columns: projects_pk_columns_input! + ): projects + + """ + update data of the table: "scans" + """ + update_scans( + """increments the numeric columns with given value of the filtered values""" + _inc: scans_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: scans_set_input + + """filter the rows which have to be updated""" + where: scans_bool_exp! + ): scans_mutation_response + + """ + update single row of the table: "scans" + """ + update_scans_by_pk( + """increments the numeric columns with given value of the filtered values""" + _inc: scans_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: scans_set_input + pk_columns: scans_pk_columns_input! + ): scans + + """ + update data of the table: "users" + """ + update_users( + """sets the columns of the filtered rows to the given values""" + _set: users_set_input + + """filter the rows which have to be updated""" + where: users_bool_exp! + ): users_mutation_response + + """ + update single row of the table: "users" + """ + update_users_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: users_set_input + pk_columns: users_pk_columns_input! + ): users + + """ + update data of the table: "vulnerabilities" + """ + update_vulnerabilities( + """sets the columns of the filtered rows to the given values""" + _set: vulnerabilities_set_input + + """filter the rows which have to be updated""" + where: vulnerabilities_bool_exp! + ): vulnerabilities_mutation_response + + """ + update single row of the table: "vulnerabilities" + """ + update_vulnerabilities_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: vulnerabilities_set_input + pk_columns: vulnerabilities_pk_columns_input! + ): vulnerabilities + + """ + update data of the table: "vulnerability_packages" + """ + update_vulnerability_packages( + """sets the columns of the filtered rows to the given values""" + _set: vulnerability_packages_set_input + + """filter the rows which have to be updated""" + where: vulnerability_packages_bool_exp! + ): vulnerability_packages_mutation_response + + """ + update single row of the table: "vulnerability_packages" + """ + update_vulnerability_packages_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: vulnerability_packages_set_input + pk_columns: vulnerability_packages_pk_columns_input! + ): vulnerability_packages + + """ + update data of the table: "webhook_cache" + """ + update_webhook_cache( + """sets the columns of the filtered rows to the given values""" + _set: webhook_cache_set_input + + """filter the rows which have to be updated""" + where: webhook_cache_bool_exp! + ): webhook_cache_mutation_response """ update single row of the table: "webhook_cache" @@ -3809,43 +4249,1489 @@ enum organizations_update_column { creator_id """column name""" - github_id + github_id + + """column name""" + github_node_id + + """column name""" + github_owner_type + + """column name""" + id + + """column name""" + installation_id + + """column name""" + name + + """column name""" + settings_id +} + +"""aggregate var_pop on columns""" +type organizations_var_pop_fields { + github_id: Float + installation_id: Float +} + +"""aggregate var_samp on columns""" +type organizations_var_samp_fields { + github_id: Float + installation_id: Float +} + +"""aggregate variance on columns""" +type organizations_variance_fields { + github_id: Float + installation_id: Float +} + +""" +columns and relationships of "package.package" +""" +type package { + custom_registry: String! + description: String + fetched_time: timestamptz + id: uuid! + name: String! + + """An array relationship""" + package_maintainers( + """distinct select on columns""" + distinct_on: [package_package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_package_maintainer_order_by!] + + """filter the rows returned""" + where: package_package_maintainer_bool_exp + ): [package_package_maintainer!]! + package_manager: package_manager! + + """An array relationship""" + releases( + """distinct select on columns""" + distinct_on: [package_release_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_order_by!] + + """filter the rows returned""" + where: package_release_bool_exp + ): [package_release!]! +} + +""" +Boolean expression to filter rows from the table "package.package". All fields are combined with a logical 'AND'. +""" +input package_bool_exp { + _and: [package_bool_exp!] + _not: package_bool_exp + _or: [package_bool_exp!] + custom_registry: String_comparison_exp + description: String_comparison_exp + fetched_time: timestamptz_comparison_exp + id: uuid_comparison_exp + name: String_comparison_exp + package_maintainers: package_package_maintainer_bool_exp + package_manager: package_manager_comparison_exp + releases: package_release_bool_exp +} + +""" +unique or primary key constraints on table "package.package" +""" +enum package_constraint { + """unique or primary key constraint""" + package_package_manager_custom_registry_name_idx + + """unique or primary key constraint""" + package_pkey +} + +""" +input type for inserting data into table "package.package" +""" +input package_insert_input { + custom_registry: String + description: String + fetched_time: timestamptz + id: uuid + name: String + package_maintainers: package_package_maintainer_arr_rel_insert_input + package_manager: package_manager + releases: package_release_arr_rel_insert_input +} + +""" +columns and relationships of "package.license" +""" +type package_license { + id: uuid! + name: String! + + """An array relationship""" + release_licenses( + """distinct select on columns""" + distinct_on: [package_release_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_license_order_by!] + + """filter the rows returned""" + where: package_release_license_bool_exp + ): [package_release_license!]! +} + +""" +Boolean expression to filter rows from the table "package.license". All fields are combined with a logical 'AND'. +""" +input package_license_bool_exp { + _and: [package_license_bool_exp!] + _not: package_license_bool_exp + _or: [package_license_bool_exp!] + id: uuid_comparison_exp + name: String_comparison_exp + release_licenses: package_release_license_bool_exp +} + +""" +unique or primary key constraints on table "package.license" +""" +enum package_license_constraint { + """unique or primary key constraint""" + license_name_idx + + """unique or primary key constraint""" + license_pkey +} + +""" +input type for inserting data into table "package.license" +""" +input package_license_insert_input { + id: uuid + name: String + release_licenses: package_release_license_arr_rel_insert_input +} + +""" +response of any mutation on the table "package.license" +""" +type package_license_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_license!]! +} + +""" +input type for inserting object relation for remote table "package.license" +""" +input package_license_obj_rel_insert_input { + data: package_license_insert_input! + + """upsert condition""" + on_conflict: package_license_on_conflict +} + +""" +on_conflict condition type for table "package.license" +""" +input package_license_on_conflict { + constraint: package_license_constraint! + update_columns: [package_license_update_column!]! = [] + where: package_license_bool_exp +} + +"""Ordering options when selecting data from "package.license".""" +input package_license_order_by { + id: order_by + name: order_by + release_licenses_aggregate: package_release_license_aggregate_order_by +} + +"""primary key columns input for table: package_license""" +input package_license_pk_columns_input { + id: uuid! +} + +""" +select columns of table "package.license" +""" +enum package_license_select_column { + """column name""" + id + + """column name""" + name +} + +""" +input type for updating data in table "package.license" +""" +input package_license_set_input { + id: uuid + name: String +} + +""" +update columns of table "package.license" +""" +enum package_license_update_column { + """column name""" + id + + """column name""" + name +} + +""" +columns and relationships of "package.maintainer" +""" +type package_maintainer { + email: String! + id: uuid! + name: String + + """An array relationship""" + package_maintainers( + """distinct select on columns""" + distinct_on: [package_package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_package_maintainer_order_by!] + + """filter the rows returned""" + where: package_package_maintainer_bool_exp + ): [package_package_maintainer!]! + package_manager: package_manager + + """An array relationship""" + published_releases( + """distinct select on columns""" + distinct_on: [package_release_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_order_by!] + + """filter the rows returned""" + where: package_release_bool_exp + ): [package_release!]! +} + +""" +Boolean expression to filter rows from the table "package.maintainer". All fields are combined with a logical 'AND'. +""" +input package_maintainer_bool_exp { + _and: [package_maintainer_bool_exp!] + _not: package_maintainer_bool_exp + _or: [package_maintainer_bool_exp!] + email: String_comparison_exp + id: uuid_comparison_exp + name: String_comparison_exp + package_maintainers: package_package_maintainer_bool_exp + package_manager: package_manager_comparison_exp + published_releases: package_release_bool_exp +} + +""" +unique or primary key constraints on table "package.maintainer" +""" +enum package_maintainer_constraint { + """unique or primary key constraint""" + maintainer_package_manager_email_idx + + """unique or primary key constraint""" + maintainer_pkey +} + +""" +input type for inserting data into table "package.maintainer" +""" +input package_maintainer_insert_input { + email: String + id: uuid + name: String + package_maintainers: package_package_maintainer_arr_rel_insert_input + package_manager: package_manager + published_releases: package_release_arr_rel_insert_input +} + +""" +response of any mutation on the table "package.maintainer" +""" +type package_maintainer_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_maintainer!]! +} + +""" +input type for inserting object relation for remote table "package.maintainer" +""" +input package_maintainer_obj_rel_insert_input { + data: package_maintainer_insert_input! + + """upsert condition""" + on_conflict: package_maintainer_on_conflict +} + +""" +on_conflict condition type for table "package.maintainer" +""" +input package_maintainer_on_conflict { + constraint: package_maintainer_constraint! + update_columns: [package_maintainer_update_column!]! = [] + where: package_maintainer_bool_exp +} + +"""Ordering options when selecting data from "package.maintainer".""" +input package_maintainer_order_by { + email: order_by + id: order_by + name: order_by + package_maintainers_aggregate: package_package_maintainer_aggregate_order_by + package_manager: order_by + published_releases_aggregate: package_release_aggregate_order_by +} + +"""primary key columns input for table: package_maintainer""" +input package_maintainer_pk_columns_input { + id: uuid! +} + +""" +select columns of table "package.maintainer" +""" +enum package_maintainer_select_column { + """column name""" + email + + """column name""" + id + + """column name""" + name + + """column name""" + package_manager +} + +""" +input type for updating data in table "package.maintainer" +""" +input package_maintainer_set_input { + email: String + id: uuid + name: String + package_manager: package_manager +} + +""" +update columns of table "package.maintainer" +""" +enum package_maintainer_update_column { + """column name""" + email + + """column name""" + id + + """column name""" + name + + """column name""" + package_manager +} + +scalar package_manager + +""" +Boolean expression to compare columns of type "package_manager". All fields are combined with logical 'AND'. +""" +input package_manager_comparison_exp { + _eq: package_manager + _gt: package_manager + _gte: package_manager + _in: [package_manager!] + _is_null: Boolean + _lt: package_manager + _lte: package_manager + _neq: package_manager + _nin: [package_manager!] +} + +""" +response of any mutation on the table "package.package" +""" +type package_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package!]! +} + +""" +input type for inserting object relation for remote table "package.package" +""" +input package_obj_rel_insert_input { + data: package_insert_input! + + """upsert condition""" + on_conflict: package_on_conflict +} + +""" +on_conflict condition type for table "package.package" +""" +input package_on_conflict { + constraint: package_constraint! + update_columns: [package_update_column!]! = [] + where: package_bool_exp +} + +"""Ordering options when selecting data from "package.package".""" +input package_order_by { + custom_registry: order_by + description: order_by + fetched_time: order_by + id: order_by + name: order_by + package_maintainers_aggregate: package_package_maintainer_aggregate_order_by + package_manager: order_by + releases_aggregate: package_release_aggregate_order_by +} + +""" +columns and relationships of "package.package_maintainer" +""" +type package_package_maintainer { + """An object relationship""" + maintainer: package_maintainer + maintainer_id: uuid + + """An object relationship""" + package: package + package_id: uuid +} + +""" +order by aggregate values of table "package.package_maintainer" +""" +input package_package_maintainer_aggregate_order_by { + count: order_by + max: package_package_maintainer_max_order_by + min: package_package_maintainer_min_order_by +} + +""" +input type for inserting array relation for remote table "package.package_maintainer" +""" +input package_package_maintainer_arr_rel_insert_input { + data: [package_package_maintainer_insert_input!]! + + """upsert condition""" + on_conflict: package_package_maintainer_on_conflict +} + +""" +Boolean expression to filter rows from the table "package.package_maintainer". All fields are combined with a logical 'AND'. +""" +input package_package_maintainer_bool_exp { + _and: [package_package_maintainer_bool_exp!] + _not: package_package_maintainer_bool_exp + _or: [package_package_maintainer_bool_exp!] + maintainer: package_maintainer_bool_exp + maintainer_id: uuid_comparison_exp + package: package_bool_exp + package_id: uuid_comparison_exp +} + +""" +unique or primary key constraints on table "package.package_maintainer" +""" +enum package_package_maintainer_constraint { + """unique or primary key constraint""" + package_maintainer_package_id_maintainer_id_idx +} + +""" +input type for inserting data into table "package.package_maintainer" +""" +input package_package_maintainer_insert_input { + maintainer: package_maintainer_obj_rel_insert_input + maintainer_id: uuid + package: package_obj_rel_insert_input + package_id: uuid +} + +""" +order by max() on columns of table "package.package_maintainer" +""" +input package_package_maintainer_max_order_by { + maintainer_id: order_by + package_id: order_by +} + +""" +order by min() on columns of table "package.package_maintainer" +""" +input package_package_maintainer_min_order_by { + maintainer_id: order_by + package_id: order_by +} + +""" +response of any mutation on the table "package.package_maintainer" +""" +type package_package_maintainer_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_package_maintainer!]! +} + +""" +on_conflict condition type for table "package.package_maintainer" +""" +input package_package_maintainer_on_conflict { + constraint: package_package_maintainer_constraint! + update_columns: [package_package_maintainer_update_column!]! = [] + where: package_package_maintainer_bool_exp +} + +""" +Ordering options when selecting data from "package.package_maintainer". +""" +input package_package_maintainer_order_by { + maintainer: package_maintainer_order_by + maintainer_id: order_by + package: package_order_by + package_id: order_by +} + +""" +select columns of table "package.package_maintainer" +""" +enum package_package_maintainer_select_column { + """column name""" + maintainer_id + + """column name""" + package_id +} + +""" +input type for updating data in table "package.package_maintainer" +""" +input package_package_maintainer_set_input { + maintainer_id: uuid + package_id: uuid +} + +""" +update columns of table "package.package_maintainer" +""" +enum package_package_maintainer_update_column { + """column name""" + maintainer_id + + """column name""" + package_id +} + +"""primary key columns input for table: package""" +input package_pk_columns_input { + id: uuid! +} + +""" +columns and relationships of "package.release" +""" +type package_release { + blob_hash: String + fetched_time: timestamptz + id: uuid! + mirrored_blob_url: String + observed_time: timestamptz! + + """An object relationship""" + package: package + package_id: uuid + + """An object relationship""" + publishing_maintainer: package_maintainer + publishing_maintainer_id: uuid + + """An array relationship""" + release_dependencies( + """distinct select on columns""" + distinct_on: [package_release_dependency_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_dependency_order_by!] + + """filter the rows returned""" + where: package_release_dependency_bool_exp + ): [package_release_dependency!]! + + """An array relationship""" + release_dependents( + """distinct select on columns""" + distinct_on: [package_release_dependency_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_dependency_order_by!] + + """filter the rows returned""" + where: package_release_dependency_bool_exp + ): [package_release_dependency!]! + + """An array relationship""" + release_licenses( + """distinct select on columns""" + distinct_on: [package_release_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_license_order_by!] + + """filter the rows returned""" + where: package_release_license_bool_exp + ): [package_release_license!]! + release_time: timestamptz + upstream_blob_url: String + upstream_data( + """JSON select path""" + path: String + ): jsonb + version: String! +} + +""" +order by aggregate values of table "package.release" +""" +input package_release_aggregate_order_by { + count: order_by + max: package_release_max_order_by + min: package_release_min_order_by +} + +"""append existing jsonb value of filtered columns with new jsonb value""" +input package_release_append_input { + upstream_data: jsonb +} + +""" +input type for inserting array relation for remote table "package.release" +""" +input package_release_arr_rel_insert_input { + data: [package_release_insert_input!]! + + """upsert condition""" + on_conflict: package_release_on_conflict +} + +""" +Boolean expression to filter rows from the table "package.release". All fields are combined with a logical 'AND'. +""" +input package_release_bool_exp { + _and: [package_release_bool_exp!] + _not: package_release_bool_exp + _or: [package_release_bool_exp!] + blob_hash: String_comparison_exp + fetched_time: timestamptz_comparison_exp + id: uuid_comparison_exp + mirrored_blob_url: String_comparison_exp + observed_time: timestamptz_comparison_exp + package: package_bool_exp + package_id: uuid_comparison_exp + publishing_maintainer: package_maintainer_bool_exp + publishing_maintainer_id: uuid_comparison_exp + release_dependencies: package_release_dependency_bool_exp + release_dependents: package_release_dependency_bool_exp + release_licenses: package_release_license_bool_exp + release_time: timestamptz_comparison_exp + upstream_blob_url: String_comparison_exp + upstream_data: jsonb_comparison_exp + version: String_comparison_exp +} + +""" +unique or primary key constraints on table "package.release" +""" +enum package_release_constraint { + """unique or primary key constraint""" + release_package_id_version_idx + + """unique or primary key constraint""" + release_pkey +} + +""" +delete the field or element with specified path (for JSON arrays, negative integers count from the end) +""" +input package_release_delete_at_path_input { + upstream_data: [String!] +} + +""" +delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array +""" +input package_release_delete_elem_input { + upstream_data: Int +} + +""" +delete key/value pair or string element. key/value pairs are matched based on their key value +""" +input package_release_delete_key_input { + upstream_data: String +} + +""" +columns and relationships of "package.release_dependency" +""" +type package_release_dependency { + """An object relationship""" + dependency_package: package + dependency_package_id: uuid + + """An object relationship""" + dependency_release: package_release + dependency_release_id: uuid + id: uuid! + package_name: String! + package_version_query: String! + + """An object relationship""" + release: package_release! + release_id: uuid! +} + +""" +order by aggregate values of table "package.release_dependency" +""" +input package_release_dependency_aggregate_order_by { + count: order_by + max: package_release_dependency_max_order_by + min: package_release_dependency_min_order_by +} + +""" +input type for inserting array relation for remote table "package.release_dependency" +""" +input package_release_dependency_arr_rel_insert_input { + data: [package_release_dependency_insert_input!]! + + """upsert condition""" + on_conflict: package_release_dependency_on_conflict +} + +""" +Boolean expression to filter rows from the table "package.release_dependency". All fields are combined with a logical 'AND'. +""" +input package_release_dependency_bool_exp { + _and: [package_release_dependency_bool_exp!] + _not: package_release_dependency_bool_exp + _or: [package_release_dependency_bool_exp!] + dependency_package: package_bool_exp + dependency_package_id: uuid_comparison_exp + dependency_release: package_release_bool_exp + dependency_release_id: uuid_comparison_exp + id: uuid_comparison_exp + package_name: String_comparison_exp + package_version_query: String_comparison_exp + release: package_release_bool_exp + release_id: uuid_comparison_exp +} + +""" +unique or primary key constraints on table "package.release_dependency" +""" +enum package_release_dependency_constraint { + """unique or primary key constraint""" + release_dependency_pkey + + """unique or primary key constraint""" + release_dependency_release_id_package_name_package_version__idx +} + +""" +input type for inserting data into table "package.release_dependency" +""" +input package_release_dependency_insert_input { + dependency_package: package_obj_rel_insert_input + dependency_package_id: uuid + dependency_release: package_release_obj_rel_insert_input + dependency_release_id: uuid + id: uuid + package_name: String + package_version_query: String + release: package_release_obj_rel_insert_input + release_id: uuid +} + +""" +order by max() on columns of table "package.release_dependency" +""" +input package_release_dependency_max_order_by { + dependency_package_id: order_by + dependency_release_id: order_by + id: order_by + package_name: order_by + package_version_query: order_by + release_id: order_by +} + +""" +order by min() on columns of table "package.release_dependency" +""" +input package_release_dependency_min_order_by { + dependency_package_id: order_by + dependency_release_id: order_by + id: order_by + package_name: order_by + package_version_query: order_by + release_id: order_by +} + +""" +response of any mutation on the table "package.release_dependency" +""" +type package_release_dependency_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_release_dependency!]! +} + +""" +on_conflict condition type for table "package.release_dependency" +""" +input package_release_dependency_on_conflict { + constraint: package_release_dependency_constraint! + update_columns: [package_release_dependency_update_column!]! = [] + where: package_release_dependency_bool_exp +} + +""" +Ordering options when selecting data from "package.release_dependency". +""" +input package_release_dependency_order_by { + dependency_package: package_order_by + dependency_package_id: order_by + dependency_release: package_release_order_by + dependency_release_id: order_by + id: order_by + package_name: order_by + package_version_query: order_by + release: package_release_order_by + release_id: order_by +} + +"""primary key columns input for table: package_release_dependency""" +input package_release_dependency_pk_columns_input { + id: uuid! +} + +""" +select columns of table "package.release_dependency" +""" +enum package_release_dependency_select_column { + """column name""" + dependency_package_id + + """column name""" + dependency_release_id + + """column name""" + id + + """column name""" + package_name + + """column name""" + package_version_query + + """column name""" + release_id +} + +""" +input type for updating data in table "package.release_dependency" +""" +input package_release_dependency_set_input { + dependency_package_id: uuid + dependency_release_id: uuid + id: uuid + package_name: String + package_version_query: String + release_id: uuid +} + +""" +update columns of table "package.release_dependency" +""" +enum package_release_dependency_update_column { + """column name""" + dependency_package_id + + """column name""" + dependency_release_id + + """column name""" + id + + """column name""" + package_name + + """column name""" + package_version_query + + """column name""" + release_id +} + +""" +input type for inserting data into table "package.release" +""" +input package_release_insert_input { + blob_hash: String + fetched_time: timestamptz + id: uuid + mirrored_blob_url: String + observed_time: timestamptz + package: package_obj_rel_insert_input + package_id: uuid + publishing_maintainer: package_maintainer_obj_rel_insert_input + publishing_maintainer_id: uuid + release_dependencies: package_release_dependency_arr_rel_insert_input + release_dependents: package_release_dependency_arr_rel_insert_input + release_licenses: package_release_license_arr_rel_insert_input + release_time: timestamptz + upstream_blob_url: String + upstream_data: jsonb + version: String +} + +""" +columns and relationships of "package.release_license" +""" +type package_release_license { + id: uuid! + + """An object relationship""" + license: package_license! + license_id: uuid! + release_id: uuid! + scan_metadata( + """JSON select path""" + path: String + ): jsonb + scan_time: timestamptz! + source: license_source! +} + +""" +order by aggregate values of table "package.release_license" +""" +input package_release_license_aggregate_order_by { + count: order_by + max: package_release_license_max_order_by + min: package_release_license_min_order_by +} + +"""append existing jsonb value of filtered columns with new jsonb value""" +input package_release_license_append_input { + scan_metadata: jsonb +} + +""" +input type for inserting array relation for remote table "package.release_license" +""" +input package_release_license_arr_rel_insert_input { + data: [package_release_license_insert_input!]! + + """upsert condition""" + on_conflict: package_release_license_on_conflict +} + +""" +Boolean expression to filter rows from the table "package.release_license". All fields are combined with a logical 'AND'. +""" +input package_release_license_bool_exp { + _and: [package_release_license_bool_exp!] + _not: package_release_license_bool_exp + _or: [package_release_license_bool_exp!] + id: uuid_comparison_exp + license: package_license_bool_exp + license_id: uuid_comparison_exp + release_id: uuid_comparison_exp + scan_metadata: jsonb_comparison_exp + scan_time: timestamptz_comparison_exp + source: license_source_comparison_exp +} + +""" +unique or primary key constraints on table "package.release_license" +""" +enum package_release_license_constraint { + """unique or primary key constraint""" + release_license_pkey +} + +""" +delete the field or element with specified path (for JSON arrays, negative integers count from the end) +""" +input package_release_license_delete_at_path_input { + scan_metadata: [String!] +} + +""" +delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array +""" +input package_release_license_delete_elem_input { + scan_metadata: Int +} + +""" +delete key/value pair or string element. key/value pairs are matched based on their key value +""" +input package_release_license_delete_key_input { + scan_metadata: String +} + +""" +input type for inserting data into table "package.release_license" +""" +input package_release_license_insert_input { + id: uuid + license: package_license_obj_rel_insert_input + license_id: uuid + release_id: uuid + scan_metadata: jsonb + scan_time: timestamptz + source: license_source +} + +""" +order by max() on columns of table "package.release_license" +""" +input package_release_license_max_order_by { + id: order_by + license_id: order_by + release_id: order_by + scan_time: order_by +} + +""" +order by min() on columns of table "package.release_license" +""" +input package_release_license_min_order_by { + id: order_by + license_id: order_by + release_id: order_by + scan_time: order_by +} + +""" +response of any mutation on the table "package.release_license" +""" +type package_release_license_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_release_license!]! +} + +""" +on_conflict condition type for table "package.release_license" +""" +input package_release_license_on_conflict { + constraint: package_release_license_constraint! + update_columns: [package_release_license_update_column!]! = [] + where: package_release_license_bool_exp +} + +"""Ordering options when selecting data from "package.release_license".""" +input package_release_license_order_by { + id: order_by + license: package_license_order_by + license_id: order_by + release_id: order_by + scan_metadata: order_by + scan_time: order_by + source: order_by +} + +"""primary key columns input for table: package_release_license""" +input package_release_license_pk_columns_input { + id: uuid! +} + +"""prepend existing jsonb value of filtered columns with new jsonb value""" +input package_release_license_prepend_input { + scan_metadata: jsonb +} + +""" +select columns of table "package.release_license" +""" +enum package_release_license_select_column { + """column name""" + id + + """column name""" + license_id + + """column name""" + release_id + + """column name""" + scan_metadata + + """column name""" + scan_time + + """column name""" + source +} + +""" +input type for updating data in table "package.release_license" +""" +input package_release_license_set_input { + id: uuid + license_id: uuid + release_id: uuid + scan_metadata: jsonb + scan_time: timestamptz + source: license_source +} + +""" +update columns of table "package.release_license" +""" +enum package_release_license_update_column { + """column name""" + id + + """column name""" + license_id + + """column name""" + release_id + + """column name""" + scan_metadata + + """column name""" + scan_time + + """column name""" + source +} + +""" +order by max() on columns of table "package.release" +""" +input package_release_max_order_by { + blob_hash: order_by + fetched_time: order_by + id: order_by + mirrored_blob_url: order_by + observed_time: order_by + package_id: order_by + publishing_maintainer_id: order_by + release_time: order_by + upstream_blob_url: order_by + version: order_by +} + +""" +order by min() on columns of table "package.release" +""" +input package_release_min_order_by { + blob_hash: order_by + fetched_time: order_by + id: order_by + mirrored_blob_url: order_by + observed_time: order_by + package_id: order_by + publishing_maintainer_id: order_by + release_time: order_by + upstream_blob_url: order_by + version: order_by +} + +""" +response of any mutation on the table "package.release" +""" +type package_release_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [package_release!]! +} + +""" +input type for inserting object relation for remote table "package.release" +""" +input package_release_obj_rel_insert_input { + data: package_release_insert_input! + + """upsert condition""" + on_conflict: package_release_on_conflict +} + +""" +on_conflict condition type for table "package.release" +""" +input package_release_on_conflict { + constraint: package_release_constraint! + update_columns: [package_release_update_column!]! = [] + where: package_release_bool_exp +} + +"""Ordering options when selecting data from "package.release".""" +input package_release_order_by { + blob_hash: order_by + fetched_time: order_by + id: order_by + mirrored_blob_url: order_by + observed_time: order_by + package: package_order_by + package_id: order_by + publishing_maintainer: package_maintainer_order_by + publishing_maintainer_id: order_by + release_dependencies_aggregate: package_release_dependency_aggregate_order_by + release_dependents_aggregate: package_release_dependency_aggregate_order_by + release_licenses_aggregate: package_release_license_aggregate_order_by + release_time: order_by + upstream_blob_url: order_by + upstream_data: order_by + version: order_by +} + +"""primary key columns input for table: package_release""" +input package_release_pk_columns_input { + id: uuid! +} + +"""prepend existing jsonb value of filtered columns with new jsonb value""" +input package_release_prepend_input { + upstream_data: jsonb +} + +""" +select columns of table "package.release" +""" +enum package_release_select_column { + """column name""" + blob_hash + + """column name""" + fetched_time + + """column name""" + id + + """column name""" + mirrored_blob_url + + """column name""" + observed_time + + """column name""" + package_id + + """column name""" + publishing_maintainer_id + + """column name""" + release_time + + """column name""" + upstream_blob_url + + """column name""" + upstream_data + + """column name""" + version +} + +""" +input type for updating data in table "package.release" +""" +input package_release_set_input { + blob_hash: String + fetched_time: timestamptz + id: uuid + mirrored_blob_url: String + observed_time: timestamptz + package_id: uuid + publishing_maintainer_id: uuid + release_time: timestamptz + upstream_blob_url: String + upstream_data: jsonb + version: String +} + +""" +update columns of table "package.release" +""" +enum package_release_update_column { + """column name""" + blob_hash + + """column name""" + fetched_time + + """column name""" + id + + """column name""" + mirrored_blob_url + + """column name""" + observed_time + + """column name""" + package_id + + """column name""" + publishing_maintainer_id + + """column name""" + release_time + + """column name""" + upstream_blob_url + + """column name""" + upstream_data + + """column name""" + version +} + +""" +select columns of table "package.package" +""" +enum package_select_column { + """column name""" + custom_registry + + """column name""" + description + + """column name""" + fetched_time + + """column name""" + id + + """column name""" + name + + """column name""" + package_manager +} + +""" +input type for updating data in table "package.package" +""" +input package_set_input { + custom_registry: String + description: String + fetched_time: timestamptz + id: uuid + name: String + package_manager: package_manager +} + +""" +update columns of table "package.package" +""" +enum package_update_column { + """column name""" + custom_registry """column name""" - github_node_id + description """column name""" - github_owner_type + fetched_time """column name""" id - """column name""" - installation_id - """column name""" name """column name""" - settings_id -} - -"""aggregate var_pop on columns""" -type organizations_var_pop_fields { - github_id: Float - installation_id: Float -} - -"""aggregate var_samp on columns""" -type organizations_var_samp_fields { - github_id: Float - installation_id: Float -} - -"""aggregate variance on columns""" -type organizations_variance_fields { - github_id: Float - installation_id: Float + package_manager } """ @@ -4609,6 +6495,11 @@ type query_root { where: github_repositories_bool_exp ): [github_repositories!]! + """ + fetch data from the table: "github_repositories" using primary key columns + """ + github_repositories_by_pk(id: uuid!): github_repositories + """ fetch data from the table: "guide_related_guides" """ @@ -4815,6 +6706,170 @@ type query_root { """fetch data from the table: "organizations" using primary key columns""" organizations_by_pk(id: uuid!): organizations + """ + fetch data from the table: "package.package" + """ + package( + """distinct select on columns""" + distinct_on: [package_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_order_by!] + + """filter the rows returned""" + where: package_bool_exp + ): [package!]! + + """fetch data from the table: "package.package" using primary key columns""" + package_by_pk(id: uuid!): package + + """ + fetch data from the table: "package.license" + """ + package_license( + """distinct select on columns""" + distinct_on: [package_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_license_order_by!] + + """filter the rows returned""" + where: package_license_bool_exp + ): [package_license!]! + + """fetch data from the table: "package.license" using primary key columns""" + package_license_by_pk(id: uuid!): package_license + + """ + fetch data from the table: "package.maintainer" + """ + package_maintainer( + """distinct select on columns""" + distinct_on: [package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_maintainer_order_by!] + + """filter the rows returned""" + where: package_maintainer_bool_exp + ): [package_maintainer!]! + + """ + fetch data from the table: "package.maintainer" using primary key columns + """ + package_maintainer_by_pk(id: uuid!): package_maintainer + + """ + fetch data from the table: "package.package_maintainer" + """ + package_package_maintainer( + """distinct select on columns""" + distinct_on: [package_package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_package_maintainer_order_by!] + + """filter the rows returned""" + where: package_package_maintainer_bool_exp + ): [package_package_maintainer!]! + + """ + fetch data from the table: "package.release" + """ + package_release( + """distinct select on columns""" + distinct_on: [package_release_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_order_by!] + + """filter the rows returned""" + where: package_release_bool_exp + ): [package_release!]! + + """fetch data from the table: "package.release" using primary key columns""" + package_release_by_pk(id: uuid!): package_release + + """ + fetch data from the table: "package.release_dependency" + """ + package_release_dependency( + """distinct select on columns""" + distinct_on: [package_release_dependency_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_dependency_order_by!] + + """filter the rows returned""" + where: package_release_dependency_bool_exp + ): [package_release_dependency!]! + + """ + fetch data from the table: "package.release_dependency" using primary key columns + """ + package_release_dependency_by_pk(id: uuid!): package_release_dependency + + """ + fetch data from the table: "package.release_license" + """ + package_release_license( + """distinct select on columns""" + distinct_on: [package_release_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_license_order_by!] + + """filter the rows returned""" + where: package_release_license_bool_exp + ): [package_release_license!]! + + """ + fetch data from the table: "package.release_license" using primary key columns + """ + package_release_license_by_pk(id: uuid!): package_release_license + """An array relationship""" package_versions( """distinct select on columns""" @@ -5657,6 +7712,11 @@ type subscription_root { where: github_repositories_bool_exp ): [github_repositories!]! + """ + fetch data from the table: "github_repositories" using primary key columns + """ + github_repositories_by_pk(id: uuid!): github_repositories + """ fetch data from the table: "guide_related_guides" """ @@ -5863,6 +7923,170 @@ type subscription_root { """fetch data from the table: "organizations" using primary key columns""" organizations_by_pk(id: uuid!): organizations + """ + fetch data from the table: "package.package" + """ + package( + """distinct select on columns""" + distinct_on: [package_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_order_by!] + + """filter the rows returned""" + where: package_bool_exp + ): [package!]! + + """fetch data from the table: "package.package" using primary key columns""" + package_by_pk(id: uuid!): package + + """ + fetch data from the table: "package.license" + """ + package_license( + """distinct select on columns""" + distinct_on: [package_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_license_order_by!] + + """filter the rows returned""" + where: package_license_bool_exp + ): [package_license!]! + + """fetch data from the table: "package.license" using primary key columns""" + package_license_by_pk(id: uuid!): package_license + + """ + fetch data from the table: "package.maintainer" + """ + package_maintainer( + """distinct select on columns""" + distinct_on: [package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_maintainer_order_by!] + + """filter the rows returned""" + where: package_maintainer_bool_exp + ): [package_maintainer!]! + + """ + fetch data from the table: "package.maintainer" using primary key columns + """ + package_maintainer_by_pk(id: uuid!): package_maintainer + + """ + fetch data from the table: "package.package_maintainer" + """ + package_package_maintainer( + """distinct select on columns""" + distinct_on: [package_package_maintainer_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_package_maintainer_order_by!] + + """filter the rows returned""" + where: package_package_maintainer_bool_exp + ): [package_package_maintainer!]! + + """ + fetch data from the table: "package.release" + """ + package_release( + """distinct select on columns""" + distinct_on: [package_release_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_order_by!] + + """filter the rows returned""" + where: package_release_bool_exp + ): [package_release!]! + + """fetch data from the table: "package.release" using primary key columns""" + package_release_by_pk(id: uuid!): package_release + + """ + fetch data from the table: "package.release_dependency" + """ + package_release_dependency( + """distinct select on columns""" + distinct_on: [package_release_dependency_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_dependency_order_by!] + + """filter the rows returned""" + where: package_release_dependency_bool_exp + ): [package_release_dependency!]! + + """ + fetch data from the table: "package.release_dependency" using primary key columns + """ + package_release_dependency_by_pk(id: uuid!): package_release_dependency + + """ + fetch data from the table: "package.release_license" + """ + package_release_license( + """distinct select on columns""" + distinct_on: [package_release_license_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [package_release_license_order_by!] + + """filter the rows returned""" + where: package_release_license_bool_exp + ): [package_release_license!]! + + """ + fetch data from the table: "package.release_license" using primary key columns + """ + package_release_license_by_pk(id: uuid!): package_release_license + """An array relationship""" package_versions( """distinct select on columns"""