add more UTs, delete ununsed files

This commit is contained in:
Anupam
2022-12-30 20:03:11 +00:00
parent faf614822d
commit 23073eb4a2
7 changed files with 484 additions and 260 deletions

View File

@@ -1,5 +1,5 @@
/* eslint-disable i18n-text/no-en */
/* eslint-disable @typescript-eslint/no-unused-vars */
import {Input} from './input'
import {EMPTY, Observable, of, throwError} from 'rxjs'
import {reduce, concatMap, map, expand, tap} from 'rxjs/operators'

View File

@@ -1,24 +0,0 @@
import * as github from '@actions/github'
// Centralize all Octokit references by re-exporting
export {Octokit} from '@octokit/rest'
export interface OctokitOptions {
baseUrl?: string
userAgent?: string
}
export function getOctokit(
authToken: string,
opts: OctokitOptions
): github.GitHub {
const options: OctokitOptions = {
baseUrl: 'https://api.github.com'
}
if (opts.userAgent) {
options.userAgent = opts.userAgent
}
return new github.GitHub(authToken, options)
}

View File

@@ -1,19 +0,0 @@
import {GitHub} from '@actions/github'
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types'
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters'
/**
* Sends a GraphQL query request based on endpoint options
*
* @param {string} token Auth token
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`.
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
export async function graphql(
token: string,
query: string,
parameters: RequestParameters
): Promise<GraphQlQueryResponseData> {
const github = new GitHub(token)
return await github.graphql(query, parameters)
}