lunasec-io / lunasec

LunaSec - Dependency Security Scanner that automatically notifies you about vulnerabilities like Log4Shell or node-ipc in your Pull Requests and Builds. Protect yourself in 30 seconds with the LunaTrace GitHub App: https://github.com/marketplace/lunatrace-by-lunasec/
https://www.lunasec.io/
Other
1.44k stars 164 forks source link

npm package popularity data #1101

Closed breadchris closed 1 year ago

breadchris commented 1 year ago

replicate package popularity data from npm

github-actions[bot] commented 1 year ago

Hasura Semantic Diff

Hasura config files have changed. This comment shows which fields have changed ignoring formatting.

Click to expand! ``` (root level) + one map entry added: table: name: package_download_count schema: npm (root level) + one map entry added: table: name: package_version_download_count schema: npm array_relationships + one list entry added: - name: download_counts using: foreign_key_constraint_on: column: package_id table: name: package_download_count schema: npm array_relationships + one list entry added: - name: download_counts using: foreign_key_constraint_on: column: release_id table: name: package_version_download_count schema: npm (root level) + two list entries added: - "!include npm_package_download_count.yaml" - "!include npm_package_version_download_count.yaml" lunatrace-custom.permissions - three list entries removed: - role: user definition: schema: | type AuthenticatedRepoCloneUrlOutput { url: String } scalar JSON type Mutation { presignManifestUpload(project_id: UUID!): PresignedUrlResponse } type PresignedUrlResponse { bucket: String! headers: JSON! key: String! url: String! } type Query { authenticatedRepoCloneUrl(repoGithubId: Int!): AuthenticatedRepoCloneUrlOutput fakeQueryToHackHasuraBeingABuggyMess: String sbomUrl(buildId: UUID!): String } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } scalar UUID type UploadUrl { headers: JSON! url: String! } - role: service definition: schema: | type AuthenticatedRepoCloneUrlOutput { url: String } scalar JSON type Mutation { presignManifestUpload(project_id: UUID!): PresignedUrlResponse } type PresignedUrlResponse { bucket: String! headers: JSON! key: String! url: String! } type Query { authenticatedRepoCloneUrl(repoGithubId: Int!): AuthenticatedRepoCloneUrlOutput fakeQueryToHackHasuraBeingABuggyMess: String presignSbomUpload(orgId: UUID!, buildId: UUID!): SbomUploadUrlOutput sbomUrl(buildId: UUID!): String } input SbomUploadUrlInput { orgId: UUID! projectId: UUID! } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } scalar UUID type UploadUrl { headers: JSON! url: String! } - role: cli definition: schema: | scalar JSON type Query { presignSbomUpload(orgId: UUID!, buildId: UUID!): SbomUploadUrlOutput } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } scalar UUID type UploadUrl { headers: JSON! url: String! } + three list entries added: - role: user definition: schema: | scalar JSON scalar UUID type AuthenticatedRepoCloneUrlOutput { url: String } type Mutation { presignManifestUpload(project_id: UUID!): PresignedUrlResponse } type PresignedUrlResponse { bucket: String! headers: JSON! key: String! url: String! } type Query { authenticatedRepoCloneUrl(repoGithubId: Int!): AuthenticatedRepoCloneUrlOutput fakeQueryToHackHasuraBeingABuggyMess: String sbomUrl(buildId: UUID!): String } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } type UploadUrl { headers: JSON! url: String! } - role: service definition: schema: | scalar JSON scalar UUID type AuthenticatedRepoCloneUrlOutput { url: String } type Mutation { presignManifestUpload(project_id: UUID!): PresignedUrlResponse } type PresignedUrlResponse { bucket: String! headers: JSON! key: String! url: String! } type Query { authenticatedRepoCloneUrl(repoGithubId: Int!): AuthenticatedRepoCloneUrlOutput fakeQueryToHackHasuraBeingABuggyMess: String presignSbomUpload(orgId: UUID!, buildId: UUID!): SbomUploadUrlOutput sbomUrl(buildId: UUID!): String } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } type UploadUrl { headers: JSON! url: String! } input SbomUploadUrlInput { orgId: UUID! projectId: UUID! } - role: cli definition: schema: | scalar JSON scalar UUID type Query { presignSbomUpload(orgId: UUID!, buildId: UUID!): SbomUploadUrlOutput } type SbomUploadUrlOutput { error: Boolean! uploadUrl: UploadUrl } type UploadUrl { headers: JSON! url: String! } diff --git a/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/down.sql b/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/down.sql new file mode 100644 index 00000000..dba54958 --- /dev/null +++ b/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/down.sql @@ -0,0 +1,2 @@ +DROP TABLE npm.package_download_count; +DROP TABLE npm.package_version_download_count; diff --git a/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/up.sql b/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/up.sql new file mode 100644 index 00000000..32072c2a --- /dev/null +++ b/lunatrace/bsl/hasura/migrations/lunatrace/1675131646659_npm_package_download_counts/up.sql @@ -0,0 +1,20 @@ +CREATE TABLE "npm"."package_download_count" ( + "name" TEXT NOT NULL, + "package_id" uuid NULL, + "day" TIMESTAMPTZ NOT NULL, + "downloads" INT NOT NULL, + UNIQUE ("name", "day"), + FOREIGN KEY ("package_id") REFERENCES "package"."package"("id") +); +COMMENT ON TABLE "npm"."package_download_count" IS E'Package download count for a specific day.'; + +CREATE TABLE "npm"."package_version_download_count" ( + "name" TEXT NOT NULL, + "release_id" uuid NULL, + "version" TEXT NOT NULL, + "downloads" INT NOT NULL, + "day" TIMESTAMPTZ NOT NULL, + UNIQUE ("name", "version", "day"), + FOREIGN KEY ("release_id") REFERENCES "package"."release"("id") +); +COMMENT ON TABLE "npm"."package_version_download_count" IS E'Package version download count data from within a week.'; ```
CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: breadchris
:x: github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.