From 063a3f417284e4bad8bb5dad43ab498a0499ea76 Mon Sep 17 00:00:00 2001 From: Sismobot <94460392+sismobot@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:17:28 +0100 Subject: [PATCH] [factory]: Adding new contributors-and-stargazer group (#2268) --- .../contributors-and-stargazer/index.ts | 48 +++++++++++++++++++ group-generators/generators/index.ts | 2 + 2 files changed, 50 insertions(+) create mode 100644 group-generators/generators/contributors-and-stargazer/index.ts diff --git a/group-generators/generators/contributors-and-stargazer/index.ts b/group-generators/generators/contributors-and-stargazer/index.ts new file mode 100644 index 000000000..b432a9f40 --- /dev/null +++ b/group-generators/generators/contributors-and-stargazer/index.ts @@ -0,0 +1,48 @@ + +import { dataOperators } from "@group-generators/helpers/data-operators"; +import { dataProviders } from "@group-generators/helpers/data-providers"; +import { Tags, ValueType, GroupWithData } from "topics/group"; +import { + GenerationContext, + GenerationFrequency, + GroupGenerator, +} from "topics/group-generator"; + +// Generated from factory.sismo.io + +const generator: GroupGenerator = { + + generationFrequency: GenerationFrequency.Weekly, + + generate: async (context: GenerationContext): Promise => { + + const githubProvider = new dataProviders.GithubProvider(); + + const githubProviderData0 = await githubProvider.getRepositoriesContributors({ + repositories: [ "anoma/namada" ] + }); + + const githubProviderData1 = await githubProvider.getRepositoriesStargazers({ + repositories: [ "anoma/namada" ] + }); + + const dataUnion = dataOperators.Union([ + githubProviderData0, + githubProviderData1 + ]); + + return [ + { + name: "contributors-and-stargazer", + timestamp: context.timestamp, + description: "all Contributors and Stargazer ", + specs: "all Contributors and Stargazer ", + data: dataUnion, + valueType: ValueType.Score, + tags: [Tags.Factory], + }, + ]; + }, +}; + +export default generator; diff --git a/group-generators/generators/index.ts b/group-generators/generators/index.ts index c9ee0bba7..498763103 100644 --- a/group-generators/generators/index.ts +++ b/group-generators/generators/index.ts @@ -120,6 +120,7 @@ import community from "./community"; import communitylad from "./communitylad"; import consensysDemoLock from "./consensys-demo-lock"; import contributors from "./contributors"; +import contributorsAndStargazer from "./contributors-and-stargazer"; import contributorsOfDataverseCda from "./contributors-of-dataverse-cda"; import cookingRoom from "./cooking-room"; import correctedVersion from "./corrected-version"; @@ -1051,6 +1052,7 @@ export const groupGenerators: GroupGeneratorsLibrary = { "communitylad": communitylad, "consensys-demo-lock": consensysDemoLock, "contributors": contributors, + "contributors-and-stargazer": contributorsAndStargazer, "contributors-of-dataverse-cda": contributorsOfDataverseCda, "cooking-room": cookingRoom, "corrected-version": correctedVersion,