-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[factory]: Adding new contributors-and-stargazer group (#2268)
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
group-generators/generators/contributors-and-stargazer/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters