Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[factory]: Add new contributors-and-stargazer group #2268

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions group-generators/generators/contributors-and-stargazer/index.ts
Original file line number Diff line number Diff line change
@@ -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<GroupWithData[]> => {

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;
2 changes: 2 additions & 0 deletions group-generators/generators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down