Skip to content

Commit

Permalink
[release] v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vn7n24fzkq committed Mar 3, 2021
1 parent c08619b commit 1d8b89a
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194685,11 +194685,11 @@ const productiveTimeCard = __nccwpck_require__(23810);
const { writeSVG } = __nccwpck_require__(1161);

const createProductiveTimeCard = async function (username) {
let userEmail = (await getProfileDetails(username))["email"];
let userId = (await getProfileDetails(username))["id"];
let until = new Date(); // get data until now
let productiveTime = await getProductiveTime(
username,
userEmail,
userId,
until.toISOString()
);
//process productiveTime
Expand Down Expand Up @@ -195048,7 +195048,7 @@ const fetcher = (token, variables, year) => {
},
{
query: `
query userInfo($login: String!) {
query CommitLanguages($login: String!) {
user(login: $login) {
contributionsCollection(from: "${year}-01-01T00:00:00Z", to: "${year}-12-31T23:59:59Z") {
commitContributionsByRepository(maxRepositories: 100) {
Expand Down Expand Up @@ -195132,7 +195132,7 @@ const fetcher = (token, variables, year) => {
},
{
query: `
query userInfo($login: String!) {
query ContributionsByYear($login: String!) {
user(login: $login) {
contributionsCollection(from: "${year}-01-01T00:00:00Z", to: "${year}-12-31T23:59:59Z") {
totalPullRequestReviewContributions
Expand Down Expand Up @@ -195208,15 +195208,15 @@ const fetcher = (token, variables) => {
},
{
query: `
query userInfo($login: String!,$authorEmail: String!,$until: GitTimestamp!) {
query ProductiveTime($login: String!,$userId: ID!,$until: GitTimestamp!) {
user(login: $login) {
contributionsCollection{
commitContributionsByRepository(maxRepositories:100) {
repository {
defaultBranchRef {
target {
... on Commit {
history(first: 100,until: $until,author:{emails:[$authorEmail]}) {
history(first: 100,until: $until,author:{id:$userId}) {
edges {
node {
message
Expand All @@ -195243,11 +195243,11 @@ const fetcher = (token, variables) => {
};

//get productive time
async function getProductiveTime(username, authorEmail, until) {
async function getProductiveTime(username, userId, until) {
let array = new Array();
let res = await fetcher(githubToken, {
login: username,
authorEmail: authorEmail,
userId: userId,
until: until,
});

Expand Down Expand Up @@ -195292,8 +195292,9 @@ const fetcher = (token, variables) => {
},
{
query: `
query userInfo($login: String!) {
query UserDetails($login: String!) {
user(login: $login) {
id
name
email
createdAt
Expand Down Expand Up @@ -195331,6 +195332,7 @@ const fetcher = (token, variables) => {

async function getProfileDetails(username) {
let result = {
id: 0,
name: "",
email: "",
joinedAt: "",
Expand All @@ -195354,6 +195356,7 @@ async function getProfileDetails(username) {

let user = res.data.data.user;

result.id = user.id;
result.name = user.name;
result.email = user.email;
result.joinedAt = user.createdAt;
Expand Down Expand Up @@ -195399,7 +195402,7 @@ const fetcher = (token, variables) => {
},
{
query: `
query userInfo($login: String!,$endCursor: String) {
query ReposPerLanguage($login: String!,$endCursor: String) {
user(login: $login) {
repositories(isFork: false, first: 100, after: $endCursor,ownerAffiliations: OWNER) {
nodes {
Expand Down

0 comments on commit 1d8b89a

Please sign in to comment.