diff --git a/package-lock.json b/package-lock.json index 6f2283f..3e29391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -426,6 +426,12 @@ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -802,6 +808,18 @@ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2165,11 +2183,26 @@ "picomatch": "^2.0.5" } }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } }, "minimatch": { "version": "3.0.4", @@ -2420,6 +2453,32 @@ } } }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -3328,10 +3387,26 @@ "typedoc": "~0.20.13" }, "dependencies": { + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "typedoc": { - "version": "0.20.30", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.30.tgz", - "integrity": "sha512-A4L6JDShPFwZDt9qp7FBsEpW7C6rA5fRv6ywgBuxGxZnT2wuF5afbWzmrwqHR3Xw38V1H2L4v/VJ0S/llBwV6Q==", + "version": "0.20.32", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.32.tgz", + "integrity": "sha512-GSopd/tiqoKE3fEdvhoaEpR9yrEPsR9tknAjkoeSPL6p1Rq5aVsKxBhhF6cwoDJ7oWjpvnm8vs0rQN0BxEHuWQ==", "dev": true, "requires": { "colors": "^1.4.0", @@ -3343,10 +3418,35 @@ "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.4", - "shiki": "^0.9.2", - "typedoc-default-themes": "^0.12.8" + "shiki": "^0.9.3", + "typedoc-default-themes": "^0.12.9" }, "dependencies": { + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -3365,13 +3465,36 @@ "integrity": "sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==", "dev": true }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, "typedoc-default-themes": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.8.tgz", - "integrity": "sha512-tyjyDTKy/JLnBSwvhoqd99VIjrP33SdOtwcMD32b+OqnrjZWe8HmZECbfBoacqoxjHd58gfeNw6wA7uvqWFa4w==", + "version": "0.12.9", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.9.tgz", + "integrity": "sha512-Jd5fYTiqzinZdoIY382W7tQXTwAzWRdg8KbHfaxmb78m1/3jL9riXtk23oBOKwhi8GFVykCOdPzEJKY87/D0LQ==", "dev": true } } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true } } }, @@ -3553,6 +3676,12 @@ "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", "dev": true }, + "vscode-textmate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/src/queries.ts b/src/queries.ts index ecd150f..1eece16 100644 --- a/src/queries.ts +++ b/src/queries.ts @@ -1,38 +1,16 @@ +export * from "./user" + /** - * @description Github Graphql Query for viewer details + * @description Github Graphql Query for Viewer + * @fields User */ -export const Viewer = ` +export const Viewer = (fields: string) => ` query { - viewer { - id - email - login - url - createdAt - updatedAt - databaseId - location - companyHTML - company - avatarUrl - bio - websiteUrl - isHireable - isDeveloperProgramMember - anyPinnableItems - isSiteAdmin - isViewer - viewerCanFollow - viewerIsFollowing - viewerCanCreateProjects - isEmployee - isBountyHunter - isCampusExpert - pinnedItemsRemaining - projectsUrl - } + viewer { + ${fields} + } } -` +`; /** * @description Github Graphql Query for repository content (files and directories) @@ -892,43 +870,6 @@ export const ViewerFollowers = ` } ` -/** - * @description Github Graphql Query for Github User - * @queryVariable username: String! - */ -export const User = ` - query($username: String!){ - user(login: $username){ - id - email - login - url - createdAt - updatedAt - databaseId - location - companyHTML - company - avatarUrl - bio - websiteUrl - isHireable - isDeveloperProgramMember - anyPinnableItems - isSiteAdmin - isViewer - viewerCanFollow - viewerIsFollowing - viewerCanCreateProjects - isEmployee - isBountyHunter - isCampusExpert - pinnedItemsRemaining - projectsUrl - } - } -` - /** * @description Github Graphql Query for All User Repositories * @queryVariable username: String! first: Int! diff --git a/src/types.ts b/src/types.ts index 4d015be..44dbcf2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2,37 +2,238 @@ * @description Github Graphql API response type for Viewer query */ export declare interface Viewer { - viewer: UserInfo; // eslint-disable-line + viewer: UserInfo; // eslint-disable-line } export declare interface UserInfo { - id: string; - email: string; - login: string; - url: string; - createdAt: string; - updatedAt: string; - databaseId: string; - companyHTML: string; - projectsUrl: string | null; - location: string | null; - company: string | null; + anyPinnableItems: boolean; avatarUrl: string | null; bio: string | null; - websiteUrl: string | null; - isHireable: boolean; - isDeveloperProgramMember: boolean; - anyPinnableItems: boolean; - isSiteAdmin: boolean; - viewerCanFollow: boolean; - viewerIsFollowing: boolean; - viewerCanCreateProjects: boolean; - isEmployee: boolean; + bioHTML: string | null; + commitComments: UserCommitContents; + company: string | null; + companyHTML: string | null; + contributionCollection: any; + createdAt: string; + databaseId: string; + email: string; + followers: Followers; + following: Following; + gist: Commit; + gistComments: Comment[]; + gists: Commit[]; + hasSponsorsListing: boolean; + hovercard: HoverCard; + id: string; isBountyHunter: boolean; isCampusExpert: boolean; + isDeveloperProgramMember: boolean; + isEmployee: boolean; + isSponsoredBy: any; + isSponsoringViewer: any; + isHireable: boolean; isViewer: boolean; - viewerCanChangePinnedItems: boolean; + isssueComments: IssueComment[] + issues: Issue[] + itemShowcase: { + hasPinnedItems: boolean; + items: { + edges: [{ + node: [ + Gist, Repositories + ] + }]; + nodes: [ + Gist, Repositories + ]; + pageInfo: PageInfo; + totalCount: number; + } + } + location: string; + login: string; + name: string; + organization: Organization + organizationVerifiedDomainEmails: (login: string) => { + + }; + organizations: Organization[]; + packages: { + edges: [{ + cursor: string; + node: Package; + }]; + nodes: [Package]; + pageInfo: PageInfo; + totalCount: number; + } + pinnableItems: { + edges: [{ + cursor: string; + node: [ + Gist, Repositories + ] + }] + nodes: [ + Gist, Repositories + ] + pageInfo: PageInfo; + totalCount: number + }; + pinnedItems: { + edges: [{ + cursor: string; + node: [ + Gist, Repositories + ] + }] + nodes: [ + Gist, Repositories + ] + pageInfo: PageInfo; + totalCount: number + }; pinnedItemsRemaining: number; + url: string; + project: Project; + projects: { + edges: [{ + cursor: string; + node: Project; + }] + nodes: Project; + pageInfo: PageInfo; + totalCount: number + } + projectsResourcePath: string; + projectsUrl:string; + publicKeys: { + edges: [{ + cursor: string; + node: { + accessedAt: string + createdAt: string + fingerprint: string + id:string; + isReadOnly: boolean + key: string + updatedAt: string + }; + }] + nodes: [{ + accessedAt: string + createdAt: string + fingerprint: string + id:string; + isReadOnly: boolean + key: string + updatedAt: string + }] + pageInfo: PageInfo; + totalCount: number; + } + pullRequests: { + edges: [{ + cursor: string, + node: PullRequest + }] + nodes: [PullRequest] + pageInfo: PageInfo; + totalCount: number; + } + repositories: { + edges: [{ + cursor: string, + node: Repository + }] + nodes: [Repository] + pageInfo: PageInfo; + totalCount: number; + totalDiskUsage: number + } + repositoriesContributedTo: { + edges: [{ + cursor: string, + node: Repository + }] + nodes: [Repository] + pageInfo: PageInfo; + totalCount: number; + totalDiskUsage: number; + } + repository: Repository; + resourcePath: string; + savedReplies: { + edges: [{ + cursor: string, + node: Reply + }] + nodes: [Reply] + pageInfo: PageInfo; + totalCount: number; + } + sponsorsListing: SponsorsListing; + sponsorshipForViewerAsSponsor: SponsorShip; + sponsorshipsAsMaintainer: { + edges: [{ + cursor: string; + node: SponsorShip; + }] + nodes: [SponsorShip]; + pageInfo: PageInfo; + totalCount: number; + } + sponsorshipsAsSponsor: { + edges: [{ + cursor: string; + node: SponsorShip; + }] + nodes: [SponsorShip]; + pageInfo: PageInfo; + totalCount: number; + } + starredRepositories: { + edges: [{ + cursor: string; + node: Repository; + }] + nodes: [Repository]; + pageInfo: PageInfo; + totalCount: number; + } + status: { + createdAt: string; + emoji: string; + emojiHTML:string; + expiresAt: string; + id: string; + indicatesLimitedAvailability: boolean; + message: string; + organization: Organization; + updatedAt: string; + user: User + } + topRepositories: { + edges: [{ + cursor: string; + node: Repository; + }] + nodes: [Repository]; + pageInfo: PageInfo; + totalCount: number; + } + twitterUsername:string; + updatedAt: string; + watching: { + edges: [{ + cursor: string; + node: Repository; + }] + nodes: [Repository]; + pageInfo: PageInfo; + totalCount: number; + }; + websiteUrl: string; } export declare interface FileEntries { @@ -43,6 +244,7 @@ export declare interface FileEntries { }; } + export declare interface FileEntriesContent { name: string; type: string; @@ -52,6 +254,22 @@ export declare interface FileEntriesContent { }; } +export declare interface File { + encodedName: string; + encoding: string; + extension: string; + isImage: boolean; + isTruncated: boolean; + language: { + color: string + id: string; + name: string; + } + name: string; + size: string; + text: string; +} + export declare interface RepositoryContent { repository: null | { defaultBranchRef: { @@ -243,22 +461,24 @@ export declare interface CodeOfConduct { }; } -export declare interface ViewerFollowers { - viewer: { - followers: { - edges: [{ - node: UserInfo; - cursor: string; - }]; - pageInfo: { - endCursor: string; - hasNextPage: string; - hasPreviousPage: string; - startCursor: string; - } - totalCount: number; - }; - }; +export declare interface Followers { + edges: [{ + node: UserInfo; + cursor: string; + }]; + nodes:[UserInfo]; + pageInfo: PageInfo; + totalCount: number; +} + +export declare interface Following { + edges: [{ + node: UserInfo; + cursor: string; + }]; + nodes:[UserInfo] + pageInfo: PageInfo; + totalCount: number; } export declare interface User { @@ -323,64 +543,379 @@ export declare interface UserCommitContents { viewerCannotUpdateReasons: string[]; } }] | []; - pageInfo: { - endCursor: string | null; - hasNextPage: boolean; - hasPreviousPage: boolean; - startCursor: string | null; - } + pageInfo: PageInfo; totalCount: number; }; }; } -export declare interface UserIssues { - user: { - issues: { +export declare interface Issue { + activeLockReason: string | null; + author: Author; + body: string; + bodyHTML: string; + bodyText: string; + closed: boolean; + closedAt: string; + createdAt: string; + createdViaEmail: boolean; + databaseId: number; + editor: Author | null; + hovercard: [{ + message: string; + octicon: string; + }]; + id: string; + includesCreatedEdit: boolean; + lastEditedAt: string | null; + locked: boolean; + number: number; + publishedAt: string; + resourcePath: string; + state: string; + title: string; + updatedAt: string; + url: string; + viewerCanReact: boolean; + viewerCanSubscribe: boolean; + viewerCanUpdate: boolean; + viewerCannotUpdateReasons: string[]; + viewerDidAuthor: boolean; + viewerSubscription: string; +} + +export declare interface HoverCard { + contexts: { + message: string; + GenericHovercardContext: { + message: string; + octicon: string; + } + OrganizationTeamsHovercardContext: { + message: string; + octicon: string; + relevantTeams: Team[] + } + } +} + +export declare interface Team { + ancestors: Team[] + avatarUrl: string; + childTeams: Team[] + combinedSlug: string; + createdAt: string; + databaseId: string; + description: string; + +} + +export declare interface Discussion { + author: Owner; + authorAssociation: string; + body: string; + bodyHTML: string; + bodyText: string; + bodyVersion: string; + comments: Comment[] + commentsResourcePath: string; + commentsUrl: string; + createdAt: string; + createdViaEmail: boolean; + databaseId: string; + editor: Owner; + id: string; + includesCreatedEdit: boolean; + isPinned: boolean; + isPrivate: boolean; + lastEditedAt: string; + number: number; + publishedAt: string; + reactionGroups: ReactionGroup[]; +} + +export declare interface Owner { + avatarUrl: string; + login: string; + resourcePath: string; + url: string; + enterpriseUserAccount: EnterpriseUserAccount; + organization: Organization + user: User; + bannequin: Mannequin; + bot: Bot; + +} + +export declare interface EnterpriseUserAccount { + avatarUrl: string; + createdAt: string; + enterprise: Enterprise; + id: string; + login: string; + name: string; + organization: Organization; + resourcePath: string; + updatedAt: string; + url: string; +} + +export declare interface Enterprise { + +} + +export declare interface Organization { + +} + +export declare interface Mannequin { + avatarUrl: string; + createdAt: string; + databaseId: string; + email: string; + id: string; + login: string; + resourcePath: string; + updatedAt: string; + url: string; +} + +export declare interface Bot { + avatarUrl: string; + createdAt: string; + databaseId: string; + id: string; + login: string; + resourcePath: string + updatedAt: string; + url: string; +} + +export declare interface ReactionGroup { + content: string; + reactionGroup: ReactionGroup; + createdAt: string; + reactionGroups: ReactionGroup[] + viewerCanReact: boolean; + issue: Issue | null; + pullRequest: PullRequest | null; + teamDiscussion: Discussion | null; + teamDiscussionComment: Discussion | null; + commitComment: CommitComment; + issueComment: IssueComment; + pullRequestReview: PullRequestReview; + pullRequestReviewComment: PullRequestReviewComment; + users: User[] + viewerHasReacted: boolean +} + +export declare interface Reaction { + content: string; + createdAt: string; + databaseId: string + id: string; + reactable: string; +} + +export declare interface PageInfo { + endCursor: string | null; + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor: string | null; +} + +export declare interface PullRequest { + +} + +export declare interface CommitComment { + +} + +export declare interface IssueComment { + +} + +export declare interface PullRequestReview { + +} + +export declare interface PullRequestReviewComment { + +} + +export declare interface Fork { + +} + +export declare interface Gist { + comments: Comment[]; + createdAt: string; + description: string; + files: File[]; + forks: Fork[]; + id: string; + isFork: boolean; + isPublic: boolean; + name: string; + owner: Owner; + pushedAt: string; + resourcePath: string; + stargazerCount: number; + stargazers: Stargazers; + updatedAt: string; + url: string; + viewerHasStarred: boolean; +} + +export declare interface Stargazers { + edges: [{ + cursor: string; + node: User; + }] + nodes: [User]; + starredAt: string; +} +export declare interface Release { + +} +export declare interface Version { + files: File[]; + id: string; + package: Package; + platform: string; + preRelease: boolean; + readme: string; + release: Release; + statistics: { + downloadsTotalCount: number; + } + summary: string; + version: string; +} + +export declare interface Package { + id: string; + latestVersion: Version; + name: string; + packageType: string; + repository: Repository + statistics: { + downloadsTotalCount: number; + }; + version: Version; + versions: { + edges: [{ + node: Version + }] + nodes: [Version] + pageInfo: PageInfo; + totalCount: number; + } +} + +export declare interface Project { + +} + +export declare interface Reply { + body: string; + bodyHTML: string; + databaseId: string; + id: string; + title: string; + user: Owner +} + +export declare interface Goal { + description: string; + kind: string; + percentComplete: number; + targetValue: number; + title: string; +} + +export declare interface Tier{ + adminInfo:{ + sponsorShips: { edges: [{ cursor: string; - node: { - activeLockReason: string | null; - author: Author; - body: string; - bodyHTML: string; - bodyText: string; - closed: boolean; - closedAt: string; - createdAt: string; - createdViaEmail: boolean; - databaseId: number; - editor: Author | null; - hovercard: [{ - message: string; - octicon: string; - }]; - id: string; - includesCreatedEdit: boolean; - lastEditedAt: string | null; - locked: boolean; - number: number; - publishedAt: string; - resourcePath: string; - state: string; - title: string; - updatedAt: string; - url: string; - viewerCanReact: boolean; - viewerCanSubscribe: boolean; - viewerCanUpdate: boolean; - viewerCannotUpdateReasons: string[]; - viewerDidAuthor: boolean; - viewerSubscription: string; - }; + node: SponsorShip; + }] + nodes: [SponsorShip]; + pageInfo: PageInfo; + }; + + } + createdAt:string; + description: string; + descriptionHTML: string; + id: string; + monthlyPriceInCents: number; + monthlyPriceInDollars: number; + name: number; + sponsorsListing: SponsorsListing; + updatedAt: string; +} +export declare interface Sponsor { + organization: Organization; + user: User; +} +export declare interface SponsorShip { + createdAt:string; + id: string; + maintainer: User; + privacyLevel: string; + sponsor: User + sponsorEntity: Sponsor + sponsorable: { + hasSponsorsListing: boolean; + isSponsoredBy: string; + isSponsoringViewer: boolean; + sponsorsListing: SponsorsListing; + sponsorshipForViewerAsSponsor: SponsorShip; + sponsorshipsAsMaintainer: { + edges: [{ + cursor: string; + node: SponsorShip; }]; - pageInfo: { - endCursor: string | null; - hasNextPage: boolean; - hasPreviousPage: boolean; - startCursor: string | null; - } + nodes: [SponsorShip]; + pageInfo: PageInfo; totalCount: number; - }; - }; + } + sponsorshipsAsSponsor: { + edges: [{ + cursor: string; + node: SponsorShip; + }]; + nodes: [SponsorShip]; + pageInfo: PageInfo; + totalCount: number; + } + viewerCanSponsor: boolean; + viewerIsSponsoring: boolean; + organizatio: Organization; + user: User; + } + tier: Tier } + +export declare interface SponsorsListing{ + activeGoal: Goal; + createdAt: string; + fullDescription:string; + fullDescriptionHTML:string; + id: string; + name: string + shortDescription: string; + slug: string; + tiers: { + edges: [{ + cursor: string; + node: Tier; + }]; + nodes: [Tier]; + pageInfo: PageInfo; + totalCount: number; + } +} \ No newline at end of file diff --git a/src/user.ts b/src/user.ts new file mode 100644 index 0000000..d7f7cdc --- /dev/null +++ b/src/user.ts @@ -0,0 +1,1585 @@ +/** + * @description Github Graphql User + * @defaultVariables id name + * @queryVariables anyPinnableItems(type: "REPOSITORY" | "GIST" | "ISSUE" | "PROJECT" | "PULL_REQUEST" | "USER" | "ORGANIZATION" | "TEAM") + * avatarUrl + * bio + * bioHTML + * CommitComments + * company + * companyHTML + * ContributionCollection + * createdAt + * databaseId + * email + * Followers + * Following + * Gist + * GistComments + * Gists + * hasSponsorsListing + * hovercard(primarySubjectId: "") { + * contexts { + * message + * octicon + * onGenericHovercardContext + * onOrganizationTeamsHovercardContext + * onReviewStatusHovercardContext + * onViewerHovercardContext + * } + * interactionAbility { + * expiresAt + * limit + * origin + * } + * isBountyHunter + * isCampusExpert + * isDeveloperProgramMember + * isEmployee + * isGitHubStar + * isHireable + * isSiteAdmin + * isSponsoredBy(accountLogin: "") + * isSponsoringViewer + * isViewer + * IssueComments + * Issues + * ItemShowcase + * location + * login + * Organisation + * organizationVerifiedDomainEmails(login: "") + * Organization + * Packages + * PinnableItems + * PinnedItemsRemaining + * Project + * Projects + * projectsResourcePath + * projectsUrl + * PublicKeys + * PullRequests + * Repositories + * RepositoriesContributedTo + * Repo + * resourcePath + * SavedReplies + * SponsorListing + * SponsorshipForViewerAsSponsor + * SponsorshipsAsMaintainer + * SponsorshipsAsSponsor + * StarredRepositoriesonUser + * status { + * message + * indicatesLimitedAvailability + * id + * expiresAt + * emojiHTML + * emoji + * createdAt + * updatedAt + * User + * Oganisation + * TopRepositories + * twitterUsername + * updatedAt + * url + * viewerCanChangePinnedItems + * viewerCanCreateProjects + * viewerCanFollow + * viewerCanSponsor + * viewerIsFollowing + * viewerIsSponsoring + * Watching + * websiteUrl + * } + *} + */ + +export const User = (fields: string) => ` + id + name + ${fields} +` +/** +* @description Github Graphql onUser +* @defaultVariables teamsUrl message totalTeamCount +* @queryVariables +* __typename +* octicon +* RelevantTeams +* teamsResourcePath +*/ + + +export const onGenericHovercardContext = (fields: string) => ` + ... on GenericHovercardContext { + teamsUrl + message + ${fields} + totalTeamCount + } +` + +/** +* @description Github Graphql onOrganizationTeamsHovercardContext +* @defaultVariables teamsUrl totalTeamCount +* @queryVariables +* __typename +* teamsResourcePath +* RelevantOrganizations +*/ + + +export const onOrganizationTeamsHovercardContext = (fields: string) => ` + ... on OrganizationTeamsHovercardContext { + teamsUrl + ${fields} + totalTeamCount + } +` +/** +* @description Github Graphql onReviewStatusHovercardContext +* @defaultVariables message +* @queryVariables + * reviewDecision + * octicon +*/ + + +export const onReviewStatusHovercardContext = (fields: string) => ` + ... on User { + message + ${fields} + } +` +/** +* @description Github Graphql onViewerHovercardContext +* @defaultVariables message +* @queryVariables +* __typename +* octicon +* viewer +*/ + + +export const onViewerHovercardContext = (fields: string) => ` + ... on ViewerHovercardContext{ + message + ${fields} + } +` +/** +* @description Github Graphql onUser +* @defaultVariables id email +* @queryVariables User +*/ + + +export const onUser = (fields: string) => ` + ... on User { + id + email + ${fields} + } +` + +/** +* @description Github Graphql RelevantTeams +* @defaultVariables totalCount +* @queryVariables +* after string +* before string +* first number +* last number +* @fields Teams +* pageInfo PageInfo +*/ + +export const RelevantTeams = (first: number = 10, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + relevantTeams(${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} first: ${first}, last: ${last}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql Followers +* @defaultVariables totalCount +* @queryVariables +* after string +* before string +* first number +* last number +* @fields User +*/ + +export const Followers = (first: number, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + followers(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql Following +* @defaultVariables totalCount +* @queryVariables +* after string +* before string +* first number +* last number +* @fields User +* pageInfo PageInfo +*/ + +export const Following = (first: number = 10, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + following(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + + +/** +* @description Github Graphql EnterpriseUserAccount +* @defaultVariables id name +* @queryVariables avatarUrl +* createdAt +* enterprise { +* Enterprise +* } +* login +* organizations { +* Organizations +* } +* resourcePath +* updatedAt +* url +* user { +* User +* } +*/ + +export const EnterpriseUserAccount = (fields?: string) => ` + id + name + ${fields} +` + +/** +* @description Github Graphql onEnterpriseUserAccount +* * @queryVariables EnterpriseUserAccount +*/ + +export const onEnterpriseUserAccount = (fields?: string) => ` + ... on EnterpriseUserAccount { + ${fields} + } +` + +/** +* @description Github Graphql OwnerInfo +* @queryVariables Admins +* AffiliatedUsersWithTwoFactorDisabled +* affiliatedUsersWithTwoFactorDisabledExist +* allowPrivateRepositoryForkingSetting +* AllowPrivateRepositoryForkingSettingOrganizations +* defaultRepositoryPermissionSetting +* DefaultRepositoryPermissionSettingOrganizations +* Domains +* EnterpriseServerInstallations +* ipAllowListEnabledSetting +* IpAllowListEntries +* isUpdatingDefaultRepositoryPermission +* isUpdatingTwoFactorRequirement +* membersCanChangeRepositoryVisibilitySetting +* MembersCanChangeRepositoryVisibilitySettingOrganizations +* membersCanCreateInternalRepositoriesSetting +* membersCanCreatePrivateRepositoriesSetting +* membersCanCreatePublicRepositoriesSetting +* membersCanCreateRepositoriesSetting +* MembersCanCreateRepositoriesSettingOrganizations +* membersCanDeleteIssuesSetting +* MembersCanDeleteIssuesSettingOrganizations +* membersCanDeleteRepositoriesSetting +* MembersCanDeleteRepositoriesSettingOrganizations +* membersCanInviteCollaboratorsSetting +* MembersCanInviteCollaboratorsSettingOrganizations +* membersCanMakePurchasesSetting +* membersCanUpdateProtectedBranchesSetting +* MembersCanUpdateProtectedBranchesSettingOrganizations +* membersCanViewDependencyInsightsSetting +* MembersCanViewDependencyInsightsSettingOrganizations +* notificationDeliveryRestrictionEnabledSetting +* organizationProjectsSetting +* OrganizationProjectsSettingOrganizations +* OutsideCollaborators +* PendingAdminInvitations +* PendingCollaboratorInvitations +* PendingCollaborators +* PendingMemberInvitations +* repositoryProjectsSetting +* RepositoryProjectsSettingOrganizations +* SamlIdentityProvider +* SamlIdentityProviderSettingOrganizations +* SupportEntitlements +* teamDiscussionsSetting +* TeamDiscussionsSettingOrganizations +* twoFactorRequiredSetting +* TwoFactorRequiredSettingOrganizations +*/ + +export const OwnerInfo = (fields?: string) => ` + ownerInfo { + ${fields} + } +` + +/** +* @description Github Graphql Admins +* @defaultVariables totalCount query = "" orderBy = CREATED_AT direction = "ASC" role = MEMBER first = 10 +* @queryArguments direction "ASC" | "DESC" +* orderBy "LOGIN" | "CREATED_AT" +* after string +* before string +* first number +* last number +* query: string +* @queryVariables +* @fields User +* pageInfo PageInfo +*/ + +export const Admins = (query?: string, first: number = 10, fields?: string, pageInfo?: string, orderBy: string = "CREATED_AT", direction: string = "ASC", after?: string, before?: string, last?: number) => ` + members(query: ${query}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${direction}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql AffiliatedUsersWithTwoFactorDisabled +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* @queryVariables +* @fields User +* pageInfo PageInfo +*/ + +export const AffiliatedUsersWithTwoFactorDisabled = (first: number = 10, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + affiliatedUsersWithTwoFactorDisabled(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""}, ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql AllowPrivateRepositoryForkingSettingOrganizations +* @defaultVariables totalCount query = "" orderBy = CREATED_AT direction = "ASC" role = MEMBER first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* @queryVariables +* @fields Organization +* pageInfo PageInfo +*/ + +export const AllowPrivateRepositoryForkingSettingOrganizations = (first: number = 10, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + AllowPrivateRepositoryForkingSettingOrganizations(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql DefaultRepositoryPermissionSettingOrganizations +* @defaultVariables totalCount query = "" orderBy = CREATED_AT direction = "ASC" role = MEMBER first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* @queryVariables +* @fields Organization +* pageInfo PageInfo +*/ + +export const DefaultRepositoryPermissionSettingOrganizations = (first: number = 10, fields?: string, pageInfo?: string, after?: string, before?: string, last?: number) => ` + defaultRepositoryPermissionSettingOrganizations(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql EnterpriseServerInstallations +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* connectedOnly boolean +* @queryVariables +* UserAccounts +* UserAccountsUploads +* createdAt +* customerName +* hostName +* id +* isConnected +* updatedAt +*/ + +export const EnterpriseServerInstallations = (first: number = 10, fields?: string, pageInfo?: string, connectedOnly: boolean = false, after?: string, before?: string, last?: number) => ` + enterpriseServerInstallations(first: ${first} ${connectedOnly ? `connectedOnly: ${connectedOnly}`:""} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} + ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount +` + + +/** +* @description Github Graphql UserAccounts +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* @queryVariables +* email +* enterpriseServerInstallation +* organization +* createdAt +* id +* isSiteAdmin +* login +* profileName +* remoteCreatedAt +* remoteUserId +* updatedAt +*/ + +export const UserAccounts = (first: number = 10, fields?: string, pageInfo?: string, connectedOnly: boolean = false, after?: string, before?: string, last?: number) => ` + userAccounts(first: ${first} ${connectedOnly ? `, connectedOnly: `:""} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql Emails +* @defaultVariables totalCount orderBy = "EMAIL" direction = "ASC" first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "EMAIL" +* @queryVariables +* createdAt +* email +* id +* isPrimary +* updatedAt +* UserAccount +*/ + +export const Emails = (first: number = 10, fields?: string, pageInfo?: string, orderBy: string = "EMAIL", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + emails(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql EnterpriseServerInstallation +* @defaultVariables totalCount orderBy = "EMAIL" direction = "ASC" first = 10 +* @queryVariables +* createdAt +* customerName +* hostName +* id +* isConnected +* UserAccounts +*/ + +export const EnterpriseServerInstallation = (fields?: string) => ` + enterpriseServerInstallation { + ${fields} + } +` + +/** +* @description Github Graphql UserAccountsUploads +* @defaultVariables totalCount orderBy = "EMAIL" direction = "ASC" first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "EMAIL" +* @queryVariables +* createdAt +* EnterpriseServerInstallation +* id +* name +* syncState +* updatedAt +*/ + +export const UserAccountsUploads = (first: number = 10, fields?: string, pageInfo?: string, orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + userAccountsUploads(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo ? pageInfo : ""} + totalCount + } +` + +/** +* @description Github Graphql IpAllowListEntries +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "ALLOW_LIST_VALUE" +* @queryVariables +* allowListValue +* createdAt +* id +* isActive +* name +* Owner +* updatedAt +*/ + +export const IpAllowListEntries = (first: number = 10, pageInfo:string,orderBy: string = "CREATED_AT", directions: string = "ASC", fields?: string, after?: string, before?: string, last?: number) => ` + ipAllowListEntries(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MembersCanChangeRepositoryVisibilitySettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanChangeRepositoryVisibilitySettingOrganizations = (first: number = 10, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanChangeRepositoryVisibilitySettingOrganizations(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` +/** +* @description Github Graphql MembersCanCreateRepositoriesSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value "ALL" | "PRIVATE" | "DISABLED" +* @queryVariables +* Organization +*/ + +export const MembersCanCreateRepositoriesSettingOrganizations = (first: number = 10, value: string = "ALL", fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanCreateRepositoriesSettingOrganizations(value:${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MembersCanDeleteIssuesSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanDeleteIssuesSettingOrganizations = (value: boolean = false, first: number = 10, fields?: string, pageInfo?: string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanDeleteIssuesSettingOrganizations(value: ${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + totalCount + ${pageInfo?pageInfo:""} + } +` + +/** +* @description Github Graphql MembersCanDeleteRepositoriesSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanDeleteRepositoriesSettingOrganizations = (value: boolean = false, first: number = 10, fields?: string, pageInfo?: string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanDeleteRepositoriesSettingOrganizations(value: ${value}, ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} , first: ${first} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MembersCanInviteCollaboratorsSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanInviteCollaboratorsSettingOrganizations = (value: boolean = false, first: number = 10, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", direction: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanInviteCollaboratorsSettingOrganizations(value: ${value}, ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} , first: ${first} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${direction}}) { + edges { + cursor + node { + ${fields} + } + } + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MembersCanUpdateProtectedBranchesSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanUpdateProtectedBranchesSettingOrganizations = (value: boolean = false, first: number = 10, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", fields?: string, after?: string, before?: string, last?: number) => ` + membersCanUpdateProtectedBranchesSettingOrganizations(value: ${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MembersCanViewDependencyInsightsSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const MembersCanViewDependencyInsightsSettingOrganizations = (value: boolean = false, first: number = 10, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + membersCanViewDependencyInsightsSettingOrganizations(value: ${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql OrganizationProjectsSettingOrganizations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "CREATED_AT" | "LOGIN" +* value boolean +* @queryVariables +* Organization +*/ + +export const OrganizationProjectsSettingOrganizations = (value: boolean = false, first: number = 10, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + organizationProjectsSettingOrganizations(value: ${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql OutsideCollaborators +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false visibility = "PUBLIC" +* @queryArguments +* after string +* before string +* first number +* last number +* login string +* orderBy "CREATED_AT" | "LOGIN" +* query string +* visibility "PRIVATE" | "PUBLIC" | "INTERNAL" +* @queryVariables +* User +*/ + +export const OutsideCollaborators = (query?: string, fields?: string, pageInfo?: string,orderBy: string = "CREATED_AT", directions: string = "ASC", first: number = 10, visibility: string = "PUBLIC", after?: string, before?: string, last?: number) => ` + outsideCollaborators(query: ${query}, first: ${first} ${visibility ? `, visibility: ${visibility}`:""} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql PendingAdminInvitations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false visibility = "PUBLIC" +* @queryArguments +* after string +* before string +* first number +* last number +* login string +* orderBy "CREATED_AT" | "LOGIN" +* direction "ASC" | "DESC" +* query string +* role "OWNER" | "BILLING_MANAGER" +* @queryVariables +* Invitation +* */ + +export const PendingAdminInvitations = (query?: string, first: number = 10, fields?: string, pageInfo?: string,orderBy: string = "CREATED_AT", directions: string = "ASC", visibility: string = "PUBLIC", after?: string, before?: string, last?: number) => ` + pendingAdminInvitations(query: ${query} ${visibility ?`, ${visibility}`:""}, ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} , first: ${first} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql PendingCollaboratorInvitations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false visibility = "PUBLIC" +* @queryArguments +* after string +* before string +* first number +* last number +* login string +* orderBy "CREATED_AT" | "INVITEE_LOGIN" +* direction "ASC" | "DESC" +* query string +* role "OWNER" | "BILLING_MANAGER" +* @queryVariables +* Invitation +*/ + +export const PendingCollaboratorInvitations = (query?: string, first: number = 10, fields?: string, pageInfo?: "", orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + pendingCollaboratorInvitations(query: ${query}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + + +/** +* @description Github Graphql PendingCollaborators +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false visibility = "PUBLIC" +* @queryArguments +* after string +* before string +* first number +* last number +* login string +* orderBy "CREATED_AT" | "INVITEE_LOGIN" +* direction "ASC" | "DESC" +* query string +* role "OWNER" | "BILLING_MANAGER" +* @queryVariables +* Invitation +*/ + +export const PendingCollaborators = (query?: string, first: number = 10, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", after?: string, before?: string, last?: number) => ` + pendingCollaborators(query: ${query}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""},orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql PendingMemberInvitations +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false visibility = "PUBLIC" +* @queryArguments +* after string +* before string +* first number +* last number +* login string +* orderBy "CREATED_AT" | "INVITEE_LOGIN" +* direction "ASC" | "DESC" +* query string +* role "OWNER" | "BILLING_MANAGER" +* @queryVariables +* Invitation +*/ + +export const PendingMemberInvitations = (query?: string, fields?: string, pageInfo?:string,orderBy: string = "CREATED_AT", directions: string = "ASC", first: number = 10, after?: string, before?: string, last?: number) => ` + pendingMemberInvitations(query: ${query}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${directions}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + totalUniqueUserCount + } +` + +/** +* @description Github Graphql AssignableUsers +* @defaultVariables totalCount orderBy = "CREATED_AT" direction = "ASC" first = 10 value = false affiliations "OWNER" isFork = false isLocked = false privacy = "PUBLIC" +* @queryArguments +* affiliations "OWNER" | "COLLABORATOR" | "ORGANIZATION_MEMBER" +* ownerAffiliations "OWNER" | "COLLABORATOR" | "ORGANIZATION_MEMBER" +* after string +* before string +* first number +* last number +* isFork boolean +* isLocked boolean +* privacy "PUBLIC" | "PRIVATE" +* @queryVariables +* User +*/ + +export const AssignableUsers = (query?: string, first: number = 10, fields?: string, pageInfo?:string, after?: string, before?: string, last?: number) => ` + assignableUsers(query: ${query}, ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} first: ${first}, ${last ? ", last:${last}" : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } + } +` + +/** +* @description Github Graphql onMannequin +* @defaultVariables id email +* @queryVariables avatarUrl +* createdAt +* databaseId +* login +* resourcePath +* updatedAt +* url +*/ + + +export const onMannequin = (fields?: string) => ` + ... on Mannequin { + id + email + ${fields} + } +` +/** +* @description Github Graphql onBot +* @defaultVariables id +* @queryVariables avatarUrl +* createdAt +* databaseId +* login +* resourcePath +* updatedAt +* url +*/ + + +export const onBot = (fields?: string) => ` +... on Bot { + id + email + ${fields} +} +` + +/** +* @description Github Graphql Author +* @defaultVariables id +* @queryVariables +* avatarUrl +* login +* resourcePath +* url +* onEnterpriseUserAccount +* onOrganazation +* onUser +* onMannequin +* onBot +*/ + +export const Author = (fields?: string) => ` + id + ${fields} +` + +/** +* @description Github Graphql Author +* @defaultVariables totalCount first = 10 +* @queryArguments direction "ASC" | "DESC" +* after string +* before string +* first number +* last number +* +* @queryVariables +* Author +*/ + +export const Authors = (first: number = 10, fields?: string, pageInfo?:string,after?: string, before?: string, last?: number) => ` + authors(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql Editor +* @defaultVariables id +* @queryVariables +* avatarUrl +* login +* resourcePath +* url +* onEnterpriseUserAccount +* onOrganazation +* onUser +* onMannequin +* onBot +*/ + +export const Editor = (fields?: string) => ` + id + ${fields} +` + +/** +* @description Github Graphql UserContentEdits +* @defaultVariables totalCount first = 10 +* @queryArguments direction "ASC" | "DESC" +* after string +* before string +* first number +* last number +* +* @queryVariables +* createdAt +* deletedAt +* deletedBy { +* Owner +* } +* diff +* editedAt +* editor { +* Owner +* } +* id +* updatedAt +*/ + +export const UserContentEdits = (first: number = 10, fields?: string, pageInfo?:string,after?: string, before?: string, last?: number) => ` + userContentEdits(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql MentionableUsers +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* query string +* @queryVariables +* User +*/ + +export const MentionableUsers = (query?: string, first: number = 10, fields?: string, pageInfo?:string,after?: string, before?: string, last?: number) => ` + mentionableUsers(query: ${query}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` +/** +* @description Github Graphql RepositoryProjectsSettingOrganizations +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* query string +* @queryVariables +* User +*/ + +export const RepositoryProjectsSettingOrganizations = (value: boolean = false, pageInfo?:string,first: number = 10, fields?: string, after?: string, before?: string, last?: number) => ` + repositoryProjectsSettingOrganizations(value: ${value}, first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql SamlIdentityProvider +* @defaultVariables id +* @queryVariables +* digestMethod +* externalIdentities { +* ExternalIdentities +* } +* idpCertificate +* issuer +* recoveryCodes +* signatureMethod +* ssoUrl +*/ + +export const SamlIdentityProvider = (fields: string) => ` + id + ${fields} +` + +/** +* @description Github Graphql Identity +* @defaultVariables givenName +* @queryVariables +* emails { +* primary +* type +* value +* } +* familyName +* givenName +* groups +* nameId +* username +*/ + + +export const Identity = (fields: string) => ` + givenName + ${fields} +` + + +/** +* @description Github Graphql ExternalIdenty +* @defaultVariables id +* @queryVariables +* digestMethod +* externalIdentities { +* guid +* id +* organizationInvitation { +* Invitation +* } +* scimIdentity { +* Identity +* } +* scimIdentity { +* Identity +* } +* user { +* User +* } +* } +* idpCertificate +* issuer +* recoveryCodes +* signatureMethod +* ssoUrl +*/ + + + +export const ExternalIdenty = (fields: string) => ` + id + ${fields} +` + +/** +* @description Github Graphql ExternalIdentities +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* @queryVariables +* ExternalIdenty +*/ + +export const ExternalIdentities = (first: number = 10, fields?: string, pageInfo?:string,after?: string, before?: string, last?: number) => ` + externalIdentities(first: ${first} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql SamlIdentityProviderSettingOrganizations +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* value "ENFORCED" | "CONFIGURED" | "UNCONFIGURED" +* @queryVariables +* Organization +*/ + +export const SamlIdentityProviderSettingOrganizations = (value: string, first: number = 10, fields?: string, pageInfo?:string,after?: string, before?: string, last?: number) => ` + samlIdentityProviderSettingOrganizations(first: ${first} ${value ? `, value: ${value}`:""} ${after ? `, after: ${after}` : ""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql SupportEntitlements +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "LOGIN" | "CREATED_AT" +* direction "ASC" | "DESC" +* @queryVariables +* onEnterpriseUserAccount +* onUser +*/ + + +export const SupportEntitlements = (first: number = 10, fields?: string, pageInfo?: string,orderBy: string = "DUE_DATE", direction?: "ASC", after?: string, before?: string, last?: number) => ` + supportEntitlements( first: ${first} ${after ? `, ${after} `:""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${direction}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` +/** +* @description Github Graphql TeamDiscussionsSettingOrganizations +* @defaultVariables totalCount first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* orderBy "LOGIN" | "CREATED_AT" +* direction "ASC" | "DESC" +* @queryVariables +* Organization +*/ + + +export const TeamDiscussionsSettingOrganizations = (value: boolean = false, fields?: string, pageInfo?:string,orderBy: string = "DUE_DATE", direction?: "ASC", first: number = 10, after?: string, before?: string, last?: number) => ` + teamDiscussionsSettingOrganizations(value: ${value}, first: ${first} ${after ? `, ${after} `:""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${direction}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +` + +/** +* @description Github Graphql TwoFactorRequiredSettingOrganizations +* @defaultVariables totalCount value = false first = 10 +* @queryArguments +* after string +* before string +* first number +* last number +* value boolean +* orderBy "LOGIN" | "CREATED_AT" +* direction "ASC" | "DESC" +* @queryVariables +* Organization +*/ + + +export const TwoFactorRequiredSettingOrganizations = (value: boolean = false, first: number = 10, pageInfo?:string,after?: string, fields?: string, orderBy: string = "DUE_DATE", direction?: "ASC", before?: string, last?: number) => ` + twoFactorRequiredSettingOrganizations(value: ${value}, first: ${first} ${after ? `, ${after} `:""} ${before ? `, before: ${before}` : ""} ${last ? `, last: ${last}` : ""}, orderBy: {field: ${orderBy}, direction: ${direction}}) { + edges { + cursor + node { + ${fields} + } + } + + nodes { + ${fields} + } + ${pageInfo?pageInfo:""} + totalCount + } +`