Repository: zenghongtu/GitHub-Pro Branch: main Commit: b64fd9d639a9 Files: 182 Total size: 2.6 MB Directory structure: gitextract_wre2chye/ ├── .editorconfig ├── .gitignore ├── .prettierignore ├── .prettierrc ├── README.md ├── babel.config.js ├── config/ │ ├── dev.js │ ├── index.js │ └── prod.js ├── openapi-codegen.config.ts ├── package.json ├── project.config.json ├── project.private.config.json ├── project.tt.json ├── src/ │ ├── app.config.ts │ ├── app.scss │ ├── app.tsx │ ├── assets/ │ │ └── iconfont/ │ │ └── icon.css │ ├── components/ │ │ ├── activity-item/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── author/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── avatar/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── empty/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── fab-button/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── font-icon/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── list-item/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── load-more/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── markdown/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── no-authority/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── repo-item/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── skeleton-card/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── user-info/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ └── user-item/ │ │ ├── index.module.scss │ │ └── index.tsx │ ├── constants.ts │ ├── github/ │ │ ├── githubComponents.ts │ │ ├── githubContext.ts │ │ ├── githubFetcher.ts │ │ ├── githubParameters.ts │ │ ├── githubResponses.ts │ │ └── githubSchemas.ts │ ├── hooks/ │ │ ├── useInfiniteGithubRequest.ts │ │ ├── usePageScrollBackToTop.tsx │ │ ├── usePullDownRefreshEvent.ts │ │ ├── useReachBottomEvent.ts │ │ ├── useRequest.ts │ │ ├── useRequestWIthMore.ts │ │ └── useTrending.ts │ ├── index.html │ ├── pages/ │ │ ├── activity/ │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ └── repo.tsx │ │ ├── bookmarks/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── commits/ │ │ │ ├── commit-item/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── developer/ │ │ │ ├── followers/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── following/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ ├── repos/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ └── starred/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── issues/ │ │ │ ├── comment-item/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── create-comment/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── create-issue/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ ├── issue-detail/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── issue-item/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ └── shared_data.ts │ │ ├── login/ │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── my-languages/ │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ └── languages.ts │ │ ├── news/ │ │ │ ├── content/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── index.config.ts │ │ │ └── index.tsx │ │ ├── notifications/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── profile/ │ │ │ ├── content.tsx │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ └── issues.tsx │ │ ├── repos/ │ │ │ ├── content/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── contributors/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── files/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── forks/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ ├── list-render/ │ │ │ │ └── index.tsx │ │ │ ├── readme/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ ├── stars/ │ │ │ │ ├── index.module.scss │ │ │ │ └── index.tsx │ │ │ └── watchs/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── search/ │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ ├── index.tsx │ │ │ ├── issues.tsx │ │ │ ├── repos.tsx │ │ │ └── users.tsx │ │ ├── starred/ │ │ │ ├── content.tsx │ │ │ ├── index.config.ts │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ └── trending/ │ │ ├── index.config.ts │ │ ├── index.module.scss │ │ ├── index.tsx │ │ ├── language/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ ├── repo-item/ │ │ │ ├── index.module.scss │ │ │ └── index.tsx │ │ └── user-item/ │ │ ├── index.module.scss │ │ └── index.tsx │ ├── services/ │ │ ├── commits.ts │ │ ├── github.ts │ │ ├── issues.ts │ │ ├── repos.ts │ │ ├── search.ts │ │ ├── trending.ts │ │ ├── user.ts │ │ └── users.ts │ ├── store/ │ │ ├── constatnts.ts │ │ ├── index.ts │ │ ├── reducers/ │ │ │ ├── issue.ts │ │ │ ├── lang.ts │ │ │ └── user.ts │ │ └── reducers.ts │ ├── style/ │ │ └── variables.scss │ ├── utils/ │ │ ├── base64.js │ │ ├── common.ts │ │ ├── date.ts │ │ ├── event_bus.ts │ │ ├── repo.ts │ │ ├── request.ts │ │ └── size.ts │ └── wemark/ │ ├── parser.js │ ├── prism.js │ ├── prism.wxss │ ├── remarkable.js │ ├── richtext.js │ ├── wemark.js │ ├── wemark.json │ ├── wemark.wxml │ └── wemark.wxss ├── tsconfig.json └── types/ ├── global.d.ts └── trending.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ # 🎨 http://editorconfig.org root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false ================================================ FILE: .gitignore ================================================ dist/ deploy_versions/ .temp/ .rn_temp/ node_modules/ .DS_Store .swc ================================================ FILE: .prettierignore ================================================ node_modules dist tests *.d.ts *.js *.md *.yaml .vscode ================================================ FILE: .prettierrc ================================================ { "printWidth": 80, "singleQuote": true, "trailingComma": "all", "proseWrap": "never", "overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }], "plugins": [ "./node_modules/prettier-plugin-packagejson", "./node_modules/prettier-plugin-organize-imports" ] } ================================================ FILE: README.md ================================================ # GitHub Pro
> 一个简洁、强大的 GitHub 小程序客户端 基于 Taro3 / Taro-ui / React-query / React18 / **TypeScript**。 ## 想法 探究 Taro 使用 TypeScript 的坑,以及 Taro Hooks 的能力(所有页面、组件均用 Hooks) -- 结论: 真香~😋 ## 扫码体验 ![](docs/qrcode.jpg) (或者微信搜索小程序:GitHub Pro) ## Preview ![](docs/github-pro.gif) ## Screenshots | | | | | :---: | :---: | :---: | |![](docs/Jietu20230218-171612.png)|![](docs/Jietu20230218-171628.png)|![](docs/Jietu20230218-171643.png)| |![](docs/Jietu20230218-171702.png)|![](docs/Jietu20230218-171941.png)|![](docs/Jietu20230218-171643.png)| ## 协议 Copyright © 2023 zenghongtu ================================================ FILE: babel.config.js ================================================ // babel-preset-taro 更多选项和默认值: // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md module.exports = { presets: [ ['taro', { framework: 'react', ts: true }] ], plugins: [ [ 'import', { libraryName: 'taro-ui', customName: name => { if(name === 'at-list-item'){ name = 'at-list/item' } else if(name === 'at-action-sheet-item'){ name = 'at-action-sheet/body/item' } return `taro-ui/lib/components/${name.slice(3)}` }, customStyleName: name => { /** * 修复style */ if(name === 'at-tabs-pane'){ name = 'at-tabs' } else if(name === 'at-list-item'){ name = 'at-list' } else if(name === 'at-action-sheet-item'){ name = 'at-action-sheet' } return `taro-ui/dist/style/components/${name.slice(3)}.scss` } }, 'taro-ui' ] ] } ================================================ FILE: config/dev.js ================================================ module.exports = { env: { NODE_ENV: '"development"' }, defineConstants: { }, mini: {}, h5: {} } ================================================ FILE: config/index.js ================================================ const path = require('path'); const config = { projectName: 'GitHub-Pro', date: '2023-2-7', designWidth: 750, deviceRatio: { 640: 2.34 / 2, 750: 1, 828: 1.81 / 2 }, sourceRoot: 'src', outputRoot: 'dist', plugins: ['@tarojs/plugin-html'], defineConstants: {}, alias: { '@': path.resolve(__dirname, '..', 'src'), }, copy: { patterns: [ { from: 'src/wemark', to: 'dist/wemark' } ], options: { } }, framework: 'react', compiler: 'webpack5', cache: { enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache }, sass: { resource: [path.resolve(__dirname, "..", "src/style/variables.scss")], // data: `@import "taro-ui/dist/style/variables/default.scss";`, }, weapp: { compile: { exclude: [ 'src/wemark/remarkable.js', ] } }, mini: { miniCssExtractPluginOption: { ignoreOrder: true, }, postcss: { pxtransform: { enable: true, config: { }, }, url: { enable: true, config: { limit: 1024, // 设定转换尺寸上限 }, }, cssModules: { enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[hash:base64:6]', }, }, }, }, h5: { publicPath: '/', staticDirectory: 'static', // esnextModules: ['nutui-react'], postcss: { pxtransform: { enable: true, config: { }, }, autoprefixer: { enable: true, config: {}, }, cssModules: { enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]', }, }, }, }, }; module.exports = function (merge) { if (process.env.NODE_ENV === 'development') { return merge({}, config, require('./dev')); } return merge({}, config, require('./prod')); }; ================================================ FILE: config/prod.js ================================================ module.exports = { env: { NODE_ENV: '"production"' }, defineConstants: { }, mini: {}, h5: { /** * WebpackChain 插件配置 * @docs https://github.com/neutrinojs/webpack-chain */ // webpackChain (chain) { // /** // * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。 // * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer // */ // chain.plugin('analyzer') // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) // /** // * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。 // * @docs https://github.com/chrisvfritz/prerender-spa-plugin // */ // const path = require('path') // const Prerender = require('prerender-spa-plugin') // const staticDir = path.join(__dirname, '..', 'dist') // chain // .plugin('prerender') // .use(new Prerender({ // staticDir, // routes: [ '/pages/index/index' ], // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') }) // })) // } } } ================================================ FILE: openapi-codegen.config.ts ================================================ import { defineConfig } from '@openapi-codegen/cli'; import { generateReactQueryComponents, generateSchemaTypes, } from '@openapi-codegen/typescript'; export default defineConfig({ github: { from: { source: 'url', url: 'https://api.apis.guru/v2/specs/github.com/1.1.4/openapi.yaml', }, outputDir: './src/github', to: async (context) => { const filenamePrefix = 'github'; const { schemasFiles } = await generateSchemaTypes(context, { filenamePrefix, }); await generateReactQueryComponents(context, { filenamePrefix, schemasFiles, }); }, }, }); ================================================ FILE: package.json ================================================ { "name": "GitHub-Pro", "version": "1.0.0", "private": true, "description": "", "license": "MIT", "author": "jasonzeng ", "scripts": { "build:alipay": "taro build --type alipay", "build:h5": "taro build --type h5", "build:jd": "taro build --type jd", "build:qq": "taro build --type qq", "build:quickapp": "taro build --type quickapp", "build:rn": "taro build --type rn", "build:swan": "taro build --type swan", "build:tt": "taro build --type tt", "build:weapp": "taro build --type weapp", "dev:alipay": "npm run build:alipay -- --watch", "dev:h5": "npm run build:h5 -- --watch", "dev:jd": "npm run build:jd -- --watch", "dev:qq": "npm run build:qq -- --watch", "dev:quickapp": "npm run build:quickapp -- --watch", "dev:rn": "npm run build:rn -- --watch", "dev:swan": "npm run build:swan -- --watch", "dev:tt": "npm run build:tt -- --watch", "dev:weapp": "npm run build:weapp -- --watch", "format": "prettier --write \"src/**/*.{ts,tsx}\"", "gen:github": "openapi-codegen gen github" }, "browserslist": [ "last 3 versions", "Android >= 4.1", "ios >= 8" ], "dependencies": { "@babel/runtime": "^7.7.7", "@tanstack/react-query": "^4.24.4", "@tarojs/components": "3.6.0", "@tarojs/helper": "3.6.0", "@tarojs/plugin-framework-react": "3.6.0", "@tarojs/plugin-html": "3.6.0", "@tarojs/plugin-platform-alipay": "3.6.0", "@tarojs/plugin-platform-jd": "3.6.0", "@tarojs/plugin-platform-qq": "3.6.0", "@tarojs/plugin-platform-swan": "3.6.0", "@tarojs/plugin-platform-tt": "3.6.0", "@tarojs/plugin-platform-weapp": "3.6.0", "@tarojs/react": "3.6.0", "@tarojs/router": "3.6.0", "@tarojs/runtime": "3.6.0", "@tarojs/shared": "3.6.0", "@tarojs/taro": "3.6.0", "@tarojs/taro-h5": "3.6.0", "classnames": "^2.3.2", "lodash": "4.17.15", "react": "^18.0.0", "react-dom": "^18.0.0", "react-redux": "^8.0.5", "react-refresh": "^0.11.0", "redux": "^4.2.1", "redux-logger": "^3.0.6", "redux-thunk": "^2.4.2", "taro-ui": "3.1.0-beta.4", "zustand": "^4.3.3" }, "devDependencies": { "@babel/core": "^7.8.0", "@openapi-codegen/cli": "^2.0.0", "@openapi-codegen/typescript": "^6.1.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@tarojs/cli": "3.6.0", "@tarojs/webpack5-runner": "3.6.0", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", "@types/react-router-dom": "^5.1.7", "@types/react-syntax-highlighter": "^13.5.2", "@types/react-test-renderer": "^18.0.0", "@types/react-transition-group": "^4.4.4", "@types/webpack-env": "^1.13.6", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", "babel-plugin-import": "^1.13.3", "babel-preset-taro": "3.6.0", "eslint": "^8.12.0", "eslint-config-taro": "3.6.0", "eslint-plugin-import": "^2.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^4.2.0", "prettier": "^2.3.2", "prettier-plugin-organize-imports": "^3.2.0", "prettier-plugin-packagejson": "^2.3.0", "style-loader": "1.3.0", "stylelint": "^14.4.0", "typescript": "^4.1.0", "webpack": "5.69.0" } } ================================================ FILE: project.config.json ================================================ { "miniprogramRoot": "dist/", "projectname": "GitHub-Pro", "description": "", "appid": "wx96c15ae0f6f25368", "setting": { "urlCheck": true, "es6": false, "enhance": false, "compileHotReLoad": false, "postcss": false, "minified": false, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" } }, "compileType": "miniprogram", "libVersion": "2.30.0", "srcMiniprogramRoot": "dist/", "packOptions": { "ignore": [], "include": [] }, "condition": {}, "editorSetting": { "tabIndent": "insertSpaces", "tabSize": 2 } } ================================================ FILE: project.private.config.json ================================================ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "projectname": "GitHub-Pro", "setting": { "compileHotReLoad": true } } ================================================ FILE: project.tt.json ================================================ { "miniprogramRoot": "./", "projectname": "GitHub-Pro", "description": "", "appid": "touristappid", "setting": { "urlCheck": true, "es6": false, "postcss": false, "minified": false }, "compileType": "miniprogram" } ================================================ FILE: src/app.config.ts ================================================ export default defineAppConfig({ pages: [ 'pages/trending/index', 'pages/news/index', 'pages/activity/repo', 'pages/activity/index', 'pages/developer/index', 'pages/profile/index', 'pages/profile/issues', 'pages/search/index', 'pages/login/index', 'pages/repos/index', 'pages/my-languages/index', 'pages/repos/contributors/index', 'pages/repos/forks/index', 'pages/repos/stars/index', 'pages/repos/watchs/index', 'pages/commits/index', 'pages/repos/content/index', 'pages/issues/index', 'pages/issues/create-comment/index', 'pages/issues/create-issue/index', 'pages/issues/issue-detail/index', 'pages/developer/followers/index', 'pages/developer/following/index', 'pages/developer/repos/index', 'pages/developer/starred/index', 'pages/repos/files/index', 'pages/starred/index', ], window: { navigationStyle: 'default', backgroundColor: '#f3f3f3', backgroundTextStyle: 'dark', navigationBarTitleText: 'GitHub Pro', navigationBarBackgroundColor: '#fafafa', navigationBarTextStyle: 'black', backgroundColorTop: '#fafafa', backgroundColorBottom: '#fafafa', enablePullDownRefresh: true, }, tabBar: { backgroundColor: '#fafafa', position: 'bottom', borderStyle: 'white', color: '#8499a5', selectedColor: '#007afb', list: [ { pagePath: 'pages/trending/index', iconPath: './assets/icons/trending.png', selectedIconPath: './assets/icons/trending_active.png', text: 'Trending', }, { pagePath: 'pages/news/index', iconPath: './assets/icons/news.png', selectedIconPath: './assets/icons/news_active.png', text: 'News', }, { pagePath: 'pages/search/index', iconPath: './assets/icons/search.png', selectedIconPath: './assets/icons/search_active.png', text: 'Search', }, { pagePath: 'pages/starred/index', iconPath: './assets/icons/star.png', selectedIconPath: './assets/icons/star_active.png', text: 'Starred', }, { pagePath: 'pages/profile/index', iconPath: './assets/icons/github.png', selectedIconPath: './assets/icons/github_active.png', text: 'Profile', }, ], }, usingComponents: { wemark: './wemark/wemark', }, }); ================================================ FILE: src/app.scss ================================================ page { background: $bg; } ================================================ FILE: src/app.tsx ================================================ import '@/assets/iconfont/icon.css'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import Taro from '@tarojs/taro'; import { Component } from 'react'; import { Provider } from 'react-redux'; import './app.scss'; import configStore from './store'; const store = configStore(); const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, retryDelay: (attempt) => attempt * 2000, // staleTime: 10, }, }, }); class App extends Component { componentWillMount() { // TODO by path // const { path, query, scene } = this.$router.params } componentDidMount() { this.updateApp(); // Taro.getClipboardData({ // success(res) { // const data = res.data as string; // if (data && data.startsWith(githubHttpsUrl)) { // const [owner, repo, filePath] = parseGitHub(data); // const url = getNavPath({ owner, filePath, repo }); // if (url) { // Taro.navigateTo({ url }); // } // } // }, // }); // no use // if (process.env.TARO_ENV === 'weapp') { // const env = process.env.ClOUD_ENV // Taro.cloud.init({ env, traceUser: true }) // } } componentDidShow() {} componentDidHide() {} componentDidCatchError() {} updateApp() { if (Taro.canIUse('getUpdateManager')) { const updateManager = Taro.getUpdateManager(); updateManager.onCheckForUpdate(function (res) { // 请求完新版本信息的回调 console.log('hasUpdate: ', res.hasUpdate); }); updateManager.onUpdateReady(function () { Taro.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', success: function (res) { if (res.confirm) { // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate(); } }, }); }); updateManager.onUpdateFailed(function () { // 新的版本下载失败 Taro.showModal({ title: '已经有新版本了哟~', content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', }); }); } } // 在 App 类中的 render() 函数没有实际作用 // 请勿修改此函数 render() { return ( {this.props.children} ); } } export default App; ================================================ FILE: src/assets/iconfont/icon.css ================================================ @font-face { font-family: 'iconfont'; src: url('iconfont.eot?t=1568428655639'); /* IE9 */ src: url('iconfont.eot?t=1568428655639#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABVIAAsAAAAAJowAABT3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCIaAq2XKsZATYCJAOBGAtOAAQgBYRtB4MbG7IfM6PmdBVAFGVJU2T/lwNOZAh1gdX7CUOpEjUxxouv3XevvVhW22qVJzGwxeOEAWaYfk6OlOETx8qpCkQQSr7hv+3wtR3K+XkoJTz8z/neB03T9BOgGyEqwm4OgY5nkC8ZuX01SAIEyAy1mc1EdpsZWAVirUdqJgNU1POBL3wJll1P/M4rKsjw/Db/z6UFxesVMQqwMQrszSuC4PQ9i3uNTRvQWXF97v8Hq3atS145uSxbVi9dqYsoloEvU+1Tr9VhYVica9ut98tedxk/sBIs8UGk9ACAwP8+nzPPDgU7WYKAolroMxjYxO7vEXRqLNZov5MEIDib/znTJjdGiRmhcPf6/Dn5f/mHCpjmiItpjwYEaixPbhPq//bo3yjNiNIRC31TZkbMqFk3IfVAWlstCyGdIDw/w8BmiUZDiOqyYRPUNwGoerLHfNhv/u/gsjEKFZHLMJq9v737QwAOOaqITl16DcJGc+UFusyaPnU8diCATpkhsGWLcUuN2FQAW67eMNhIf734wQ0BSUBxHbLflM6TaGdivKHK8AijmskuTwHWtwIFVAENch+zQexIOaiKCg7rT5wWM4BOtCOANjEm0YQaqUkznU0fM9rMNvv+wnwyLeJumDvJneyus9EOex1wzCnnXHDXJ8/xkj1XT+AV+j4klPfb4l0H93pxgk638rpY0uu/44EkW64cWYpZCAJoHPIVyRMiTBTRxBBLnHgJEiWxKZAsRao06TIoCmUKgrBA5ygA8dhKFMPEPGZAgkkE2TCVIBemGeTAtAdZMJ2Pk30QFhyNEHA2IgD3ITR8gXDgJ0Q+/I0ogi0AeXDTQQjcKhAGdxSIAncyiAZ3HYgBd2PEwh2IOLgLEQ93IxLgHkQi3ItIggcQNjyGKICnEMnwHCIFXkCkwruINPgJIB2eAzLgJQMFXioohJcHMuEN/RAEoOT10wtYBfZScP643qKOhry9bQQKbXC2Jks+lmVtPZkeQZBnyOkMx6UEJuAEnAhltqIilrZtXbiEECfWuJrNkUhHEPloajo9K2IoQQ3tcKGFmpraQp0JaiQM6fbIjTAlgiOJSCQWmZ8h4xTV1IxQYkaMpIU6qM7mthD5kNs2KiqO9ZcSjQeHtJv1T+jlzIHRDk5stJ99ZFgscMrdn87ZCyMXR4sMf9VDJ9blikaFOIh6/DFGkdGc8Xoj54l/biFWcFC7yXyLXe6kmoujDbNsc5RyIGEPJP0WusGsvrHmA6T9LllYvTjhb/96HMz+xJ4EsJ6mcaAtfKGtqT2MRARwNw7gIIaIxyBApiIeQSxCFMCQOE9+hrozPDTUfWpW6/0zI4I9p2dTZ9x/Dh1oCdMiVTwUC8n6eK2VoWTQPpKhvG8mhLmEYCfExKuVIeWMkLmnzEypiykh9WXGeDNGYl3SsDhmxUm8Nk4mpwtLaT59V52TLaxk+Wzj+YQkXkiKyV6ZACk209+tLxaL7mOAllqfKqZmEV6/K5nhHoEDmYyqXE/M8FidUITkzKRCMunhs3XBumwlWwxSCySU0umsh5OmuvfH/8rgYcWRXNWXPVBVfsm/1Z9STqijjx/TtHVYxhHcRzXTjfMmQrdamntH59B3zw272toskxylDYJFsFKXG7hdrUnVw8grwxUFpO/COt5d6U++W6lDKJvVGiBSzbXcOTQ00H14FlZXyTpCZRIGMzGtRuMBczCFFB4RdEWzWD6vRkV8f6gzRviiVpVqakOui/bmOQR7RmZTd84WyJxD4KnQ90dz0EYOy4aaZ4GmKTokuq+S3QbDaMerKIkhGqMoSOcfkjSG0ldCiEV8ECeWNldOHTxcfhALSf3soVL2iFGAYbv2cPDQsYPBI2cIv0MQd4nCVp7caCkO9g3WlMecDNvkTipIn4huAzBEBxDAO8QnZcAw1Plc8MKLjjiqOAgsg+kMjw7TQKoN1SdqERcTWiBI6i+plYJsl5WieeMNXhSg17WpdwQGsecCKT+Tn6tPpSfHmbMQwBVpSFm2E0q6paDfndW30CEjeP/imAFvdcQfuPMutOp9/XoSfgv8myCeFahTnu1TcnfNsn887XtyQo4o8p53wJt95PmLNUNof0GUv3YYZPCCAAkP725nFInsU4305IzVrdt1NzPgU2Cu60B9q+/7yu/bfDHTGc+Ee68S9/0j6yb5+V5ToXxcu6JyOqd7BHnwNOYfN151hrkZmcMxQC9zz7zZoPR13FM32zk0WDBHjYJd5jxxuXeC+wTeCOPtvDymVdfH79lux7TYWjd4jVorLrR5CxCG7EbKLez1xhf83FyFMD/BswW7x7MQran/OLs0hXslTjuU+E0fetqnLr/Lv/iieMqyP8Mh1RcNT9DLRZPp+ofxH09euRrLO1uLK6LsuT+i5E5yt/lnOu+L/7pMnPaOJ2gO/0jLgH/GkCkUdIZA265+OQyRZ5GMG0PUPIdtBillEGiDaYz1b4ZBJBzddoKHKNfGCLSrfTS+tyXcerE26mwSITYDEuXH1a2gRadGA1C16i8Z+tXPfWii5XKTC5VRdTs1q1SKiny+Uilwu8V6JNU5QbCVGCFatdnIRypJkbfSPNFMlp/i+RgiGjYniErdngPuPZu9WGxd3jKL3PpPqFIakIYV0c9VhLe458zVDimczkVQa0C6+sFUI0DkZ/5VtVYr24XohqgvXUqIG/qqd7gL4QL1TlFw8OIaesJXaYgyPTw9r1hNgRZI45hAKcZBwKl+AXkzoji/nqjoenSPYcxndmo5OHp59Iy0/d5om8OwoT56fG/4mKnKPBE6ofr+Bb/W2JjATeX7AYt21S8aYPHZ7IDa6oRA8oALba9Xh7WeJdczHkWRVaC88/fn+GIUZ6HmXLD/4vQyQx45C584k4xWjsRu+hrOcGuoVBYfbw746Vu5HHsqLTz65PiHaA2ZO05dOt9YQLAywFGU1KpsPh+VUnXP0IAm0N5yqi4fksTP604er12h27Ty9+bwUr2NsM9Z+c5qUlXG1+UJYsMfx66435A5boRc8iN5P1MgGpy/x5lf71aiSbW7UfGxOq4mjSVVZz638k61m82zP1sg/m79m7EdIvcmKv7IX978R95q9IaEB463CfvdRbv0p+x57o8Z9EiXM3Hn7r+8OjI4mvzYn4Pvnp/38Kd7vhmVjyT279SK3xA4cKhYLDx++zS+b49RieKSSfqWUIj5ILVi6BEuuOXS5qAVdn19REv3nO0NJROl68le6lxsvGZFEpqhmioYTY0Y2eK4zkmeJ5bQokGysUbc8+vmer8N8lagoOjmz6+jCACUSUCONjU3CjduFv+8h61ubU4LCJpthPh3LLPd99x7P2tu9JIRcipEQPA+xtwuxtsBdyPX9ZZDUJqgucM+b0YmJa+pIQ8iIIJWTm8oYBsysGONBgtqGEoFALWWoSGD10sggN42Qy22VANqsLCiehtKNBRgUF+qfk0E5BiIcqQCqmMUSVmzORjo2R+NVe5sf/dEB1GyGLf6uA3c/lvWW/3cT459tzqjM64JgT1eK+Hf8Sq3dVeF8hEzOU4uOnzZVdWukWna3VSXN89hxpPkqFB+da3KLR6X4VzMlYFGS+doP4yTCw//47aZ8M/h2Htr82rGOpWr2UpfyJmf9GRDz99fvz+/Dl33unF67b7H63fIgqt+3fJ434LTVvthy/NnV37akObiHxxY0fU9lyf+Za/djRsL9z52kVUG5eHhHu1be+Ym2/jt2eV5i2UuAYZ+lUbTe699f119UFTMrAYxI+3798e4Zxhj2aDxEKDEDPdiMGtW+X0LEBjDb8IoABJAGFAmbrAYcGaqjYh2Oms56+QQTM0EXCcvJ+5L3Txk8NmQ42A1nHXyBMCpDmeY6vYhlIhollHoaHRX4t3M7QA3OgihG0jeUPqibOop1VanY5M8kq2DCeQpkkyfcegpRMDnWNWTS+tKcWQY1nbV4U7aNs1/mWkwNyz+rNxH7i0XiEhwy2F8psk2UUD0jtyGTLood1auiD6LvoGeFBpAp6Aw7X80+GQI+7rLKTuYfcrlOqfkgY5n5XVpB6OPPYgTPFsSUV4ub6UyKK3q7evsbZeat9ko6X8VCP2r9qdnGCQu/egpbZsinDSYDhxGd+tNTGYOsXvUAdDHfg6ZYQqp0is2818rqGx785q+u3uuEVvN3QzoxQAmIFA2B42mfCfNL8YC2xhwjCQx3BBbB8bEeGPcDFBpdOdAuc1GDkenMeDwx0CIJceaGpvVJnAemQ2fJ8GYaTWmx/U2UhzK2ZnET9rpuiOZn7wDDPEE2Yk3ruPXb2ykdWaU4qXxmFFjbNwNQx8VZCVaX+OvrUQ6MkOJK8XYNHe61WwNFQh4tFJ2EX0s8GTsZYHah5Iw4cb8jTLpbu9f7axJWRTfgoLbr9LrS/lCVm5o4qvbRp+n05aFLVGksiu+JWdTfQrU48d7yuMkinypPzqEWCO6neci+/28UbFN+jnqJ0tynMOjMeJZei5bEicX8pu4KT1jKIraHE4RqVfvgtW13BjBwDJPnlScBJDLC9NHTc7+Fh+vXZz8NIJpTcyiOKoLbt9OryPlq7UyI57+i8Vr43V2aoODErJuJPDLs7zk8oyW8xNGQxba6qlFXZx8cd3G6uXEhpw2xsbphAVS0f3yD511NDzmQYD9U3V+KBdBpYubHFEWbdrC2hz2iiB60J1hkzQ7yYIJJ82dUYKgTKCD8kU+mjk6IvKojtWiBMWBf/t1x8+0kxGvNvQMOACHgXmLXxHT9Jnx3X5/B4LiFqWOdTSS0M159rejATdwZ/7AmV9H07Mc0abFUCkQUEN30V6+1LsEGj5d3r/ZOqtn9SU05wTUzGvd/DOnSDs/L+CL3+xHJ7e5GU/GrqBPojOKElaeVNDyJaueG/nbQtNXsjT2pSnt7GVdbLx6HiOeqgiY6Z0ToJnPKQRPxHOv/EHfGu5zRJFLYNhL8fTtVt+OcCy+aEP8UeE+ir8rESIbp+oCtfStF//gxZ8O0WU8UoQoQvMUC5YTLdM6AyRYHbuGCtXXd2QhycvKE/6Rijc45R6W1oDMHyVFYEyPYzj+wAKb/iA0twueuBXfSvCcoQLyZwwqoYoKiG7lCeHyYJ6dAKjEcIRAHvox/mcG8yCTUVz86hWPCkBiN0Ii3c5gDQ2RUHcKacbNIdh5mIDMEODE8yJm5ks2GTCDmgQY0DtAunEDIPWJdf4jBw4eOnAgzH9yIrV3yNJLXYrFQn1jLUO9ufVQby+lgVJ/oHoAzIfqoQYs8PPI5qbMKe/d+7Bf+vb2ls9JyeYe6VulK4SPPgnsfHYy5mSBB3cULtStEgrTlxbv5JBL03/xmNe0ikiRHFhfN+AxQMAvnEKsmtcEhkOR19/irzpHsGztRiwEqCBxN7GPOClOaAbBNlyBhMCtgVN6/GTdpGMkxqr+EMSz63iEbDbPgZ58/vV9IQF0FQK24DwJ4hPEXmJ3IipgPYbNjnC+gnwdgT8Et4CQxDZwnGKGUBR+DxcVCmPMcZjDCIuyqfdUW52ZCgMRNJCgeN49uQp0M1/Ka/LyqnV27uUKYpRqeih9lqdkxEeyfaOndNRbAcbnP2FkS5woEPFrm0GX+x//H/4wX/sw/x/KNqk0NCU0rdJ5kup58LeJeV5AT0oLEoIqkKoJE6qcK4PjC2iQsrxiHV6pVNIZa3xF7ni+y1PcCkUIyGG8plnaxaGlpW4WmhSVS6GJUDfSwiUFm06jsvSNYCLNFERSgSpuRq1uplSJrg42RZWAjems2bR+8WqeaAP8CI7p0Y9Kq4JqVqHxc/Sc2+a30qD780R2MSUaoZScOHJkLgfenzF5enjmDtrz57QdICN8OrDFxGqamg4iZmetsxk52NRUpMFiYjQ7jldWDouGX/gEMKXZejD9AXKwi+5nx7TDA0SFFdMcl4ryYw76E6Bkhazh2pQZQKABz1PsVuzvQe7Rgs3F8TkGTD5tb+5mQmb7E1TCn7ijcvluJFelotNRLn37gFyapfqOfX+BvTh69Hku9CX9GjxXNNxt7KV1Hj+aRFlWO2sZ5bdM5SZhLXRAPdA3sGv/N1PFVecos2zJSR+G+6FD8vQV/ujRn0AfsGl+5ud7e6d0jsbH3RVYM25Yycsc9Me1Z3SCVn5rec+sHUOHlHE1Bdqw6qTPfjfFLz75JV1YbQFXk9Zb4pdz7C7L3MfuIdhq+1xhViQ/ON/DglgqGsyPnFT7XFAlttvRXt/q1Aln/eDwb3NzfwKumfx+/5WZMdPhTsdxltYKesEK3yf/Ja88yhv8iPpbRY6qRrEa1NldoNqHGODfSkPdEX+knUrjHW1U1UmrOjVHvrHif1UDPThjyzrYN0IoHTUEfccovhRhSSuJnbD/D2WJ9P/acBUOICulpJPdkiM6OiDNlaGeFxJUV8jdRBklvxOvS1Ia74ZM8M+ry2pQr8euwWWG/A8qkxfU/1UeS7r0s6kvNv66srGxKS02/p/UVR+OpLTBj2jQHKqNTELiZPuRZOc8RJ+cV1Ry/uvwsGm5uMRJHEWCY93s8hOpJsHXqkjJ3PZfcVKyx0mCZHMKmyJWj6niAoRp4ixs2nIOleajvD2WqM2SaARgvJkLToizlZNiPOSUOKdYPeY6F5DiOWeJi8o5hvSsM6ykuquvAjIMrj859iohwnZld/2F2BIVv5Mu+IdSudm9RUSFUz8hKDIodR/fzYILRSf3Y/FgSEldLrqFt81olj9fIrWsJ9h4nWZXOiqAGBg4VU6vTet4SoTzm6vIyP8CUZOQkrLH46b/QFHxjTvRIkRxsD8F4dqjLpu324vedRAlcI/tCzVxMogC6RZXTgu70BZ4ZqNWoC37FEmOpOUVNuqlaSxJoCfu5fpZM1EkWVE13TAt23F9fk4Qznhc8Lly486DJy/efHzXn0pIxI+/AIGCgnEjObVHTzyQtOSnOOiAsfHSqD8LmgaU648XFU1AtkxyXmHGEleBE86iSqx83nreCSDc9KS+ibWciXjZq+46zZCVlwafsXy6yqHteKKIM3c4Q7mKbF1fSPz4sMifW0pdwf+GavchYkHWLmjZYThb3sPY+nVM2mM5qq1Yggpb/5zAdptYdh2OMnUIpZXgUM8qqPhxVW3zK210nAWSXeM1JuJ0lqF5ac+wh1itbFZc4oRVEYYuknoyVrkgb7xnO81mAAAA') format('woff2'), url('iconfont.woff?t=1568428655639') format('woff'), url('iconfont.ttf?t=1568428655639') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('iconfont.svg?t=1568428655639#iconfont') format('svg'); /* iOS 4.1- */ } .icon { font-family: 'iconfont' !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-guanyu:before { content: '\e65d'; } .icon-author:before { content: '\e60e'; } .icon-tab:before { content: '\e815'; } .icon-folder:before { content: '\e69c'; } .icon-3801wenjian:before { content: '\e66d'; } .icon-setting:before { content: '\e64e'; } .icon-file:before { content: '\e857'; } .icon-gongsi:before { content: '\e79e'; } .icon-comment:before { content: '\e719'; } .icon-baocuntupian:before { content: '\e6d1'; } .icon-book-open:before { content: '\e72c'; } .icon-code:before { content: '\e75c'; } .icon-copy:before { content: '\e765'; } .icon-file-image:before { content: '\e78c'; } .icon-filter:before { content: '\e78f'; } .icon-git-branch:before { content: '\e796'; } .icon-git-pull-request:before { content: '\e798'; } .icon-git-repo-forked:before { content: '\e799'; } .icon-github:before { content: '\e79a'; } .icon-globe:before { content: '\e79b'; } .icon-hot:before { content: '\e7a8'; } .icon-info:before { content: '\e7ac'; } .icon-git-commit:before { content: '\e7ae'; } .icon-link-external:before { content: '\e7bb'; } .icon-news:before { content: '\e7db'; } .icon-search:before { content: '\e80a'; } .icon-star:before { content: '\e820'; } .icon-book:before { content: '\e641'; } .icon-fankui:before { content: '\e613'; } .icon-email:before { content: '\e635'; } .icon-people:before { content: '\e62b'; } .icon-events:before { content: '\e6f5'; } .icon-tag:before { content: '\e6db'; } .icon-eye:before { content: '\e7a4'; } .icon-link:before { content: '\e817'; } .icon-location:before { content: '\e6f4'; } .icon-activity:before { content: '\e645'; } ================================================ FILE: src/components/activity-item/index.module.scss ================================================ .item-wrap { padding: 20px; margin-top: 20px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .repo-name { font-weight: 800; color: $color-brand-light; } .event-wrap { margin-left: 5px; overflow: hidden; } .commit-sha { color: $color-brand-dark; } .event-desc { margin-top: 10px; font-size: 25px; font-weight: 400; } .event-action { text-transform: capitalize; } .issue-number { color: $color-brand-light; } ================================================ FILE: src/components/activity-item/index.tsx ================================================ import Author from '@/components/author'; import type * as Schemas from '@/src/githubSchemas'; import { Text, View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import Taro from '@tarojs/taro'; import { memo } from 'react'; import styles from './index.module.scss'; const spacesRegExp = new RegExp('[\r\n\t]+', 'g'); const refsHeadsRegExp = new RegExp('refs/heads/'); const maxTextLength = 100; const truncateText = (text = '') => { let truncated = text.slice(0, maxTextLength); if (text.length >= maxTextLength) { truncated += '...'; } return truncated; }; export type ActivityItemDataType = Schemas.Event; interface ActivityItemProps { item: ActivityItemDataType; } const ActivityItem = ({ item }: ActivityItemProps) => { if (!item) { return null; } const { actor: { avatar_url, display_login, login }, repo: { name }, created_at, } = item; const handleIssueNumberClick = (full_name, number) => (e: ITouchEvent) => { e.stopPropagation(); const url = `/pages/issues/issue-detail/index?full_name=${full_name}&number=${number}`; Taro.navigateTo({ url }); }; const renderEvent = () => { const { type, repo: { name }, payload, } = item; switch (type) { case 'PushEvent': { const { ref, commits } = payload; const _ref = ref!.replace(refsHeadsRegExp, ''); const len = commits!.length; return ( Pushed to {_ref} at{' '} {name} {commits!.slice(0, 3).map((item) => { const { message, sha } = item; const commit = truncateText(message.replace(spacesRegExp, '')); const _sha = sha.substr(0, 8); return ( {_sha} {commit} ); })} {len > 3 && ( ... )} ); } case 'IssuesEvent': { return ( {payload.action}{' '} issue {name} {payload.issue!.title} ); } case 'PullRequestEvent': { const { pull_request, action } = payload; const { title } = pull_request!; return ( {action} pull request{' '} {name} {title} ); } case 'IssueCommentEvent': { const { comment, issue } = payload; const { body } = comment!; const detail = body.replace(spacesRegExp, ' '); const text = truncateText(detail); const number = issue!.number; return ( Created comment on{' '} #{number} {' '} in {name} {text} ); } case 'WatchEvent': { return ( Starred {name} ); } case 'PublicEvent': { return ( Open sourced {name} ); } case 'ForkEvent': { const { forkee } = payload; return ( Forked {forkee?.full_name} from{' '} {name} ); } case 'CreateEvent': { return ( Created {payload.ref_type} {payload.ref || ''} at {name} {payload.description || ''} ); } case 'DeleteEvent': { return ( Deleted {payload.ref_type} {payload.ref} at {name} {payload.description} ); } case 'MemberEvent': { return ( {payload.action} permissions of {payload.member!.login} to {payload.repository?.full_name} ); } case 'PullRequestReviewCommentEvent': { const comment = payload.comment; const body = comment!.body; const detail = body.replace(spacesRegExp, ' '); const text = truncateText(detail); return ( Reviewed pull request in{' '} {name} {text} ); } case 'GollumEvent': { const page = payload.pages![0]; const { action, page_name } = page; return ( {action} {page_name}{' '} {name} ); } case 'ReleaseEvent': { return ( Released {payload.release!.name || payload.release!.tag_name} at{' '} {name} ); } case 'CommitCommentEvent': { const comment = payload.comment; return ( Commented on commit{' '} {name} @{' '} {comment!.commit_id.substring(0, 8)} ); } } // const text = JSON.stringify(item); // return ( // // {text} // // ); return ( {payload?.action} at {name} ); }; const handleCardClick = () => { Taro.navigateTo({ url: `/pages/repos/index?full_name=${name}` }); }; return ( {renderEvent()} ); }; const areEqual = ({ item: prevItem }: any, { item }: any) => { return prevItem && prevItem.repo.name === item.repo.name; }; export default memo(ActivityItem, areEqual); ================================================ FILE: src/components/author/index.module.scss ================================================ .author { display: flex; justify-items: center; width: 100%; } .login { font-size: 32px; font-weight: 400; color: #40a0fa; } .create-at { margin-left: auto; align-self: flex-start; font-size: 25px; color: rgb(151, 151, 151); } ================================================ FILE: src/components/author/index.tsx ================================================ import { getTimeAgo } from '@/utils/date'; import { Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { memo } from 'react'; import Avatar from '../avatar'; import styles from './index.module.scss'; interface AuthorProps { login: string; url: string; size?: number | string; created_at?: string; } const Author = ({ login, url, size, created_at = '' }: AuthorProps) => { const handleLoginClick = () => { const url = `/pages/developer/index?name=${login}`; Taro.navigateTo({ url }); }; url = url.endsWith('?') ? `${url}s=96&v=4` : `${url}&s=96`; return ( {login} {!!created_at && ( {getTimeAgo(created_at)} )} ); }; const areEqual = ({ login: prevLogin }: any, { login }: any) => { return prevLogin === login; }; export default memo(Author, areEqual); ================================================ FILE: src/components/avatar/index.module.scss ================================================ .avatar { width: 80px; height: 80px; margin-right: 20px; border-radius: 50%; } ================================================ FILE: src/components/avatar/index.tsx ================================================ import { Block, Image } from '@tarojs/components'; import Taro from '@tarojs/taro'; import classnames from 'classnames'; import { memo } from 'react'; import styles from './index.module.scss'; interface AvatarProps { url: string; className?: string; username?: string; circle?: boolean; size?: string | number; } const Avatar = ({ url, className = '', username = '', circle = true, size = 40, }: AvatarProps) => { const width = size + 'px'; const styleProps: any = { width, height: width, }; if (!circle) { styleProps.borderRadius = +size / 4 + 'px'; } const handleImgClick = () => { if (!username) { return; } const url = `/pages/developer/index?name=${username}`; Taro.navigateTo({ url }); }; return ( ); }; const areEqual = (prevProps: any, props: any) => { return prevProps.url === props.url; }; export default memo(Avatar, areEqual); ================================================ FILE: src/components/empty/index.module.scss ================================================ .wrap { height: 100vh; width: 100vw; display: flex; justify-content: center; background: $bg; } .inner { margin: 40px auto; } .img { width: 400px; height: 400px; } .desc { text-align: center; font-size: 35px; color: rgb(88, 88, 88); } .tips { color: $primary; } ================================================ FILE: src/components/empty/index.tsx ================================================ import img from '@/assets/spidertocat.png'; import { Image, Text, View } from '@tarojs/components'; import { FC } from 'react'; import styles from './index.module.scss'; const Empty: FC = () => { return ( 没有数据~ 试试下拉刷新 {/* { Taro.startPullDownRefresh(); }} > 重试 */} ); }; export default Empty; ================================================ FILE: src/components/fab-button/index.module.scss ================================================ .fab-btn { position: fixed; bottom: 36px; right: 26px; z-index: 3; } ================================================ FILE: src/components/fab-button/index.tsx ================================================ import { View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import { ReactNode } from 'react'; import { AtFab, AtIcon } from 'taro-ui'; import styles from './index.module.scss'; interface FabButtonProps { icon?: string; prefixClass?: string; children?: ReactNode; size?: 'small' | 'normal'; onClick: (e: ITouchEvent) => void; } const FabButton = ({ icon = 'filter', prefixClass = '', onClick, children, size = 'small', }: FabButtonProps) => { const props: any = { value: icon }; if (prefixClass) { props.prefixClass = prefixClass; } return ( {children || } ); }; export default FabButton; ================================================ FILE: src/components/font-icon/index.module.scss ================================================ ================================================ FILE: src/components/font-icon/index.tsx ================================================ import { AtIcon } from 'taro-ui'; interface FontIconProps { value: string; size?: string | number; styleProps?: React.CSSProperties; } const FontIcon = ({ value, size = 16, styleProps = {} }: FontIconProps) => { const fontSize = size + 'px'; const style: React.CSSProperties = { lineHeight: '1em', fontSize, ...styleProps, }; return ( ); }; export default FontIcon; ================================================ FILE: src/components/list-item/index.module.scss ================================================ .item { display: flex; align-items: center; padding: 15px 24px; position: relative; -webkit-box-sizing: border-box; box-sizing: border-box; color: $primary-text-color; font-size: 29px; font-weight: 500; line-height: 1.5; transition: background-color 0.3s; position: relative; border-bottom: 0px solid $bg; &:active { background-color: #f0f0f0; } } .left { display: flex; align-items: center; } .right { margin-left: auto; @extend .left; } .extra-text { font-size: 28px; text-align: right; font-weight: 400; color: $text-color; } ================================================ FILE: src/components/list-item/index.tsx ================================================ import FontIcon from '@/components/font-icon'; import { Text, View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import classnames from 'classnames'; import { AtIcon } from 'taro-ui'; import styles from './index.module.scss'; interface ListItemProps { onClick?: (ev: ITouchEvent) => void; className?: string; hasBorder?: boolean; title?: string; renderTitle?: () => JSX.Element; onRightClick?: (ev: ITouchEvent) => void; extraText?: string; language?: string; icon?: string; rightIcon?: string; color?: string; renderExtraText?: () => JSX.Element; arrow?: 'right' | 'left' | 'up' | 'down' | null; size?: string | number; style?: React.CSSProperties; } const ListItem = ({ className, title, language, extraText, icon, rightIcon, renderTitle, renderExtraText, onClick = function () {}, onRightClick = function () {}, arrow = 'right', hasBorder = true, color = 'none', size = 25, style = {}, }: ListItemProps) => { const styleProps: any = {}; if (hasBorder) { styleProps.borderBottomWidth = '1px'; } const iconStyleProps: React.CSSProperties = { fontSize: size + 'px', padding: '1px', marginRight: '10px', borderRadius: '50%', color: '#fff', background: color, ...style, }; return ( {icon && } {title || (renderTitle && renderTitle())} {extraText && {extraText}} {rightIcon && ( )} {arrow && ( )} ); }; export default ListItem; ================================================ FILE: src/components/load-more/index.module.scss ================================================ .wrap { position: relative; } ================================================ FILE: src/components/load-more/index.tsx ================================================ import { View } from '@tarojs/components'; import { AtLoadMore } from 'taro-ui'; import 'taro-ui/dist/style/components/activity-indicator.scss'; import 'taro-ui/dist/style/components/loading.scss'; import styles from './index.module.scss'; const LoadMore = ({ hasMore }: { hasMore: boolean }) => { const status = hasMore ? 'loading' : 'noMore'; return ( ); }; export default LoadMore; ================================================ FILE: src/components/markdown/index.module.scss ================================================ ================================================ FILE: src/components/markdown/index.tsx ================================================ import { copyText } from '@/utils/common'; import { getNavPath, githubHttpsUrl, isGitHubPage, mdLink, parseGitHub, } from '@/utils/repo'; import { View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import Taro from '@tarojs/taro'; interface MarkDownProps { md: string | undefined | null; full_name?: string; } const Markdown = ({ md: rawMD, full_name }: MarkDownProps) => { if (!rawMD) { return null; } const faceLink = (f: string) => { return ( '![](https://www.webfx.com/tools/emoji-cheat-sheet/graphics/emojis/' + f + '.png)' ); }; const getFixedMD = (rawMD = '') => { let md = rawMD; const d = { '’': "'", '
': '\n\n', '
': '\n\n', '
': '\n\n', '': '', '': '', '': '', '': '', '
  • ': '* ', '
  • ': '\n', '': '\n', '': '`', '': '`', ' ': ' ', '"': '"', '“': '"', '”': '"', '>': '>', '<': '<', }; for (const k in d) { const reg = new RegExp(k, 'g'); md = md.replace(reg, d[k]); } const faceRegExp = [/:([a-z_]{1,30}?):/g, /[+*-] (\[[x ]\])/g]; faceRegExp.map((f) => { const tmpreg = md; while ((match = f.exec(tmpreg))) { if (match[1].startsWith('[')) { match[0] = match[1]; if (match[1].indexOf('x') > 0) { match[1] = 'white_check_mark'; } else { match[1] = 'white_medium_square'; } } md = md.replace(match[0], faceLink(match[1])); } }); const linkRegExp = /((^|[ \n:\uff1a\uff0c]+)(https?:\/\/[/0-9a-zA-Z.&=#_?-]+)([ \t\r\n]+|$))/g; const matchCnt = 3; let match: any; const newHtml = md; while ((match = linkRegExp.exec(newHtml))) { if (match[1] && match[matchCnt]) { const t = match[1]; const url = match[matchCnt]; const r = t.replace(url, mdLink(url, url)); md = md.replace(match[1], r); } } return md; }; const md = getFixedMD(rawMD); const handleClick = (e: ITouchEvent) => { let clickurl = e.detail.currentTarget.dataset.text; console.log('clickurl: ', clickurl); const isRelativeFile = clickurl && (clickurl.startsWith('./') || !clickurl.startsWith('http')); if (isRelativeFile) { clickurl = `${githubHttpsUrl}/${full_name}/${clickurl}`; } const isGitHubUrl = isRelativeFile || isGitHubPage(clickurl); // TODO 跳转其他小程序 if (isGitHubUrl) { const [owner, repo, filePath] = parseGitHub(clickurl); const path = getNavPath({ owner, repo, filePath }); console.log('path: ', path); if (path) { Taro.navigateTo({ url: path }); } return; } else { copyText(clickurl); } }; const baseUrl = full_name ? 'https://raw.githubusercontent.com/' + full_name + '/master/' : ''; // TODO 修复 md 中含有 html 情况下的渲染 // TODO 修复表格显示问题 // TODO 添加 currentDir,获取正确的图片引入地址 return ( ); }; export default Markdown; ================================================ FILE: src/components/no-authority/index.module.scss ================================================ .wrap { display: flex; height: 100vh; width: 100vw; justify-content: center; text-align: center; align-items: center; // background: $itemBg; } .inner { margin: auto; } .img { width: 400px; height: 400px; } .desc { font-size: 35px; color: rgb(88, 88, 88); } .login { margin-top: 20px; } ================================================ FILE: src/components/no-authority/index.tsx ================================================ import img from '@/assets/stormtroopocat.png'; import { Image, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { AtButton } from 'taro-ui'; import styles from './index.module.scss'; const NoAuthority = () => { return ( 需要登录才能查看 { Taro.navigateTo({ url: `/pages/login/index` }); }} > 前往登录 ); }; export default NoAuthority; ================================================ FILE: src/components/repo-item/index.module.scss ================================================ .repo-wrap { display: flex; margin: 25px 20px; padding: 20px; box-sizing: border-box; font-size: 25px; border-radius: 10px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); background: $itemBg; } .avatar { width: 80px; height: 80px; margin-right: 20px; border-radius: 50%; } .info { flex: 1; } .lang-color { width: 25px; height: 25px; border-radius: 50%; margin-left: 8px; } .top { display: flex; align-items: center; flex-wrap: wrap; } .name { color: #40a0fa; font-weight: 700; font-size: 28px; } .language { margin-left: auto; align-self: flex-start; } .desc { font-size: 23px; font-weight: 400; margin: 10px 0 10px 5px; } .bottom { display: flex; justify-content: flex-start; font-size: 23px; font-weight: 300; } .meta-item { flex: 1; white-space: nowrap; color: rgb(107, 107, 107); } ================================================ FILE: src/components/repo-item/index.tsx ================================================ import { SearchReposResponse } from '@/github/githubComponents'; import { Text, View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import Taro from '@tarojs/taro'; import { memo } from 'react'; import { LANGUAGE_COLOR_MAP } from '../../pages/my-languages/languages'; import FontIcon from '../font-icon'; import styles from './index.module.scss'; interface RepoItemProps { repo: SearchReposResponse['items'][number]; } const RepoItem = ({ repo }: RepoItemProps) => { if (!repo) { return null; } const { id, node_id, name, full_name, owner, html_url, description, fork, url, forks_url, keys_url, collaborators_url, teams_url, hooks_url, issue_events_url, events_url, assignees_url, branches_url, tags_url, blobs_url, git_tags_url, git_refs_url, trees_url, statuses_url, languages_url, stargazers_url, contributors_url, subscribers_url, subscription_url, commits_url, git_commits_url, comments_url, issue_comment_url, contents_url, compare_url, merges_url, archive_url, downloads_url, issues_url, pulls_url, milestones_url, notifications_url, labels_url, releases_url, deployments_url, created_at, updated_at, pushed_at, git_url, ssh_url, clone_url, svn_url, homepage, size, stargazers_count, watchers_count, language, has_issues, has_projects, has_downloads, has_wiki, has_pages, forks_count, mirror_url, archived, disabled, open_issues_count, license, forks, open_issues, watchers, default_branch, permissions, } = repo; const { avatar_url, login } = owner || {}; const handleNameClick = (e: ITouchEvent) => { e.stopPropagation(); const url = `/pages/developer/index?name=${login}`; Taro.navigateTo({ url }); }; const handleCardClick = () => { const url = `/pages/repos/index?owner=${login}&repo=${name}`; Taro.navigateTo({ url }); }; return ( {/* */} {full_name} {language || ''} {description || ''} {stargazers_count} {forks_count} Updated on{' '} {updated_at.slice(0, 10)} ); }; const areEqual = ({ repo: prevRepo }: any, { repo }: any) => { return prevRepo && prevRepo.full_name === repo.full_name; }; export default memo(RepoItem, areEqual); ================================================ FILE: src/components/skeleton-card/index.module.scss ================================================ .loading { text-align: center; margin-top: 250px; color: $loading-text-color; font-size: 30px; } ================================================ FILE: src/components/skeleton-card/index.tsx ================================================ import monaLoadingGif from '@/assets/mona-loading.gif'; import { Block, Image, Text, View } from '@tarojs/components'; import { FC, ReactNode } from 'react'; import Empty from '../empty'; import styles from './index.module.scss'; const SkeletonCard: FC<{ children: ReactNode; isLoading?: boolean; isError?: boolean; }> = ({ children, isLoading, isError }) => { // TODO skeleton replace loading return ( {isLoading ? ( 努力加载.. ) : isError ? ( ) : ( children )} ); }; export default SkeletonCard; ================================================ FILE: src/components/user-info/index.module.scss ================================================ .wrap { } .header { padding: 20px; display: flex; align-items: space-between; background: $itemBg; } .divide { height: 1px; width: 100vw; } .basic { display: flex; flex-wrap: wrap; margin-right: auto; font-size: 25px; } .name { width: 100%; font-size: 32px; font-weight: 600; color: $primary; } .bio { width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: break-all; word-wrap: break-word; overflow: hidden; text-overflow: ellipsis; color: $text-color; } .Joined { width: 100%; font-size: 25px; font-weight: 400; } .info { margin-top: 30px; padding: 20px; border-radius: 10px; box-sizing: border-box; background: $itemBg; } .meta { margin: 0; } .nav { display: flex; justify-content: space-around; align-items: center; } .nav-item { flex: 1; text-align: center; } .item-count { color: rgb(43, 43, 43); font-weight: 600; font-size: 35px; } .item-label { font-weight: 400; font-size: 28px; text-transform: capitalize; } .logout { padding: 30px; } .action-btns { display: flex; justify-content: space-around; padding: 0 30px 20px; background-color: $itemBg; } .btn { } ================================================ FILE: src/components/user-info/index.tsx ================================================ import { useActivityCheckRepoIsStarredByAuthenticatedUser, useActivityStarRepoForAuthenticatedUser, } from '@/github/githubComponents'; import { copyText } from '@/utils/common'; import { getTimeAgo } from '@/utils/date'; import { Block, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import classnames from 'classnames'; import { AtButton, AtList } from 'taro-ui'; import Avatar from '../avatar'; import Empty from '../empty'; import ListItem from '../list-item'; import styles from './index.module.scss'; const supportStarParams = { owner: 'zenghongtu', repo: 'GitHub-Pro' }; const UserInfo = ({ userInfo, isFollowing, onFollowClick, onLogout, isCurrent = true, }: any) => { if (!userInfo) { return ; } const { data } = useActivityCheckRepoIsStarredByAuthenticatedUser({ pathParams: supportStarParams, }); const isStarred = !data && data !== null; const { mutateAsync } = useActivityStarRepoForAuthenticatedUser({}); const handleNavTo = (url: string) => () => { Taro.navigateTo({ url }); }; const handleCopy = (text: string) => () => { copyText(text); }; const handleSupport = () => { mutateAsync({ pathParams: supportStarParams }).then((res) => { if (!res && res !== null) { Taro.showToast({ title: '感谢支持! 🎈', icon: 'none' }); } }); }; const { login, id, node_id, avatar_url, gravatar_id, url, html_url, followers_url, following_url, gists_url, starred_url, subscriptions_url, organizations_url, repos_url, events_url, received_events_url, type, site_admin, name, company = '', blog = '', location = '', email = '', hireable, bio = '', public_repos, public_gists, followers = 0, following = 0, created_at, updated_at, } = userInfo!; const style: React.CSSProperties = { padding: '6px', fontSize: '16px' }; return ( {name || login} ({login}) {bio} Joined at {getTimeAgo(created_at)} {Number(public_repos).toLocaleString()} repositories {Number(followers).toLocaleString()} followers {Number(following).toLocaleString()} following {/* {public_gists} Gists */} {!isCurrent && ( {isFollowing ? 'unfollow' : 'follow'} share )} {!isCurrent && ( )} {isCurrent && ( {!isStarred && ( )} Logout )} ); }; export default UserInfo; ================================================ FILE: src/components/user-item/index.module.scss ================================================ .user { display: flex; align-items: center; margin: 20px; padding: 8px 0; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } ================================================ FILE: src/components/user-item/index.tsx ================================================ import { Block, View } from '@tarojs/components'; import Author from '../author'; import Empty from '../empty'; import LoadMore from '../load-more'; import styles from './index.module.scss'; const UserItem = ({ data, hasMore }: any) => { return ( {data ? ( {data.map((user) => { const node_id = user.node_id; const login = user.login; const avatar_url = user.avatar_url; return ( ); })} {data && } ) : ( )} ); }; export default UserItem; ================================================ FILE: src/constants.ts ================================================ export interface IDefaultParams { per_page?: number; page?: number; } export const defaultParams: IDefaultParams = { per_page: 20, page: 1, }; export const issueDefaultParams: IDefaultParams = { // 多了会 GG per_page: 10, page: 1, }; export const defaultSearchParams = { q: '', sort: '', order: '', per_page: 30, page: 1, }; export const REACH_BOTTOM_EVENT = 'reach_bottom_event'; export const PULL_DOWN_REFRESH_EVENT = 'pull_down_refresh_event'; export const THROTTLE_DELAY = 1500; export const TRENDING_URL = 'https://trending.stayin.cn'; export const CURRENT_LANGUAGE_STORAGE_KEY = 'current-language'; ================================================ FILE: src/github/githubComponents.ts ================================================ /** * Generated by @openapi-codegen * * @version 1.1.4 */ import * as reactQuery from '@tanstack/react-query'; import { GithubContext, useGithubContext } from './githubContext'; import type * as Fetcher from './githubFetcher'; import { githubFetch } from './githubFetcher'; import type * as Responses from './githubResponses'; import type * as Schemas from './githubSchemas'; export type MetaRootError = Fetcher.ErrorWrapper; export type MetaRootResponse = { /** * @format uri */ authorizations_url: string; /** * @format uri */ code_search_url: string; /** * @format uri */ commit_search_url: string; /** * @format uri */ current_user_authorizations_html_url: string; /** * @format uri */ current_user_repositories_url: string; /** * @format uri */ current_user_url: string; /** * @format uri */ emails_url: string; /** * @format uri */ emojis_url: string; /** * @format uri */ events_url: string; /** * @format uri */ feeds_url: string; /** * @format uri */ followers_url: string; /** * @format uri */ following_url: string; /** * @format uri */ gists_url: string; /** * @format uri */ hub_url: string; /** * @format uri */ issue_search_url: string; /** * @format uri */ issues_url: string; /** * @format uri */ keys_url: string; /** * @format uri */ label_search_url: string; /** * @format uri */ notifications_url: string; /** * @format uri */ organization_repositories_url: string; /** * @format uri */ organization_teams_url: string; /** * @format uri */ organization_url: string; /** * @format uri */ public_gists_url: string; /** * @format uri */ rate_limit_url: string; /** * @format uri */ repository_search_url: string; /** * @format uri */ repository_url: string; /** * @format uri */ starred_gists_url: string; /** * @format uri */ starred_url: string; /** * @format uri */ topic_search_url?: string; /** * @format uri */ user_organizations_url: string; /** * @format uri */ user_repositories_url: string; /** * @format uri */ user_search_url: string; /** * @format uri */ user_url: string; }; export type MetaRootVariables = GithubContext['fetcherOptions']; /** * Get Hypermedia links to resources accessible in GitHub's REST API */ export const fetchMetaRoot = ( variables: MetaRootVariables, signal?: AbortSignal, ) => githubFetch({ url: '/', method: 'get', ...variables, signal, }); /** * Get Hypermedia links to resources accessible in GitHub's REST API */ export const useMetaRoot = ( variables: MetaRootVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/', operationId: 'metaRoot', variables }), ({ signal }) => fetchMetaRoot({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsGetAuthenticatedError = Fetcher.ErrorWrapper; export type AppsGetAuthenticatedVariables = GithubContext['fetcherOptions']; /** * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetAuthenticated = ( variables: AppsGetAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Integration, AppsGetAuthenticatedError, undefined, {}, {}, {} >({ url: '/app', method: 'get', ...variables, signal }); /** * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetAuthenticated = ( variables: AppsGetAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Integration, AppsGetAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Integration, AppsGetAuthenticatedError, TData >( queryKeyFn({ path: '/app', operationId: 'appsGetAuthenticated', variables, }), ({ signal }) => fetchAppsGetAuthenticated({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsCreateFromManifestPathParams = { code: string; }; export type AppsCreateFromManifestError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type AppsCreateFromManifestResponse = { /** * @example "Iv1.25b5d1e65ffc4022" */ client_id: string; /** * @example "1d4b2097ac622ba702d19de498f005747a8b21d3" */ client_secret: string; /** * @example "2017-07-08T20:18:44.000Z" * @format date-time */ created_at: string; /** * @example The description of the app. */ description: string | null; /** * The list of events for the GitHub app * * @example label * @example deployment */ events: string[]; /** * @example https://example.com * @format uri */ external_url: string; /** * @example https://github.com/apps/super-ci * @format uri */ html_url: string; /** * Unique identifier of the GitHub app * * @example 37 */ id?: number; /** * The number of installations associated with the GitHub app * * @example 5 */ installations_count?: number; /** * The name of the GitHub app * * @example Probot Owners */ name?: string; /** * @example MDExOkludGVncmF0aW9uMQ== */ node_id?: string; /** * Simple User */ owner?: Schemas.SimpleUser; /** * @example "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\n-----END RSA PRIVATE KEY-----\n" */ pem: string; /** * The set of permissions for the GitHub app * * @example {"deployments":"write","issues":"read"} */ permissions: { checks?: string; contents?: string; deployments?: string; issues?: string; metadata?: string; } & { [key: string]: string; }; /** * The slug name of the GitHub app * * @example probot-owners */ slug?: string; /** * @example "2017-07-08T20:18:44.000Z" * @format date-time */ updated_at: string; /** * @example "6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b" */ webhook_secret: string; } & { [key: string]: any; }; export type AppsCreateFromManifestVariables = { pathParams: AppsCreateFromManifestPathParams; } & GithubContext['fetcherOptions']; /** * Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. */ export const fetchAppsCreateFromManifest = ( variables: AppsCreateFromManifestVariables, signal?: AbortSignal, ) => githubFetch< AppsCreateFromManifestResponse, AppsCreateFromManifestError, undefined, {}, {}, AppsCreateFromManifestPathParams >({ url: '/app-manifests/{code}/conversions', method: 'post', ...variables, signal, }); /** * Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. */ export const useAppsCreateFromManifest = ( options?: Omit< reactQuery.UseMutationOptions< AppsCreateFromManifestResponse, AppsCreateFromManifestError, AppsCreateFromManifestVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< AppsCreateFromManifestResponse, AppsCreateFromManifestError, AppsCreateFromManifestVariables >( (variables: AppsCreateFromManifestVariables) => fetchAppsCreateFromManifest({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetWebhookConfigForAppError = Fetcher.ErrorWrapper; export type AppsGetWebhookConfigForAppVariables = GithubContext['fetcherOptions']; /** * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetWebhookConfigForApp = ( variables: AppsGetWebhookConfigForAppVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, AppsGetWebhookConfigForAppError, undefined, {}, {}, {} >({ url: '/app/hook/config', method: 'get', ...variables, signal }); /** * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetWebhookConfigForApp = ( variables: AppsGetWebhookConfigForAppVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WebhookConfig, AppsGetWebhookConfigForAppError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WebhookConfig, AppsGetWebhookConfigForAppError, TData >( queryKeyFn({ path: '/app/hook/config', operationId: 'appsGetWebhookConfigForApp', variables, }), ({ signal }) => fetchAppsGetWebhookConfigForApp( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsUpdateWebhookConfigForAppError = Fetcher.ErrorWrapper; export type AppsUpdateWebhookConfigForAppRequestBody = { content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; secret?: Schemas.WebhookConfigSecret; url?: Schemas.WebhookConfigUrl; }; export type AppsUpdateWebhookConfigForAppVariables = { body?: AppsUpdateWebhookConfigForAppRequestBody; } & GithubContext['fetcherOptions']; /** * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsUpdateWebhookConfigForApp = ( variables: AppsUpdateWebhookConfigForAppVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, AppsUpdateWebhookConfigForAppError, AppsUpdateWebhookConfigForAppRequestBody, {}, {}, {} >({ url: '/app/hook/config', method: 'patch', ...variables, signal }); /** * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsUpdateWebhookConfigForApp = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.WebhookConfig, AppsUpdateWebhookConfigForAppError, AppsUpdateWebhookConfigForAppVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.WebhookConfig, AppsUpdateWebhookConfigForAppError, AppsUpdateWebhookConfigForAppVariables >( (variables: AppsUpdateWebhookConfigForAppVariables) => fetchAppsUpdateWebhookConfigForApp({ ...fetcherOptions, ...variables }), options, ); }; export type AppsListInstallationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; outdated?: string; }; export type AppsListInstallationsError = Fetcher.ErrorWrapper; export type AppsListInstallationsResponse = Schemas.Installation[]; export type AppsListInstallationsVariables = { queryParams?: AppsListInstallationsQueryParams; } & GithubContext['fetcherOptions']; /** * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * * The permissions the installation has are included under the `permissions` key. */ export const fetchAppsListInstallations = ( variables: AppsListInstallationsVariables, signal?: AbortSignal, ) => githubFetch< AppsListInstallationsResponse, AppsListInstallationsError, undefined, {}, AppsListInstallationsQueryParams, {} >({ url: '/app/installations', method: 'get', ...variables, signal }); /** * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * * The permissions the installation has are included under the `permissions` key. */ export const useAppsListInstallations = ( variables: AppsListInstallationsVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListInstallationsResponse, AppsListInstallationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListInstallationsResponse, AppsListInstallationsError, TData >( queryKeyFn({ path: '/app/installations', operationId: 'appsListInstallations', variables, }), ({ signal }) => fetchAppsListInstallations({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsDeleteInstallationPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsDeleteInstallationError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type AppsDeleteInstallationVariables = { pathParams: AppsDeleteInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/reference/apps/#suspend-an-app-installation)" endpoint. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsDeleteInstallation = ( variables: AppsDeleteInstallationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsDeleteInstallationError, undefined, {}, {}, AppsDeleteInstallationPathParams >({ url: '/app/installations/{installationId}', method: 'delete', ...variables, signal, }); /** * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/reference/apps/#suspend-an-app-installation)" endpoint. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsDeleteInstallation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsDeleteInstallationError, AppsDeleteInstallationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsDeleteInstallationError, AppsDeleteInstallationVariables >( (variables: AppsDeleteInstallationVariables) => fetchAppsDeleteInstallation({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetInstallationPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsGetInstallationError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type AppsGetInstallationVariables = { pathParams: AppsGetInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (`target_type`) will be either an organization or a user account, depending which account the repository belongs to. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetInstallation = ( variables: AppsGetInstallationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Installation, AppsGetInstallationError, undefined, {}, {}, AppsGetInstallationPathParams >({ url: '/app/installations/{installationId}', method: 'get', ...variables, signal, }); /** * Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (`target_type`) will be either an organization or a user account, depending which account the repository belongs to. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetInstallation = ( variables: AppsGetInstallationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Installation, AppsGetInstallationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Installation, AppsGetInstallationError, TData >( queryKeyFn({ path: '/app/installations/{installation_id}', operationId: 'appsGetInstallation', variables, }), ({ signal }) => fetchAppsGetInstallation({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsCreateInstallationAccessTokenPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsCreateInstallationAccessTokenError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type AppsCreateInstallationAccessTokenRequestBody = { permissions?: Schemas.AppPermissions; /** * List of repository names that the token should have access to */ repositories?: string[]; /** * List of repository IDs that the token should have access to * * @example 1 */ repository_ids?: number[]; }; export type AppsCreateInstallationAccessTokenVariables = { body?: AppsCreateInstallationAccessTokenRequestBody; pathParams: AppsCreateInstallationAccessTokenPathParams; } & GithubContext['fetcherOptions']; /** * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsCreateInstallationAccessToken = ( variables: AppsCreateInstallationAccessTokenVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InstallationToken, AppsCreateInstallationAccessTokenError, AppsCreateInstallationAccessTokenRequestBody, {}, {}, AppsCreateInstallationAccessTokenPathParams >({ url: '/app/installations/{installationId}/access_tokens', method: 'post', ...variables, signal, }); /** * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsCreateInstallationAccessToken = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.InstallationToken, AppsCreateInstallationAccessTokenError, AppsCreateInstallationAccessTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.InstallationToken, AppsCreateInstallationAccessTokenError, AppsCreateInstallationAccessTokenVariables >( (variables: AppsCreateInstallationAccessTokenVariables) => fetchAppsCreateInstallationAccessToken({ ...fetcherOptions, ...variables, }), options, ); }; export type AppsUnsuspendInstallationPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsUnsuspendInstallationError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type AppsUnsuspendInstallationVariables = { pathParams: AppsUnsuspendInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Removes a GitHub App installation suspension. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsUnsuspendInstallation = ( variables: AppsUnsuspendInstallationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsUnsuspendInstallationError, undefined, {}, {}, AppsUnsuspendInstallationPathParams >({ url: '/app/installations/{installationId}/suspended', method: 'delete', ...variables, signal, }); /** * Removes a GitHub App installation suspension. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsUnsuspendInstallation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsUnsuspendInstallationError, AppsUnsuspendInstallationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsUnsuspendInstallationError, AppsUnsuspendInstallationVariables >( (variables: AppsUnsuspendInstallationVariables) => fetchAppsUnsuspendInstallation({ ...fetcherOptions, ...variables }), options, ); }; export type AppsSuspendInstallationPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsSuspendInstallationError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type AppsSuspendInstallationVariables = { pathParams: AppsSuspendInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsSuspendInstallation = ( variables: AppsSuspendInstallationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsSuspendInstallationError, undefined, {}, {}, AppsSuspendInstallationPathParams >({ url: '/app/installations/{installationId}/suspended', method: 'put', ...variables, signal, }); /** * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsSuspendInstallation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsSuspendInstallationError, AppsSuspendInstallationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsSuspendInstallationError, AppsSuspendInstallationVariables >( (variables: AppsSuspendInstallationVariables) => fetchAppsSuspendInstallation({ ...fetcherOptions, ...variables }), options, ); }; export type OauthAuthorizationsListGrantsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * The client ID of your GitHub app. */ client_id?: string; }; export type OauthAuthorizationsListGrantsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type OauthAuthorizationsListGrantsResponse = Schemas.ApplicationGrant[]; export type OauthAuthorizationsListGrantsVariables = { queryParams?: OauthAuthorizationsListGrantsQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. */ export const fetchOauthAuthorizationsListGrants = ( variables: OauthAuthorizationsListGrantsVariables, signal?: AbortSignal, ) => githubFetch< OauthAuthorizationsListGrantsResponse, OauthAuthorizationsListGrantsError, undefined, {}, OauthAuthorizationsListGrantsQueryParams, {} >({ url: '/applications/grants', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. */ export const useOauthAuthorizationsListGrants = < TData = OauthAuthorizationsListGrantsResponse, >( variables: OauthAuthorizationsListGrantsVariables, options?: Omit< reactQuery.UseQueryOptions< OauthAuthorizationsListGrantsResponse, OauthAuthorizationsListGrantsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OauthAuthorizationsListGrantsResponse, OauthAuthorizationsListGrantsError, TData >( queryKeyFn({ path: '/applications/grants', operationId: 'oauthAuthorizationsListGrants', variables, }), ({ signal }) => fetchOauthAuthorizationsListGrants( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OauthAuthorizationsDeleteGrantPathParams = { /** * grant_id parameter */ grantId: number; }; export type OauthAuthorizationsDeleteGrantError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type OauthAuthorizationsDeleteGrantVariables = { pathParams: OauthAuthorizationsDeleteGrantPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). */ export const fetchOauthAuthorizationsDeleteGrant = ( variables: OauthAuthorizationsDeleteGrantVariables, signal?: AbortSignal, ) => githubFetch< undefined, OauthAuthorizationsDeleteGrantError, undefined, {}, {}, OauthAuthorizationsDeleteGrantPathParams >({ url: '/applications/grants/{grantId}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). */ export const useOauthAuthorizationsDeleteGrant = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OauthAuthorizationsDeleteGrantError, OauthAuthorizationsDeleteGrantVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OauthAuthorizationsDeleteGrantError, OauthAuthorizationsDeleteGrantVariables >( (variables: OauthAuthorizationsDeleteGrantVariables) => fetchOauthAuthorizationsDeleteGrant({ ...fetcherOptions, ...variables }), options, ); }; export type OauthAuthorizationsGetGrantPathParams = { /** * grant_id parameter */ grantId: number; }; export type OauthAuthorizationsGetGrantError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type OauthAuthorizationsGetGrantVariables = { pathParams: OauthAuthorizationsGetGrantPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const fetchOauthAuthorizationsGetGrant = ( variables: OauthAuthorizationsGetGrantVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ApplicationGrant, OauthAuthorizationsGetGrantError, undefined, {}, {}, OauthAuthorizationsGetGrantPathParams >({ url: '/applications/grants/{grantId}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const useOauthAuthorizationsGetGrant = < TData = Schemas.ApplicationGrant, >( variables: OauthAuthorizationsGetGrantVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ApplicationGrant, OauthAuthorizationsGetGrantError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ApplicationGrant, OauthAuthorizationsGetGrantError, TData >( queryKeyFn({ path: '/applications/grants/{grant_id}', operationId: 'oauthAuthorizationsGetGrant', variables, }), ({ signal }) => fetchOauthAuthorizationsGetGrant( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsDeleteAuthorizationPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type AppsDeleteAuthorizationError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type AppsDeleteAuthorizationRequestBody = { /** * The OAuth access token used to authenticate to the GitHub API. */ access_token?: string; }; export type AppsDeleteAuthorizationVariables = { body?: AppsDeleteAuthorizationRequestBody; pathParams: AppsDeleteAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). */ export const fetchAppsDeleteAuthorization = ( variables: AppsDeleteAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsDeleteAuthorizationError, AppsDeleteAuthorizationRequestBody, {}, {}, AppsDeleteAuthorizationPathParams >({ url: '/applications/{clientId}/grant', method: 'delete', ...variables, signal, }); /** * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). */ export const useAppsDeleteAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsDeleteAuthorizationError, AppsDeleteAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsDeleteAuthorizationError, AppsDeleteAuthorizationVariables >( (variables: AppsDeleteAuthorizationVariables) => fetchAppsDeleteAuthorization({ ...fetcherOptions, ...variables }), options, ); }; export type AppsRevokeGrantForApplicationPathParams = { /** * The client ID of your GitHub app. */ clientId: string; accessToken: string; }; export type AppsRevokeGrantForApplicationError = Fetcher.ErrorWrapper; export type AppsRevokeGrantForApplicationVariables = { pathParams: AppsRevokeGrantForApplicationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted. * * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). */ export const fetchAppsRevokeGrantForApplication = ( variables: AppsRevokeGrantForApplicationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsRevokeGrantForApplicationError, undefined, {}, {}, AppsRevokeGrantForApplicationPathParams >({ url: '/applications/{clientId}/grants/{accessToken}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted. * * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). */ export const useAppsRevokeGrantForApplication = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsRevokeGrantForApplicationError, AppsRevokeGrantForApplicationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsRevokeGrantForApplicationError, AppsRevokeGrantForApplicationVariables >( (variables: AppsRevokeGrantForApplicationVariables) => fetchAppsRevokeGrantForApplication({ ...fetcherOptions, ...variables }), options, ); }; export type AppsDeleteTokenPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type AppsDeleteTokenError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type AppsDeleteTokenRequestBody = { /** * The OAuth access token used to authenticate to the GitHub API. */ access_token: string; }; export type AppsDeleteTokenVariables = { body: AppsDeleteTokenRequestBody; pathParams: AppsDeleteTokenPathParams; } & GithubContext['fetcherOptions']; /** * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ export const fetchAppsDeleteToken = ( variables: AppsDeleteTokenVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsDeleteTokenError, AppsDeleteTokenRequestBody, {}, {}, AppsDeleteTokenPathParams >({ url: '/applications/{clientId}/token', method: 'delete', ...variables, signal, }); /** * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ export const useAppsDeleteToken = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsDeleteTokenError, AppsDeleteTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsDeleteTokenError, AppsDeleteTokenVariables >( (variables: AppsDeleteTokenVariables) => fetchAppsDeleteToken({ ...fetcherOptions, ...variables }), options, ); }; export type AppsResetTokenPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type AppsResetTokenError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type AppsResetTokenRequestBody = { /** * The access_token of the OAuth application. */ access_token: string; }; export type AppsResetTokenVariables = { body: AppsResetTokenRequestBody; pathParams: AppsResetTokenPathParams; } & GithubContext['fetcherOptions']; /** * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const fetchAppsResetToken = ( variables: AppsResetTokenVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, AppsResetTokenError, AppsResetTokenRequestBody, {}, {}, AppsResetTokenPathParams >({ url: '/applications/{clientId}/token', method: 'patch', ...variables, signal, }); /** * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const useAppsResetToken = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, AppsResetTokenError, AppsResetTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, AppsResetTokenError, AppsResetTokenVariables >( (variables: AppsResetTokenVariables) => fetchAppsResetToken({ ...fetcherOptions, ...variables }), options, ); }; export type AppsCheckTokenPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type AppsCheckTokenError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type AppsCheckTokenRequestBody = { /** * The access_token of the OAuth application. */ access_token: string; }; export type AppsCheckTokenVariables = { body: AppsCheckTokenRequestBody; pathParams: AppsCheckTokenPathParams; } & GithubContext['fetcherOptions']; /** * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. */ export const fetchAppsCheckToken = ( variables: AppsCheckTokenVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, AppsCheckTokenError, AppsCheckTokenRequestBody, {}, {}, AppsCheckTokenPathParams >({ url: '/applications/{clientId}/token', method: 'post', ...variables, signal, }); /** * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. */ export const useAppsCheckToken = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, AppsCheckTokenError, AppsCheckTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, AppsCheckTokenError, AppsCheckTokenVariables >( (variables: AppsCheckTokenVariables) => fetchAppsCheckToken({ ...fetcherOptions, ...variables }), options, ); }; export type AppsScopeTokenPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type AppsScopeTokenError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type AppsScopeTokenRequestBody = { /** * **Required.** The OAuth access token used to authenticate to the GitHub API. * * @example e72e16c7e42f292c6912e7710c838347ae178b4a */ access_token: string; permissions?: Schemas.AppPermissions; /** * The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified. */ repositories?: string[]; /** * The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified. * * @example 1 */ repository_ids?: number[]; /** * The name of the user or organization to scope the user-to-server access token to. **Required** unless `target_id` is specified. * * @example octocat */ target?: string; /** * The ID of the user or organization to scope the user-to-server access token to. **Required** unless `target` is specified. * * @example 1 */ target_id?: number; }; export type AppsScopeTokenVariables = { body: AppsScopeTokenRequestBody; pathParams: AppsScopeTokenPathParams; } & GithubContext['fetcherOptions']; /** * Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const fetchAppsScopeToken = ( variables: AppsScopeTokenVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, AppsScopeTokenError, AppsScopeTokenRequestBody, {}, {}, AppsScopeTokenPathParams >({ url: '/applications/{clientId}/token/scoped', method: 'post', ...variables, signal, }); /** * Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const useAppsScopeToken = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, AppsScopeTokenError, AppsScopeTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, AppsScopeTokenError, AppsScopeTokenVariables >( (variables: AppsScopeTokenVariables) => fetchAppsScopeToken({ ...fetcherOptions, ...variables }), options, ); }; export type AppsRevokeAuthorizationForApplicationPathParams = { /** * The client ID of your GitHub app. */ clientId: string; accessToken: string; }; export type AppsRevokeAuthorizationForApplicationError = Fetcher.ErrorWrapper; export type AppsRevokeAuthorizationForApplicationVariables = { pathParams: AppsRevokeAuthorizationForApplicationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ export const fetchAppsRevokeAuthorizationForApplication = ( variables: AppsRevokeAuthorizationForApplicationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsRevokeAuthorizationForApplicationError, undefined, {}, {}, AppsRevokeAuthorizationForApplicationPathParams >({ url: '/applications/{clientId}/tokens/{accessToken}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ export const useAppsRevokeAuthorizationForApplication = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsRevokeAuthorizationForApplicationError, AppsRevokeAuthorizationForApplicationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsRevokeAuthorizationForApplicationError, AppsRevokeAuthorizationForApplicationVariables >( (variables: AppsRevokeAuthorizationForApplicationVariables) => fetchAppsRevokeAuthorizationForApplication({ ...fetcherOptions, ...variables, }), options, ); }; export type AppsCheckAuthorizationPathParams = { /** * The client ID of your GitHub app. */ clientId: string; accessToken: string; }; export type AppsCheckAuthorizationError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type AppsCheckAuthorizationResponse = Schemas.Authorization; export type AppsCheckAuthorizationVariables = { pathParams: AppsCheckAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const fetchAppsCheckAuthorization = ( variables: AppsCheckAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< AppsCheckAuthorizationResponse, AppsCheckAuthorizationError, undefined, {}, {}, AppsCheckAuthorizationPathParams >({ url: '/applications/{clientId}/tokens/{accessToken}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const useAppsCheckAuthorization = < TData = AppsCheckAuthorizationResponse, >( variables: AppsCheckAuthorizationVariables, options?: Omit< reactQuery.UseQueryOptions< AppsCheckAuthorizationResponse, AppsCheckAuthorizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsCheckAuthorizationResponse, AppsCheckAuthorizationError, TData >( queryKeyFn({ path: '/applications/{client_id}/tokens/{access_token}', operationId: 'appsCheckAuthorization', variables, }), ({ signal }) => fetchAppsCheckAuthorization({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsResetAuthorizationPathParams = { /** * The client ID of your GitHub app. */ clientId: string; accessToken: string; }; export type AppsResetAuthorizationError = Fetcher.ErrorWrapper; export type AppsResetAuthorizationVariables = { pathParams: AppsResetAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const fetchAppsResetAuthorization = ( variables: AppsResetAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, AppsResetAuthorizationError, undefined, {}, {}, AppsResetAuthorizationPathParams >({ url: '/applications/{clientId}/tokens/{accessToken}', method: 'post', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ export const useAppsResetAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, AppsResetAuthorizationError, AppsResetAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, AppsResetAuthorizationError, AppsResetAuthorizationVariables >( (variables: AppsResetAuthorizationVariables) => fetchAppsResetAuthorization({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetBySlugPathParams = { appSlug: string; }; export type AppsGetBySlugError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type AppsGetBySlugVariables = { pathParams: AppsGetBySlugPathParams; } & GithubContext['fetcherOptions']; /** * **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). * * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const fetchAppsGetBySlug = ( variables: AppsGetBySlugVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Integration, AppsGetBySlugError, undefined, {}, {}, AppsGetBySlugPathParams >({ url: '/apps/{appSlug}', method: 'get', ...variables, signal }); /** * **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). * * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const useAppsGetBySlug = ( variables: AppsGetBySlugVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/apps/{app_slug}', operationId: 'appsGetBySlug', variables, }), ({ signal }) => fetchAppsGetBySlug({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OauthAuthorizationsListAuthorizationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * The client ID of your GitHub app. */ client_id?: string; }; export type OauthAuthorizationsListAuthorizationsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type OauthAuthorizationsListAuthorizationsResponse = Schemas.Authorization[]; export type OauthAuthorizationsListAuthorizationsVariables = { queryParams?: OauthAuthorizationsListAuthorizationsQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const fetchOauthAuthorizationsListAuthorizations = ( variables: OauthAuthorizationsListAuthorizationsVariables, signal?: AbortSignal, ) => githubFetch< OauthAuthorizationsListAuthorizationsResponse, OauthAuthorizationsListAuthorizationsError, undefined, {}, OauthAuthorizationsListAuthorizationsQueryParams, {} >({ url: '/authorizations', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const useOauthAuthorizationsListAuthorizations = < TData = OauthAuthorizationsListAuthorizationsResponse, >( variables: OauthAuthorizationsListAuthorizationsVariables, options?: Omit< reactQuery.UseQueryOptions< OauthAuthorizationsListAuthorizationsResponse, OauthAuthorizationsListAuthorizationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OauthAuthorizationsListAuthorizationsResponse, OauthAuthorizationsListAuthorizationsError, TData >( queryKeyFn({ path: '/authorizations', operationId: 'oauthAuthorizationsListAuthorizations', variables, }), ({ signal }) => fetchOauthAuthorizationsListAuthorizations( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OauthAuthorizationsCreateAuthorizationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OauthAuthorizationsCreateAuthorizationRequestBody = { /** * The OAuth app client key for which to create the token. * * @maxLength 20 */ client_id?: string; /** * The OAuth app client secret for which to create the token. * * @maxLength 40 */ client_secret?: string; /** * A unique string to distinguish an authorization from others created for the same client ID and user. */ fingerprint?: string; /** * A note to remind you what the OAuth token is for. * * @example Update all gems */ note?: string; /** * A URL to remind you what app the OAuth token is for. */ note_url?: string; /** * A list of scopes that this authorization is in. * * @example public_repo * @example user */ scopes?: string[] | null; }; export type OauthAuthorizationsCreateAuthorizationVariables = { body?: OauthAuthorizationsCreateAuthorizationRequestBody; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them. * * You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). * * Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). */ export const fetchOauthAuthorizationsCreateAuthorization = ( variables: OauthAuthorizationsCreateAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, OauthAuthorizationsCreateAuthorizationError, OauthAuthorizationsCreateAuthorizationRequestBody, {}, {}, {} >({ url: '/authorizations', method: 'post', ...variables, signal }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them. * * You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). * * Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). */ export const useOauthAuthorizationsCreateAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, OauthAuthorizationsCreateAuthorizationError, OauthAuthorizationsCreateAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, OauthAuthorizationsCreateAuthorizationError, OauthAuthorizationsCreateAuthorizationVariables >( (variables: OauthAuthorizationsCreateAuthorizationVariables) => fetchOauthAuthorizationsCreateAuthorization({ ...fetcherOptions, ...variables, }), options, ); }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppPathParams = { /** * The client ID of your GitHub app. */ clientId: string; }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OauthAuthorizationsGetOrCreateAuthorizationForAppRequestBody = { /** * The OAuth app client secret for which to create the token. * * @maxLength 40 */ client_secret: string; /** * A unique string to distinguish an authorization from others created for the same client ID and user. */ fingerprint?: string; /** * A note to remind you what the OAuth token is for. * * @example Update all gems */ note?: string; /** * A URL to remind you what app the OAuth token is for. */ note_url?: string; /** * A list of scopes that this authorization is in. * * @example public_repo * @example user */ scopes?: string[] | null; }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppVariables = { body: OauthAuthorizationsGetOrCreateAuthorizationForAppRequestBody; pathParams: OauthAuthorizationsGetOrCreateAuthorizationForAppPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const fetchOauthAuthorizationsGetOrCreateAuthorizationForApp = ( variables: OauthAuthorizationsGetOrCreateAuthorizationForAppVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError, OauthAuthorizationsGetOrCreateAuthorizationForAppRequestBody, {}, {}, OauthAuthorizationsGetOrCreateAuthorizationForAppPathParams >({ url: '/authorizations/clients/{clientId}', method: 'put', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const useOauthAuthorizationsGetOrCreateAuthorizationForApp = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError, OauthAuthorizationsGetOrCreateAuthorizationForAppVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError, OauthAuthorizationsGetOrCreateAuthorizationForAppVariables >( (variables: OauthAuthorizationsGetOrCreateAuthorizationForAppVariables) => fetchOauthAuthorizationsGetOrCreateAuthorizationForApp({ ...fetcherOptions, ...variables, }), options, ); }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPathParams = { /** * The client ID of your GitHub app. */ clientId: string; fingerprint: string; }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRequestBody = { /** * The OAuth app client secret for which to create the token. * * @maxLength 40 */ client_secret: string; /** * A note to remind you what the OAuth token is for. * * @example Update all gems */ note?: string; /** * A URL to remind you what app the OAuth token is for. */ note_url?: string; /** * A list of scopes that this authorization is in. * * @example public_repo * @example user */ scopes?: string[] | null; }; export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintVariables = { body: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRequestBody; pathParams: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." */ export const fetchOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint = ( variables: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRequestBody, {}, {}, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPathParams >({ url: '/authorizations/clients/{clientId}/{fingerprint}', method: 'put', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). * * This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." */ export const useOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintVariables >( ( variables: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintVariables, ) => fetchOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint({ ...fetcherOptions, ...variables, }), options, ); }; export type OauthAuthorizationsDeleteAuthorizationPathParams = { /** * authorization_id parameter */ authorizationId: number; }; export type OauthAuthorizationsDeleteAuthorizationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type OauthAuthorizationsDeleteAuthorizationVariables = { pathParams: OauthAuthorizationsDeleteAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const fetchOauthAuthorizationsDeleteAuthorization = ( variables: OauthAuthorizationsDeleteAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, OauthAuthorizationsDeleteAuthorizationError, undefined, {}, {}, OauthAuthorizationsDeleteAuthorizationPathParams >({ url: '/authorizations/{authorizationId}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const useOauthAuthorizationsDeleteAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OauthAuthorizationsDeleteAuthorizationError, OauthAuthorizationsDeleteAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OauthAuthorizationsDeleteAuthorizationError, OauthAuthorizationsDeleteAuthorizationVariables >( (variables: OauthAuthorizationsDeleteAuthorizationVariables) => fetchOauthAuthorizationsDeleteAuthorization({ ...fetcherOptions, ...variables, }), options, ); }; export type OauthAuthorizationsGetAuthorizationPathParams = { /** * authorization_id parameter */ authorizationId: number; }; export type OauthAuthorizationsGetAuthorizationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type OauthAuthorizationsGetAuthorizationVariables = { pathParams: OauthAuthorizationsGetAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const fetchOauthAuthorizationsGetAuthorization = ( variables: OauthAuthorizationsGetAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, OauthAuthorizationsGetAuthorizationError, undefined, {}, {}, OauthAuthorizationsGetAuthorizationPathParams >({ url: '/authorizations/{authorizationId}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ export const useOauthAuthorizationsGetAuthorization = < TData = Schemas.Authorization, >( variables: OauthAuthorizationsGetAuthorizationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Authorization, OauthAuthorizationsGetAuthorizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Authorization, OauthAuthorizationsGetAuthorizationError, TData >( queryKeyFn({ path: '/authorizations/{authorization_id}', operationId: 'oauthAuthorizationsGetAuthorization', variables, }), ({ signal }) => fetchOauthAuthorizationsGetAuthorization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OauthAuthorizationsUpdateAuthorizationPathParams = { /** * authorization_id parameter */ authorizationId: number; }; export type OauthAuthorizationsUpdateAuthorizationError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type OauthAuthorizationsUpdateAuthorizationRequestBody = { /** * A list of scopes to add to this authorization. */ add_scopes?: string[]; /** * A unique string to distinguish an authorization from others created for the same client ID and user. */ fingerprint?: string; /** * A note to remind you what the OAuth token is for. * * @example Update all gems */ note?: string; /** * A URL to remind you what app the OAuth token is for. */ note_url?: string; /** * A list of scopes to remove from this authorization. */ remove_scopes?: string[]; /** * A list of scopes that this authorization is in. * * @example public_repo * @example user */ scopes?: string[] | null; }; export type OauthAuthorizationsUpdateAuthorizationVariables = { body?: OauthAuthorizationsUpdateAuthorizationRequestBody; pathParams: OauthAuthorizationsUpdateAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * You can only send one of these scope keys at a time. */ export const fetchOauthAuthorizationsUpdateAuthorization = ( variables: OauthAuthorizationsUpdateAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Authorization, OauthAuthorizationsUpdateAuthorizationError, OauthAuthorizationsUpdateAuthorizationRequestBody, {}, {}, OauthAuthorizationsUpdateAuthorizationPathParams >({ url: '/authorizations/{authorizationId}', method: 'patch', ...variables, signal, }); /** * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * * You can only send one of these scope keys at a time. */ export const useOauthAuthorizationsUpdateAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Authorization, OauthAuthorizationsUpdateAuthorizationError, OauthAuthorizationsUpdateAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Authorization, OauthAuthorizationsUpdateAuthorizationError, OauthAuthorizationsUpdateAuthorizationVariables >( (variables: OauthAuthorizationsUpdateAuthorizationVariables) => fetchOauthAuthorizationsUpdateAuthorization({ ...fetcherOptions, ...variables, }), options, ); }; export type CodesOfConductGetAllCodesOfConductError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type CodesOfConductGetAllCodesOfConductResponse = Schemas.CodeOfConduct[]; export type CodesOfConductGetAllCodesOfConductVariables = GithubContext['fetcherOptions']; export const fetchCodesOfConductGetAllCodesOfConduct = ( variables: CodesOfConductGetAllCodesOfConductVariables, signal?: AbortSignal, ) => githubFetch< CodesOfConductGetAllCodesOfConductResponse, CodesOfConductGetAllCodesOfConductError, undefined, {}, {}, {} >({ url: '/codes_of_conduct', method: 'get', ...variables, signal }); export const useCodesOfConductGetAllCodesOfConduct = < TData = CodesOfConductGetAllCodesOfConductResponse, >( variables: CodesOfConductGetAllCodesOfConductVariables, options?: Omit< reactQuery.UseQueryOptions< CodesOfConductGetAllCodesOfConductResponse, CodesOfConductGetAllCodesOfConductError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< CodesOfConductGetAllCodesOfConductResponse, CodesOfConductGetAllCodesOfConductError, TData >( queryKeyFn({ path: '/codes_of_conduct', operationId: 'codesOfConductGetAllCodesOfConduct', variables, }), ({ signal }) => fetchCodesOfConductGetAllCodesOfConduct( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type CodesOfConductGetConductCodePathParams = { key: string; }; export type CodesOfConductGetConductCodeError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type CodesOfConductGetConductCodeVariables = { pathParams: CodesOfConductGetConductCodePathParams; } & GithubContext['fetcherOptions']; export const fetchCodesOfConductGetConductCode = ( variables: CodesOfConductGetConductCodeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeOfConduct, CodesOfConductGetConductCodeError, undefined, {}, {}, CodesOfConductGetConductCodePathParams >({ url: '/codes_of_conduct/{key}', method: 'get', ...variables, signal }); export const useCodesOfConductGetConductCode = ( variables: CodesOfConductGetConductCodeVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CodeOfConduct, CodesOfConductGetConductCodeError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CodeOfConduct, CodesOfConductGetConductCodeError, TData >( queryKeyFn({ path: '/codes_of_conduct/{key}', operationId: 'codesOfConductGetConductCode', variables, }), ({ signal }) => fetchCodesOfConductGetConductCode( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsCreateContentAttachmentPathParams = { contentReferenceId: number; }; export type AppsCreateContentAttachmentError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type AppsCreateContentAttachmentRequestBody = { /** * The body of the attachment * * @example Body of the attachment * @maxLength 262144 */ body: string; /** * The title of the attachment * * @example Title of the attachment * @maxLength 1024 */ title: string; }; export type AppsCreateContentAttachmentVariables = { body: AppsCreateContentAttachmentRequestBody; pathParams: AppsCreateContentAttachmentPathParams; } & GithubContext['fetcherOptions']; /** * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. * * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const fetchAppsCreateContentAttachment = ( variables: AppsCreateContentAttachmentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ContentReferenceAttachment, AppsCreateContentAttachmentError, AppsCreateContentAttachmentRequestBody, {}, {}, AppsCreateContentAttachmentPathParams >({ url: '/content_references/{contentReferenceId}/attachments', method: 'post', ...variables, signal, }); /** * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. * * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const useAppsCreateContentAttachment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ContentReferenceAttachment, AppsCreateContentAttachmentError, AppsCreateContentAttachmentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ContentReferenceAttachment, AppsCreateContentAttachmentError, AppsCreateContentAttachmentVariables >( (variables: AppsCreateContentAttachmentVariables) => fetchAppsCreateContentAttachment({ ...fetcherOptions, ...variables }), options, ); }; export type EmojisGetError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type EmojisGetResponse = { [key: string]: string; }; export type EmojisGetVariables = GithubContext['fetcherOptions']; /** * Lists all the emojis available to use on GitHub. */ export const fetchEmojisGet = ( variables: EmojisGetVariables, signal?: AbortSignal, ) => githubFetch({ url: '/emojis', method: 'get', ...variables, signal, }); /** * Lists all the emojis available to use on GitHub. */ export const useEmojisGet = ( variables: EmojisGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/emojis', operationId: 'emojisGet', variables }), ({ signal }) => fetchEmojisGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminGetGithubActionsPermissionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseVariables = { pathParams: EnterpriseAdminGetGithubActionsPermissionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminGetGithubActionsPermissionsEnterprise = ( variables: EnterpriseAdminGetGithubActionsPermissionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsEnterprisePermissions, EnterpriseAdminGetGithubActionsPermissionsEnterpriseError, undefined, {}, {}, EnterpriseAdminGetGithubActionsPermissionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions', method: 'get', ...variables, signal, }); /** * Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminGetGithubActionsPermissionsEnterprise = < TData = Schemas.ActionsEnterprisePermissions, >( variables: EnterpriseAdminGetGithubActionsPermissionsEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsEnterprisePermissions, EnterpriseAdminGetGithubActionsPermissionsEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsEnterprisePermissions, EnterpriseAdminGetGithubActionsPermissionsEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/permissions', operationId: 'enterpriseAdminGetGithubActionsPermissionsEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminGetGithubActionsPermissionsEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminSetGithubActionsPermissionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminSetGithubActionsPermissionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetGithubActionsPermissionsEnterpriseRequestBody = { allowed_actions?: Schemas.AllowedActions; enabled_organizations: Schemas.EnabledOrganizations; }; export type EnterpriseAdminSetGithubActionsPermissionsEnterpriseVariables = { body: EnterpriseAdminSetGithubActionsPermissionsEnterpriseRequestBody; pathParams: EnterpriseAdminSetGithubActionsPermissionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminSetGithubActionsPermissionsEnterprise = ( variables: EnterpriseAdminSetGithubActionsPermissionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminSetGithubActionsPermissionsEnterpriseError, EnterpriseAdminSetGithubActionsPermissionsEnterpriseRequestBody, {}, {}, EnterpriseAdminSetGithubActionsPermissionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions', method: 'put', ...variables, signal, }); /** * Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminSetGithubActionsPermissionsEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminSetGithubActionsPermissionsEnterpriseError, EnterpriseAdminSetGithubActionsPermissionsEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminSetGithubActionsPermissionsEnterpriseError, EnterpriseAdminSetGithubActionsPermissionsEnterpriseVariables >( ( variables: EnterpriseAdminSetGithubActionsPermissionsEnterpriseVariables, ) => fetchEnterpriseAdminSetGithubActionsPermissionsEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseResponse = { organizations: Schemas.OrganizationSimple[]; total_count: number; }; export type EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseVariables = { pathParams: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprisePathParams; queryParams?: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise = ( variables: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseResponse, EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseError, undefined, {}, EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseQueryParams, EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/organizations', method: 'get', ...variables, signal, }); /** * Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise = < TData = EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseResponse, >( variables: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseResponse, EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseResponse, EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/permissions/organizations', operationId: 'enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseRequestBody = { /** * List of organization IDs to enable for GitHub Actions. */ selected_organization_ids: number[]; }; export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseVariables = { body: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseRequestBody; pathParams: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise = ( variables: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseError, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseRequestBody, {}, {}, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/organizations', method: 'put', ...variables, signal, }); /** * Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseError, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseError, EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseVariables >( ( variables: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseVariables, ) => fetchEnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise( { ...fetcherOptions, ...variables }, ), options, ); }; export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of an organization. */ orgId: number; }; export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseVariables = { pathParams: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise = ( variables: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseError, undefined, {}, {}, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/organizations/{orgId}', method: 'delete', ...variables, signal, }); /** * Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseError, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseError, EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseVariables >( ( variables: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseVariables, ) => fetchEnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of an organization. */ orgId: number; }; export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseVariables = { pathParams: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise = ( variables: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseError, undefined, {}, {}, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/organizations/{orgId}', method: 'put', ...variables, signal, }); /** * Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseError, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseError, EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseVariables >( ( variables: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseVariables, ) => fetchEnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminGetAllowedActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminGetAllowedActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetAllowedActionsEnterpriseVariables = { pathParams: EnterpriseAdminGetAllowedActionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminGetAllowedActionsEnterprise = ( variables: EnterpriseAdminGetAllowedActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.SelectedActions, EnterpriseAdminGetAllowedActionsEnterpriseError, undefined, {}, {}, EnterpriseAdminGetAllowedActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/selected-actions', method: 'get', ...variables, signal, }); /** * Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminGetAllowedActionsEnterprise = < TData = Schemas.SelectedActions, >( variables: EnterpriseAdminGetAllowedActionsEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.SelectedActions, EnterpriseAdminGetAllowedActionsEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.SelectedActions, EnterpriseAdminGetAllowedActionsEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/permissions/selected-actions', operationId: 'enterpriseAdminGetAllowedActionsEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminGetAllowedActionsEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminSetAllowedActionsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminSetAllowedActionsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetAllowedActionsEnterpriseVariables = { body: Schemas.SelectedActions; pathParams: EnterpriseAdminSetAllowedActionsEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminSetAllowedActionsEnterprise = ( variables: EnterpriseAdminSetAllowedActionsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminSetAllowedActionsEnterpriseError, Schemas.SelectedActions, {}, {}, EnterpriseAdminSetAllowedActionsEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/permissions/selected-actions', method: 'put', ...variables, signal, }); /** * Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminSetAllowedActionsEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminSetAllowedActionsEnterpriseError, EnterpriseAdminSetAllowedActionsEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminSetAllowedActionsEnterpriseError, EnterpriseAdminSetAllowedActionsEnterpriseVariables >( (variables: EnterpriseAdminSetAllowedActionsEnterpriseVariables) => fetchEnterpriseAdminSetAllowedActionsEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse = { runner_groups: Schemas.RunnerGroupsEnterprise[]; total_count: number; }; export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseVariables = { pathParams: EnterpriseAdminListSelfHostedRunnerGroupsForEnterprisePathParams; queryParams?: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all self-hosted runner groups for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListSelfHostedRunnerGroupsForEnterprise = ( variables: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseError, undefined, {}, EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseQueryParams, EnterpriseAdminListSelfHostedRunnerGroupsForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups', method: 'get', ...variables, signal, }); /** * Lists all self-hosted runner groups for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListSelfHostedRunnerGroupsForEnterprise = < TData = EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse, >( variables: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runner-groups', operationId: 'enterpriseAdminListSelfHostedRunnerGroupsForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListSelfHostedRunnerGroupsForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseRequestBody = { /** * Name of the runner group. */ name: string; /** * List of runner IDs to add to the runner group. */ runners?: number[]; /** * List of organization IDs that can access the runner group. */ selected_organization_ids?: number[]; /** * Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: `all` or `selected` */ visibility?: 'selected' | 'all'; }; export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVariables = { body: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseRequestBody; pathParams: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Creates a new self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise = ( variables: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsEnterprise, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseRequestBody, {}, {}, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups', method: 'post', ...variables, signal, }); /** * Creates a new self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RunnerGroupsEnterprise, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RunnerGroupsEnterprise, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVariables >( ( variables: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVariables, ) => fetchEnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseVariables = { pathParams: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Deletes a self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise = ( variables: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseError, undefined, {}, {}, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}', method: 'delete', ...variables, signal, }); /** * Deletes a self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseError, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseError, EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseVariables >( ( variables: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseVariables, ) => fetchEnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseVariables = { pathParams: EnterpriseAdminGetSelfHostedRunnerGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminGetSelfHostedRunnerGroupForEnterprise = ( variables: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsEnterprise, EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseError, undefined, {}, {}, EnterpriseAdminGetSelfHostedRunnerGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}', method: 'get', ...variables, signal, }); /** * Gets a specific self-hosted runner group for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminGetSelfHostedRunnerGroupForEnterprise = < TData = Schemas.RunnerGroupsEnterprise, >( variables: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RunnerGroupsEnterprise, EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RunnerGroupsEnterprise, EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', operationId: 'enterpriseAdminGetSelfHostedRunnerGroupForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminGetSelfHostedRunnerGroupForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseRequestBody = { /** * Name of the runner group. */ name?: string; /** * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: `all` or `selected` * * @default all */ visibility?: 'selected' | 'all'; }; export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVariables = { body?: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseRequestBody; pathParams: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Updates the `name` and `visibility` of a self-hosted runner group in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise = ( variables: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsEnterprise, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseRequestBody, {}, {}, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}', method: 'patch', ...variables, signal, }); /** * Updates the `name` and `visibility` of a self-hosted runner group in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RunnerGroupsEnterprise, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RunnerGroupsEnterprise, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseError, EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVariables >( ( variables: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVariables, ) => fetchEnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponse = { organizations: Schemas.OrganizationSimple[]; total_count: number; }; export type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables = { pathParams: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams; queryParams?: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the organizations with access to a self-hosted runner group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise = ( variables: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponse, EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseError, undefined, {}, EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseQueryParams, EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/organizations', method: 'get', ...variables, signal, }); /** * Lists the organizations with access to a self-hosted runner group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise = < TData = EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponse, >( variables: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponse, EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponse, EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations', operationId: 'enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestBody = { /** * List of organization IDs that can access the runner group. */ selected_organization_ids: number[]; }; export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables = { body: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestBody; pathParams: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise = ( variables: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestBody, {}, {}, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/organizations', method: 'put', ...variables, signal, }); /** * Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >( ( variables: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, ) => fetchEnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of an organization. */ orgId: number; }; export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables = { pathParams: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise = ( variables: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseError, undefined, {}, {}, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/organizations/{orgId}', method: 'delete', ...variables, signal, }); /** * Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >( ( variables: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, ) => fetchEnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of an organization. */ orgId: number; }; export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables = { pathParams: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise = ( variables: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseError, undefined, {}, {}, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/organizations/{orgId}', method: 'put', ...variables, signal, }); /** * Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseError, EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables >( ( variables: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables, ) => fetchEnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListSelfHostedRunnersInGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse = { runners: Schemas.Runner[]; total_count: number; }; export type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseVariables = { pathParams: EnterpriseAdminListSelfHostedRunnersInGroupForEnterprisePathParams; queryParams?: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the self-hosted runners that are in a specific enterprise group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListSelfHostedRunnersInGroupForEnterprise = ( variables: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseError, undefined, {}, EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseQueryParams, EnterpriseAdminListSelfHostedRunnersInGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/runners', method: 'get', ...variables, signal, }); /** * Lists the self-hosted runners that are in a specific enterprise group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListSelfHostedRunnersInGroupForEnterprise = < TData = EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse, >( variables: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners', operationId: 'enterpriseAdminListSelfHostedRunnersInGroupForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListSelfHostedRunnersInGroupForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseRequestBody = { /** * List of runner IDs to add to the runner group. */ runners: number[]; }; export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseVariables = { body: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseRequestBody; pathParams: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Replaces the list of self-hosted runners that are part of an enterprise runner group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise = ( variables: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseError, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseRequestBody, {}, {}, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/runners', method: 'put', ...variables, signal, }); /** * Replaces the list of self-hosted runners that are part of an enterprise runner group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseError, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseError, EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseVariables >( ( variables: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseVariables, ) => fetchEnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseVariables = { pathParams: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise = ( variables: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseError, undefined, {}, {}, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/runners/{runnerId}', method: 'delete', ...variables, signal, }); /** * Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseError, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseError, EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseVariables >( ( variables: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseVariables, ) => fetchEnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseVariables = { pathParams: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Adds a self-hosted runner to a runner group configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` * scope to use this endpoint. */ export const fetchEnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise = ( variables: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseError, undefined, {}, {}, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runner-groups/{runnerGroupId}/runners/{runnerId}', method: 'put', ...variables, signal, }); /** * Adds a self-hosted runner to a runner group configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` * scope to use this endpoint. */ export const useEnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseError, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseError, EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseVariables >( ( variables: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseVariables, ) => fetchEnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListSelfHostedRunnersForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListSelfHostedRunnersForEnterpriseQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type EnterpriseAdminListSelfHostedRunnersForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListSelfHostedRunnersForEnterpriseResponse = { runners?: Schemas.Runner[]; total_count?: number; }; export type EnterpriseAdminListSelfHostedRunnersForEnterpriseVariables = { pathParams: EnterpriseAdminListSelfHostedRunnersForEnterprisePathParams; queryParams?: EnterpriseAdminListSelfHostedRunnersForEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all self-hosted runners configured for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListSelfHostedRunnersForEnterprise = ( variables: EnterpriseAdminListSelfHostedRunnersForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListSelfHostedRunnersForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersForEnterpriseError, undefined, {}, EnterpriseAdminListSelfHostedRunnersForEnterpriseQueryParams, EnterpriseAdminListSelfHostedRunnersForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners', method: 'get', ...variables, signal, }); /** * Lists all self-hosted runners configured for an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListSelfHostedRunnersForEnterprise = < TData = EnterpriseAdminListSelfHostedRunnersForEnterpriseResponse, >( variables: EnterpriseAdminListSelfHostedRunnersForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListSelfHostedRunnersForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListSelfHostedRunnersForEnterpriseResponse, EnterpriseAdminListSelfHostedRunnersForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runners', operationId: 'enterpriseAdminListSelfHostedRunnersForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListSelfHostedRunnersForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminListRunnerApplicationsForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListRunnerApplicationsForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListRunnerApplicationsForEnterpriseResponse = Schemas.RunnerApplication[]; export type EnterpriseAdminListRunnerApplicationsForEnterpriseVariables = { pathParams: EnterpriseAdminListRunnerApplicationsForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminListRunnerApplicationsForEnterprise = ( variables: EnterpriseAdminListRunnerApplicationsForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< EnterpriseAdminListRunnerApplicationsForEnterpriseResponse, EnterpriseAdminListRunnerApplicationsForEnterpriseError, undefined, {}, {}, EnterpriseAdminListRunnerApplicationsForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners/downloads', method: 'get', ...variables, signal, }); /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminListRunnerApplicationsForEnterprise = < TData = EnterpriseAdminListRunnerApplicationsForEnterpriseResponse, >( variables: EnterpriseAdminListRunnerApplicationsForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< EnterpriseAdminListRunnerApplicationsForEnterpriseResponse, EnterpriseAdminListRunnerApplicationsForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< EnterpriseAdminListRunnerApplicationsForEnterpriseResponse, EnterpriseAdminListRunnerApplicationsForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runners/downloads', operationId: 'enterpriseAdminListRunnerApplicationsForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListRunnerApplicationsForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminCreateRegistrationTokenForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminCreateRegistrationTokenForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminCreateRegistrationTokenForEnterpriseVariables = { pathParams: EnterpriseAdminCreateRegistrationTokenForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to the `config` script. The token expires after one hour. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN * ``` */ export const fetchEnterpriseAdminCreateRegistrationTokenForEnterprise = ( variables: EnterpriseAdminCreateRegistrationTokenForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, EnterpriseAdminCreateRegistrationTokenForEnterpriseError, undefined, {}, {}, EnterpriseAdminCreateRegistrationTokenForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners/registration-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to the `config` script. The token expires after one hour. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN * ``` */ export const useEnterpriseAdminCreateRegistrationTokenForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, EnterpriseAdminCreateRegistrationTokenForEnterpriseError, EnterpriseAdminCreateRegistrationTokenForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, EnterpriseAdminCreateRegistrationTokenForEnterpriseError, EnterpriseAdminCreateRegistrationTokenForEnterpriseVariables >( (variables: EnterpriseAdminCreateRegistrationTokenForEnterpriseVariables) => fetchEnterpriseAdminCreateRegistrationTokenForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminCreateRemoveTokenForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminCreateRemoveTokenForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminCreateRemoveTokenForEnterpriseVariables = { pathParams: EnterpriseAdminCreateRemoveTokenForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this * endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const fetchEnterpriseAdminCreateRemoveTokenForEnterprise = ( variables: EnterpriseAdminCreateRemoveTokenForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, EnterpriseAdminCreateRemoveTokenForEnterpriseError, undefined, {}, {}, EnterpriseAdminCreateRemoveTokenForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners/remove-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this * endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const useEnterpriseAdminCreateRemoveTokenForEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, EnterpriseAdminCreateRemoveTokenForEnterpriseError, EnterpriseAdminCreateRemoveTokenForEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, EnterpriseAdminCreateRemoveTokenForEnterpriseError, EnterpriseAdminCreateRemoveTokenForEnterpriseVariables >( (variables: EnterpriseAdminCreateRemoveTokenForEnterpriseVariables) => fetchEnterpriseAdminCreateRemoveTokenForEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseVariables = { pathParams: EnterpriseAdminDeleteSelfHostedRunnerFromEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminDeleteSelfHostedRunnerFromEnterprise = ( variables: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseError, undefined, {}, {}, EnterpriseAdminDeleteSelfHostedRunnerFromEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners/{runnerId}', method: 'delete', ...variables, signal, }); /** * Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminDeleteSelfHostedRunnerFromEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseError, EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseError, EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseVariables >( (variables: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseVariables) => fetchEnterpriseAdminDeleteSelfHostedRunnerFromEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminGetSelfHostedRunnerForEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type EnterpriseAdminGetSelfHostedRunnerForEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetSelfHostedRunnerForEnterpriseVariables = { pathParams: EnterpriseAdminGetSelfHostedRunnerForEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific self-hosted runner configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const fetchEnterpriseAdminGetSelfHostedRunnerForEnterprise = ( variables: EnterpriseAdminGetSelfHostedRunnerForEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Runner, EnterpriseAdminGetSelfHostedRunnerForEnterpriseError, undefined, {}, {}, EnterpriseAdminGetSelfHostedRunnerForEnterprisePathParams >({ url: '/enterprises/{enterprise}/actions/runners/{runnerId}', method: 'get', ...variables, signal, }); /** * Gets a specific self-hosted runner configured in an enterprise. * * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. */ export const useEnterpriseAdminGetSelfHostedRunnerForEnterprise = < TData = Schemas.Runner, >( variables: EnterpriseAdminGetSelfHostedRunnerForEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Runner, EnterpriseAdminGetSelfHostedRunnerForEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Runner, EnterpriseAdminGetSelfHostedRunnerForEnterpriseError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/actions/runners/{runner_id}', operationId: 'enterpriseAdminGetSelfHostedRunnerForEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminGetSelfHostedRunnerForEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AuditLogGetAuditLogPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type AuditLogGetAuditLogQueryParams = { /** * A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ phrase?: string; /** * The event types to include: * * - `web` - returns web (non-Git) events * - `git` - returns Git events * - `all` - returns both web and Git events * * The default is `web`. */ include?: 'web' | 'git' | 'all'; /** * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ after?: string; /** * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ before?: string; /** * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. * * The default is `desc`. */ order?: 'desc' | 'asc'; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type AuditLogGetAuditLogError = Fetcher.ErrorWrapper; export type AuditLogGetAuditLogResponse = Schemas.AuditLogEvent[]; export type AuditLogGetAuditLogVariables = { pathParams: AuditLogGetAuditLogPathParams; queryParams?: AuditLogGetAuditLogQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The audit log REST API is currently in beta and is subject to change. * * Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope. */ export const fetchAuditLogGetAuditLog = ( variables: AuditLogGetAuditLogVariables, signal?: AbortSignal, ) => githubFetch< AuditLogGetAuditLogResponse, AuditLogGetAuditLogError, undefined, {}, AuditLogGetAuditLogQueryParams, AuditLogGetAuditLogPathParams >({ url: '/enterprises/{enterprise}/audit-log', method: 'get', ...variables, signal, }); /** * **Note:** The audit log REST API is currently in beta and is subject to change. * * Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope. */ export const useAuditLogGetAuditLog = ( variables: AuditLogGetAuditLogVariables, options?: Omit< reactQuery.UseQueryOptions< AuditLogGetAuditLogResponse, AuditLogGetAuditLogError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AuditLogGetAuditLogResponse, AuditLogGetAuditLogError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/audit-log', operationId: 'auditLogGetAuditLog', variables, }), ({ signal }) => fetchAuditLogGetAuditLog({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type BillingGetGithubActionsBillingGhePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type BillingGetGithubActionsBillingGheError = Fetcher.ErrorWrapper; export type BillingGetGithubActionsBillingGheVariables = { pathParams: BillingGetGithubActionsBillingGhePathParams; } & GithubContext['fetcherOptions']; /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * The authenticated user must be an enterprise admin. */ export const fetchBillingGetGithubActionsBillingGhe = ( variables: BillingGetGithubActionsBillingGheVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingGheError, undefined, {}, {}, BillingGetGithubActionsBillingGhePathParams >({ url: '/enterprises/{enterprise}/settings/billing/actions', method: 'get', ...variables, signal, }); /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * The authenticated user must be an enterprise admin. */ export const useBillingGetGithubActionsBillingGhe = < TData = Schemas.ActionsBillingUsage, >( variables: BillingGetGithubActionsBillingGheVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingGheError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingGheError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/settings/billing/actions', operationId: 'billingGetGithubActionsBillingGhe', variables, }), ({ signal }) => fetchBillingGetGithubActionsBillingGhe( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetGithubPackagesBillingGhePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type BillingGetGithubPackagesBillingGheError = Fetcher.ErrorWrapper; export type BillingGetGithubPackagesBillingGheVariables = { pathParams: BillingGetGithubPackagesBillingGhePathParams; } & GithubContext['fetcherOptions']; /** * Gets the free and paid storage used for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * The authenticated user must be an enterprise admin. */ export const fetchBillingGetGithubPackagesBillingGhe = ( variables: BillingGetGithubPackagesBillingGheVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingGheError, undefined, {}, {}, BillingGetGithubPackagesBillingGhePathParams >({ url: '/enterprises/{enterprise}/settings/billing/packages', method: 'get', ...variables, signal, }); /** * Gets the free and paid storage used for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * The authenticated user must be an enterprise admin. */ export const useBillingGetGithubPackagesBillingGhe = < TData = Schemas.PackagesBillingUsage, >( variables: BillingGetGithubPackagesBillingGheVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingGheError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingGheError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/settings/billing/packages', operationId: 'billingGetGithubPackagesBillingGhe', variables, }), ({ signal }) => fetchBillingGetGithubPackagesBillingGhe( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetSharedStorageBillingGhePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type BillingGetSharedStorageBillingGheError = Fetcher.ErrorWrapper; export type BillingGetSharedStorageBillingGheVariables = { pathParams: BillingGetSharedStorageBillingGhePathParams; } & GithubContext['fetcherOptions']; /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * The authenticated user must be an enterprise admin. */ export const fetchBillingGetSharedStorageBillingGhe = ( variables: BillingGetSharedStorageBillingGheVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingGheError, undefined, {}, {}, BillingGetSharedStorageBillingGhePathParams >({ url: '/enterprises/{enterprise}/settings/billing/shared-storage', method: 'get', ...variables, signal, }); /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * The authenticated user must be an enterprise admin. */ export const useBillingGetSharedStorageBillingGhe = < TData = Schemas.CombinedBillingUsage, >( variables: BillingGetSharedStorageBillingGheVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingGheError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingGheError, TData >( queryKeyFn({ path: '/enterprises/{enterprise}/settings/billing/shared-storage', operationId: 'billingGetSharedStorageBillingGhe', variables, }), ({ signal }) => fetchBillingGetSharedStorageBillingGhe( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListPublicEventsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListPublicEventsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type ActivityListPublicEventsResponse = Schemas.Event[]; export type ActivityListPublicEventsVariables = { queryParams?: ActivityListPublicEventsQueryParams; } & GithubContext['fetcherOptions']; /** * We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. */ export const fetchActivityListPublicEvents = ( variables: ActivityListPublicEventsVariables, signal?: AbortSignal, ) => githubFetch< ActivityListPublicEventsResponse, ActivityListPublicEventsError, undefined, {}, ActivityListPublicEventsQueryParams, {} >({ url: '/events', method: 'get', ...variables, signal }); /** * We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. */ export const useActivityListPublicEvents = < TData = ActivityListPublicEventsResponse, >( variables: ActivityListPublicEventsVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListPublicEventsResponse, ActivityListPublicEventsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListPublicEventsResponse, ActivityListPublicEventsError, TData >( queryKeyFn({ path: '/events', operationId: 'activityListPublicEvents', variables, }), ({ signal }) => fetchActivityListPublicEvents( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityGetFeedsError = Fetcher.ErrorWrapper; export type ActivityGetFeedsVariables = GithubContext['fetcherOptions']; /** * GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * * * **Timeline**: The GitHub global public timeline * * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * * **Current user public**: The public timeline for the authenticated user * * **Current user**: The private timeline for the authenticated user * * **Current user actor**: The private timeline for activity created by the authenticated user * * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. * * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. */ export const fetchActivityGetFeeds = ( variables: ActivityGetFeedsVariables, signal?: AbortSignal, ) => githubFetch({ url: '/feeds', method: 'get', ...variables, signal, }); /** * GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * * * **Timeline**: The GitHub global public timeline * * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * * **Current user public**: The public timeline for the authenticated user * * **Current user**: The private timeline for the authenticated user * * **Current user actor**: The private timeline for activity created by the authenticated user * * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. * * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. */ export const useActivityGetFeeds = ( variables: ActivityGetFeedsVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/feeds', operationId: 'activityGetFeeds', variables }), ({ signal }) => fetchActivityGetFeeds({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsListQueryParams = { /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } >; export type GistsListResponse = Schemas.BaseGist[]; export type GistsListVariables = { queryParams?: GistsListQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: */ export const fetchGistsList = ( variables: GistsListVariables, signal?: AbortSignal, ) => githubFetch< GistsListResponse, GistsListError, undefined, {}, GistsListQueryParams, {} >({ url: '/gists', method: 'get', ...variables, signal }); /** * Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: */ export const useGistsList = ( variables: GistsListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/gists', operationId: 'gistsList', variables }), ({ signal }) => fetchGistsList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsCreateError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GistsCreateRequestBody = { /** * Description of the gist * * @example Example Ruby script */ description?: string; /** * Names and content for the files that make up the gist * * @example {"hello.rb":{"content":"puts \"Hello, World!\""}} */ files: { [key: string]: { /** * Content of the file */ content: string; }; }; public?: boolean | ('true' | 'false'); }; export type GistsCreateVariables = { body: GistsCreateRequestBody; } & GithubContext['fetcherOptions']; /** * Allows you to add a new gist with one or more files. * * **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. */ export const fetchGistsCreate = ( variables: GistsCreateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistSimple, GistsCreateError, GistsCreateRequestBody, {}, {}, {} >({ url: '/gists', method: 'post', ...variables, signal }); /** * Allows you to add a new gist with one or more files. * * **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. */ export const useGistsCreate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GistSimple, GistsCreateError, GistsCreateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GistSimple, GistsCreateError, GistsCreateVariables >( (variables: GistsCreateVariables) => fetchGistsCreate({ ...fetcherOptions, ...variables }), options, ); }; export type GistsListPublicQueryParams = { /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListPublicError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GistsListPublicResponse = Schemas.BaseGist[]; export type GistsListPublicVariables = { queryParams?: GistsListPublicQueryParams; } & GithubContext['fetcherOptions']; /** * List public gists sorted by most recently updated to least recently updated. * * Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. */ export const fetchGistsListPublic = ( variables: GistsListPublicVariables, signal?: AbortSignal, ) => githubFetch< GistsListPublicResponse, GistsListPublicError, undefined, {}, GistsListPublicQueryParams, {} >({ url: '/gists/public', method: 'get', ...variables, signal }); /** * List public gists sorted by most recently updated to least recently updated. * * Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. */ export const useGistsListPublic = ( variables: GistsListPublicVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListPublicResponse, GistsListPublicError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListPublicResponse, GistsListPublicError, TData >( queryKeyFn({ path: '/gists/public', operationId: 'gistsListPublic', variables, }), ({ signal }) => fetchGistsListPublic({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsListStarredQueryParams = { /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListStarredError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type GistsListStarredResponse = Schemas.BaseGist[]; export type GistsListStarredVariables = { queryParams?: GistsListStarredQueryParams; } & GithubContext['fetcherOptions']; /** * List the authenticated user's starred gists: */ export const fetchGistsListStarred = ( variables: GistsListStarredVariables, signal?: AbortSignal, ) => githubFetch< GistsListStarredResponse, GistsListStarredError, undefined, {}, GistsListStarredQueryParams, {} >({ url: '/gists/starred', method: 'get', ...variables, signal }); /** * List the authenticated user's starred gists: */ export const useGistsListStarred = ( variables: GistsListStarredVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListStarredResponse, GistsListStarredError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListStarredResponse, GistsListStarredError, TData >( queryKeyFn({ path: '/gists/starred', operationId: 'gistsListStarred', variables, }), ({ signal }) => fetchGistsListStarred({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsDeletePathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsDeleteError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsDeleteVariables = { pathParams: GistsDeletePathParams; } & GithubContext['fetcherOptions']; export const fetchGistsDelete = ( variables: GistsDeleteVariables, signal?: AbortSignal, ) => githubFetch< undefined, GistsDeleteError, undefined, {}, {}, GistsDeletePathParams >({ url: '/gists/{gistId}', method: 'delete', ...variables, signal }); export const useGistsDelete = ( options?: Omit< reactQuery.UseMutationOptions< undefined, GistsDeleteError, GistsDeleteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, GistsDeleteError, GistsDeleteVariables >( (variables: GistsDeleteVariables) => fetchGistsDelete({ ...fetcherOptions, ...variables }), options, ); }; export type GistsGetPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsGetError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.ForbiddenGist; } | { status: 404; payload: Responses.NotFound; } >; export type GistsGetVariables = { pathParams: GistsGetPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsGet = ( variables: GistsGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistSimple, GistsGetError, undefined, {}, {}, GistsGetPathParams >({ url: '/gists/{gistId}', method: 'get', ...variables, signal }); export const useGistsGet = ( variables: GistsGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/gists/{gist_id}', operationId: 'gistsGet', variables, }), ({ signal }) => fetchGistsGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsUpdatePathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsUpdateError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GistsUpdateVariables = { body?: | { /** * Description of the gist * * @example Example Ruby script */ description: string; /** * Names of files to be updated * * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} */ files?: { [key: string]: | { /** * The new content of the file */ content: string; /** * The new filename for the file */ filename?: string | null; } | { /** * The new content of the file */ content?: string; /** * The new filename for the file */ filename: string | null; } | {} | null; }; } | { /** * Description of the gist * * @example Example Ruby script */ description?: string; /** * Names of files to be updated * * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} */ files: { [key: string]: | { /** * The new content of the file */ content: string; /** * The new filename for the file */ filename?: string | null; } | { /** * The new content of the file */ content?: string; /** * The new filename for the file */ filename: string | null; } | {} | null; }; } | null; pathParams: GistsUpdatePathParams; } & GithubContext['fetcherOptions']; /** * Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. */ export const fetchGistsUpdate = ( variables: GistsUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistSimple, GistsUpdateError, | { /** * Description of the gist * * @example Example Ruby script */ description: string; /** * Names of files to be updated * * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} */ files?: { [key: string]: | { /** * The new content of the file */ content: string; /** * The new filename for the file */ filename?: string | null; } | { /** * The new content of the file */ content?: string; /** * The new filename for the file */ filename: string | null; } | {} | null; }; } | { /** * Description of the gist * * @example Example Ruby script */ description?: string; /** * Names of files to be updated * * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} */ files: { [key: string]: | { /** * The new content of the file */ content: string; /** * The new filename for the file */ filename?: string | null; } | { /** * The new content of the file */ content?: string; /** * The new filename for the file */ filename: string | null; } | {} | null; }; } | null, {}, {}, GistsUpdatePathParams >({ url: '/gists/{gistId}', method: 'patch', ...variables, signal }); /** * Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. */ export const useGistsUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GistSimple, GistsUpdateError, GistsUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GistSimple, GistsUpdateError, GistsUpdateVariables >( (variables: GistsUpdateVariables) => fetchGistsUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type GistsListCommentsPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsListCommentsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListCommentsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsListCommentsResponse = Schemas.GistComment[]; export type GistsListCommentsVariables = { pathParams: GistsListCommentsPathParams; queryParams?: GistsListCommentsQueryParams; } & GithubContext['fetcherOptions']; export const fetchGistsListComments = ( variables: GistsListCommentsVariables, signal?: AbortSignal, ) => githubFetch< GistsListCommentsResponse, GistsListCommentsError, undefined, {}, GistsListCommentsQueryParams, GistsListCommentsPathParams >({ url: '/gists/{gistId}/comments', method: 'get', ...variables, signal }); export const useGistsListComments = ( variables: GistsListCommentsVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListCommentsResponse, GistsListCommentsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListCommentsResponse, GistsListCommentsError, TData >( queryKeyFn({ path: '/gists/{gist_id}/comments', operationId: 'gistsListComments', variables, }), ({ signal }) => fetchGistsListComments({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsCreateCommentPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsCreateCommentError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsCreateCommentRequestBody = { /** * The comment text. * * @example Body of the attachment * @maxLength 65535 */ body: string; }; export type GistsCreateCommentVariables = { body: GistsCreateCommentRequestBody; pathParams: GistsCreateCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsCreateComment = ( variables: GistsCreateCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistComment, GistsCreateCommentError, GistsCreateCommentRequestBody, {}, {}, GistsCreateCommentPathParams >({ url: '/gists/{gistId}/comments', method: 'post', ...variables, signal }); export const useGistsCreateComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GistComment, GistsCreateCommentError, GistsCreateCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GistComment, GistsCreateCommentError, GistsCreateCommentVariables >( (variables: GistsCreateCommentVariables) => fetchGistsCreateComment({ ...fetcherOptions, ...variables }), options, ); }; export type GistsDeleteCommentPathParams = { /** * gist_id parameter */ gistId: string; /** * comment_id parameter */ commentId: number; }; export type GistsDeleteCommentError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsDeleteCommentVariables = { pathParams: GistsDeleteCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsDeleteComment = ( variables: GistsDeleteCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, GistsDeleteCommentError, undefined, {}, {}, GistsDeleteCommentPathParams >({ url: '/gists/{gistId}/comments/{commentId}', method: 'delete', ...variables, signal, }); export const useGistsDeleteComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, GistsDeleteCommentError, GistsDeleteCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, GistsDeleteCommentError, GistsDeleteCommentVariables >( (variables: GistsDeleteCommentVariables) => fetchGistsDeleteComment({ ...fetcherOptions, ...variables }), options, ); }; export type GistsGetCommentPathParams = { /** * gist_id parameter */ gistId: string; /** * comment_id parameter */ commentId: number; }; export type GistsGetCommentError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.ForbiddenGist; } | { status: 404; payload: Responses.NotFound; } >; export type GistsGetCommentVariables = { pathParams: GistsGetCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsGetComment = ( variables: GistsGetCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistComment, GistsGetCommentError, undefined, {}, {}, GistsGetCommentPathParams >({ url: '/gists/{gistId}/comments/{commentId}', method: 'get', ...variables, signal, }); export const useGistsGetComment = ( variables: GistsGetCommentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GistComment, GistsGetCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/gists/{gist_id}/comments/{comment_id}', operationId: 'gistsGetComment', variables, }), ({ signal }) => fetchGistsGetComment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsUpdateCommentPathParams = { /** * gist_id parameter */ gistId: string; /** * comment_id parameter */ commentId: number; }; export type GistsUpdateCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type GistsUpdateCommentRequestBody = { /** * The comment text. * * @example Body of the attachment * @maxLength 65535 */ body: string; }; export type GistsUpdateCommentVariables = { body: GistsUpdateCommentRequestBody; pathParams: GistsUpdateCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsUpdateComment = ( variables: GistsUpdateCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistComment, GistsUpdateCommentError, GistsUpdateCommentRequestBody, {}, {}, GistsUpdateCommentPathParams >({ url: '/gists/{gistId}/comments/{commentId}', method: 'patch', ...variables, signal, }); export const useGistsUpdateComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GistComment, GistsUpdateCommentError, GistsUpdateCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GistComment, GistsUpdateCommentError, GistsUpdateCommentVariables >( (variables: GistsUpdateCommentVariables) => fetchGistsUpdateComment({ ...fetcherOptions, ...variables }), options, ); }; export type GistsListCommitsPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsListCommitsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListCommitsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsListCommitsResponse = Schemas.GistCommit[]; export type GistsListCommitsVariables = { pathParams: GistsListCommitsPathParams; queryParams?: GistsListCommitsQueryParams; } & GithubContext['fetcherOptions']; export const fetchGistsListCommits = ( variables: GistsListCommitsVariables, signal?: AbortSignal, ) => githubFetch< GistsListCommitsResponse, GistsListCommitsError, undefined, {}, GistsListCommitsQueryParams, GistsListCommitsPathParams >({ url: '/gists/{gistId}/commits', method: 'get', ...variables, signal }); export const useGistsListCommits = ( variables: GistsListCommitsVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListCommitsResponse, GistsListCommitsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListCommitsResponse, GistsListCommitsError, TData >( queryKeyFn({ path: '/gists/{gist_id}/commits', operationId: 'gistsListCommits', variables, }), ({ signal }) => fetchGistsListCommits({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsListForksPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsListForksQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListForksError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsListForksResponse = Schemas.GistSimple[]; export type GistsListForksVariables = { pathParams: GistsListForksPathParams; queryParams?: GistsListForksQueryParams; } & GithubContext['fetcherOptions']; export const fetchGistsListForks = ( variables: GistsListForksVariables, signal?: AbortSignal, ) => githubFetch< GistsListForksResponse, GistsListForksError, undefined, {}, GistsListForksQueryParams, GistsListForksPathParams >({ url: '/gists/{gistId}/forks', method: 'get', ...variables, signal }); export const useGistsListForks = ( variables: GistsListForksVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListForksResponse, GistsListForksError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListForksResponse, GistsListForksError, TData >( queryKeyFn({ path: '/gists/{gist_id}/forks', operationId: 'gistsListForks', variables, }), ({ signal }) => fetchGistsListForks({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsForkPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsForkError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GistsForkVariables = { pathParams: GistsForkPathParams; } & GithubContext['fetcherOptions']; /** * **Note**: This was previously `/gists/:gist_id/fork`. */ export const fetchGistsFork = ( variables: GistsForkVariables, signal?: AbortSignal, ) => githubFetch< Schemas.BaseGist, GistsForkError, undefined, {}, {}, GistsForkPathParams >({ url: '/gists/{gistId}/forks', method: 'post', ...variables, signal }); /** * **Note**: This was previously `/gists/:gist_id/fork`. */ export const useGistsFork = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.BaseGist, GistsForkError, GistsForkVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.BaseGist, GistsForkError, GistsForkVariables >( (variables: GistsForkVariables) => fetchGistsFork({ ...fetcherOptions, ...variables }), options, ); }; export type GistsUnstarPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsUnstarError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsUnstarVariables = { pathParams: GistsUnstarPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsUnstar = ( variables: GistsUnstarVariables, signal?: AbortSignal, ) => githubFetch< undefined, GistsUnstarError, undefined, {}, {}, GistsUnstarPathParams >({ url: '/gists/{gistId}/star', method: 'delete', ...variables, signal }); export const useGistsUnstar = ( options?: Omit< reactQuery.UseMutationOptions< undefined, GistsUnstarError, GistsUnstarVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, GistsUnstarError, GistsUnstarVariables >( (variables: GistsUnstarVariables) => fetchGistsUnstar({ ...fetcherOptions, ...variables }), options, ); }; export type GistsCheckIsStarredPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsCheckIsStarredError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: {}; } >; export type GistsCheckIsStarredVariables = { pathParams: GistsCheckIsStarredPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsCheckIsStarred = ( variables: GistsCheckIsStarredVariables, signal?: AbortSignal, ) => githubFetch< undefined, GistsCheckIsStarredError, undefined, {}, {}, GistsCheckIsStarredPathParams >({ url: '/gists/{gistId}/star', method: 'get', ...variables, signal }); export const useGistsCheckIsStarred = ( variables: GistsCheckIsStarredVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/gists/{gist_id}/star', operationId: 'gistsCheckIsStarred', variables, }), ({ signal }) => fetchGistsCheckIsStarred({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GistsStarPathParams = { /** * gist_id parameter */ gistId: string; }; export type GistsStarError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type GistsStarVariables = { pathParams: GistsStarPathParams; } & GithubContext['fetcherOptions']; /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchGistsStar = ( variables: GistsStarVariables, signal?: AbortSignal, ) => githubFetch< undefined, GistsStarError, undefined, {}, {}, GistsStarPathParams >({ url: '/gists/{gistId}/star', method: 'put', ...variables, signal }); /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useGistsStar = ( options?: Omit< reactQuery.UseMutationOptions< undefined, GistsStarError, GistsStarVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation( (variables: GistsStarVariables) => fetchGistsStar({ ...fetcherOptions, ...variables }), options, ); }; export type GistsGetRevisionPathParams = { /** * gist_id parameter */ gistId: string; sha: string; }; export type GistsGetRevisionError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GistsGetRevisionVariables = { pathParams: GistsGetRevisionPathParams; } & GithubContext['fetcherOptions']; export const fetchGistsGetRevision = ( variables: GistsGetRevisionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GistSimple, GistsGetRevisionError, undefined, {}, {}, GistsGetRevisionPathParams >({ url: '/gists/{gistId}/{sha}', method: 'get', ...variables, signal }); export const useGistsGetRevision = ( variables: GistsGetRevisionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GistSimple, GistsGetRevisionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/gists/{gist_id}/{sha}', operationId: 'gistsGetRevision', variables, }), ({ signal }) => fetchGistsGetRevision({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitignoreGetAllTemplatesError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type GitignoreGetAllTemplatesResponse = string[]; export type GitignoreGetAllTemplatesVariables = GithubContext['fetcherOptions']; /** * List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). */ export const fetchGitignoreGetAllTemplates = ( variables: GitignoreGetAllTemplatesVariables, signal?: AbortSignal, ) => githubFetch< GitignoreGetAllTemplatesResponse, GitignoreGetAllTemplatesError, undefined, {}, {}, {} >({ url: '/gitignore/templates', method: 'get', ...variables, signal }); /** * List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). */ export const useGitignoreGetAllTemplates = < TData = GitignoreGetAllTemplatesResponse, >( variables: GitignoreGetAllTemplatesVariables, options?: Omit< reactQuery.UseQueryOptions< GitignoreGetAllTemplatesResponse, GitignoreGetAllTemplatesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GitignoreGetAllTemplatesResponse, GitignoreGetAllTemplatesError, TData >( queryKeyFn({ path: '/gitignore/templates', operationId: 'gitignoreGetAllTemplates', variables, }), ({ signal }) => fetchGitignoreGetAllTemplates( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type GitignoreGetTemplatePathParams = { name: string; }; export type GitignoreGetTemplateError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type GitignoreGetTemplateVariables = { pathParams: GitignoreGetTemplatePathParams; } & GithubContext['fetcherOptions']; /** * The API also allows fetching the source of a single template. * Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. */ export const fetchGitignoreGetTemplate = ( variables: GitignoreGetTemplateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitignoreTemplate, GitignoreGetTemplateError, undefined, {}, {}, GitignoreGetTemplatePathParams >({ url: '/gitignore/templates/{name}', method: 'get', ...variables, signal, }); /** * The API also allows fetching the source of a single template. * Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. */ export const useGitignoreGetTemplate = ( variables: GitignoreGetTemplateVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GitignoreTemplate, GitignoreGetTemplateError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.GitignoreTemplate, GitignoreGetTemplateError, TData >( queryKeyFn({ path: '/gitignore/templates/{name}', operationId: 'gitignoreGetTemplate', variables, }), ({ signal }) => fetchGitignoreGetTemplate({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsListReposAccessibleToInstallationQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListReposAccessibleToInstallationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type AppsListReposAccessibleToInstallationResponse = { repositories: Schemas.Repository[]; /** * @example selected */ repository_selection?: string; total_count: number; }; export type AppsListReposAccessibleToInstallationVariables = { queryParams?: AppsListReposAccessibleToInstallationQueryParams; } & GithubContext['fetcherOptions']; /** * List repositories that an app installation can access. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const fetchAppsListReposAccessibleToInstallation = ( variables: AppsListReposAccessibleToInstallationVariables, signal?: AbortSignal, ) => githubFetch< AppsListReposAccessibleToInstallationResponse, AppsListReposAccessibleToInstallationError, undefined, {}, AppsListReposAccessibleToInstallationQueryParams, {} >({ url: '/installation/repositories', method: 'get', ...variables, signal }); /** * List repositories that an app installation can access. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const useAppsListReposAccessibleToInstallation = < TData = AppsListReposAccessibleToInstallationResponse, >( variables: AppsListReposAccessibleToInstallationVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListReposAccessibleToInstallationResponse, AppsListReposAccessibleToInstallationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListReposAccessibleToInstallationResponse, AppsListReposAccessibleToInstallationError, TData >( queryKeyFn({ path: '/installation/repositories', operationId: 'appsListReposAccessibleToInstallation', variables, }), ({ signal }) => fetchAppsListReposAccessibleToInstallation( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsRevokeInstallationAccessTokenError = Fetcher.ErrorWrapper; export type AppsRevokeInstallationAccessTokenVariables = GithubContext['fetcherOptions']; /** * Revokes the installation token you're using to authenticate as an installation and access this endpoint. * * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const fetchAppsRevokeInstallationAccessToken = ( variables: AppsRevokeInstallationAccessTokenVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsRevokeInstallationAccessTokenError, undefined, {}, {}, {} >({ url: '/installation/token', method: 'delete', ...variables, signal }); /** * Revokes the installation token you're using to authenticate as an installation and access this endpoint. * * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. * * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ export const useAppsRevokeInstallationAccessToken = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsRevokeInstallationAccessTokenError, AppsRevokeInstallationAccessTokenVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsRevokeInstallationAccessTokenError, AppsRevokeInstallationAccessTokenVariables >( (variables: AppsRevokeInstallationAccessTokenVariables) => fetchAppsRevokeInstallationAccessToken({ ...fetcherOptions, ...variables, }), options, ); }; export type IssuesListQueryParams = { /** * Indicates which sorts of issues to return. Can be one of: * \* `assigned`: Issues assigned to you * \* `created`: Issues created by you * \* `mentioned`: Issues mentioning you * \* `subscribed`: Issues you're subscribed to updates for * \* `all`: All issues the authenticated user can see, regardless of participation or creation * * @default assigned */ filter?: | 'assigned' | 'created' | 'mentioned' | 'subscribed' | 'repos' | 'all'; /** * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * A list of comma separated label names. Example: `bug,ui,@high` */ labels?: string; /** * What to sort results by. Can be either `created`, `updated`, `comments`. * * @default created */ sort?: 'created' | 'updated' | 'comments'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; collab?: boolean; orgs?: boolean; owned?: boolean; pulls?: boolean; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesListResponse = Schemas.Issue[]; export type IssuesListVariables = { queryParams?: IssuesListQueryParams; } & GithubContext['fetcherOptions']; /** * List issues assigned to the authenticated user across all visible repositories including owned repositories, member * repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not * necessarily assigned to you. * * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchIssuesList = ( variables: IssuesListVariables, signal?: AbortSignal, ) => githubFetch< IssuesListResponse, IssuesListError, undefined, {}, IssuesListQueryParams, {} >({ url: '/issues', method: 'get', ...variables, signal }); /** * List issues assigned to the authenticated user across all visible repositories including owned repositories, member * repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not * necessarily assigned to you. * * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useIssuesList = ( variables: IssuesListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/issues', operationId: 'issuesList', variables }), ({ signal }) => fetchIssuesList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type LicensesGetAllCommonlyUsedQueryParams = { featured?: boolean; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type LicensesGetAllCommonlyUsedError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type LicensesGetAllCommonlyUsedResponse = Schemas.LicenseSimple[]; export type LicensesGetAllCommonlyUsedVariables = { queryParams?: LicensesGetAllCommonlyUsedQueryParams; } & GithubContext['fetcherOptions']; export const fetchLicensesGetAllCommonlyUsed = ( variables: LicensesGetAllCommonlyUsedVariables, signal?: AbortSignal, ) => githubFetch< LicensesGetAllCommonlyUsedResponse, LicensesGetAllCommonlyUsedError, undefined, {}, LicensesGetAllCommonlyUsedQueryParams, {} >({ url: '/licenses', method: 'get', ...variables, signal }); export const useLicensesGetAllCommonlyUsed = < TData = LicensesGetAllCommonlyUsedResponse, >( variables: LicensesGetAllCommonlyUsedVariables, options?: Omit< reactQuery.UseQueryOptions< LicensesGetAllCommonlyUsedResponse, LicensesGetAllCommonlyUsedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< LicensesGetAllCommonlyUsedResponse, LicensesGetAllCommonlyUsedError, TData >( queryKeyFn({ path: '/licenses', operationId: 'licensesGetAllCommonlyUsed', variables, }), ({ signal }) => fetchLicensesGetAllCommonlyUsed( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type LicensesGetPathParams = { license: string; }; export type LicensesGetError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type LicensesGetVariables = { pathParams: LicensesGetPathParams; } & GithubContext['fetcherOptions']; export const fetchLicensesGet = ( variables: LicensesGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.License, LicensesGetError, undefined, {}, {}, LicensesGetPathParams >({ url: '/licenses/{license}', method: 'get', ...variables, signal }); export const useLicensesGet = ( variables: LicensesGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/licenses/{license}', operationId: 'licensesGet', variables, }), ({ signal }) => fetchLicensesGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type MarkdownRenderError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type MarkdownRenderRequestBody = { /** * The repository context to use when creating references in `gfm` mode. */ context?: string; /** * The rendering mode. * * @default markdown * @example markdown */ mode?: 'markdown' | 'gfm'; /** * The Markdown text to render in HTML. */ text: string; }; export type MarkdownRenderVariables = { body: MarkdownRenderRequestBody; } & GithubContext['fetcherOptions']; export const fetchMarkdownRender = ( variables: MarkdownRenderVariables, signal?: AbortSignal, ) => githubFetch< undefined, MarkdownRenderError, MarkdownRenderRequestBody, {}, {}, {} >({ url: '/markdown', method: 'post', ...variables, signal }); export const useMarkdownRender = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MarkdownRenderError, MarkdownRenderVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MarkdownRenderError, MarkdownRenderVariables >( (variables: MarkdownRenderVariables) => fetchMarkdownRender({ ...fetcherOptions, ...variables }), options, ); }; export type MarkdownRenderRawError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type MarkdownRenderRawVariables = GithubContext['fetcherOptions']; /** * You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. */ export const fetchMarkdownRenderRaw = ( variables: MarkdownRenderRawVariables, signal?: AbortSignal, ) => githubFetch({ url: '/markdown/raw', method: 'post', ...variables, signal, }); /** * You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. */ export const useMarkdownRenderRaw = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MarkdownRenderRawError, MarkdownRenderRawVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MarkdownRenderRawError, MarkdownRenderRawVariables >( (variables: MarkdownRenderRawVariables) => fetchMarkdownRenderRaw({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetSubscriptionPlanForAccountPathParams = { /** * account_id parameter */ accountId: number; }; export type AppsGetSubscriptionPlanForAccountError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 404; payload: Schemas.BasicError; } >; export type AppsGetSubscriptionPlanForAccountVariables = { pathParams: AppsGetSubscriptionPlanForAccountPathParams; } & GithubContext['fetcherOptions']; /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsGetSubscriptionPlanForAccount = ( variables: AppsGetSubscriptionPlanForAccountVariables, signal?: AbortSignal, ) => githubFetch< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountError, undefined, {}, {}, AppsGetSubscriptionPlanForAccountPathParams >({ url: '/marketplace_listing/accounts/{accountId}', method: 'get', ...variables, signal, }); /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsGetSubscriptionPlanForAccount = < TData = Schemas.MarketplacePurchase, >( variables: AppsGetSubscriptionPlanForAccountVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountError, TData >( queryKeyFn({ path: '/marketplace_listing/accounts/{account_id}', operationId: 'appsGetSubscriptionPlanForAccount', variables, }), ({ signal }) => fetchAppsGetSubscriptionPlanForAccount( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListPlansQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListPlansError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 404; payload: Responses.NotFound; } >; export type AppsListPlansResponse = Schemas.MarketplaceListingPlan[]; export type AppsListPlansVariables = { queryParams?: AppsListPlansQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all plans that are part of your GitHub Marketplace listing. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsListPlans = ( variables: AppsListPlansVariables, signal?: AbortSignal, ) => githubFetch< AppsListPlansResponse, AppsListPlansError, undefined, {}, AppsListPlansQueryParams, {} >({ url: '/marketplace_listing/plans', method: 'get', ...variables, signal }); /** * Lists all plans that are part of your GitHub Marketplace listing. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsListPlans = ( variables: AppsListPlansVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListPlansResponse, AppsListPlansError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/marketplace_listing/plans', operationId: 'appsListPlans', variables, }), ({ signal }) => fetchAppsListPlans({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsListAccountsForPlanPathParams = { /** * plan_id parameter */ planId: number; }; export type AppsListAccountsForPlanQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListAccountsForPlanError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type AppsListAccountsForPlanResponse = Schemas.MarketplacePurchase[]; export type AppsListAccountsForPlanVariables = { pathParams: AppsListAccountsForPlanPathParams; queryParams?: AppsListAccountsForPlanQueryParams; } & GithubContext['fetcherOptions']; /** * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsListAccountsForPlan = ( variables: AppsListAccountsForPlanVariables, signal?: AbortSignal, ) => githubFetch< AppsListAccountsForPlanResponse, AppsListAccountsForPlanError, undefined, {}, AppsListAccountsForPlanQueryParams, AppsListAccountsForPlanPathParams >({ url: '/marketplace_listing/plans/{planId}/accounts', method: 'get', ...variables, signal, }); /** * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsListAccountsForPlan = < TData = AppsListAccountsForPlanResponse, >( variables: AppsListAccountsForPlanVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListAccountsForPlanResponse, AppsListAccountsForPlanError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListAccountsForPlanResponse, AppsListAccountsForPlanError, TData >( queryKeyFn({ path: '/marketplace_listing/plans/{plan_id}/accounts', operationId: 'appsListAccountsForPlan', variables, }), ({ signal }) => fetchAppsListAccountsForPlan({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsGetSubscriptionPlanForAccountStubbedPathParams = { /** * account_id parameter */ accountId: number; }; export type AppsGetSubscriptionPlanForAccountStubbedError = Fetcher.ErrorWrapper<{ status: 401; payload: Responses.RequiresAuthentication; }>; export type AppsGetSubscriptionPlanForAccountStubbedVariables = { pathParams: AppsGetSubscriptionPlanForAccountStubbedPathParams; } & GithubContext['fetcherOptions']; /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsGetSubscriptionPlanForAccountStubbed = ( variables: AppsGetSubscriptionPlanForAccountStubbedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountStubbedError, undefined, {}, {}, AppsGetSubscriptionPlanForAccountStubbedPathParams >({ url: '/marketplace_listing/stubbed/accounts/{accountId}', method: 'get', ...variables, signal, }); /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsGetSubscriptionPlanForAccountStubbed = < TData = Schemas.MarketplacePurchase, >( variables: AppsGetSubscriptionPlanForAccountStubbedVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountStubbedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.MarketplacePurchase, AppsGetSubscriptionPlanForAccountStubbedError, TData >( queryKeyFn({ path: '/marketplace_listing/stubbed/accounts/{account_id}', operationId: 'appsGetSubscriptionPlanForAccountStubbed', variables, }), ({ signal }) => fetchAppsGetSubscriptionPlanForAccountStubbed( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListPlansStubbedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListPlansStubbedError = Fetcher.ErrorWrapper<{ status: 401; payload: Responses.RequiresAuthentication; }>; export type AppsListPlansStubbedResponse = Schemas.MarketplaceListingPlan[]; export type AppsListPlansStubbedVariables = { queryParams?: AppsListPlansStubbedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all plans that are part of your GitHub Marketplace listing. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsListPlansStubbed = ( variables: AppsListPlansStubbedVariables, signal?: AbortSignal, ) => githubFetch< AppsListPlansStubbedResponse, AppsListPlansStubbedError, undefined, {}, AppsListPlansStubbedQueryParams, {} >({ url: '/marketplace_listing/stubbed/plans', method: 'get', ...variables, signal, }); /** * Lists all plans that are part of your GitHub Marketplace listing. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsListPlansStubbed = ( variables: AppsListPlansStubbedVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListPlansStubbedResponse, AppsListPlansStubbedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListPlansStubbedResponse, AppsListPlansStubbedError, TData >( queryKeyFn({ path: '/marketplace_listing/stubbed/plans', operationId: 'appsListPlansStubbed', variables, }), ({ signal }) => fetchAppsListPlansStubbed({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsListAccountsForPlanStubbedPathParams = { /** * plan_id parameter */ planId: number; }; export type AppsListAccountsForPlanStubbedQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListAccountsForPlanStubbedError = Fetcher.ErrorWrapper<{ status: 401; payload: Responses.RequiresAuthentication; }>; export type AppsListAccountsForPlanStubbedResponse = Schemas.MarketplacePurchase[]; export type AppsListAccountsForPlanStubbedVariables = { pathParams: AppsListAccountsForPlanStubbedPathParams; queryParams?: AppsListAccountsForPlanStubbedQueryParams; } & GithubContext['fetcherOptions']; /** * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const fetchAppsListAccountsForPlanStubbed = ( variables: AppsListAccountsForPlanStubbedVariables, signal?: AbortSignal, ) => githubFetch< AppsListAccountsForPlanStubbedResponse, AppsListAccountsForPlanStubbedError, undefined, {}, AppsListAccountsForPlanStubbedQueryParams, AppsListAccountsForPlanStubbedPathParams >({ url: '/marketplace_listing/stubbed/plans/{planId}/accounts', method: 'get', ...variables, signal, }); /** * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ export const useAppsListAccountsForPlanStubbed = < TData = AppsListAccountsForPlanStubbedResponse, >( variables: AppsListAccountsForPlanStubbedVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListAccountsForPlanStubbedResponse, AppsListAccountsForPlanStubbedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListAccountsForPlanStubbedResponse, AppsListAccountsForPlanStubbedError, TData >( queryKeyFn({ path: '/marketplace_listing/stubbed/plans/{plan_id}/accounts', operationId: 'appsListAccountsForPlanStubbed', variables, }), ({ signal }) => fetchAppsListAccountsForPlanStubbed( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MetaGetError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type MetaGetVariables = GithubContext['fetcherOptions']; /** * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." * * **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. */ export const fetchMetaGet = ( variables: MetaGetVariables, signal?: AbortSignal, ) => githubFetch({ url: '/meta', method: 'get', ...variables, signal, }); /** * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." * * **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. */ export const useMetaGet = ( variables: MetaGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/meta', operationId: 'metaGet', variables }), ({ signal }) => fetchMetaGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActivityListPublicEventsForRepoNetworkPathParams = { owner: string; repo: string; }; export type ActivityListPublicEventsForRepoNetworkQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListPublicEventsForRepoNetworkError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ActivityListPublicEventsForRepoNetworkResponse = Schemas.Event[]; export type ActivityListPublicEventsForRepoNetworkVariables = { pathParams: ActivityListPublicEventsForRepoNetworkPathParams; queryParams?: ActivityListPublicEventsForRepoNetworkQueryParams; } & GithubContext['fetcherOptions']; export const fetchActivityListPublicEventsForRepoNetwork = ( variables: ActivityListPublicEventsForRepoNetworkVariables, signal?: AbortSignal, ) => githubFetch< ActivityListPublicEventsForRepoNetworkResponse, ActivityListPublicEventsForRepoNetworkError, undefined, {}, ActivityListPublicEventsForRepoNetworkQueryParams, ActivityListPublicEventsForRepoNetworkPathParams >({ url: '/networks/{owner}/{repo}/events', method: 'get', ...variables, signal, }); export const useActivityListPublicEventsForRepoNetwork = < TData = ActivityListPublicEventsForRepoNetworkResponse, >( variables: ActivityListPublicEventsForRepoNetworkVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListPublicEventsForRepoNetworkResponse, ActivityListPublicEventsForRepoNetworkError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListPublicEventsForRepoNetworkResponse, ActivityListPublicEventsForRepoNetworkError, TData >( queryKeyFn({ path: '/networks/{owner}/{repo}/events', operationId: 'activityListPublicEventsForRepoNetwork', variables, }), ({ signal }) => fetchActivityListPublicEventsForRepoNetwork( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListNotificationsForAuthenticatedUserQueryParams = { /** * If `true`, show notifications marked as read. * * @default false */ all?: boolean; /** * If `true`, only shows notifications in which the user is directly participating or mentioned. * * @default false */ participating?: boolean; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ before?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListNotificationsForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ActivityListNotificationsForAuthenticatedUserResponse = Schemas.Thread[]; export type ActivityListNotificationsForAuthenticatedUserVariables = { queryParams?: ActivityListNotificationsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List all notifications for the current user, sorted by most recently updated. */ export const fetchActivityListNotificationsForAuthenticatedUser = ( variables: ActivityListNotificationsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListNotificationsForAuthenticatedUserResponse, ActivityListNotificationsForAuthenticatedUserError, undefined, {}, ActivityListNotificationsForAuthenticatedUserQueryParams, {} >({ url: '/notifications', method: 'get', ...variables, signal }); /** * List all notifications for the current user, sorted by most recently updated. */ export const useActivityListNotificationsForAuthenticatedUser = < TData = ActivityListNotificationsForAuthenticatedUserResponse, >( variables: ActivityListNotificationsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListNotificationsForAuthenticatedUserResponse, ActivityListNotificationsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListNotificationsForAuthenticatedUserResponse, ActivityListNotificationsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/notifications', operationId: 'activityListNotificationsForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListNotificationsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityMarkNotificationsAsReadError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityMarkNotificationsAsReadResponse = { message?: string; }; export type ActivityMarkNotificationsAsReadRequestBody = { /** * Describes the last point that notifications were checked. * * @format date-time */ last_read_at?: string; /** * Whether the notification has been read. */ read?: boolean; }; export type ActivityMarkNotificationsAsReadVariables = { body?: ActivityMarkNotificationsAsReadRequestBody; } & GithubContext['fetcherOptions']; /** * Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ export const fetchActivityMarkNotificationsAsRead = ( variables: ActivityMarkNotificationsAsReadVariables, signal?: AbortSignal, ) => githubFetch< ActivityMarkNotificationsAsReadResponse, ActivityMarkNotificationsAsReadError, ActivityMarkNotificationsAsReadRequestBody, {}, {}, {} >({ url: '/notifications', method: 'put', ...variables, signal }); /** * Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ export const useActivityMarkNotificationsAsRead = ( options?: Omit< reactQuery.UseMutationOptions< ActivityMarkNotificationsAsReadResponse, ActivityMarkNotificationsAsReadError, ActivityMarkNotificationsAsReadVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ActivityMarkNotificationsAsReadResponse, ActivityMarkNotificationsAsReadError, ActivityMarkNotificationsAsReadVariables >( (variables: ActivityMarkNotificationsAsReadVariables) => fetchActivityMarkNotificationsAsRead({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityGetThreadPathParams = { /** * thread_id parameter */ threadId: number; }; export type ActivityGetThreadError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityGetThreadVariables = { pathParams: ActivityGetThreadPathParams; } & GithubContext['fetcherOptions']; export const fetchActivityGetThread = ( variables: ActivityGetThreadVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Thread, ActivityGetThreadError, undefined, {}, {}, ActivityGetThreadPathParams >({ url: '/notifications/threads/{threadId}', method: 'get', ...variables, signal, }); export const useActivityGetThread = ( variables: ActivityGetThreadVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/notifications/threads/{thread_id}', operationId: 'activityGetThread', variables, }), ({ signal }) => fetchActivityGetThread({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActivityMarkThreadAsReadPathParams = { /** * thread_id parameter */ threadId: number; }; export type ActivityMarkThreadAsReadError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityMarkThreadAsReadVariables = { pathParams: ActivityMarkThreadAsReadPathParams; } & GithubContext['fetcherOptions']; export const fetchActivityMarkThreadAsRead = ( variables: ActivityMarkThreadAsReadVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityMarkThreadAsReadError, undefined, {}, {}, ActivityMarkThreadAsReadPathParams >({ url: '/notifications/threads/{threadId}', method: 'patch', ...variables, signal, }); export const useActivityMarkThreadAsRead = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityMarkThreadAsReadError, ActivityMarkThreadAsReadVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityMarkThreadAsReadError, ActivityMarkThreadAsReadVariables >( (variables: ActivityMarkThreadAsReadVariables) => fetchActivityMarkThreadAsRead({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityDeleteThreadSubscriptionPathParams = { /** * thread_id parameter */ threadId: number; }; export type ActivityDeleteThreadSubscriptionError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityDeleteThreadSubscriptionVariables = { pathParams: ActivityDeleteThreadSubscriptionPathParams; } & GithubContext['fetcherOptions']; /** * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`. */ export const fetchActivityDeleteThreadSubscription = ( variables: ActivityDeleteThreadSubscriptionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityDeleteThreadSubscriptionError, undefined, {}, {}, ActivityDeleteThreadSubscriptionPathParams >({ url: '/notifications/threads/{threadId}/subscription', method: 'delete', ...variables, signal, }); /** * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`. */ export const useActivityDeleteThreadSubscription = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityDeleteThreadSubscriptionError, ActivityDeleteThreadSubscriptionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityDeleteThreadSubscriptionError, ActivityDeleteThreadSubscriptionVariables >( (variables: ActivityDeleteThreadSubscriptionVariables) => fetchActivityDeleteThreadSubscription({ ...fetcherOptions, ...variables, }), options, ); }; export type ActivityGetThreadSubscriptionForAuthenticatedUserPathParams = { /** * thread_id parameter */ threadId: number; }; export type ActivityGetThreadSubscriptionForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityGetThreadSubscriptionForAuthenticatedUserVariables = { pathParams: ActivityGetThreadSubscriptionForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). * * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. */ export const fetchActivityGetThreadSubscriptionForAuthenticatedUser = ( variables: ActivityGetThreadSubscriptionForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ThreadSubscription, ActivityGetThreadSubscriptionForAuthenticatedUserError, undefined, {}, {}, ActivityGetThreadSubscriptionForAuthenticatedUserPathParams >({ url: '/notifications/threads/{threadId}/subscription', method: 'get', ...variables, signal, }); /** * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). * * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. */ export const useActivityGetThreadSubscriptionForAuthenticatedUser = < TData = Schemas.ThreadSubscription, >( variables: ActivityGetThreadSubscriptionForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ThreadSubscription, ActivityGetThreadSubscriptionForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ThreadSubscription, ActivityGetThreadSubscriptionForAuthenticatedUserError, TData >( queryKeyFn({ path: '/notifications/threads/{thread_id}/subscription', operationId: 'activityGetThreadSubscriptionForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityGetThreadSubscriptionForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivitySetThreadSubscriptionPathParams = { /** * thread_id parameter */ threadId: number; }; export type ActivitySetThreadSubscriptionError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivitySetThreadSubscriptionRequestBody = { /** * Whether to block all notifications from a thread. * * @default false */ ignored?: boolean; }; export type ActivitySetThreadSubscriptionVariables = { body?: ActivitySetThreadSubscriptionRequestBody; pathParams: ActivitySetThreadSubscriptionPathParams; } & GithubContext['fetcherOptions']; /** * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. * * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. * * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. */ export const fetchActivitySetThreadSubscription = ( variables: ActivitySetThreadSubscriptionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ThreadSubscription, ActivitySetThreadSubscriptionError, ActivitySetThreadSubscriptionRequestBody, {}, {}, ActivitySetThreadSubscriptionPathParams >({ url: '/notifications/threads/{threadId}/subscription', method: 'put', ...variables, signal, }); /** * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. * * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. * * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. */ export const useActivitySetThreadSubscription = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ThreadSubscription, ActivitySetThreadSubscriptionError, ActivitySetThreadSubscriptionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ThreadSubscription, ActivitySetThreadSubscriptionError, ActivitySetThreadSubscriptionVariables >( (variables: ActivitySetThreadSubscriptionVariables) => fetchActivitySetThreadSubscription({ ...fetcherOptions, ...variables }), options, ); }; export type MetaGetOctocatQueryParams = { /** * The words to show in Octocat's speech bubble */ s?: string; }; export type MetaGetOctocatError = Fetcher.ErrorWrapper; export type MetaGetOctocatVariables = { queryParams?: MetaGetOctocatQueryParams; } & GithubContext['fetcherOptions']; /** * Get the octocat as ASCII art */ export const fetchMetaGetOctocat = ( variables: MetaGetOctocatVariables, signal?: AbortSignal, ) => githubFetch< undefined, MetaGetOctocatError, undefined, {}, MetaGetOctocatQueryParams, {} >({ url: '/octocat', method: 'get', ...variables, signal }); /** * Get the octocat as ASCII art */ export const useMetaGetOctocat = ( variables: MetaGetOctocatVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/octocat', operationId: 'metaGetOctocat', variables }), ({ signal }) => fetchMetaGetOctocat({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsListQueryParams = { /** * An organization ID. Only return organizations with an ID greater than this ID. */ since?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type OrgsListError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type OrgsListResponse = Schemas.OrganizationSimple[]; export type OrgsListVariables = { queryParams?: OrgsListQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all organizations, in the order that they were created on GitHub. * * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. */ export const fetchOrgsList = ( variables: OrgsListVariables, signal?: AbortSignal, ) => githubFetch< OrgsListResponse, OrgsListError, undefined, {}, OrgsListQueryParams, {} >({ url: '/organizations', method: 'get', ...variables, signal }); /** * Lists all organizations, in the order that they were created on GitHub. * * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. */ export const useOrgsList = ( variables: OrgsListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/organizations', operationId: 'orgsList', variables }), ({ signal }) => fetchOrgsList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsGetPathParams = { org: string; }; export type OrgsGetError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsGetVariables = { pathParams: OrgsGetPathParams; } & GithubContext['fetcherOptions']; /** * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). * * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." */ export const fetchOrgsGet = ( variables: OrgsGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrganizationFull, OrgsGetError, undefined, {}, {}, OrgsGetPathParams >({ url: '/orgs/{org}', method: 'get', ...variables, signal }); /** * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). * * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." */ export const useOrgsGet = ( variables: OrgsGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}', operationId: 'orgsGet', variables }), ({ signal }) => fetchOrgsGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsUpdatePathParams = { org: string; }; export type OrgsUpdateError = Fetcher.ErrorWrapper< | { status: 409; payload: Responses.Conflict; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Schemas.ValidationError | Schemas.ValidationErrorSimple; } >; export type OrgsUpdateRequestBody = { /** * Billing email address. This address is not publicized. */ billing_email?: string; /** * @example "http://github.blog" */ blog?: string; /** * The company name. */ company?: string; /** * Default permission level members have for organization repositories: * \* `read` - can pull, but not push to or administer this repository. * \* `write` - can pull and push, but not administer this repository. * \* `admin` - can pull, push, and administer this repository. * \* `none` - no permissions granted by default. * * @default read */ default_repository_permission?: 'read' | 'write' | 'admin' | 'none'; /** * The description of the company. */ description?: string; /** * The publicly visible email address. */ email?: string; /** * Toggles whether an organization can use organization projects. */ has_organization_projects?: boolean; /** * Toggles whether repositories that belong to the organization can use repository projects. */ has_repository_projects?: boolean; /** * The location. */ location?: string; /** * Specifies which types of repositories non-admin organization members can create. Can be one of: * \* `all` - all organization members can create public and private repositories. * \* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. * \* `none` - only admin members can create repositories. * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. */ members_allowed_repository_creation_type?: 'all' | 'private' | 'none'; /** * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: * \* `true` - all organization members can create internal repositories. * \* `false` - only organization owners can create internal repositories. * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ members_can_create_internal_repositories?: boolean; /** * Toggles whether organization members can create GitHub Pages sites. Can be one of: * \* `true` - all organization members can create GitHub Pages sites. * \* `false` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. * * @default true */ members_can_create_pages?: boolean; /** * Toggles whether organization members can create private GitHub Pages sites. Can be one of: * \* `true` - all organization members can create private GitHub Pages sites. * \* `false` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. * * @default true */ members_can_create_private_pages?: boolean; /** * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: * \* `true` - all organization members can create private repositories. * \* `false` - only organization owners can create private repositories. * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ members_can_create_private_repositories?: boolean; /** * Toggles whether organization members can create public GitHub Pages sites. Can be one of: * \* `true` - all organization members can create public GitHub Pages sites. * \* `false` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. * * @default true */ members_can_create_public_pages?: boolean; /** * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: * \* `true` - all organization members can create public repositories. * \* `false` - only organization owners can create public repositories. * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ members_can_create_public_repositories?: boolean; /** * Toggles the ability of non-admin organization members to create repositories. Can be one of: * \* `true` - all organization members can create repositories. * \* `false` - only organization owners can create repositories. * Default: `true` * **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. * * @default true */ members_can_create_repositories?: boolean; /** * The shorthand name of the company. */ name?: string; /** * The Twitter username of the company. */ twitter_username?: string; }; export type OrgsUpdateVariables = { body?: OrgsUpdateRequestBody; pathParams: OrgsUpdatePathParams; } & GithubContext['fetcherOptions']; /** * **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). * * Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges. */ export const fetchOrgsUpdate = ( variables: OrgsUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrganizationFull, OrgsUpdateError, OrgsUpdateRequestBody, {}, {}, OrgsUpdatePathParams >({ url: '/orgs/{org}', method: 'patch', ...variables, signal }); /** * **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). * * Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges. */ export const useOrgsUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrganizationFull, OrgsUpdateError, OrgsUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrganizationFull, OrgsUpdateError, OrgsUpdateVariables >( (variables: OrgsUpdateVariables) => fetchOrgsUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetGithubActionsPermissionsOrganizationPathParams = { org: string; }; export type ActionsGetGithubActionsPermissionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsGetGithubActionsPermissionsOrganizationVariables = { pathParams: ActionsGetGithubActionsPermissionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsGetGithubActionsPermissionsOrganization = ( variables: ActionsGetGithubActionsPermissionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsOrganizationPermissions, ActionsGetGithubActionsPermissionsOrganizationError, undefined, {}, {}, ActionsGetGithubActionsPermissionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions', method: 'get', ...variables, signal, }); /** * Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsGetGithubActionsPermissionsOrganization = < TData = Schemas.ActionsOrganizationPermissions, >( variables: ActionsGetGithubActionsPermissionsOrganizationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsOrganizationPermissions, ActionsGetGithubActionsPermissionsOrganizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsOrganizationPermissions, ActionsGetGithubActionsPermissionsOrganizationError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/permissions', operationId: 'actionsGetGithubActionsPermissionsOrganization', variables, }), ({ signal }) => fetchActionsGetGithubActionsPermissionsOrganization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetGithubActionsPermissionsOrganizationPathParams = { org: string; }; export type ActionsSetGithubActionsPermissionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsSetGithubActionsPermissionsOrganizationRequestBody = { allowed_actions?: Schemas.AllowedActions; enabled_repositories: Schemas.EnabledRepositories; }; export type ActionsSetGithubActionsPermissionsOrganizationVariables = { body: ActionsSetGithubActionsPermissionsOrganizationRequestBody; pathParams: ActionsSetGithubActionsPermissionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. * * If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsSetGithubActionsPermissionsOrganization = ( variables: ActionsSetGithubActionsPermissionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetGithubActionsPermissionsOrganizationError, ActionsSetGithubActionsPermissionsOrganizationRequestBody, {}, {}, ActionsSetGithubActionsPermissionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions', method: 'put', ...variables, signal, }); /** * Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. * * If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsSetGithubActionsPermissionsOrganization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetGithubActionsPermissionsOrganizationError, ActionsSetGithubActionsPermissionsOrganizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetGithubActionsPermissionsOrganizationError, ActionsSetGithubActionsPermissionsOrganizationVariables >( (variables: ActionsSetGithubActionsPermissionsOrganizationVariables) => fetchActionsSetGithubActionsPermissionsOrganization({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationPathParams = { org: string; }; export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse = { repositories: Schemas.Repository[]; total_count: number; }; export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationVariables = { pathParams: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationPathParams; queryParams?: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsListSelectedRepositoriesEnabledGithubActionsOrganization = ( variables: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse, ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationError, undefined, {}, ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationQueryParams, ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/repositories', method: 'get', ...variables, signal, }); /** * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsListSelectedRepositoriesEnabledGithubActionsOrganization = < TData = ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse, >( variables: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse, ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse, ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/permissions/repositories', operationId: 'actionsListSelectedRepositoriesEnabledGithubActionsOrganization', variables, }), ({ signal }) => fetchActionsListSelectedRepositoriesEnabledGithubActionsOrganization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPathParams = { org: string; }; export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationRequestBody = { /** * List of repository IDs to enable for GitHub Actions. */ selected_repository_ids: number[]; }; export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationVariables = { body: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationRequestBody; pathParams: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsSetSelectedRepositoriesEnabledGithubActionsOrganization = ( variables: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationRequestBody, {}, {}, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/repositories', method: 'put', ...variables, signal, }); /** * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsSetSelectedRepositoriesEnabledGithubActionsOrganization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationError, ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationVariables >( ( variables: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationVariables, ) => fetchActionsSetSelectedRepositoriesEnabledGithubActionsOrganization({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsDisableSelectedRepositoryGithubActionsOrganizationPathParams = { org: string; repositoryId: number; }; export type ActionsDisableSelectedRepositoryGithubActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsDisableSelectedRepositoryGithubActionsOrganizationVariables = { pathParams: ActionsDisableSelectedRepositoryGithubActionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsDisableSelectedRepositoryGithubActionsOrganization = ( variables: ActionsDisableSelectedRepositoryGithubActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDisableSelectedRepositoryGithubActionsOrganizationError, undefined, {}, {}, ActionsDisableSelectedRepositoryGithubActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/repositories/{repositoryId}', method: 'delete', ...variables, signal, }); /** * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsDisableSelectedRepositoryGithubActionsOrganization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDisableSelectedRepositoryGithubActionsOrganizationError, ActionsDisableSelectedRepositoryGithubActionsOrganizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDisableSelectedRepositoryGithubActionsOrganizationError, ActionsDisableSelectedRepositoryGithubActionsOrganizationVariables >( ( variables: ActionsDisableSelectedRepositoryGithubActionsOrganizationVariables, ) => fetchActionsDisableSelectedRepositoryGithubActionsOrganization({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsEnableSelectedRepositoryGithubActionsOrganizationPathParams = { org: string; repositoryId: number; }; export type ActionsEnableSelectedRepositoryGithubActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsEnableSelectedRepositoryGithubActionsOrganizationVariables = { pathParams: ActionsEnableSelectedRepositoryGithubActionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsEnableSelectedRepositoryGithubActionsOrganization = ( variables: ActionsEnableSelectedRepositoryGithubActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsEnableSelectedRepositoryGithubActionsOrganizationError, undefined, {}, {}, ActionsEnableSelectedRepositoryGithubActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/repositories/{repositoryId}', method: 'put', ...variables, signal, }); /** * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsEnableSelectedRepositoryGithubActionsOrganization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsEnableSelectedRepositoryGithubActionsOrganizationError, ActionsEnableSelectedRepositoryGithubActionsOrganizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsEnableSelectedRepositoryGithubActionsOrganizationError, ActionsEnableSelectedRepositoryGithubActionsOrganizationVariables >( ( variables: ActionsEnableSelectedRepositoryGithubActionsOrganizationVariables, ) => fetchActionsEnableSelectedRepositoryGithubActionsOrganization({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsGetAllowedActionsOrganizationPathParams = { org: string; }; export type ActionsGetAllowedActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsGetAllowedActionsOrganizationVariables = { pathParams: ActionsGetAllowedActionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsGetAllowedActionsOrganization = ( variables: ActionsGetAllowedActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.SelectedActions, ActionsGetAllowedActionsOrganizationError, undefined, {}, {}, ActionsGetAllowedActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/selected-actions', method: 'get', ...variables, signal, }); /** * Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsGetAllowedActionsOrganization = < TData = Schemas.SelectedActions, >( variables: ActionsGetAllowedActionsOrganizationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.SelectedActions, ActionsGetAllowedActionsOrganizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.SelectedActions, ActionsGetAllowedActionsOrganizationError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/permissions/selected-actions', operationId: 'actionsGetAllowedActionsOrganization', variables, }), ({ signal }) => fetchActionsGetAllowedActionsOrganization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetAllowedActionsOrganizationPathParams = { org: string; }; export type ActionsSetAllowedActionsOrganizationError = Fetcher.ErrorWrapper; export type ActionsSetAllowedActionsOrganizationVariables = { body: Schemas.SelectedActions; pathParams: ActionsSetAllowedActionsOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. * * To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const fetchActionsSetAllowedActionsOrganization = ( variables: ActionsSetAllowedActionsOrganizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetAllowedActionsOrganizationError, Schemas.SelectedActions, {}, {}, ActionsSetAllowedActionsOrganizationPathParams >({ url: '/orgs/{org}/actions/permissions/selected-actions', method: 'put', ...variables, signal, }); /** * Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." * * If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. * * To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. */ export const useActionsSetAllowedActionsOrganization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetAllowedActionsOrganizationError, ActionsSetAllowedActionsOrganizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetAllowedActionsOrganizationError, ActionsSetAllowedActionsOrganizationVariables >( (variables: ActionsSetAllowedActionsOrganizationVariables) => fetchActionsSetAllowedActionsOrganization({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListSelfHostedRunnerGroupsForOrgPathParams = { org: string; }; export type ActionsListSelfHostedRunnerGroupsForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListSelfHostedRunnerGroupsForOrgError = Fetcher.ErrorWrapper; export type ActionsListSelfHostedRunnerGroupsForOrgResponse = { runner_groups: Schemas.RunnerGroupsOrg[]; total_count: number; }; export type ActionsListSelfHostedRunnerGroupsForOrgVariables = { pathParams: ActionsListSelfHostedRunnerGroupsForOrgPathParams; queryParams?: ActionsListSelfHostedRunnerGroupsForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsListSelfHostedRunnerGroupsForOrg = ( variables: ActionsListSelfHostedRunnerGroupsForOrgVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelfHostedRunnerGroupsForOrgResponse, ActionsListSelfHostedRunnerGroupsForOrgError, undefined, {}, ActionsListSelfHostedRunnerGroupsForOrgQueryParams, ActionsListSelfHostedRunnerGroupsForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups', method: 'get', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsListSelfHostedRunnerGroupsForOrg = < TData = ActionsListSelfHostedRunnerGroupsForOrgResponse, >( variables: ActionsListSelfHostedRunnerGroupsForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelfHostedRunnerGroupsForOrgResponse, ActionsListSelfHostedRunnerGroupsForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelfHostedRunnerGroupsForOrgResponse, ActionsListSelfHostedRunnerGroupsForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runner-groups', operationId: 'actionsListSelfHostedRunnerGroupsForOrg', variables, }), ({ signal }) => fetchActionsListSelfHostedRunnerGroupsForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsCreateSelfHostedRunnerGroupForOrgPathParams = { org: string; }; export type ActionsCreateSelfHostedRunnerGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsCreateSelfHostedRunnerGroupForOrgRequestBody = { /** * Name of the runner group. */ name: string; /** * List of runner IDs to add to the runner group. */ runners?: number[]; /** * List of repository IDs that can access the runner group. */ selected_repository_ids?: number[]; /** * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: `all`, `selected`, or `private`. * * @default all */ visibility?: 'selected' | 'all' | 'private'; }; export type ActionsCreateSelfHostedRunnerGroupForOrgVariables = { body: ActionsCreateSelfHostedRunnerGroupForOrgRequestBody; pathParams: ActionsCreateSelfHostedRunnerGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Creates a new self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsCreateSelfHostedRunnerGroupForOrg = ( variables: ActionsCreateSelfHostedRunnerGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsOrg, ActionsCreateSelfHostedRunnerGroupForOrgError, ActionsCreateSelfHostedRunnerGroupForOrgRequestBody, {}, {}, ActionsCreateSelfHostedRunnerGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups', method: 'post', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Creates a new self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsCreateSelfHostedRunnerGroupForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RunnerGroupsOrg, ActionsCreateSelfHostedRunnerGroupForOrgError, ActionsCreateSelfHostedRunnerGroupForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RunnerGroupsOrg, ActionsCreateSelfHostedRunnerGroupForOrgError, ActionsCreateSelfHostedRunnerGroupForOrgVariables >( (variables: ActionsCreateSelfHostedRunnerGroupForOrgVariables) => fetchActionsCreateSelfHostedRunnerGroupForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsDeleteSelfHostedRunnerGroupFromOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsDeleteSelfHostedRunnerGroupFromOrgError = Fetcher.ErrorWrapper; export type ActionsDeleteSelfHostedRunnerGroupFromOrgVariables = { pathParams: ActionsDeleteSelfHostedRunnerGroupFromOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Deletes a self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsDeleteSelfHostedRunnerGroupFromOrg = ( variables: ActionsDeleteSelfHostedRunnerGroupFromOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteSelfHostedRunnerGroupFromOrgError, undefined, {}, {}, ActionsDeleteSelfHostedRunnerGroupFromOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}', method: 'delete', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Deletes a self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsDeleteSelfHostedRunnerGroupFromOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteSelfHostedRunnerGroupFromOrgError, ActionsDeleteSelfHostedRunnerGroupFromOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteSelfHostedRunnerGroupFromOrgError, ActionsDeleteSelfHostedRunnerGroupFromOrgVariables >( (variables: ActionsDeleteSelfHostedRunnerGroupFromOrgVariables) => fetchActionsDeleteSelfHostedRunnerGroupFromOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsGetSelfHostedRunnerGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsGetSelfHostedRunnerGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsGetSelfHostedRunnerGroupForOrgVariables = { pathParams: ActionsGetSelfHostedRunnerGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Gets a specific self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsGetSelfHostedRunnerGroupForOrg = ( variables: ActionsGetSelfHostedRunnerGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsOrg, ActionsGetSelfHostedRunnerGroupForOrgError, undefined, {}, {}, ActionsGetSelfHostedRunnerGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}', method: 'get', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Gets a specific self-hosted runner group for an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsGetSelfHostedRunnerGroupForOrg = < TData = Schemas.RunnerGroupsOrg, >( variables: ActionsGetSelfHostedRunnerGroupForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RunnerGroupsOrg, ActionsGetSelfHostedRunnerGroupForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RunnerGroupsOrg, ActionsGetSelfHostedRunnerGroupForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runner-groups/{runner_group_id}', operationId: 'actionsGetSelfHostedRunnerGroupForOrg', variables, }), ({ signal }) => fetchActionsGetSelfHostedRunnerGroupForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsUpdateSelfHostedRunnerGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsUpdateSelfHostedRunnerGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsUpdateSelfHostedRunnerGroupForOrgRequestBody = { /** * Name of the runner group. */ name?: string; /** * Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: `all`, `selected`, or `private`. */ visibility?: 'selected' | 'all' | 'private'; }; export type ActionsUpdateSelfHostedRunnerGroupForOrgVariables = { body?: ActionsUpdateSelfHostedRunnerGroupForOrgRequestBody; pathParams: ActionsUpdateSelfHostedRunnerGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Updates the `name` and `visibility` of a self-hosted runner group in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsUpdateSelfHostedRunnerGroupForOrg = ( variables: ActionsUpdateSelfHostedRunnerGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RunnerGroupsOrg, ActionsUpdateSelfHostedRunnerGroupForOrgError, ActionsUpdateSelfHostedRunnerGroupForOrgRequestBody, {}, {}, ActionsUpdateSelfHostedRunnerGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}', method: 'patch', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Updates the `name` and `visibility` of a self-hosted runner group in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsUpdateSelfHostedRunnerGroupForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RunnerGroupsOrg, ActionsUpdateSelfHostedRunnerGroupForOrgError, ActionsUpdateSelfHostedRunnerGroupForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RunnerGroupsOrg, ActionsUpdateSelfHostedRunnerGroupForOrgError, ActionsUpdateSelfHostedRunnerGroupForOrgVariables >( (variables: ActionsUpdateSelfHostedRunnerGroupForOrgVariables) => fetchActionsUpdateSelfHostedRunnerGroupForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgError = Fetcher.ErrorWrapper; export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse = { repositories: Schemas.Repository[]; total_count: number; }; export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgVariables = { pathParams: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgPathParams; queryParams?: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists the repositories with access to a self-hosted runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsListRepoAccessToSelfHostedRunnerGroupInOrg = ( variables: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgVariables, signal?: AbortSignal, ) => githubFetch< ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse, ActionsListRepoAccessToSelfHostedRunnerGroupInOrgError, undefined, {}, ActionsListRepoAccessToSelfHostedRunnerGroupInOrgQueryParams, ActionsListRepoAccessToSelfHostedRunnerGroupInOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/repositories', method: 'get', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists the repositories with access to a self-hosted runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsListRepoAccessToSelfHostedRunnerGroupInOrg = < TData = ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse, >( variables: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse, ActionsListRepoAccessToSelfHostedRunnerGroupInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse, ActionsListRepoAccessToSelfHostedRunnerGroupInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories', operationId: 'actionsListRepoAccessToSelfHostedRunnerGroupInOrg', variables, }), ({ signal }) => fetchActionsListRepoAccessToSelfHostedRunnerGroupInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError = Fetcher.ErrorWrapper; export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgRequestBody = { /** * List of repository IDs that can access the runner group. */ selected_repository_ids: number[]; }; export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgVariables = { body: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgRequestBody; pathParams: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsSetRepoAccessToSelfHostedRunnerGroupInOrg = ( variables: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgRequestBody, {}, {}, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/repositories', method: 'put', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsSetRepoAccessToSelfHostedRunnerGroupInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgVariables >( (variables: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgVariables) => fetchActionsSetRepoAccessToSelfHostedRunnerGroupInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; repositoryId: number; }; export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError = Fetcher.ErrorWrapper; export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgVariables = { pathParams: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg = ( variables: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError, undefined, {}, {}, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/repositories/{repositoryId}', method: 'delete', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgVariables >( (variables: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgVariables) => fetchActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; repositoryId: number; }; export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError = Fetcher.ErrorWrapper; export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgVariables = { pathParams: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." * * You must authenticate using an access token with the `admin:org` * scope to use this endpoint. */ export const fetchActionsAddRepoAccessToSelfHostedRunnerGroupInOrg = ( variables: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError, undefined, {}, {}, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/repositories/{repositoryId}', method: 'put', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." * * You must authenticate using an access token with the `admin:org` * scope to use this endpoint. */ export const useActionsAddRepoAccessToSelfHostedRunnerGroupInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgError, ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgVariables >( (variables: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgVariables) => fetchActionsAddRepoAccessToSelfHostedRunnerGroupInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListSelfHostedRunnersInGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsListSelfHostedRunnersInGroupForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListSelfHostedRunnersInGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsListSelfHostedRunnersInGroupForOrgResponse = { runners: Schemas.Runner[]; total_count: number; }; export type ActionsListSelfHostedRunnersInGroupForOrgVariables = { pathParams: ActionsListSelfHostedRunnersInGroupForOrgPathParams; queryParams?: ActionsListSelfHostedRunnersInGroupForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists self-hosted runners that are in a specific organization group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsListSelfHostedRunnersInGroupForOrg = ( variables: ActionsListSelfHostedRunnersInGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelfHostedRunnersInGroupForOrgResponse, ActionsListSelfHostedRunnersInGroupForOrgError, undefined, {}, ActionsListSelfHostedRunnersInGroupForOrgQueryParams, ActionsListSelfHostedRunnersInGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/runners', method: 'get', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Lists self-hosted runners that are in a specific organization group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsListSelfHostedRunnersInGroupForOrg = < TData = ActionsListSelfHostedRunnersInGroupForOrgResponse, >( variables: ActionsListSelfHostedRunnersInGroupForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelfHostedRunnersInGroupForOrgResponse, ActionsListSelfHostedRunnersInGroupForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelfHostedRunnersInGroupForOrgResponse, ActionsListSelfHostedRunnersInGroupForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runner-groups/{runner_group_id}/runners', operationId: 'actionsListSelfHostedRunnersInGroupForOrg', variables, }), ({ signal }) => fetchActionsListSelfHostedRunnersInGroupForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetSelfHostedRunnersInGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; }; export type ActionsSetSelfHostedRunnersInGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsSetSelfHostedRunnersInGroupForOrgRequestBody = { /** * List of runner IDs to add to the runner group. */ runners: number[]; }; export type ActionsSetSelfHostedRunnersInGroupForOrgVariables = { body: ActionsSetSelfHostedRunnersInGroupForOrgRequestBody; pathParams: ActionsSetSelfHostedRunnersInGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Replaces the list of self-hosted runners that are part of an organization runner group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsSetSelfHostedRunnersInGroupForOrg = ( variables: ActionsSetSelfHostedRunnersInGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetSelfHostedRunnersInGroupForOrgError, ActionsSetSelfHostedRunnersInGroupForOrgRequestBody, {}, {}, ActionsSetSelfHostedRunnersInGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/runners', method: 'put', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * Replaces the list of self-hosted runners that are part of an organization runner group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsSetSelfHostedRunnersInGroupForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetSelfHostedRunnersInGroupForOrgError, ActionsSetSelfHostedRunnersInGroupForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetSelfHostedRunnersInGroupForOrgError, ActionsSetSelfHostedRunnersInGroupForOrgVariables >( (variables: ActionsSetSelfHostedRunnersInGroupForOrgVariables) => fetchActionsSetSelfHostedRunnersInGroupForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsRemoveSelfHostedRunnerFromGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsRemoveSelfHostedRunnerFromGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsRemoveSelfHostedRunnerFromGroupForOrgVariables = { pathParams: ActionsRemoveSelfHostedRunnerFromGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsRemoveSelfHostedRunnerFromGroupForOrg = ( variables: ActionsRemoveSelfHostedRunnerFromGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsRemoveSelfHostedRunnerFromGroupForOrgError, undefined, {}, {}, ActionsRemoveSelfHostedRunnerFromGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/runners/{runnerId}', method: 'delete', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsRemoveSelfHostedRunnerFromGroupForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsRemoveSelfHostedRunnerFromGroupForOrgError, ActionsRemoveSelfHostedRunnerFromGroupForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsRemoveSelfHostedRunnerFromGroupForOrgError, ActionsRemoveSelfHostedRunnerFromGroupForOrgVariables >( (variables: ActionsRemoveSelfHostedRunnerFromGroupForOrgVariables) => fetchActionsRemoveSelfHostedRunnerFromGroupForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsAddSelfHostedRunnerToGroupForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner group. */ runnerGroupId: number; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsAddSelfHostedRunnerToGroupForOrgError = Fetcher.ErrorWrapper; export type ActionsAddSelfHostedRunnerToGroupForOrgVariables = { pathParams: ActionsAddSelfHostedRunnerToGroupForOrgPathParams; } & GithubContext['fetcherOptions']; /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Adds a self-hosted runner to a runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` * scope to use this endpoint. */ export const fetchActionsAddSelfHostedRunnerToGroupForOrg = ( variables: ActionsAddSelfHostedRunnerToGroupForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsAddSelfHostedRunnerToGroupForOrgError, undefined, {}, {}, ActionsAddSelfHostedRunnerToGroupForOrgPathParams >({ url: '/orgs/{org}/actions/runner-groups/{runnerGroupId}/runners/{runnerId}', method: 'put', ...variables, signal, }); /** * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." * * * Adds a self-hosted runner to a runner group configured in an organization. * * You must authenticate using an access token with the `admin:org` * scope to use this endpoint. */ export const useActionsAddSelfHostedRunnerToGroupForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsAddSelfHostedRunnerToGroupForOrgError, ActionsAddSelfHostedRunnerToGroupForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsAddSelfHostedRunnerToGroupForOrgError, ActionsAddSelfHostedRunnerToGroupForOrgVariables >( (variables: ActionsAddSelfHostedRunnerToGroupForOrgVariables) => fetchActionsAddSelfHostedRunnerToGroupForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListSelfHostedRunnersForOrgPathParams = { org: string; }; export type ActionsListSelfHostedRunnersForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListSelfHostedRunnersForOrgError = Fetcher.ErrorWrapper; export type ActionsListSelfHostedRunnersForOrgResponse = { runners: Schemas.Runner[]; total_count: number; }; export type ActionsListSelfHostedRunnersForOrgVariables = { pathParams: ActionsListSelfHostedRunnersForOrgPathParams; queryParams?: ActionsListSelfHostedRunnersForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all self-hosted runners configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsListSelfHostedRunnersForOrg = ( variables: ActionsListSelfHostedRunnersForOrgVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelfHostedRunnersForOrgResponse, ActionsListSelfHostedRunnersForOrgError, undefined, {}, ActionsListSelfHostedRunnersForOrgQueryParams, ActionsListSelfHostedRunnersForOrgPathParams >({ url: '/orgs/{org}/actions/runners', method: 'get', ...variables, signal, }); /** * Lists all self-hosted runners configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsListSelfHostedRunnersForOrg = < TData = ActionsListSelfHostedRunnersForOrgResponse, >( variables: ActionsListSelfHostedRunnersForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelfHostedRunnersForOrgResponse, ActionsListSelfHostedRunnersForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelfHostedRunnersForOrgResponse, ActionsListSelfHostedRunnersForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runners', operationId: 'actionsListSelfHostedRunnersForOrg', variables, }), ({ signal }) => fetchActionsListSelfHostedRunnersForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsListRunnerApplicationsForOrgPathParams = { org: string; }; export type ActionsListRunnerApplicationsForOrgError = Fetcher.ErrorWrapper; export type ActionsListRunnerApplicationsForOrgResponse = Schemas.RunnerApplication[]; export type ActionsListRunnerApplicationsForOrgVariables = { pathParams: ActionsListRunnerApplicationsForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsListRunnerApplicationsForOrg = ( variables: ActionsListRunnerApplicationsForOrgVariables, signal?: AbortSignal, ) => githubFetch< ActionsListRunnerApplicationsForOrgResponse, ActionsListRunnerApplicationsForOrgError, undefined, {}, {}, ActionsListRunnerApplicationsForOrgPathParams >({ url: '/orgs/{org}/actions/runners/downloads', method: 'get', ...variables, signal, }); /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsListRunnerApplicationsForOrg = < TData = ActionsListRunnerApplicationsForOrgResponse, >( variables: ActionsListRunnerApplicationsForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListRunnerApplicationsForOrgResponse, ActionsListRunnerApplicationsForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListRunnerApplicationsForOrgResponse, ActionsListRunnerApplicationsForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runners/downloads', operationId: 'actionsListRunnerApplicationsForOrg', variables, }), ({ signal }) => fetchActionsListRunnerApplicationsForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsCreateRegistrationTokenForOrgPathParams = { org: string; }; export type ActionsCreateRegistrationTokenForOrgError = Fetcher.ErrorWrapper; export type ActionsCreateRegistrationTokenForOrgVariables = { pathParams: ActionsCreateRegistrationTokenForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to the `config` script. The token expires after one hour. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/octo-org --token TOKEN * ``` */ export const fetchActionsCreateRegistrationTokenForOrg = ( variables: ActionsCreateRegistrationTokenForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForOrgError, undefined, {}, {}, ActionsCreateRegistrationTokenForOrgPathParams >({ url: '/orgs/{org}/actions/runners/registration-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to the `config` script. The token expires after one hour. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/octo-org --token TOKEN * ``` */ export const useActionsCreateRegistrationTokenForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForOrgError, ActionsCreateRegistrationTokenForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForOrgError, ActionsCreateRegistrationTokenForOrgVariables >( (variables: ActionsCreateRegistrationTokenForOrgVariables) => fetchActionsCreateRegistrationTokenForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsCreateRemoveTokenForOrgPathParams = { org: string; }; export type ActionsCreateRemoveTokenForOrgError = Fetcher.ErrorWrapper; export type ActionsCreateRemoveTokenForOrgVariables = { pathParams: ActionsCreateRemoveTokenForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this * endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const fetchActionsCreateRemoveTokenForOrg = ( variables: ActionsCreateRemoveTokenForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForOrgError, undefined, {}, {}, ActionsCreateRemoveTokenForOrgPathParams >({ url: '/orgs/{org}/actions/runners/remove-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this * endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const useActionsCreateRemoveTokenForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForOrgError, ActionsCreateRemoveTokenForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForOrgError, ActionsCreateRemoveTokenForOrgVariables >( (variables: ActionsCreateRemoveTokenForOrgVariables) => fetchActionsCreateRemoveTokenForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsDeleteSelfHostedRunnerFromOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsDeleteSelfHostedRunnerFromOrgError = Fetcher.ErrorWrapper; export type ActionsDeleteSelfHostedRunnerFromOrgVariables = { pathParams: ActionsDeleteSelfHostedRunnerFromOrgPathParams; } & GithubContext['fetcherOptions']; /** * Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsDeleteSelfHostedRunnerFromOrg = ( variables: ActionsDeleteSelfHostedRunnerFromOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteSelfHostedRunnerFromOrgError, undefined, {}, {}, ActionsDeleteSelfHostedRunnerFromOrgPathParams >({ url: '/orgs/{org}/actions/runners/{runnerId}', method: 'delete', ...variables, signal, }); /** * Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsDeleteSelfHostedRunnerFromOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteSelfHostedRunnerFromOrgError, ActionsDeleteSelfHostedRunnerFromOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteSelfHostedRunnerFromOrgError, ActionsDeleteSelfHostedRunnerFromOrgVariables >( (variables: ActionsDeleteSelfHostedRunnerFromOrgVariables) => fetchActionsDeleteSelfHostedRunnerFromOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsGetSelfHostedRunnerForOrgPathParams = { org: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsGetSelfHostedRunnerForOrgError = Fetcher.ErrorWrapper; export type ActionsGetSelfHostedRunnerForOrgVariables = { pathParams: ActionsGetSelfHostedRunnerForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific self-hosted runner configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const fetchActionsGetSelfHostedRunnerForOrg = ( variables: ActionsGetSelfHostedRunnerForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Runner, ActionsGetSelfHostedRunnerForOrgError, undefined, {}, {}, ActionsGetSelfHostedRunnerForOrgPathParams >({ url: '/orgs/{org}/actions/runners/{runnerId}', method: 'get', ...variables, signal, }); /** * Gets a specific self-hosted runner configured in an organization. * * You must authenticate using an access token with the `admin:org` scope to use this endpoint. */ export const useActionsGetSelfHostedRunnerForOrg = ( variables: ActionsGetSelfHostedRunnerForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Runner, ActionsGetSelfHostedRunnerForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Runner, ActionsGetSelfHostedRunnerForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/runners/{runner_id}', operationId: 'actionsGetSelfHostedRunnerForOrg', variables, }), ({ signal }) => fetchActionsGetSelfHostedRunnerForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsListOrgSecretsPathParams = { org: string; }; export type ActionsListOrgSecretsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListOrgSecretsError = Fetcher.ErrorWrapper; export type ActionsListOrgSecretsResponse = { secrets: Schemas.OrganizationActionsSecret[]; total_count: number; }; export type ActionsListOrgSecretsVariables = { pathParams: ActionsListOrgSecretsPathParams; queryParams?: ActionsListOrgSecretsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsListOrgSecrets = ( variables: ActionsListOrgSecretsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListOrgSecretsResponse, ActionsListOrgSecretsError, undefined, {}, ActionsListOrgSecretsQueryParams, ActionsListOrgSecretsPathParams >({ url: '/orgs/{org}/actions/secrets', method: 'get', ...variables, signal, }); /** * Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsListOrgSecrets = ( variables: ActionsListOrgSecretsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListOrgSecretsResponse, ActionsListOrgSecretsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListOrgSecretsResponse, ActionsListOrgSecretsError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/secrets', operationId: 'actionsListOrgSecrets', variables, }), ({ signal }) => fetchActionsListOrgSecrets({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsGetOrgPublicKeyPathParams = { org: string; }; export type ActionsGetOrgPublicKeyError = Fetcher.ErrorWrapper; export type ActionsGetOrgPublicKeyVariables = { pathParams: ActionsGetOrgPublicKeyPathParams; } & GithubContext['fetcherOptions']; /** * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsGetOrgPublicKey = ( variables: ActionsGetOrgPublicKeyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsPublicKey, ActionsGetOrgPublicKeyError, undefined, {}, {}, ActionsGetOrgPublicKeyPathParams >({ url: '/orgs/{org}/actions/secrets/public-key', method: 'get', ...variables, signal, }); /** * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsGetOrgPublicKey = ( variables: ActionsGetOrgPublicKeyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsPublicKey, ActionsGetOrgPublicKeyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsPublicKey, ActionsGetOrgPublicKeyError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/secrets/public-key', operationId: 'actionsGetOrgPublicKey', variables, }), ({ signal }) => fetchActionsGetOrgPublicKey({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; }; export type ActionsDeleteOrgSecretError = Fetcher.ErrorWrapper; export type ActionsDeleteOrgSecretVariables = { pathParams: ActionsDeleteOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsDeleteOrgSecret = ( variables: ActionsDeleteOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteOrgSecretError, undefined, {}, {}, ActionsDeleteOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}', method: 'delete', ...variables, signal, }); /** * Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsDeleteOrgSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteOrgSecretError, ActionsDeleteOrgSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteOrgSecretError, ActionsDeleteOrgSecretVariables >( (variables: ActionsDeleteOrgSecretVariables) => fetchActionsDeleteOrgSecret({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; }; export type ActionsGetOrgSecretError = Fetcher.ErrorWrapper; export type ActionsGetOrgSecretVariables = { pathParams: ActionsGetOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsGetOrgSecret = ( variables: ActionsGetOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrganizationActionsSecret, ActionsGetOrgSecretError, undefined, {}, {}, ActionsGetOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}', method: 'get', ...variables, signal, }); /** * Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsGetOrgSecret = < TData = Schemas.OrganizationActionsSecret, >( variables: ActionsGetOrgSecretVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.OrganizationActionsSecret, ActionsGetOrgSecretError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.OrganizationActionsSecret, ActionsGetOrgSecretError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/secrets/{secret_name}', operationId: 'actionsGetOrgSecret', variables, }), ({ signal }) => fetchActionsGetOrgSecret({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsCreateOrUpdateOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; }; export type ActionsCreateOrUpdateOrgSecretError = Fetcher.ErrorWrapper; export type ActionsCreateOrUpdateOrgSecretRequestBody = { /** * Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. * * @pattern ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$ */ encrypted_value?: string; /** * ID of the key you used to encrypt the secret. */ key_id?: string; /** * An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ selected_repository_ids?: string[]; /** * Configures the access that repositories have to the organization secret. Can be one of: * \- `all` - All repositories in an organization can access the secret. * \- `private` - Private repositories in an organization can access the secret. * \- `selected` - Only specific repositories can access the secret. */ visibility?: 'all' | 'private' | 'selected'; }; export type ActionsCreateOrUpdateOrgSecretVariables = { body?: ActionsCreateOrUpdateOrgSecretRequestBody; pathParams: ActionsCreateOrUpdateOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Creates or updates an organization secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to * use this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const fetchActionsCreateOrUpdateOrgSecret = ( variables: ActionsCreateOrUpdateOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsCreateOrUpdateOrgSecretError, ActionsCreateOrUpdateOrgSecretRequestBody, {}, {}, ActionsCreateOrUpdateOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}', method: 'put', ...variables, signal, }); /** * Creates or updates an organization secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to * use this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const useActionsCreateOrUpdateOrgSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsCreateOrUpdateOrgSecretError, ActionsCreateOrUpdateOrgSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsCreateOrUpdateOrgSecretError, ActionsCreateOrUpdateOrgSecretVariables >( (variables: ActionsCreateOrUpdateOrgSecretVariables) => fetchActionsCreateOrUpdateOrgSecret({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsListSelectedReposForOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; }; export type ActionsListSelectedReposForOrgSecretQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type ActionsListSelectedReposForOrgSecretError = Fetcher.ErrorWrapper; export type ActionsListSelectedReposForOrgSecretResponse = { repositories: Schemas.MinimalRepository[]; total_count: number; }; export type ActionsListSelectedReposForOrgSecretVariables = { pathParams: ActionsListSelectedReposForOrgSecretPathParams; queryParams?: ActionsListSelectedReposForOrgSecretQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsListSelectedReposForOrgSecret = ( variables: ActionsListSelectedReposForOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelectedReposForOrgSecretResponse, ActionsListSelectedReposForOrgSecretError, undefined, {}, ActionsListSelectedReposForOrgSecretQueryParams, ActionsListSelectedReposForOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}/repositories', method: 'get', ...variables, signal, }); /** * Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsListSelectedReposForOrgSecret = < TData = ActionsListSelectedReposForOrgSecretResponse, >( variables: ActionsListSelectedReposForOrgSecretVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelectedReposForOrgSecretResponse, ActionsListSelectedReposForOrgSecretError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelectedReposForOrgSecretResponse, ActionsListSelectedReposForOrgSecretError, TData >( queryKeyFn({ path: '/orgs/{org}/actions/secrets/{secret_name}/repositories', operationId: 'actionsListSelectedReposForOrgSecret', variables, }), ({ signal }) => fetchActionsListSelectedReposForOrgSecret( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetSelectedReposForOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; }; export type ActionsSetSelectedReposForOrgSecretError = Fetcher.ErrorWrapper; export type ActionsSetSelectedReposForOrgSecretRequestBody = { /** * An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ selected_repository_ids?: number[]; }; export type ActionsSetSelectedReposForOrgSecretVariables = { body?: ActionsSetSelectedReposForOrgSecretRequestBody; pathParams: ActionsSetSelectedReposForOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsSetSelectedReposForOrgSecret = ( variables: ActionsSetSelectedReposForOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetSelectedReposForOrgSecretError, ActionsSetSelectedReposForOrgSecretRequestBody, {}, {}, ActionsSetSelectedReposForOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}/repositories', method: 'put', ...variables, signal, }); /** * Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsSetSelectedReposForOrgSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetSelectedReposForOrgSecretError, ActionsSetSelectedReposForOrgSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetSelectedReposForOrgSecretError, ActionsSetSelectedReposForOrgSecretVariables >( (variables: ActionsSetSelectedReposForOrgSecretVariables) => fetchActionsSetSelectedReposForOrgSecret({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsRemoveSelectedRepoFromOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; repositoryId: number; }; export type ActionsRemoveSelectedRepoFromOrgSecretError = Fetcher.ErrorWrapper; export type ActionsRemoveSelectedRepoFromOrgSecretVariables = { pathParams: ActionsRemoveSelectedRepoFromOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsRemoveSelectedRepoFromOrgSecret = ( variables: ActionsRemoveSelectedRepoFromOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsRemoveSelectedRepoFromOrgSecretError, undefined, {}, {}, ActionsRemoveSelectedRepoFromOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}/repositories/{repositoryId}', method: 'delete', ...variables, signal, }); /** * Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsRemoveSelectedRepoFromOrgSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsRemoveSelectedRepoFromOrgSecretError, ActionsRemoveSelectedRepoFromOrgSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsRemoveSelectedRepoFromOrgSecretError, ActionsRemoveSelectedRepoFromOrgSecretVariables >( (variables: ActionsRemoveSelectedRepoFromOrgSecretVariables) => fetchActionsRemoveSelectedRepoFromOrgSecret({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsAddSelectedRepoToOrgSecretPathParams = { org: string; /** * secret_name parameter */ secretName: string; repositoryId: number; }; export type ActionsAddSelectedRepoToOrgSecretError = Fetcher.ErrorWrapper; export type ActionsAddSelectedRepoToOrgSecretVariables = { pathParams: ActionsAddSelectedRepoToOrgSecretPathParams; } & GithubContext['fetcherOptions']; /** * Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const fetchActionsAddSelectedRepoToOrgSecret = ( variables: ActionsAddSelectedRepoToOrgSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsAddSelectedRepoToOrgSecretError, undefined, {}, {}, ActionsAddSelectedRepoToOrgSecretPathParams >({ url: '/orgs/{org}/actions/secrets/{secretName}/repositories/{repositoryId}', method: 'put', ...variables, signal, }); /** * Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ export const useActionsAddSelectedRepoToOrgSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsAddSelectedRepoToOrgSecretError, ActionsAddSelectedRepoToOrgSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsAddSelectedRepoToOrgSecretError, ActionsAddSelectedRepoToOrgSecretVariables >( (variables: ActionsAddSelectedRepoToOrgSecretVariables) => fetchActionsAddSelectedRepoToOrgSecret({ ...fetcherOptions, ...variables, }), options, ); }; export type OrgsGetAuditLogPathParams = { org: string; }; export type OrgsGetAuditLogQueryParams = { /** * A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ phrase?: string; /** * The event types to include: * * - `web` - returns web (non-Git) events * - `git` - returns Git events * - `all` - returns both web and Git events * * The default is `web`. */ include?: 'web' | 'git' | 'all'; /** * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ after?: string; /** * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ before?: string; /** * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. * * The default is `desc`. */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsGetAuditLogError = Fetcher.ErrorWrapper; export type OrgsGetAuditLogResponse = Schemas.AuditLogEvent[]; export type OrgsGetAuditLogVariables = { pathParams: OrgsGetAuditLogPathParams; queryParams?: OrgsGetAuditLogQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The audit log REST API is currently in beta and is subject to change. * * Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." * * To use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint. */ export const fetchOrgsGetAuditLog = ( variables: OrgsGetAuditLogVariables, signal?: AbortSignal, ) => githubFetch< OrgsGetAuditLogResponse, OrgsGetAuditLogError, undefined, {}, OrgsGetAuditLogQueryParams, OrgsGetAuditLogPathParams >({ url: '/orgs/{org}/audit-log', method: 'get', ...variables, signal }); /** * **Note:** The audit log REST API is currently in beta and is subject to change. * * Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." * * To use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint. */ export const useOrgsGetAuditLog = ( variables: OrgsGetAuditLogVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsGetAuditLogResponse, OrgsGetAuditLogError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsGetAuditLogResponse, OrgsGetAuditLogError, TData >( queryKeyFn({ path: '/orgs/{org}/audit-log', operationId: 'orgsGetAuditLog', variables, }), ({ signal }) => fetchOrgsGetAuditLog({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsListBlockedUsersPathParams = { org: string; }; export type OrgsListBlockedUsersError = Fetcher.ErrorWrapper<{ status: 415; payload: Responses.PreviewHeaderMissing; }>; export type OrgsListBlockedUsersResponse = Schemas.SimpleUser[]; export type OrgsListBlockedUsersVariables = { pathParams: OrgsListBlockedUsersPathParams; } & GithubContext['fetcherOptions']; /** * List the users blocked by an organization. */ export const fetchOrgsListBlockedUsers = ( variables: OrgsListBlockedUsersVariables, signal?: AbortSignal, ) => githubFetch< OrgsListBlockedUsersResponse, OrgsListBlockedUsersError, undefined, {}, {}, OrgsListBlockedUsersPathParams >({ url: '/orgs/{org}/blocks', method: 'get', ...variables, signal }); /** * List the users blocked by an organization. */ export const useOrgsListBlockedUsers = ( variables: OrgsListBlockedUsersVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListBlockedUsersResponse, OrgsListBlockedUsersError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListBlockedUsersResponse, OrgsListBlockedUsersError, TData >( queryKeyFn({ path: '/orgs/{org}/blocks', operationId: 'orgsListBlockedUsers', variables, }), ({ signal }) => fetchOrgsListBlockedUsers({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsUnblockUserPathParams = { org: string; username: string; }; export type OrgsUnblockUserError = Fetcher.ErrorWrapper; export type OrgsUnblockUserVariables = { pathParams: OrgsUnblockUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsUnblockUser = ( variables: OrgsUnblockUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsUnblockUserError, undefined, {}, {}, OrgsUnblockUserPathParams >({ url: '/orgs/{org}/blocks/{username}', method: 'delete', ...variables, signal, }); export const useOrgsUnblockUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsUnblockUserError, OrgsUnblockUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsUnblockUserError, OrgsUnblockUserVariables >( (variables: OrgsUnblockUserVariables) => fetchOrgsUnblockUser({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsCheckBlockedUserPathParams = { org: string; username: string; }; export type OrgsCheckBlockedUserError = Fetcher.ErrorWrapper<{ status: 404; payload: Schemas.BasicError; }>; export type OrgsCheckBlockedUserVariables = { pathParams: OrgsCheckBlockedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsCheckBlockedUser = ( variables: OrgsCheckBlockedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsCheckBlockedUserError, undefined, {}, {}, OrgsCheckBlockedUserPathParams >({ url: '/orgs/{org}/blocks/{username}', method: 'get', ...variables, signal, }); export const useOrgsCheckBlockedUser = ( variables: OrgsCheckBlockedUserVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}/blocks/{username}', operationId: 'orgsCheckBlockedUser', variables, }), ({ signal }) => fetchOrgsCheckBlockedUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsBlockUserPathParams = { org: string; username: string; }; export type OrgsBlockUserError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type OrgsBlockUserVariables = { pathParams: OrgsBlockUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsBlockUser = ( variables: OrgsBlockUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsBlockUserError, undefined, {}, {}, OrgsBlockUserPathParams >({ url: '/orgs/{org}/blocks/{username}', method: 'put', ...variables, signal, }); export const useOrgsBlockUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsBlockUserError, OrgsBlockUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsBlockUserError, OrgsBlockUserVariables >( (variables: OrgsBlockUserVariables) => fetchOrgsBlockUser({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsListSamlSsoAuthorizationsPathParams = { org: string; }; export type OrgsListSamlSsoAuthorizationsError = Fetcher.ErrorWrapper; export type OrgsListSamlSsoAuthorizationsResponse = Schemas.CredentialAuthorization[]; export type OrgsListSamlSsoAuthorizationsVariables = { pathParams: OrgsListSamlSsoAuthorizationsPathParams; } & GithubContext['fetcherOptions']; /** * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). * * An authenticated organization owner with the `read:org` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). */ export const fetchOrgsListSamlSsoAuthorizations = ( variables: OrgsListSamlSsoAuthorizationsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListSamlSsoAuthorizationsResponse, OrgsListSamlSsoAuthorizationsError, undefined, {}, {}, OrgsListSamlSsoAuthorizationsPathParams >({ url: '/orgs/{org}/credential-authorizations', method: 'get', ...variables, signal, }); /** * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). * * An authenticated organization owner with the `read:org` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). */ export const useOrgsListSamlSsoAuthorizations = < TData = OrgsListSamlSsoAuthorizationsResponse, >( variables: OrgsListSamlSsoAuthorizationsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListSamlSsoAuthorizationsResponse, OrgsListSamlSsoAuthorizationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListSamlSsoAuthorizationsResponse, OrgsListSamlSsoAuthorizationsError, TData >( queryKeyFn({ path: '/orgs/{org}/credential-authorizations', operationId: 'orgsListSamlSsoAuthorizations', variables, }), ({ signal }) => fetchOrgsListSamlSsoAuthorizations( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsRemoveSamlSsoAuthorizationPathParams = { org: string; credentialId: number; }; export type OrgsRemoveSamlSsoAuthorizationError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsRemoveSamlSsoAuthorizationVariables = { pathParams: OrgsRemoveSamlSsoAuthorizationPathParams; } & GithubContext['fetcherOptions']; /** * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). * * An authenticated organization owner with the `admin:org` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. */ export const fetchOrgsRemoveSamlSsoAuthorization = ( variables: OrgsRemoveSamlSsoAuthorizationVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsRemoveSamlSsoAuthorizationError, undefined, {}, {}, OrgsRemoveSamlSsoAuthorizationPathParams >({ url: '/orgs/{org}/credential-authorizations/{credentialId}', method: 'delete', ...variables, signal, }); /** * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). * * An authenticated organization owner with the `admin:org` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. */ export const useOrgsRemoveSamlSsoAuthorization = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsRemoveSamlSsoAuthorizationError, OrgsRemoveSamlSsoAuthorizationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsRemoveSamlSsoAuthorizationError, OrgsRemoveSamlSsoAuthorizationVariables >( (variables: OrgsRemoveSamlSsoAuthorizationVariables) => fetchOrgsRemoveSamlSsoAuthorization({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityListPublicOrgEventsPathParams = { org: string; }; export type ActivityListPublicOrgEventsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListPublicOrgEventsError = Fetcher.ErrorWrapper; export type ActivityListPublicOrgEventsResponse = Schemas.Event[]; export type ActivityListPublicOrgEventsVariables = { pathParams: ActivityListPublicOrgEventsPathParams; queryParams?: ActivityListPublicOrgEventsQueryParams; } & GithubContext['fetcherOptions']; export const fetchActivityListPublicOrgEvents = ( variables: ActivityListPublicOrgEventsVariables, signal?: AbortSignal, ) => githubFetch< ActivityListPublicOrgEventsResponse, ActivityListPublicOrgEventsError, undefined, {}, ActivityListPublicOrgEventsQueryParams, ActivityListPublicOrgEventsPathParams >({ url: '/orgs/{org}/events', method: 'get', ...variables, signal }); export const useActivityListPublicOrgEvents = < TData = ActivityListPublicOrgEventsResponse, >( variables: ActivityListPublicOrgEventsVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListPublicOrgEventsResponse, ActivityListPublicOrgEventsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListPublicOrgEventsResponse, ActivityListPublicOrgEventsError, TData >( queryKeyFn({ path: '/orgs/{org}/events', operationId: 'activityListPublicOrgEvents', variables, }), ({ signal }) => fetchActivityListPublicOrgEvents( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListFailedInvitationsPathParams = { org: string; }; export type OrgsListFailedInvitationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListFailedInvitationsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsListFailedInvitationsResponse = Schemas.OrganizationInvitation[]; export type OrgsListFailedInvitationsVariables = { pathParams: OrgsListFailedInvitationsPathParams; queryParams?: OrgsListFailedInvitationsQueryParams; } & GithubContext['fetcherOptions']; /** * The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. */ export const fetchOrgsListFailedInvitations = ( variables: OrgsListFailedInvitationsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListFailedInvitationsResponse, OrgsListFailedInvitationsError, undefined, {}, OrgsListFailedInvitationsQueryParams, OrgsListFailedInvitationsPathParams >({ url: '/orgs/{org}/failed_invitations', method: 'get', ...variables, signal, }); /** * The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. */ export const useOrgsListFailedInvitations = < TData = OrgsListFailedInvitationsResponse, >( variables: OrgsListFailedInvitationsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListFailedInvitationsResponse, OrgsListFailedInvitationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListFailedInvitationsResponse, OrgsListFailedInvitationsError, TData >( queryKeyFn({ path: '/orgs/{org}/failed_invitations', operationId: 'orgsListFailedInvitations', variables, }), ({ signal }) => fetchOrgsListFailedInvitations( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListWebhooksPathParams = { org: string; }; export type OrgsListWebhooksQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListWebhooksError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsListWebhooksResponse = Schemas.OrgHook[]; export type OrgsListWebhooksVariables = { pathParams: OrgsListWebhooksPathParams; queryParams?: OrgsListWebhooksQueryParams; } & GithubContext['fetcherOptions']; export const fetchOrgsListWebhooks = ( variables: OrgsListWebhooksVariables, signal?: AbortSignal, ) => githubFetch< OrgsListWebhooksResponse, OrgsListWebhooksError, undefined, {}, OrgsListWebhooksQueryParams, OrgsListWebhooksPathParams >({ url: '/orgs/{org}/hooks', method: 'get', ...variables, signal }); export const useOrgsListWebhooks = ( variables: OrgsListWebhooksVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListWebhooksResponse, OrgsListWebhooksError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListWebhooksResponse, OrgsListWebhooksError, TData >( queryKeyFn({ path: '/orgs/{org}/hooks', operationId: 'orgsListWebhooks', variables, }), ({ signal }) => fetchOrgsListWebhooks({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsCreateWebhookPathParams = { org: string; }; export type OrgsCreateWebhookError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsCreateWebhookRequestBody = { /** * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. * * @default true */ active?: boolean; /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ config: { content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; /** * @example "password" */ password?: string; secret?: Schemas.WebhookConfigSecret; url: Schemas.WebhookConfigUrl; /** * @example "kdaigle" */ username?: string; }; /** * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. * * @default push */ events?: string[]; /** * Must be passed as "web". */ name: string; }; export type OrgsCreateWebhookVariables = { body: OrgsCreateWebhookRequestBody; pathParams: OrgsCreateWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Here's how you can create a hook that posts payloads in JSON format: */ export const fetchOrgsCreateWebhook = ( variables: OrgsCreateWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgHook, OrgsCreateWebhookError, OrgsCreateWebhookRequestBody, {}, {}, OrgsCreateWebhookPathParams >({ url: '/orgs/{org}/hooks', method: 'post', ...variables, signal }); /** * Here's how you can create a hook that posts payloads in JSON format: */ export const useOrgsCreateWebhook = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrgHook, OrgsCreateWebhookError, OrgsCreateWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrgHook, OrgsCreateWebhookError, OrgsCreateWebhookVariables >( (variables: OrgsCreateWebhookVariables) => fetchOrgsCreateWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsDeleteWebhookPathParams = { org: string; hookId: number; }; export type OrgsDeleteWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsDeleteWebhookVariables = { pathParams: OrgsDeleteWebhookPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsDeleteWebhook = ( variables: OrgsDeleteWebhookVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsDeleteWebhookError, undefined, {}, {}, OrgsDeleteWebhookPathParams >({ url: '/orgs/{org}/hooks/{hookId}', method: 'delete', ...variables, signal, }); export const useOrgsDeleteWebhook = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsDeleteWebhookError, OrgsDeleteWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsDeleteWebhookError, OrgsDeleteWebhookVariables >( (variables: OrgsDeleteWebhookVariables) => fetchOrgsDeleteWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsGetWebhookPathParams = { org: string; hookId: number; }; export type OrgsGetWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsGetWebhookVariables = { pathParams: OrgsGetWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." */ export const fetchOrgsGetWebhook = ( variables: OrgsGetWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgHook, OrgsGetWebhookError, undefined, {}, {}, OrgsGetWebhookPathParams >({ url: '/orgs/{org}/hooks/{hookId}', method: 'get', ...variables, signal }); /** * Returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." */ export const useOrgsGetWebhook = ( variables: OrgsGetWebhookVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}/hooks/{hook_id}', operationId: 'orgsGetWebhook', variables, }), ({ signal }) => fetchOrgsGetWebhook({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsUpdateWebhookPathParams = { org: string; hookId: number; }; export type OrgsUpdateWebhookError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsUpdateWebhookRequestBody = { /** * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. * * @default true */ active?: boolean; /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ config?: { content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; secret?: Schemas.WebhookConfigSecret; url: Schemas.WebhookConfigUrl; }; /** * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. * * @default push */ events?: string[]; /** * @example "web" */ name?: string; }; export type OrgsUpdateWebhookVariables = { body?: OrgsUpdateWebhookRequestBody; pathParams: OrgsUpdateWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." */ export const fetchOrgsUpdateWebhook = ( variables: OrgsUpdateWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgHook, OrgsUpdateWebhookError, OrgsUpdateWebhookRequestBody, {}, {}, OrgsUpdateWebhookPathParams >({ url: '/orgs/{org}/hooks/{hookId}', method: 'patch', ...variables, signal, }); /** * Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." */ export const useOrgsUpdateWebhook = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrgHook, OrgsUpdateWebhookError, OrgsUpdateWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrgHook, OrgsUpdateWebhookError, OrgsUpdateWebhookVariables >( (variables: OrgsUpdateWebhookVariables) => fetchOrgsUpdateWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsGetWebhookConfigForOrgPathParams = { org: string; hookId: number; }; export type OrgsGetWebhookConfigForOrgError = Fetcher.ErrorWrapper; export type OrgsGetWebhookConfigForOrgVariables = { pathParams: OrgsGetWebhookConfigForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." * * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission. */ export const fetchOrgsGetWebhookConfigForOrg = ( variables: OrgsGetWebhookConfigForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, OrgsGetWebhookConfigForOrgError, undefined, {}, {}, OrgsGetWebhookConfigForOrgPathParams >({ url: '/orgs/{org}/hooks/{hookId}/config', method: 'get', ...variables, signal, }); /** * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." * * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission. */ export const useOrgsGetWebhookConfigForOrg = ( variables: OrgsGetWebhookConfigForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WebhookConfig, OrgsGetWebhookConfigForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WebhookConfig, OrgsGetWebhookConfigForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/hooks/{hook_id}/config', operationId: 'orgsGetWebhookConfigForOrg', variables, }), ({ signal }) => fetchOrgsGetWebhookConfigForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsUpdateWebhookConfigForOrgPathParams = { org: string; hookId: number; }; export type OrgsUpdateWebhookConfigForOrgError = Fetcher.ErrorWrapper; export type OrgsUpdateWebhookConfigForOrgRequestBody = { content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; secret?: Schemas.WebhookConfigSecret; url?: Schemas.WebhookConfigUrl; }; export type OrgsUpdateWebhookConfigForOrgVariables = { body?: OrgsUpdateWebhookConfigForOrgRequestBody; pathParams: OrgsUpdateWebhookConfigForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." * * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission. */ export const fetchOrgsUpdateWebhookConfigForOrg = ( variables: OrgsUpdateWebhookConfigForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, OrgsUpdateWebhookConfigForOrgError, OrgsUpdateWebhookConfigForOrgRequestBody, {}, {}, OrgsUpdateWebhookConfigForOrgPathParams >({ url: '/orgs/{org}/hooks/{hookId}/config', method: 'patch', ...variables, signal, }); /** * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." * * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission. */ export const useOrgsUpdateWebhookConfigForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.WebhookConfig, OrgsUpdateWebhookConfigForOrgError, OrgsUpdateWebhookConfigForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.WebhookConfig, OrgsUpdateWebhookConfigForOrgError, OrgsUpdateWebhookConfigForOrgVariables >( (variables: OrgsUpdateWebhookConfigForOrgVariables) => fetchOrgsUpdateWebhookConfigForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsPingWebhookPathParams = { org: string; hookId: number; }; export type OrgsPingWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsPingWebhookVariables = { pathParams: OrgsPingWebhookPathParams; } & GithubContext['fetcherOptions']; /** * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ export const fetchOrgsPingWebhook = ( variables: OrgsPingWebhookVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsPingWebhookError, undefined, {}, {}, OrgsPingWebhookPathParams >({ url: '/orgs/{org}/hooks/{hookId}/pings', method: 'post', ...variables, signal, }); /** * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ export const useOrgsPingWebhook = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsPingWebhookError, OrgsPingWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsPingWebhookError, OrgsPingWebhookVariables >( (variables: OrgsPingWebhookVariables) => fetchOrgsPingWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetOrgInstallationPathParams = { org: string; }; export type AppsGetOrgInstallationError = Fetcher.ErrorWrapper; export type AppsGetOrgInstallationVariables = { pathParams: AppsGetOrgInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Enables an authenticated GitHub App to find the organization's installation information. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetOrgInstallation = ( variables: AppsGetOrgInstallationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Installation, AppsGetOrgInstallationError, undefined, {}, {}, AppsGetOrgInstallationPathParams >({ url: '/orgs/{org}/installation', method: 'get', ...variables, signal }); /** * Enables an authenticated GitHub App to find the organization's installation information. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetOrgInstallation = ( variables: AppsGetOrgInstallationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Installation, AppsGetOrgInstallationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Installation, AppsGetOrgInstallationError, TData >( queryKeyFn({ path: '/orgs/{org}/installation', operationId: 'appsGetOrgInstallation', variables, }), ({ signal }) => fetchAppsGetOrgInstallation({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsListAppInstallationsPathParams = { org: string; }; export type OrgsListAppInstallationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListAppInstallationsError = Fetcher.ErrorWrapper; export type OrgsListAppInstallationsResponse = { installations: Schemas.Installation[]; total_count: number; }; export type OrgsListAppInstallationsVariables = { pathParams: OrgsListAppInstallationsPathParams; queryParams?: OrgsListAppInstallationsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint. */ export const fetchOrgsListAppInstallations = ( variables: OrgsListAppInstallationsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListAppInstallationsResponse, OrgsListAppInstallationsError, undefined, {}, OrgsListAppInstallationsQueryParams, OrgsListAppInstallationsPathParams >({ url: '/orgs/{org}/installations', method: 'get', ...variables, signal }); /** * Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint. */ export const useOrgsListAppInstallations = < TData = OrgsListAppInstallationsResponse, >( variables: OrgsListAppInstallationsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListAppInstallationsResponse, OrgsListAppInstallationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListAppInstallationsResponse, OrgsListAppInstallationsError, TData >( queryKeyFn({ path: '/orgs/{org}/installations', operationId: 'orgsListAppInstallations', variables, }), ({ signal }) => fetchOrgsListAppInstallations( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type InteractionsRemoveRestrictionsForOrgPathParams = { org: string; }; export type InteractionsRemoveRestrictionsForOrgError = Fetcher.ErrorWrapper; export type InteractionsRemoveRestrictionsForOrgVariables = { pathParams: InteractionsRemoveRestrictionsForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. */ export const fetchInteractionsRemoveRestrictionsForOrg = ( variables: InteractionsRemoveRestrictionsForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, InteractionsRemoveRestrictionsForOrgError, undefined, {}, {}, InteractionsRemoveRestrictionsForOrgPathParams >({ url: '/orgs/{org}/interaction-limits', method: 'delete', ...variables, signal, }); /** * Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. */ export const useInteractionsRemoveRestrictionsForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, InteractionsRemoveRestrictionsForOrgError, InteractionsRemoveRestrictionsForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, InteractionsRemoveRestrictionsForOrgError, InteractionsRemoveRestrictionsForOrgVariables >( (variables: InteractionsRemoveRestrictionsForOrgVariables) => fetchInteractionsRemoveRestrictionsForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type InteractionsGetRestrictionsForOrgPathParams = { org: string; }; export type InteractionsGetRestrictionsForOrgError = Fetcher.ErrorWrapper; export type InteractionsGetRestrictionsForOrgVariables = { pathParams: InteractionsGetRestrictionsForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. */ export const fetchInteractionsGetRestrictionsForOrg = ( variables: InteractionsGetRestrictionsForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForOrgError, undefined, {}, {}, InteractionsGetRestrictionsForOrgPathParams >({ url: '/orgs/{org}/interaction-limits', method: 'get', ...variables, signal, }); /** * Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. */ export const useInteractionsGetRestrictionsForOrg = < TData = Schemas.InteractionLimitResponse, >( variables: InteractionsGetRestrictionsForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/interaction-limits', operationId: 'interactionsGetRestrictionsForOrg', variables, }), ({ signal }) => fetchInteractionsGetRestrictionsForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type InteractionsSetRestrictionsForOrgPathParams = { org: string; }; export type InteractionsSetRestrictionsForOrgError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type InteractionsSetRestrictionsForOrgVariables = { body: Schemas.InteractionLimit; pathParams: InteractionsSetRestrictionsForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. */ export const fetchInteractionsSetRestrictionsForOrg = ( variables: InteractionsSetRestrictionsForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForOrgError, Schemas.InteractionLimit, {}, {}, InteractionsSetRestrictionsForOrgPathParams >({ url: '/orgs/{org}/interaction-limits', method: 'put', ...variables, signal, }); /** * Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. */ export const useInteractionsSetRestrictionsForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForOrgError, InteractionsSetRestrictionsForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForOrgError, InteractionsSetRestrictionsForOrgVariables >( (variables: InteractionsSetRestrictionsForOrgVariables) => fetchInteractionsSetRestrictionsForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type OrgsListPendingInvitationsPathParams = { org: string; }; export type OrgsListPendingInvitationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListPendingInvitationsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsListPendingInvitationsResponse = Schemas.OrganizationInvitation[]; export type OrgsListPendingInvitationsVariables = { pathParams: OrgsListPendingInvitationsPathParams; queryParams?: OrgsListPendingInvitationsQueryParams; } & GithubContext['fetcherOptions']; /** * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ export const fetchOrgsListPendingInvitations = ( variables: OrgsListPendingInvitationsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListPendingInvitationsResponse, OrgsListPendingInvitationsError, undefined, {}, OrgsListPendingInvitationsQueryParams, OrgsListPendingInvitationsPathParams >({ url: '/orgs/{org}/invitations', method: 'get', ...variables, signal }); /** * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ export const useOrgsListPendingInvitations = < TData = OrgsListPendingInvitationsResponse, >( variables: OrgsListPendingInvitationsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListPendingInvitationsResponse, OrgsListPendingInvitationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListPendingInvitationsResponse, OrgsListPendingInvitationsError, TData >( queryKeyFn({ path: '/orgs/{org}/invitations', operationId: 'orgsListPendingInvitations', variables, }), ({ signal }) => fetchOrgsListPendingInvitations( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsCreateInvitationPathParams = { org: string; }; export type OrgsCreateInvitationError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsCreateInvitationRequestBody = { /** * **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. */ email?: string; /** * **Required unless you provide `email`**. GitHub user ID for the person you are inviting. */ invitee_id?: number; /** * Specify role for new member. Can be one of: * \* `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. * \* `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. * \* `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. * * @default direct_member */ role?: 'admin' | 'direct_member' | 'billing_manager'; /** * Specify IDs for the teams you want to invite new members to. */ team_ids?: number[]; }; export type OrgsCreateInvitationVariables = { body?: OrgsCreateInvitationRequestBody; pathParams: OrgsCreateInvitationPathParams; } & GithubContext['fetcherOptions']; /** * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchOrgsCreateInvitation = ( variables: OrgsCreateInvitationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrganizationInvitation, OrgsCreateInvitationError, OrgsCreateInvitationRequestBody, {}, {}, OrgsCreateInvitationPathParams >({ url: '/orgs/{org}/invitations', method: 'post', ...variables, signal }); /** * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const useOrgsCreateInvitation = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrganizationInvitation, OrgsCreateInvitationError, OrgsCreateInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrganizationInvitation, OrgsCreateInvitationError, OrgsCreateInvitationVariables >( (variables: OrgsCreateInvitationVariables) => fetchOrgsCreateInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsCancelInvitationPathParams = { org: string; /** * invitation_id parameter */ invitationId: number; }; export type OrgsCancelInvitationError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsCancelInvitationVariables = { pathParams: OrgsCancelInvitationPathParams; } & GithubContext['fetcherOptions']; /** * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). */ export const fetchOrgsCancelInvitation = ( variables: OrgsCancelInvitationVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsCancelInvitationError, undefined, {}, {}, OrgsCancelInvitationPathParams >({ url: '/orgs/{org}/invitations/{invitationId}', method: 'delete', ...variables, signal, }); /** * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). */ export const useOrgsCancelInvitation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsCancelInvitationError, OrgsCancelInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsCancelInvitationError, OrgsCancelInvitationVariables >( (variables: OrgsCancelInvitationVariables) => fetchOrgsCancelInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsListInvitationTeamsPathParams = { org: string; /** * invitation_id parameter */ invitationId: number; }; export type OrgsListInvitationTeamsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListInvitationTeamsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type OrgsListInvitationTeamsResponse = Schemas.Team[]; export type OrgsListInvitationTeamsVariables = { pathParams: OrgsListInvitationTeamsPathParams; queryParams?: OrgsListInvitationTeamsQueryParams; } & GithubContext['fetcherOptions']; /** * List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. */ export const fetchOrgsListInvitationTeams = ( variables: OrgsListInvitationTeamsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListInvitationTeamsResponse, OrgsListInvitationTeamsError, undefined, {}, OrgsListInvitationTeamsQueryParams, OrgsListInvitationTeamsPathParams >({ url: '/orgs/{org}/invitations/{invitationId}/teams', method: 'get', ...variables, signal, }); /** * List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. */ export const useOrgsListInvitationTeams = < TData = OrgsListInvitationTeamsResponse, >( variables: OrgsListInvitationTeamsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListInvitationTeamsResponse, OrgsListInvitationTeamsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListInvitationTeamsResponse, OrgsListInvitationTeamsError, TData >( queryKeyFn({ path: '/orgs/{org}/invitations/{invitation_id}/teams', operationId: 'orgsListInvitationTeams', variables, }), ({ signal }) => fetchOrgsListInvitationTeams({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesListForOrgPathParams = { org: string; }; export type IssuesListForOrgQueryParams = { /** * Indicates which sorts of issues to return. Can be one of: * \* `assigned`: Issues assigned to you * \* `created`: Issues created by you * \* `mentioned`: Issues mentioning you * \* `subscribed`: Issues you're subscribed to updates for * \* `all`: All issues the authenticated user can see, regardless of participation or creation * * @default assigned */ filter?: | 'assigned' | 'created' | 'mentioned' | 'subscribed' | 'repos' | 'all'; /** * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * A list of comma separated label names. Example: `bug,ui,@high` */ labels?: string; /** * What to sort results by. Can be either `created`, `updated`, `comments`. * * @default created */ sort?: 'created' | 'updated' | 'comments'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesListForOrgResponse = Schemas.Issue[]; export type IssuesListForOrgVariables = { pathParams: IssuesListForOrgPathParams; queryParams?: IssuesListForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List issues in an organization assigned to the authenticated user. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchIssuesListForOrg = ( variables: IssuesListForOrgVariables, signal?: AbortSignal, ) => githubFetch< IssuesListForOrgResponse, IssuesListForOrgError, undefined, {}, IssuesListForOrgQueryParams, IssuesListForOrgPathParams >({ url: '/orgs/{org}/issues', method: 'get', ...variables, signal }); /** * List issues in an organization assigned to the authenticated user. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useIssuesListForOrg = ( variables: IssuesListForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListForOrgResponse, IssuesListForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListForOrgResponse, IssuesListForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/issues', operationId: 'issuesListForOrg', variables, }), ({ signal }) => fetchIssuesListForOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsListMembersPathParams = { org: string; }; export type OrgsListMembersQueryParams = { /** * Filter members returned in the list. Can be one of: * \* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. * \* `all` - All members the authenticated user can see. * * @default all */ filter?: '2fa_disabled' | 'all'; /** * Filter members returned by their role. Can be one of: * \* `all` - All members of the organization, regardless of role. * \* `admin` - Organization owners. * \* `member` - Non-owner organization members. * * @default all */ role?: 'all' | 'admin' | 'member'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListMembersError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type OrgsListMembersResponse = Schemas.SimpleUser[]; export type OrgsListMembersVariables = { pathParams: OrgsListMembersPathParams; queryParams?: OrgsListMembersQueryParams; } & GithubContext['fetcherOptions']; /** * List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. */ export const fetchOrgsListMembers = ( variables: OrgsListMembersVariables, signal?: AbortSignal, ) => githubFetch< OrgsListMembersResponse, OrgsListMembersError, undefined, {}, OrgsListMembersQueryParams, OrgsListMembersPathParams >({ url: '/orgs/{org}/members', method: 'get', ...variables, signal }); /** * List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. */ export const useOrgsListMembers = ( variables: OrgsListMembersVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListMembersResponse, OrgsListMembersError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListMembersResponse, OrgsListMembersError, TData >( queryKeyFn({ path: '/orgs/{org}/members', operationId: 'orgsListMembers', variables, }), ({ signal }) => fetchOrgsListMembers({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsRemoveMemberPathParams = { org: string; username: string; }; export type OrgsRemoveMemberError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type OrgsRemoveMemberVariables = { pathParams: OrgsRemoveMemberPathParams; } & GithubContext['fetcherOptions']; /** * Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. */ export const fetchOrgsRemoveMember = ( variables: OrgsRemoveMemberVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsRemoveMemberError, undefined, {}, {}, OrgsRemoveMemberPathParams >({ url: '/orgs/{org}/members/{username}', method: 'delete', ...variables, signal, }); /** * Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. */ export const useOrgsRemoveMember = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsRemoveMemberError, OrgsRemoveMemberVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsRemoveMemberError, OrgsRemoveMemberVariables >( (variables: OrgsRemoveMemberVariables) => fetchOrgsRemoveMember({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsCheckMembershipForUserPathParams = { org: string; username: string; }; export type OrgsCheckMembershipForUserError = Fetcher.ErrorWrapper; export type OrgsCheckMembershipForUserVariables = { pathParams: OrgsCheckMembershipForUserPathParams; } & GithubContext['fetcherOptions']; /** * Check if a user is, publicly or privately, a member of the organization. */ export const fetchOrgsCheckMembershipForUser = ( variables: OrgsCheckMembershipForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsCheckMembershipForUserError, undefined, {}, {}, OrgsCheckMembershipForUserPathParams >({ url: '/orgs/{org}/members/{username}', method: 'get', ...variables, signal, }); /** * Check if a user is, publicly or privately, a member of the organization. */ export const useOrgsCheckMembershipForUser = ( variables: OrgsCheckMembershipForUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, OrgsCheckMembershipForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}/members/{username}', operationId: 'orgsCheckMembershipForUser', variables, }), ({ signal }) => fetchOrgsCheckMembershipForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsRemoveMembershipForUserPathParams = { org: string; username: string; }; export type OrgsRemoveMembershipForUserError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type OrgsRemoveMembershipForUserVariables = { pathParams: OrgsRemoveMembershipForUserPathParams; } & GithubContext['fetcherOptions']; /** * In order to remove a user's membership with an organization, the authenticated user must be an organization owner. * * If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. */ export const fetchOrgsRemoveMembershipForUser = ( variables: OrgsRemoveMembershipForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsRemoveMembershipForUserError, undefined, {}, {}, OrgsRemoveMembershipForUserPathParams >({ url: '/orgs/{org}/memberships/{username}', method: 'delete', ...variables, signal, }); /** * In order to remove a user's membership with an organization, the authenticated user must be an organization owner. * * If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. */ export const useOrgsRemoveMembershipForUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsRemoveMembershipForUserError, OrgsRemoveMembershipForUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsRemoveMembershipForUserError, OrgsRemoveMembershipForUserVariables >( (variables: OrgsRemoveMembershipForUserVariables) => fetchOrgsRemoveMembershipForUser({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsGetMembershipForUserPathParams = { org: string; username: string; }; export type OrgsGetMembershipForUserError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type OrgsGetMembershipForUserVariables = { pathParams: OrgsGetMembershipForUserPathParams; } & GithubContext['fetcherOptions']; /** * In order to get a user's membership with an organization, the authenticated user must be an organization member. */ export const fetchOrgsGetMembershipForUser = ( variables: OrgsGetMembershipForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgMembership, OrgsGetMembershipForUserError, undefined, {}, {}, OrgsGetMembershipForUserPathParams >({ url: '/orgs/{org}/memberships/{username}', method: 'get', ...variables, signal, }); /** * In order to get a user's membership with an organization, the authenticated user must be an organization member. */ export const useOrgsGetMembershipForUser = ( variables: OrgsGetMembershipForUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.OrgMembership, OrgsGetMembershipForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.OrgMembership, OrgsGetMembershipForUserError, TData >( queryKeyFn({ path: '/orgs/{org}/memberships/{username}', operationId: 'orgsGetMembershipForUser', variables, }), ({ signal }) => fetchOrgsGetMembershipForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsSetMembershipForUserPathParams = { org: string; username: string; }; export type OrgsSetMembershipForUserError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsSetMembershipForUserRequestBody = { /** * The role to give the user in the organization. Can be one of: * \* `admin` - The user will become an owner of the organization. * \* `member` - The user will become a non-owner member of the organization. * * @default member */ role?: 'admin' | 'member'; }; export type OrgsSetMembershipForUserVariables = { body?: OrgsSetMembershipForUserRequestBody; pathParams: OrgsSetMembershipForUserPathParams; } & GithubContext['fetcherOptions']; /** * Only authenticated organization owners can add a member to the organization or update the member's role. * * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * * * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. * * **Rate limits** * * To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. */ export const fetchOrgsSetMembershipForUser = ( variables: OrgsSetMembershipForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgMembership, OrgsSetMembershipForUserError, OrgsSetMembershipForUserRequestBody, {}, {}, OrgsSetMembershipForUserPathParams >({ url: '/orgs/{org}/memberships/{username}', method: 'put', ...variables, signal, }); /** * Only authenticated organization owners can add a member to the organization or update the member's role. * * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * * * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. * * **Rate limits** * * To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. */ export const useOrgsSetMembershipForUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrgMembership, OrgsSetMembershipForUserError, OrgsSetMembershipForUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrgMembership, OrgsSetMembershipForUserError, OrgsSetMembershipForUserVariables >( (variables: OrgsSetMembershipForUserVariables) => fetchOrgsSetMembershipForUser({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsListForOrgPathParams = { org: string; }; export type MigrationsListForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Exclude attributes from the API response to improve performance */ exclude?: 'repositories'[]; }; export type MigrationsListForOrgError = Fetcher.ErrorWrapper; export type MigrationsListForOrgResponse = Schemas.Migration[]; export type MigrationsListForOrgVariables = { pathParams: MigrationsListForOrgPathParams; queryParams?: MigrationsListForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the most recent migrations. */ export const fetchMigrationsListForOrg = ( variables: MigrationsListForOrgVariables, signal?: AbortSignal, ) => githubFetch< MigrationsListForOrgResponse, MigrationsListForOrgError, undefined, {}, MigrationsListForOrgQueryParams, MigrationsListForOrgPathParams >({ url: '/orgs/{org}/migrations', method: 'get', ...variables, signal }); /** * Lists the most recent migrations. */ export const useMigrationsListForOrg = ( variables: MigrationsListForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsListForOrgResponse, MigrationsListForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsListForOrgResponse, MigrationsListForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/migrations', operationId: 'migrationsListForOrg', variables, }), ({ signal }) => fetchMigrationsListForOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type MigrationsStartForOrgPathParams = { org: string; }; export type MigrationsStartForOrgError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type MigrationsStartForOrgRequestBody = { exclude?: string[]; /** * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). * * @default false */ exclude_attachments?: boolean; /** * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. * * @default false */ lock_repositories?: boolean; /** * A list of arrays indicating which repositories should be migrated. */ repositories: string[]; }; export type MigrationsStartForOrgVariables = { body: MigrationsStartForOrgRequestBody; pathParams: MigrationsStartForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Initiates the generation of a migration archive. */ export const fetchMigrationsStartForOrg = ( variables: MigrationsStartForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Migration, MigrationsStartForOrgError, MigrationsStartForOrgRequestBody, {}, {}, MigrationsStartForOrgPathParams >({ url: '/orgs/{org}/migrations', method: 'post', ...variables, signal }); /** * Initiates the generation of a migration archive. */ export const useMigrationsStartForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Migration, MigrationsStartForOrgError, MigrationsStartForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Migration, MigrationsStartForOrgError, MigrationsStartForOrgVariables >( (variables: MigrationsStartForOrgVariables) => fetchMigrationsStartForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsGetStatusForOrgPathParams = { org: string; /** * migration_id parameter */ migrationId: number; }; export type MigrationsGetStatusForOrgQueryParams = { /** * Exclude attributes from the API response to improve performance */ exclude?: 'repositories'[]; }; export type MigrationsGetStatusForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsGetStatusForOrgVariables = { pathParams: MigrationsGetStatusForOrgPathParams; queryParams?: MigrationsGetStatusForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Fetches the status of a migration. * * The `state` of a migration can be one of the following values: * * * `pending`, which means the migration hasn't started yet. * * `exporting`, which means the migration is in progress. * * `exported`, which means the migration finished successfully. * * `failed`, which means the migration failed. */ export const fetchMigrationsGetStatusForOrg = ( variables: MigrationsGetStatusForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Migration, MigrationsGetStatusForOrgError, undefined, {}, MigrationsGetStatusForOrgQueryParams, MigrationsGetStatusForOrgPathParams >({ url: '/orgs/{org}/migrations/{migrationId}', method: 'get', ...variables, signal, }); /** * Fetches the status of a migration. * * The `state` of a migration can be one of the following values: * * * `pending`, which means the migration hasn't started yet. * * `exporting`, which means the migration is in progress. * * `exported`, which means the migration finished successfully. * * `failed`, which means the migration failed. */ export const useMigrationsGetStatusForOrg = ( variables: MigrationsGetStatusForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Migration, MigrationsGetStatusForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Migration, MigrationsGetStatusForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/migrations/{migration_id}', operationId: 'migrationsGetStatusForOrg', variables, }), ({ signal }) => fetchMigrationsGetStatusForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsDeleteArchiveForOrgPathParams = { org: string; /** * migration_id parameter */ migrationId: number; }; export type MigrationsDeleteArchiveForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsDeleteArchiveForOrgVariables = { pathParams: MigrationsDeleteArchiveForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a previous migration archive. Migration archives are automatically deleted after seven days. */ export const fetchMigrationsDeleteArchiveForOrg = ( variables: MigrationsDeleteArchiveForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsDeleteArchiveForOrgError, undefined, {}, {}, MigrationsDeleteArchiveForOrgPathParams >({ url: '/orgs/{org}/migrations/{migrationId}/archive', method: 'delete', ...variables, signal, }); /** * Deletes a previous migration archive. Migration archives are automatically deleted after seven days. */ export const useMigrationsDeleteArchiveForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MigrationsDeleteArchiveForOrgError, MigrationsDeleteArchiveForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MigrationsDeleteArchiveForOrgError, MigrationsDeleteArchiveForOrgVariables >( (variables: MigrationsDeleteArchiveForOrgVariables) => fetchMigrationsDeleteArchiveForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsDownloadArchiveForOrgPathParams = { org: string; /** * migration_id parameter */ migrationId: number; }; export type MigrationsDownloadArchiveForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsDownloadArchiveForOrgVariables = { pathParams: MigrationsDownloadArchiveForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Fetches the URL to a migration archive. */ export const fetchMigrationsDownloadArchiveForOrg = ( variables: MigrationsDownloadArchiveForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsDownloadArchiveForOrgError, undefined, {}, {}, MigrationsDownloadArchiveForOrgPathParams >({ url: '/orgs/{org}/migrations/{migrationId}/archive', method: 'get', ...variables, signal, }); /** * Fetches the URL to a migration archive. */ export const useMigrationsDownloadArchiveForOrg = ( variables: MigrationsDownloadArchiveForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, MigrationsDownloadArchiveForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, MigrationsDownloadArchiveForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/migrations/{migration_id}/archive', operationId: 'migrationsDownloadArchiveForOrg', variables, }), ({ signal }) => fetchMigrationsDownloadArchiveForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsUnlockRepoForOrgPathParams = { org: string; /** * migration_id parameter */ migrationId: number; /** * repo_name parameter */ repoName: string; }; export type MigrationsUnlockRepoForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsUnlockRepoForOrgVariables = { pathParams: MigrationsUnlockRepoForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. */ export const fetchMigrationsUnlockRepoForOrg = ( variables: MigrationsUnlockRepoForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsUnlockRepoForOrgError, undefined, {}, {}, MigrationsUnlockRepoForOrgPathParams >({ url: '/orgs/{org}/migrations/{migrationId}/repos/{repoName}/lock', method: 'delete', ...variables, signal, }); /** * Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. */ export const useMigrationsUnlockRepoForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MigrationsUnlockRepoForOrgError, MigrationsUnlockRepoForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MigrationsUnlockRepoForOrgError, MigrationsUnlockRepoForOrgVariables >( (variables: MigrationsUnlockRepoForOrgVariables) => fetchMigrationsUnlockRepoForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsListReposForOrgPathParams = { org: string; /** * migration_id parameter */ migrationId: number; }; export type MigrationsListReposForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type MigrationsListReposForOrgError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsListReposForOrgResponse = Schemas.MinimalRepository[]; export type MigrationsListReposForOrgVariables = { pathParams: MigrationsListReposForOrgPathParams; queryParams?: MigrationsListReposForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List all the repositories for this organization migration. */ export const fetchMigrationsListReposForOrg = ( variables: MigrationsListReposForOrgVariables, signal?: AbortSignal, ) => githubFetch< MigrationsListReposForOrgResponse, MigrationsListReposForOrgError, undefined, {}, MigrationsListReposForOrgQueryParams, MigrationsListReposForOrgPathParams >({ url: '/orgs/{org}/migrations/{migrationId}/repositories', method: 'get', ...variables, signal, }); /** * List all the repositories for this organization migration. */ export const useMigrationsListReposForOrg = < TData = MigrationsListReposForOrgResponse, >( variables: MigrationsListReposForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsListReposForOrgResponse, MigrationsListReposForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsListReposForOrgResponse, MigrationsListReposForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/migrations/{migration_id}/repositories', operationId: 'migrationsListReposForOrg', variables, }), ({ signal }) => fetchMigrationsListReposForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListOutsideCollaboratorsPathParams = { org: string; }; export type OrgsListOutsideCollaboratorsQueryParams = { /** * Filter the list of outside collaborators. Can be one of: * \* `2fa_disabled`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. * \* `all`: All outside collaborators. * * @default all */ filter?: '2fa_disabled' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListOutsideCollaboratorsError = Fetcher.ErrorWrapper; export type OrgsListOutsideCollaboratorsResponse = Schemas.SimpleUser[]; export type OrgsListOutsideCollaboratorsVariables = { pathParams: OrgsListOutsideCollaboratorsPathParams; queryParams?: OrgsListOutsideCollaboratorsQueryParams; } & GithubContext['fetcherOptions']; /** * List all users who are outside collaborators of an organization. */ export const fetchOrgsListOutsideCollaborators = ( variables: OrgsListOutsideCollaboratorsVariables, signal?: AbortSignal, ) => githubFetch< OrgsListOutsideCollaboratorsResponse, OrgsListOutsideCollaboratorsError, undefined, {}, OrgsListOutsideCollaboratorsQueryParams, OrgsListOutsideCollaboratorsPathParams >({ url: '/orgs/{org}/outside_collaborators', method: 'get', ...variables, signal, }); /** * List all users who are outside collaborators of an organization. */ export const useOrgsListOutsideCollaborators = < TData = OrgsListOutsideCollaboratorsResponse, >( variables: OrgsListOutsideCollaboratorsVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListOutsideCollaboratorsResponse, OrgsListOutsideCollaboratorsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListOutsideCollaboratorsResponse, OrgsListOutsideCollaboratorsError, TData >( queryKeyFn({ path: '/orgs/{org}/outside_collaborators', operationId: 'orgsListOutsideCollaborators', variables, }), ({ signal }) => fetchOrgsListOutsideCollaborators( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsRemoveOutsideCollaboratorPathParams = { org: string; username: string; }; export type OrgsRemoveOutsideCollaboratorError = Fetcher.ErrorWrapper<{ status: 422; payload: { documentation_url?: string; message?: string; }; }>; export type OrgsRemoveOutsideCollaboratorVariables = { pathParams: OrgsRemoveOutsideCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * Removing a user from this list will remove them from all the organization's repositories. */ export const fetchOrgsRemoveOutsideCollaborator = ( variables: OrgsRemoveOutsideCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsRemoveOutsideCollaboratorError, undefined, {}, {}, OrgsRemoveOutsideCollaboratorPathParams >({ url: '/orgs/{org}/outside_collaborators/{username}', method: 'delete', ...variables, signal, }); /** * Removing a user from this list will remove them from all the organization's repositories. */ export const useOrgsRemoveOutsideCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsRemoveOutsideCollaboratorError, OrgsRemoveOutsideCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsRemoveOutsideCollaboratorError, OrgsRemoveOutsideCollaboratorVariables >( (variables: OrgsRemoveOutsideCollaboratorVariables) => fetchOrgsRemoveOutsideCollaborator({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsConvertMemberToOutsideCollaboratorPathParams = { org: string; username: string; }; export type OrgsConvertMemberToOutsideCollaboratorError = Fetcher.ErrorWrapper< | { status: 403; payload: { documentation_url?: string; message?: string; }; } | { status: 404; payload: Responses.NotFound; } >; export type OrgsConvertMemberToOutsideCollaboratorVariables = { pathParams: OrgsConvertMemberToOutsideCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". */ export const fetchOrgsConvertMemberToOutsideCollaborator = ( variables: OrgsConvertMemberToOutsideCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsConvertMemberToOutsideCollaboratorError, undefined, {}, {}, OrgsConvertMemberToOutsideCollaboratorPathParams >({ url: '/orgs/{org}/outside_collaborators/{username}', method: 'put', ...variables, signal, }); /** * When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". */ export const useOrgsConvertMemberToOutsideCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsConvertMemberToOutsideCollaboratorError, OrgsConvertMemberToOutsideCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsConvertMemberToOutsideCollaboratorError, OrgsConvertMemberToOutsideCollaboratorVariables >( (variables: OrgsConvertMemberToOutsideCollaboratorVariables) => fetchOrgsConvertMemberToOutsideCollaborator({ ...fetcherOptions, ...variables, }), options, ); }; export type PackagesDeletePackageForOrgPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; }; export type PackagesDeletePackageForOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesDeletePackageForOrgVariables = { pathParams: PackagesDeletePackageForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. */ export const fetchPackagesDeletePackageForOrg = ( variables: PackagesDeletePackageForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesDeletePackageForOrgError, undefined, {}, {}, PackagesDeletePackageForOrgPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}', method: 'delete', ...variables, signal, }); /** * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. */ export const usePackagesDeletePackageForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesDeletePackageForOrgError, PackagesDeletePackageForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesDeletePackageForOrgError, PackagesDeletePackageForOrgVariables >( (variables: PackagesDeletePackageForOrgVariables) => fetchPackagesDeletePackageForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type PackagesGetPackageForOrganizationPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; }; export type PackagesGetPackageForOrganizationError = Fetcher.ErrorWrapper; export type PackagesGetPackageForOrganizationVariables = { pathParams: PackagesGetPackageForOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package in an organization. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageForOrganization = ( variables: PackagesGetPackageForOrganizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Package, PackagesGetPackageForOrganizationError, undefined, {}, {}, PackagesGetPackageForOrganizationPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}', method: 'get', ...variables, signal, }); /** * Gets a specific package in an organization. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageForOrganization = ( variables: PackagesGetPackageForOrganizationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Package, PackagesGetPackageForOrganizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Package, PackagesGetPackageForOrganizationError, TData >( queryKeyFn({ path: '/orgs/{org}/packages/{package_type}/{package_name}', operationId: 'packagesGetPackageForOrganization', variables, }), ({ signal }) => fetchPackagesGetPackageForOrganization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesRestorePackageForOrgPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; }; export type PackagesRestorePackageForOrgQueryParams = { /** * package token */ token?: string; }; export type PackagesRestorePackageForOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesRestorePackageForOrgVariables = { pathParams: PackagesRestorePackageForOrgPathParams; queryParams?: PackagesRestorePackageForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Restores an entire package in an organization. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. */ export const fetchPackagesRestorePackageForOrg = ( variables: PackagesRestorePackageForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesRestorePackageForOrgError, undefined, {}, PackagesRestorePackageForOrgQueryParams, PackagesRestorePackageForOrgPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}/restore', method: 'post', ...variables, signal, }); /** * Restores an entire package in an organization. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. */ export const usePackagesRestorePackageForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesRestorePackageForOrgError, PackagesRestorePackageForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesRestorePackageForOrgError, PackagesRestorePackageForOrgVariables >( (variables: PackagesRestorePackageForOrgVariables) => fetchPackagesRestorePackageForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type PackagesGetAllPackageVersionsForPackageOwnedByOrgPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; }; export type PackagesGetAllPackageVersionsForPackageOwnedByOrgQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * The state of the package, either active or deleted. * * @default active */ state?: 'active' | 'deleted'; }; export type PackagesGetAllPackageVersionsForPackageOwnedByOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse = Schemas.PackageVersion[]; export type PackagesGetAllPackageVersionsForPackageOwnedByOrgVariables = { pathParams: PackagesGetAllPackageVersionsForPackageOwnedByOrgPathParams; queryParams?: PackagesGetAllPackageVersionsForPackageOwnedByOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Returns all package versions for a package owned by an organization. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetAllPackageVersionsForPackageOwnedByOrg = ( variables: PackagesGetAllPackageVersionsForPackageOwnedByOrgVariables, signal?: AbortSignal, ) => githubFetch< PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse, PackagesGetAllPackageVersionsForPackageOwnedByOrgError, undefined, {}, PackagesGetAllPackageVersionsForPackageOwnedByOrgQueryParams, PackagesGetAllPackageVersionsForPackageOwnedByOrgPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}/versions', method: 'get', ...variables, signal, }); /** * Returns all package versions for a package owned by an organization. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetAllPackageVersionsForPackageOwnedByOrg = < TData = PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse, >( variables: PackagesGetAllPackageVersionsForPackageOwnedByOrgVariables, options?: Omit< reactQuery.UseQueryOptions< PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse, PackagesGetAllPackageVersionsForPackageOwnedByOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse, PackagesGetAllPackageVersionsForPackageOwnedByOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/packages/{package_type}/{package_name}/versions', operationId: 'packagesGetAllPackageVersionsForPackageOwnedByOrg', variables, }), ({ signal }) => fetchPackagesGetAllPackageVersionsForPackageOwnedByOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesDeletePackageVersionForOrgPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesDeletePackageVersionForOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesDeletePackageVersionForOrgVariables = { pathParams: PackagesDeletePackageVersionForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a specific package version in an organization. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. */ export const fetchPackagesDeletePackageVersionForOrg = ( variables: PackagesDeletePackageVersionForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesDeletePackageVersionForOrgError, undefined, {}, {}, PackagesDeletePackageVersionForOrgPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}/versions/{packageVersionId}', method: 'delete', ...variables, signal, }); /** * Deletes a specific package version in an organization. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. */ export const usePackagesDeletePackageVersionForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesDeletePackageVersionForOrgError, PackagesDeletePackageVersionForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesDeletePackageVersionForOrgError, PackagesDeletePackageVersionForOrgVariables >( (variables: PackagesDeletePackageVersionForOrgVariables) => fetchPackagesDeletePackageVersionForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type PackagesGetPackageVersionForOrganizationPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesGetPackageVersionForOrganizationError = Fetcher.ErrorWrapper; export type PackagesGetPackageVersionForOrganizationVariables = { pathParams: PackagesGetPackageVersionForOrganizationPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package version in an organization. * * You must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageVersionForOrganization = ( variables: PackagesGetPackageVersionForOrganizationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackageVersion, PackagesGetPackageVersionForOrganizationError, undefined, {}, {}, PackagesGetPackageVersionForOrganizationPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}/versions/{packageVersionId}', method: 'get', ...variables, signal, }); /** * Gets a specific package version in an organization. * * You must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageVersionForOrganization = < TData = Schemas.PackageVersion, >( variables: PackagesGetPackageVersionForOrganizationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackageVersion, PackagesGetPackageVersionForOrganizationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackageVersion, PackagesGetPackageVersionForOrganizationError, TData >( queryKeyFn({ path: '/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}', operationId: 'packagesGetPackageVersionForOrganization', variables, }), ({ signal }) => fetchPackagesGetPackageVersionForOrganization( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesRestorePackageVersionForOrgPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; org: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesRestorePackageVersionForOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesRestorePackageVersionForOrgVariables = { pathParams: PackagesRestorePackageVersionForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Restores a specific package version in an organization. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. */ export const fetchPackagesRestorePackageVersionForOrg = ( variables: PackagesRestorePackageVersionForOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesRestorePackageVersionForOrgError, undefined, {}, {}, PackagesRestorePackageVersionForOrgPathParams >({ url: '/orgs/{org}/packages/{packageType}/{packageName}/versions/{packageVersionId}/restore', method: 'post', ...variables, signal, }); /** * Restores a specific package version in an organization. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scope. In addition: * - If `package_type` is not `container`, your token must also include the `repo` scope. * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. */ export const usePackagesRestorePackageVersionForOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesRestorePackageVersionForOrgError, PackagesRestorePackageVersionForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesRestorePackageVersionForOrgError, PackagesRestorePackageVersionForOrgVariables >( (variables: PackagesRestorePackageVersionForOrgVariables) => fetchPackagesRestorePackageVersionForOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ProjectsListForOrgPathParams = { org: string; }; export type ProjectsListForOrgQueryParams = { /** * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListForOrgError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailedSimple; }>; export type ProjectsListForOrgResponse = Schemas.Project[]; export type ProjectsListForOrgVariables = { pathParams: ProjectsListForOrgPathParams; queryParams?: ProjectsListForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsListForOrg = ( variables: ProjectsListForOrgVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListForOrgResponse, ProjectsListForOrgError, undefined, {}, ProjectsListForOrgQueryParams, ProjectsListForOrgPathParams >({ url: '/orgs/{org}/projects', method: 'get', ...variables, signal }); /** * Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsListForOrg = ( variables: ProjectsListForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListForOrgResponse, ProjectsListForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListForOrgResponse, ProjectsListForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/projects', operationId: 'projectsListForOrg', variables, }), ({ signal }) => fetchProjectsListForOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsCreateForOrgPathParams = { org: string; }; export type ProjectsCreateForOrgError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsCreateForOrgRequestBody = { /** * The description of the project. */ body?: string; /** * The name of the project. */ name: string; }; export type ProjectsCreateForOrgVariables = { body: ProjectsCreateForOrgRequestBody; pathParams: ProjectsCreateForOrgPathParams; } & GithubContext['fetcherOptions']; /** * Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsCreateForOrg = ( variables: ProjectsCreateForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Project, ProjectsCreateForOrgError, ProjectsCreateForOrgRequestBody, {}, {}, ProjectsCreateForOrgPathParams >({ url: '/orgs/{org}/projects', method: 'post', ...variables, signal }); /** * Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsCreateForOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Project, ProjectsCreateForOrgError, ProjectsCreateForOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Project, ProjectsCreateForOrgError, ProjectsCreateForOrgVariables >( (variables: ProjectsCreateForOrgVariables) => fetchProjectsCreateForOrg({ ...fetcherOptions, ...variables }), options, ); }; export type OrgsListPublicMembersPathParams = { org: string; }; export type OrgsListPublicMembersQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListPublicMembersError = Fetcher.ErrorWrapper; export type OrgsListPublicMembersResponse = Schemas.SimpleUser[]; export type OrgsListPublicMembersVariables = { pathParams: OrgsListPublicMembersPathParams; queryParams?: OrgsListPublicMembersQueryParams; } & GithubContext['fetcherOptions']; /** * Members of an organization can choose to have their membership publicized or not. */ export const fetchOrgsListPublicMembers = ( variables: OrgsListPublicMembersVariables, signal?: AbortSignal, ) => githubFetch< OrgsListPublicMembersResponse, OrgsListPublicMembersError, undefined, {}, OrgsListPublicMembersQueryParams, OrgsListPublicMembersPathParams >({ url: '/orgs/{org}/public_members', method: 'get', ...variables, signal }); /** * Members of an organization can choose to have their membership publicized or not. */ export const useOrgsListPublicMembers = ( variables: OrgsListPublicMembersVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListPublicMembersResponse, OrgsListPublicMembersError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListPublicMembersResponse, OrgsListPublicMembersError, TData >( queryKeyFn({ path: '/orgs/{org}/public_members', operationId: 'orgsListPublicMembers', variables, }), ({ signal }) => fetchOrgsListPublicMembers({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type OrgsRemovePublicMembershipForAuthenticatedUserPathParams = { org: string; username: string; }; export type OrgsRemovePublicMembershipForAuthenticatedUserError = Fetcher.ErrorWrapper; export type OrgsRemovePublicMembershipForAuthenticatedUserVariables = { pathParams: OrgsRemovePublicMembershipForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsRemovePublicMembershipForAuthenticatedUser = ( variables: OrgsRemovePublicMembershipForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsRemovePublicMembershipForAuthenticatedUserError, undefined, {}, {}, OrgsRemovePublicMembershipForAuthenticatedUserPathParams >({ url: '/orgs/{org}/public_members/{username}', method: 'delete', ...variables, signal, }); export const useOrgsRemovePublicMembershipForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsRemovePublicMembershipForAuthenticatedUserError, OrgsRemovePublicMembershipForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsRemovePublicMembershipForAuthenticatedUserError, OrgsRemovePublicMembershipForAuthenticatedUserVariables >( (variables: OrgsRemovePublicMembershipForAuthenticatedUserVariables) => fetchOrgsRemovePublicMembershipForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type OrgsCheckPublicMembershipForUserPathParams = { org: string; username: string; }; export type OrgsCheckPublicMembershipForUserError = Fetcher.ErrorWrapper; export type OrgsCheckPublicMembershipForUserVariables = { pathParams: OrgsCheckPublicMembershipForUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsCheckPublicMembershipForUser = ( variables: OrgsCheckPublicMembershipForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsCheckPublicMembershipForUserError, undefined, {}, {}, OrgsCheckPublicMembershipForUserPathParams >({ url: '/orgs/{org}/public_members/{username}', method: 'get', ...variables, signal, }); export const useOrgsCheckPublicMembershipForUser = ( variables: OrgsCheckPublicMembershipForUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, OrgsCheckPublicMembershipForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, OrgsCheckPublicMembershipForUserError, TData >( queryKeyFn({ path: '/orgs/{org}/public_members/{username}', operationId: 'orgsCheckPublicMembershipForUser', variables, }), ({ signal }) => fetchOrgsCheckPublicMembershipForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsSetPublicMembershipForAuthenticatedUserPathParams = { org: string; username: string; }; export type OrgsSetPublicMembershipForAuthenticatedUserError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type OrgsSetPublicMembershipForAuthenticatedUserVariables = { pathParams: OrgsSetPublicMembershipForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * The user can publicize their own membership. (A user cannot publicize the membership for another user.) * * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchOrgsSetPublicMembershipForAuthenticatedUser = ( variables: OrgsSetPublicMembershipForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, OrgsSetPublicMembershipForAuthenticatedUserError, undefined, {}, {}, OrgsSetPublicMembershipForAuthenticatedUserPathParams >({ url: '/orgs/{org}/public_members/{username}', method: 'put', ...variables, signal, }); /** * The user can publicize their own membership. (A user cannot publicize the membership for another user.) * * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useOrgsSetPublicMembershipForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, OrgsSetPublicMembershipForAuthenticatedUserError, OrgsSetPublicMembershipForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, OrgsSetPublicMembershipForAuthenticatedUserError, OrgsSetPublicMembershipForAuthenticatedUserVariables >( (variables: OrgsSetPublicMembershipForAuthenticatedUserVariables) => fetchOrgsSetPublicMembershipForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposListForOrgPathParams = { org: string; }; export type ReposListForOrgQueryParams = { /** * Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. */ type?: | 'all' | 'public' | 'private' | 'forks' | 'sources' | 'member' | 'internal'; /** * Can be one of `created`, `updated`, `pushed`, `full_name`. * * @default created */ sort?: 'created' | 'updated' | 'pushed' | 'full_name'; /** * Can be one of `asc` or `desc`. Default: when using `full_name`: `asc`, otherwise `desc` */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListForOrgError = Fetcher.ErrorWrapper; export type ReposListForOrgResponse = Schemas.MinimalRepository[]; export type ReposListForOrgVariables = { pathParams: ReposListForOrgPathParams; queryParams?: ReposListForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories for the specified organization. */ export const fetchReposListForOrg = ( variables: ReposListForOrgVariables, signal?: AbortSignal, ) => githubFetch< ReposListForOrgResponse, ReposListForOrgError, undefined, {}, ReposListForOrgQueryParams, ReposListForOrgPathParams >({ url: '/orgs/{org}/repos', method: 'get', ...variables, signal }); /** * Lists repositories for the specified organization. */ export const useReposListForOrg = ( variables: ReposListForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListForOrgResponse, ReposListForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListForOrgResponse, ReposListForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/repos', operationId: 'reposListForOrg', variables, }), ({ signal }) => fetchReposListForOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateInOrgPathParams = { org: string; }; export type ReposCreateInOrgError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateInOrgRequestBody = { /** * Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. * * @default true */ allow_merge_commit?: boolean; /** * Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. * * @default true */ allow_rebase_merge?: boolean; /** * Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. * * @default true */ allow_squash_merge?: boolean; /** * Pass `true` to create an initial commit with empty README. * * @default false */ auto_init?: boolean; /** * Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. * * @default false */ delete_branch_on_merge?: boolean; /** * A short description of the repository. */ description?: string; /** * Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ gitignore_template?: string; /** * Either `true` to enable issues for this repository or `false` to disable them. * * @default true */ has_issues?: boolean; /** * Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. * * @default true */ has_projects?: boolean; /** * Either `true` to enable the wiki for this repository or `false` to disable it. * * @default true */ has_wiki?: boolean; /** * A URL with more information about the repository. */ homepage?: string; /** * Either `true` to make this repo available as a template repository or `false` to prevent it. * * @default false */ is_template?: boolean; /** * Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". */ license_template?: string; /** * The name of the repository. */ name: string; /** * Whether the repository is private. * * @default false */ private?: boolean; /** * The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ team_id?: number; /** * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. * The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. */ visibility?: 'public' | 'private' | 'visibility' | 'internal'; }; export type ReposCreateInOrgVariables = { body: ReposCreateInOrgRequestBody; pathParams: ReposCreateInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Creates a new repository in the specified organization. The authenticated user must be a member of the organization. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ export const fetchReposCreateInOrg = ( variables: ReposCreateInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Repository, ReposCreateInOrgError, ReposCreateInOrgRequestBody, {}, {}, ReposCreateInOrgPathParams >({ url: '/orgs/{org}/repos', method: 'post', ...variables, signal }); /** * Creates a new repository in the specified organization. The authenticated user must be a member of the organization. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ export const useReposCreateInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Repository, ReposCreateInOrgError, ReposCreateInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Repository, ReposCreateInOrgError, ReposCreateInOrgVariables >( (variables: ReposCreateInOrgVariables) => fetchReposCreateInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type BillingGetGithubActionsBillingOrgPathParams = { org: string; }; export type BillingGetGithubActionsBillingOrgError = Fetcher.ErrorWrapper; export type BillingGetGithubActionsBillingOrgVariables = { pathParams: BillingGetGithubActionsBillingOrgPathParams; } & GithubContext['fetcherOptions']; /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `repo` or `admin:org` scope. */ export const fetchBillingGetGithubActionsBillingOrg = ( variables: BillingGetGithubActionsBillingOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingOrgError, undefined, {}, {}, BillingGetGithubActionsBillingOrgPathParams >({ url: '/orgs/{org}/settings/billing/actions', method: 'get', ...variables, signal, }); /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `repo` or `admin:org` scope. */ export const useBillingGetGithubActionsBillingOrg = < TData = Schemas.ActionsBillingUsage, >( variables: BillingGetGithubActionsBillingOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/settings/billing/actions', operationId: 'billingGetGithubActionsBillingOrg', variables, }), ({ signal }) => fetchBillingGetGithubActionsBillingOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetGithubPackagesBillingOrgPathParams = { org: string; }; export type BillingGetGithubPackagesBillingOrgError = Fetcher.ErrorWrapper; export type BillingGetGithubPackagesBillingOrgVariables = { pathParams: BillingGetGithubPackagesBillingOrgPathParams; } & GithubContext['fetcherOptions']; /** * Gets the free and paid storage usued for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `repo` or `admin:org` scope. */ export const fetchBillingGetGithubPackagesBillingOrg = ( variables: BillingGetGithubPackagesBillingOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingOrgError, undefined, {}, {}, BillingGetGithubPackagesBillingOrgPathParams >({ url: '/orgs/{org}/settings/billing/packages', method: 'get', ...variables, signal, }); /** * Gets the free and paid storage usued for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `repo` or `admin:org` scope. */ export const useBillingGetGithubPackagesBillingOrg = < TData = Schemas.PackagesBillingUsage, >( variables: BillingGetGithubPackagesBillingOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/settings/billing/packages', operationId: 'billingGetGithubPackagesBillingOrg', variables, }), ({ signal }) => fetchBillingGetGithubPackagesBillingOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetSharedStorageBillingOrgPathParams = { org: string; }; export type BillingGetSharedStorageBillingOrgError = Fetcher.ErrorWrapper; export type BillingGetSharedStorageBillingOrgVariables = { pathParams: BillingGetSharedStorageBillingOrgPathParams; } & GithubContext['fetcherOptions']; /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `repo` or `admin:org` scope. */ export const fetchBillingGetSharedStorageBillingOrg = ( variables: BillingGetSharedStorageBillingOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingOrgError, undefined, {}, {}, BillingGetSharedStorageBillingOrgPathParams >({ url: '/orgs/{org}/settings/billing/shared-storage', method: 'get', ...variables, signal, }); /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `repo` or `admin:org` scope. */ export const useBillingGetSharedStorageBillingOrg = < TData = Schemas.CombinedBillingUsage, >( variables: BillingGetSharedStorageBillingOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/settings/billing/shared-storage', operationId: 'billingGetSharedStorageBillingOrg', variables, }), ({ signal }) => fetchBillingGetSharedStorageBillingOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsListIdpGroupsForOrgPathParams = { org: string; }; export type TeamsListIdpGroupsForOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page token */ page?: string; }; export type TeamsListIdpGroupsForOrgError = Fetcher.ErrorWrapper; export type TeamsListIdpGroupsForOrgVariables = { pathParams: TeamsListIdpGroupsForOrgPathParams; queryParams?: TeamsListIdpGroupsForOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups available in an organization. You can limit your page results using the `per_page` parameter. GitHub generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." * * The `per_page` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user `octocat` wants to see two groups per page in `octo-org` via cURL, it would look like this: */ export const fetchTeamsListIdpGroupsForOrg = ( variables: TeamsListIdpGroupsForOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GroupMapping, TeamsListIdpGroupsForOrgError, undefined, {}, TeamsListIdpGroupsForOrgQueryParams, TeamsListIdpGroupsForOrgPathParams >({ url: '/orgs/{org}/team-sync/groups', method: 'get', ...variables, signal, }); /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups available in an organization. You can limit your page results using the `per_page` parameter. GitHub generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." * * The `per_page` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user `octocat` wants to see two groups per page in `octo-org` via cURL, it would look like this: */ export const useTeamsListIdpGroupsForOrg = ( variables: TeamsListIdpGroupsForOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GroupMapping, TeamsListIdpGroupsForOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.GroupMapping, TeamsListIdpGroupsForOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/team-sync/groups', operationId: 'teamsListIdpGroupsForOrg', variables, }), ({ signal }) => fetchTeamsListIdpGroupsForOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsListPathParams = { org: string; }; export type TeamsListQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type TeamsListResponse = Schemas.Team[]; export type TeamsListVariables = { pathParams: TeamsListPathParams; queryParams?: TeamsListQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all teams in an organization that are visible to the authenticated user. */ export const fetchTeamsList = ( variables: TeamsListVariables, signal?: AbortSignal, ) => githubFetch< TeamsListResponse, TeamsListError, undefined, {}, TeamsListQueryParams, TeamsListPathParams >({ url: '/orgs/{org}/teams', method: 'get', ...variables, signal }); /** * Lists all teams in an organization that are visible to the authenticated user. */ export const useTeamsList = ( variables: TeamsListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}/teams', operationId: 'teamsList', variables, }), ({ signal }) => fetchTeamsList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsCreatePathParams = { org: string; }; export type TeamsCreateError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsCreateRequestBody = { /** * The description of the team. */ description?: string; /** * List GitHub IDs for organization members who will become team maintainers. */ maintainers?: string[]; /** * The name of the team. */ name: string; /** * The ID of a team to set as the parent team. */ parent_team_id?: number; /** * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: * \* `pull` - team members can pull, but not push to or administer newly-added repositories. * \* `push` - team members can pull and push, but not administer newly-added repositories. * \* `admin` - team members can pull, push and administer newly-added repositories. * * @default pull */ permission?: 'pull' | 'push' | 'admin'; /** * The level of privacy this team should have. The options are: * **For a non-nested team:** * \* `secret` - only visible to organization owners and members of this team. * \* `closed` - visible to all members of this organization. * Default: `secret` * **For a parent or child team:** * \* `closed` - visible to all members of this organization. * Default for child team: `closed` */ privacy?: 'secret' | 'closed'; /** * The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ repo_names?: string[]; }; export type TeamsCreateVariables = { body: TeamsCreateRequestBody; pathParams: TeamsCreatePathParams; } & GithubContext['fetcherOptions']; /** * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." * * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". */ export const fetchTeamsCreate = ( variables: TeamsCreateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamFull, TeamsCreateError, TeamsCreateRequestBody, {}, {}, TeamsCreatePathParams >({ url: '/orgs/{org}/teams', method: 'post', ...variables, signal }); /** * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." * * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". */ export const useTeamsCreate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamFull, TeamsCreateError, TeamsCreateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamFull, TeamsCreateError, TeamsCreateVariables >( (variables: TeamsCreateVariables) => fetchTeamsCreate({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsDeleteInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsDeleteInOrgError = Fetcher.ErrorWrapper; export type TeamsDeleteInOrgVariables = { pathParams: TeamsDeleteInOrgPathParams; } & GithubContext['fetcherOptions']; /** * To delete a team, the authenticated user must be an organization owner or team maintainer. * * If you are an organization owner, deleting a parent team will delete all of its child teams as well. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. */ export const fetchTeamsDeleteInOrg = ( variables: TeamsDeleteInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteInOrgError, undefined, {}, {}, TeamsDeleteInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}', method: 'delete', ...variables, signal, }); /** * To delete a team, the authenticated user must be an organization owner or team maintainer. * * If you are an organization owner, deleting a parent team will delete all of its child teams as well. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. */ export const useTeamsDeleteInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteInOrgError, TeamsDeleteInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteInOrgError, TeamsDeleteInOrgVariables >( (variables: TeamsDeleteInOrgVariables) => fetchTeamsDeleteInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsGetByNamePathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsGetByNameError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type TeamsGetByNameVariables = { pathParams: TeamsGetByNamePathParams; } & GithubContext['fetcherOptions']; /** * Gets a team using the team's `slug`. GitHub generates the `slug` from the team `name`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. */ export const fetchTeamsGetByName = ( variables: TeamsGetByNameVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamFull, TeamsGetByNameError, undefined, {}, {}, TeamsGetByNamePathParams >({ url: '/orgs/{org}/teams/{teamSlug}', method: 'get', ...variables, signal, }); /** * Gets a team using the team's `slug`. GitHub generates the `slug` from the team `name`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. */ export const useTeamsGetByName = ( variables: TeamsGetByNameVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}', operationId: 'teamsGetByName', variables, }), ({ signal }) => fetchTeamsGetByName({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsUpdateInOrgError = Fetcher.ErrorWrapper; export type TeamsUpdateInOrgRequestBody = { /** * The description of the team. */ description?: string; /** * The name of the team. */ name?: string; /** * The ID of a team to set as the parent team. */ parent_team_id?: number | null; /** * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: * \* `pull` - team members can pull, but not push to or administer newly-added repositories. * \* `push` - team members can pull and push, but not administer newly-added repositories. * \* `admin` - team members can pull, push and administer newly-added repositories. * * @default pull */ permission?: 'pull' | 'push' | 'admin'; /** * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: * **For a non-nested team:** * \* `secret` - only visible to organization owners and members of this team. * \* `closed` - visible to all members of this organization. * **For a parent or child team:** * \* `closed` - visible to all members of this organization. */ privacy?: 'secret' | 'closed'; }; export type TeamsUpdateInOrgVariables = { body?: TeamsUpdateInOrgRequestBody; pathParams: TeamsUpdateInOrgPathParams; } & GithubContext['fetcherOptions']; /** * To edit a team, the authenticated user must either be an organization owner or a team maintainer. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. */ export const fetchTeamsUpdateInOrg = ( variables: TeamsUpdateInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamFull, TeamsUpdateInOrgError, TeamsUpdateInOrgRequestBody, {}, {}, TeamsUpdateInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}', method: 'patch', ...variables, signal, }); /** * To edit a team, the authenticated user must either be an organization owner or a team maintainer. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. */ export const useTeamsUpdateInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamFull, TeamsUpdateInOrgError, TeamsUpdateInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamFull, TeamsUpdateInOrgError, TeamsUpdateInOrgVariables >( (variables: TeamsUpdateInOrgVariables) => fetchTeamsUpdateInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsListDiscussionsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListDiscussionsInOrgQueryParams = { /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Pinned discussions only filter */ pinned?: string; }; export type TeamsListDiscussionsInOrgError = Fetcher.ErrorWrapper; export type TeamsListDiscussionsInOrgResponse = Schemas.TeamDiscussion[]; export type TeamsListDiscussionsInOrgVariables = { pathParams: TeamsListDiscussionsInOrgPathParams; queryParams?: TeamsListDiscussionsInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. */ export const fetchTeamsListDiscussionsInOrg = ( variables: TeamsListDiscussionsInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListDiscussionsInOrgResponse, TeamsListDiscussionsInOrgError, undefined, {}, TeamsListDiscussionsInOrgQueryParams, TeamsListDiscussionsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions', method: 'get', ...variables, signal, }); /** * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. */ export const useTeamsListDiscussionsInOrg = < TData = TeamsListDiscussionsInOrgResponse, >( variables: TeamsListDiscussionsInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListDiscussionsInOrgResponse, TeamsListDiscussionsInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListDiscussionsInOrgResponse, TeamsListDiscussionsInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions', operationId: 'teamsListDiscussionsInOrg', variables, }), ({ signal }) => fetchTeamsListDiscussionsInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsCreateDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsCreateDiscussionInOrgError = Fetcher.ErrorWrapper; export type TeamsCreateDiscussionInOrgRequestBody = { /** * The discussion post's body text. */ body: string; /** * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. * * @default false */ private?: boolean; /** * The discussion post's title. */ title: string; }; export type TeamsCreateDiscussionInOrgVariables = { body: TeamsCreateDiscussionInOrgRequestBody; pathParams: TeamsCreateDiscussionInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. */ export const fetchTeamsCreateDiscussionInOrg = ( variables: TeamsCreateDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsCreateDiscussionInOrgError, TeamsCreateDiscussionInOrgRequestBody, {}, {}, TeamsCreateDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions', method: 'post', ...variables, signal, }); /** * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. */ export const useTeamsCreateDiscussionInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussion, TeamsCreateDiscussionInOrgError, TeamsCreateDiscussionInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussion, TeamsCreateDiscussionInOrgError, TeamsCreateDiscussionInOrgVariables >( (variables: TeamsCreateDiscussionInOrgVariables) => fetchTeamsCreateDiscussionInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsDeleteDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type TeamsDeleteDiscussionInOrgError = Fetcher.ErrorWrapper; export type TeamsDeleteDiscussionInOrgVariables = { pathParams: TeamsDeleteDiscussionInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const fetchTeamsDeleteDiscussionInOrg = ( variables: TeamsDeleteDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteDiscussionInOrgError, undefined, {}, {}, TeamsDeleteDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}', method: 'delete', ...variables, signal, }); /** * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const useTeamsDeleteDiscussionInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteDiscussionInOrgError, TeamsDeleteDiscussionInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteDiscussionInOrgError, TeamsDeleteDiscussionInOrgVariables >( (variables: TeamsDeleteDiscussionInOrgVariables) => fetchTeamsDeleteDiscussionInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsGetDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type TeamsGetDiscussionInOrgError = Fetcher.ErrorWrapper; export type TeamsGetDiscussionInOrgVariables = { pathParams: TeamsGetDiscussionInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const fetchTeamsGetDiscussionInOrg = ( variables: TeamsGetDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsGetDiscussionInOrgError, undefined, {}, {}, TeamsGetDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}', method: 'get', ...variables, signal, }); /** * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const useTeamsGetDiscussionInOrg = ( variables: TeamsGetDiscussionInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamDiscussion, TeamsGetDiscussionInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamDiscussion, TeamsGetDiscussionInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}', operationId: 'teamsGetDiscussionInOrg', variables, }), ({ signal }) => fetchTeamsGetDiscussionInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type TeamsUpdateDiscussionInOrgError = Fetcher.ErrorWrapper; export type TeamsUpdateDiscussionInOrgRequestBody = { /** * The discussion post's body text. */ body?: string; /** * The discussion post's title. */ title?: string; }; export type TeamsUpdateDiscussionInOrgVariables = { body?: TeamsUpdateDiscussionInOrgRequestBody; pathParams: TeamsUpdateDiscussionInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const fetchTeamsUpdateDiscussionInOrg = ( variables: TeamsUpdateDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsUpdateDiscussionInOrgError, TeamsUpdateDiscussionInOrgRequestBody, {}, {}, TeamsUpdateDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}', method: 'patch', ...variables, signal, }); /** * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ export const useTeamsUpdateDiscussionInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussion, TeamsUpdateDiscussionInOrgError, TeamsUpdateDiscussionInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussion, TeamsUpdateDiscussionInOrgError, TeamsUpdateDiscussionInOrgVariables >( (variables: TeamsUpdateDiscussionInOrgVariables) => fetchTeamsUpdateDiscussionInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsListDiscussionCommentsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type TeamsListDiscussionCommentsInOrgQueryParams = { /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListDiscussionCommentsInOrgError = Fetcher.ErrorWrapper; export type TeamsListDiscussionCommentsInOrgResponse = Schemas.TeamDiscussionComment[]; export type TeamsListDiscussionCommentsInOrgVariables = { pathParams: TeamsListDiscussionCommentsInOrgPathParams; queryParams?: TeamsListDiscussionCommentsInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ export const fetchTeamsListDiscussionCommentsInOrg = ( variables: TeamsListDiscussionCommentsInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListDiscussionCommentsInOrgResponse, TeamsListDiscussionCommentsInOrgError, undefined, {}, TeamsListDiscussionCommentsInOrgQueryParams, TeamsListDiscussionCommentsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments', method: 'get', ...variables, signal, }); /** * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ export const useTeamsListDiscussionCommentsInOrg = < TData = TeamsListDiscussionCommentsInOrgResponse, >( variables: TeamsListDiscussionCommentsInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListDiscussionCommentsInOrgResponse, TeamsListDiscussionCommentsInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListDiscussionCommentsInOrgResponse, TeamsListDiscussionCommentsInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments', operationId: 'teamsListDiscussionCommentsInOrg', variables, }), ({ signal }) => fetchTeamsListDiscussionCommentsInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsCreateDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type TeamsCreateDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type TeamsCreateDiscussionCommentInOrgRequestBody = { /** * The discussion comment's body text. */ body: string; }; export type TeamsCreateDiscussionCommentInOrgVariables = { body: TeamsCreateDiscussionCommentInOrgRequestBody; pathParams: TeamsCreateDiscussionCommentInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ export const fetchTeamsCreateDiscussionCommentInOrg = ( variables: TeamsCreateDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentInOrgError, TeamsCreateDiscussionCommentInOrgRequestBody, {}, {}, TeamsCreateDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments', method: 'post', ...variables, signal, }); /** * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ export const useTeamsCreateDiscussionCommentInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentInOrgError, TeamsCreateDiscussionCommentInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentInOrgError, TeamsCreateDiscussionCommentInOrgVariables >( (variables: TeamsCreateDiscussionCommentInOrgVariables) => fetchTeamsCreateDiscussionCommentInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsDeleteDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; }; export type TeamsDeleteDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type TeamsDeleteDiscussionCommentInOrgVariables = { pathParams: TeamsDeleteDiscussionCommentInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const fetchTeamsDeleteDiscussionCommentInOrg = ( variables: TeamsDeleteDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteDiscussionCommentInOrgError, undefined, {}, {}, TeamsDeleteDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'delete', ...variables, signal, }); /** * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const useTeamsDeleteDiscussionCommentInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteDiscussionCommentInOrgError, TeamsDeleteDiscussionCommentInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteDiscussionCommentInOrgError, TeamsDeleteDiscussionCommentInOrgVariables >( (variables: TeamsDeleteDiscussionCommentInOrgVariables) => fetchTeamsDeleteDiscussionCommentInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsGetDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; }; export type TeamsGetDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type TeamsGetDiscussionCommentInOrgVariables = { pathParams: TeamsGetDiscussionCommentInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const fetchTeamsGetDiscussionCommentInOrg = ( variables: TeamsGetDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentInOrgError, undefined, {}, {}, TeamsGetDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'get', ...variables, signal, }); /** * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const useTeamsGetDiscussionCommentInOrg = < TData = Schemas.TeamDiscussionComment, >( variables: TeamsGetDiscussionCommentInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}', operationId: 'teamsGetDiscussionCommentInOrg', variables, }), ({ signal }) => fetchTeamsGetDiscussionCommentInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; }; export type TeamsUpdateDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type TeamsUpdateDiscussionCommentInOrgRequestBody = { /** * The discussion comment's body text. */ body: string; }; export type TeamsUpdateDiscussionCommentInOrgVariables = { body: TeamsUpdateDiscussionCommentInOrgRequestBody; pathParams: TeamsUpdateDiscussionCommentInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const fetchTeamsUpdateDiscussionCommentInOrg = ( variables: TeamsUpdateDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentInOrgError, TeamsUpdateDiscussionCommentInOrgRequestBody, {}, {}, TeamsUpdateDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'patch', ...variables, signal, }); /** * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ export const useTeamsUpdateDiscussionCommentInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentInOrgError, TeamsUpdateDiscussionCommentInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentInOrgError, TeamsUpdateDiscussionCommentInOrgVariables >( (variables: TeamsUpdateDiscussionCommentInOrgVariables) => fetchTeamsUpdateDiscussionCommentInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsListForTeamDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; }; export type ReactionsListForTeamDiscussionCommentInOrgQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForTeamDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type ReactionsListForTeamDiscussionCommentInOrgResponse = Schemas.Reaction[]; export type ReactionsListForTeamDiscussionCommentInOrgVariables = { pathParams: ReactionsListForTeamDiscussionCommentInOrgPathParams; queryParams?: ReactionsListForTeamDiscussionCommentInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ export const fetchReactionsListForTeamDiscussionCommentInOrg = ( variables: ReactionsListForTeamDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForTeamDiscussionCommentInOrgResponse, ReactionsListForTeamDiscussionCommentInOrgError, undefined, {}, ReactionsListForTeamDiscussionCommentInOrgQueryParams, ReactionsListForTeamDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ export const useReactionsListForTeamDiscussionCommentInOrg = < TData = ReactionsListForTeamDiscussionCommentInOrgResponse, >( variables: ReactionsListForTeamDiscussionCommentInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForTeamDiscussionCommentInOrgResponse, ReactionsListForTeamDiscussionCommentInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForTeamDiscussionCommentInOrgResponse, ReactionsListForTeamDiscussionCommentInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions', operationId: 'reactionsListForTeamDiscussionCommentInOrg', variables, }), ({ signal }) => fetchReactionsListForTeamDiscussionCommentInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForTeamDiscussionCommentInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; }; export type ReactionsCreateForTeamDiscussionCommentInOrgError = Fetcher.ErrorWrapper; export type ReactionsCreateForTeamDiscussionCommentInOrgRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForTeamDiscussionCommentInOrgVariables = { body: ReactionsCreateForTeamDiscussionCommentInOrgRequestBody; pathParams: ReactionsCreateForTeamDiscussionCommentInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion comment. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ export const fetchReactionsCreateForTeamDiscussionCommentInOrg = ( variables: ReactionsCreateForTeamDiscussionCommentInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentInOrgError, ReactionsCreateForTeamDiscussionCommentInOrgRequestBody, {}, {}, ReactionsCreateForTeamDiscussionCommentInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion comment. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ export const useReactionsCreateForTeamDiscussionCommentInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentInOrgError, ReactionsCreateForTeamDiscussionCommentInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentInOrgError, ReactionsCreateForTeamDiscussionCommentInOrgVariables >( (variables: ReactionsCreateForTeamDiscussionCommentInOrgVariables) => fetchReactionsCreateForTeamDiscussionCommentInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsDeleteForTeamDiscussionCommentPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; commentNumber: number; reactionId: number; }; export type ReactionsDeleteForTeamDiscussionCommentError = Fetcher.ErrorWrapper; export type ReactionsDeleteForTeamDiscussionCommentVariables = { pathParams: ReactionsDeleteForTeamDiscussionCommentPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. * * Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchReactionsDeleteForTeamDiscussionComment = ( variables: ReactionsDeleteForTeamDiscussionCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForTeamDiscussionCommentError, undefined, {}, {}, ReactionsDeleteForTeamDiscussionCommentPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/comments/{commentNumber}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. * * Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useReactionsDeleteForTeamDiscussionComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForTeamDiscussionCommentError, ReactionsDeleteForTeamDiscussionCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForTeamDiscussionCommentError, ReactionsDeleteForTeamDiscussionCommentVariables >( (variables: ReactionsDeleteForTeamDiscussionCommentVariables) => fetchReactionsDeleteForTeamDiscussionComment({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsListForTeamDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type ReactionsListForTeamDiscussionInOrgQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForTeamDiscussionInOrgError = Fetcher.ErrorWrapper; export type ReactionsListForTeamDiscussionInOrgResponse = Schemas.Reaction[]; export type ReactionsListForTeamDiscussionInOrgVariables = { pathParams: ReactionsListForTeamDiscussionInOrgPathParams; queryParams?: ReactionsListForTeamDiscussionInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ export const fetchReactionsListForTeamDiscussionInOrg = ( variables: ReactionsListForTeamDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForTeamDiscussionInOrgResponse, ReactionsListForTeamDiscussionInOrgError, undefined, {}, ReactionsListForTeamDiscussionInOrgQueryParams, ReactionsListForTeamDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ export const useReactionsListForTeamDiscussionInOrg = < TData = ReactionsListForTeamDiscussionInOrgResponse, >( variables: ReactionsListForTeamDiscussionInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForTeamDiscussionInOrgResponse, ReactionsListForTeamDiscussionInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForTeamDiscussionInOrgResponse, ReactionsListForTeamDiscussionInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions', operationId: 'reactionsListForTeamDiscussionInOrg', variables, }), ({ signal }) => fetchReactionsListForTeamDiscussionInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForTeamDiscussionInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; }; export type ReactionsCreateForTeamDiscussionInOrgError = Fetcher.ErrorWrapper; export type ReactionsCreateForTeamDiscussionInOrgRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForTeamDiscussionInOrgVariables = { body: ReactionsCreateForTeamDiscussionInOrgRequestBody; pathParams: ReactionsCreateForTeamDiscussionInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ export const fetchReactionsCreateForTeamDiscussionInOrg = ( variables: ReactionsCreateForTeamDiscussionInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForTeamDiscussionInOrgError, ReactionsCreateForTeamDiscussionInOrgRequestBody, {}, {}, ReactionsCreateForTeamDiscussionInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ export const useReactionsCreateForTeamDiscussionInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForTeamDiscussionInOrgError, ReactionsCreateForTeamDiscussionInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForTeamDiscussionInOrgError, ReactionsCreateForTeamDiscussionInOrgVariables >( (variables: ReactionsCreateForTeamDiscussionInOrgVariables) => fetchReactionsCreateForTeamDiscussionInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsDeleteForTeamDiscussionPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; discussionNumber: number; reactionId: number; }; export type ReactionsDeleteForTeamDiscussionError = Fetcher.ErrorWrapper; export type ReactionsDeleteForTeamDiscussionVariables = { pathParams: ReactionsDeleteForTeamDiscussionPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. * * Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchReactionsDeleteForTeamDiscussion = ( variables: ReactionsDeleteForTeamDiscussionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForTeamDiscussionError, undefined, {}, {}, ReactionsDeleteForTeamDiscussionPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/discussions/{discussionNumber}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. * * Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useReactionsDeleteForTeamDiscussion = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForTeamDiscussionError, ReactionsDeleteForTeamDiscussionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForTeamDiscussionError, ReactionsDeleteForTeamDiscussionVariables >( (variables: ReactionsDeleteForTeamDiscussionVariables) => fetchReactionsDeleteForTeamDiscussion({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListPendingInvitationsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListPendingInvitationsInOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListPendingInvitationsInOrgError = Fetcher.ErrorWrapper; export type TeamsListPendingInvitationsInOrgResponse = Schemas.OrganizationInvitation[]; export type TeamsListPendingInvitationsInOrgVariables = { pathParams: TeamsListPendingInvitationsInOrgPathParams; queryParams?: TeamsListPendingInvitationsInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. */ export const fetchTeamsListPendingInvitationsInOrg = ( variables: TeamsListPendingInvitationsInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListPendingInvitationsInOrgResponse, TeamsListPendingInvitationsInOrgError, undefined, {}, TeamsListPendingInvitationsInOrgQueryParams, TeamsListPendingInvitationsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/invitations', method: 'get', ...variables, signal, }); /** * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. */ export const useTeamsListPendingInvitationsInOrg = < TData = TeamsListPendingInvitationsInOrgResponse, >( variables: TeamsListPendingInvitationsInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListPendingInvitationsInOrgResponse, TeamsListPendingInvitationsInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListPendingInvitationsInOrgResponse, TeamsListPendingInvitationsInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/invitations', operationId: 'teamsListPendingInvitationsInOrg', variables, }), ({ signal }) => fetchTeamsListPendingInvitationsInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsListMembersInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListMembersInOrgQueryParams = { /** * Filters members returned by their role in the team. Can be one of: * \* `member` - normal members of the team. * \* `maintainer` - team maintainers. * \* `all` - all members of the team. * * @default all */ role?: 'member' | 'maintainer' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListMembersInOrgError = Fetcher.ErrorWrapper; export type TeamsListMembersInOrgResponse = Schemas.SimpleUser[]; export type TeamsListMembersInOrgVariables = { pathParams: TeamsListMembersInOrgPathParams; queryParams?: TeamsListMembersInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Team members will include the members of child teams. * * To list members in a team, the team must be visible to the authenticated user. */ export const fetchTeamsListMembersInOrg = ( variables: TeamsListMembersInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListMembersInOrgResponse, TeamsListMembersInOrgError, undefined, {}, TeamsListMembersInOrgQueryParams, TeamsListMembersInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/members', method: 'get', ...variables, signal, }); /** * Team members will include the members of child teams. * * To list members in a team, the team must be visible to the authenticated user. */ export const useTeamsListMembersInOrg = ( variables: TeamsListMembersInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListMembersInOrgResponse, TeamsListMembersInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListMembersInOrgResponse, TeamsListMembersInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/members', operationId: 'teamsListMembersInOrg', variables, }), ({ signal }) => fetchTeamsListMembersInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveMembershipForUserInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; username: string; }; export type TeamsRemoveMembershipForUserInOrgError = Fetcher.ErrorWrapper; export type TeamsRemoveMembershipForUserInOrgVariables = { pathParams: TeamsRemoveMembershipForUserInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. */ export const fetchTeamsRemoveMembershipForUserInOrg = ( variables: TeamsRemoveMembershipForUserInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveMembershipForUserInOrgError, undefined, {}, {}, TeamsRemoveMembershipForUserInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/memberships/{username}', method: 'delete', ...variables, signal, }); /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. */ export const useTeamsRemoveMembershipForUserInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveMembershipForUserInOrgError, TeamsRemoveMembershipForUserInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveMembershipForUserInOrgError, TeamsRemoveMembershipForUserInOrgVariables >( (variables: TeamsRemoveMembershipForUserInOrgVariables) => fetchTeamsRemoveMembershipForUserInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsGetMembershipForUserInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; username: string; }; export type TeamsGetMembershipForUserInOrgError = Fetcher.ErrorWrapper; export type TeamsGetMembershipForUserInOrgVariables = { pathParams: TeamsGetMembershipForUserInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Team members will include the members of child teams. * * To get a user's membership with a team, the team must be visible to the authenticated user. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. * * **Note:** The `role` for organization owners returns as `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). */ export const fetchTeamsGetMembershipForUserInOrg = ( variables: TeamsGetMembershipForUserInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamMembership, TeamsGetMembershipForUserInOrgError, undefined, {}, {}, TeamsGetMembershipForUserInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/memberships/{username}', method: 'get', ...variables, signal, }); /** * Team members will include the members of child teams. * * To get a user's membership with a team, the team must be visible to the authenticated user. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. * * **Note:** The `role` for organization owners returns as `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). */ export const useTeamsGetMembershipForUserInOrg = < TData = Schemas.TeamMembership, >( variables: TeamsGetMembershipForUserInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamMembership, TeamsGetMembershipForUserInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamMembership, TeamsGetMembershipForUserInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/memberships/{username}', operationId: 'teamsGetMembershipForUserInOrg', variables, }), ({ signal }) => fetchTeamsGetMembershipForUserInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateMembershipForUserInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; username: string; }; export type TeamsAddOrUpdateMembershipForUserInOrgError = Fetcher.ErrorWrapper<{ status: 422; payload: { errors?: { code?: string; field?: string; resource?: string; }[]; message?: string; }; }>; export type TeamsAddOrUpdateMembershipForUserInOrgRequestBody = { /** * The role that this user should have in the team. Can be one of: * \* `member` - a normal member of the team. * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. * * @default member */ role?: 'member' | 'maintainer'; }; export type TeamsAddOrUpdateMembershipForUserInOrgVariables = { body?: TeamsAddOrUpdateMembershipForUserInOrgRequestBody; pathParams: TeamsAddOrUpdateMembershipForUserInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. * * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. */ export const fetchTeamsAddOrUpdateMembershipForUserInOrg = ( variables: TeamsAddOrUpdateMembershipForUserInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserInOrgError, TeamsAddOrUpdateMembershipForUserInOrgRequestBody, {}, {}, TeamsAddOrUpdateMembershipForUserInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/memberships/{username}', method: 'put', ...variables, signal, }); /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. * * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. */ export const useTeamsAddOrUpdateMembershipForUserInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserInOrgError, TeamsAddOrUpdateMembershipForUserInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserInOrgError, TeamsAddOrUpdateMembershipForUserInOrgVariables >( (variables: TeamsAddOrUpdateMembershipForUserInOrgVariables) => fetchTeamsAddOrUpdateMembershipForUserInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListProjectsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListProjectsInOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListProjectsInOrgError = Fetcher.ErrorWrapper; export type TeamsListProjectsInOrgResponse = Schemas.TeamProject[]; export type TeamsListProjectsInOrgVariables = { pathParams: TeamsListProjectsInOrgPathParams; queryParams?: TeamsListProjectsInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the organization projects for a team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. */ export const fetchTeamsListProjectsInOrg = ( variables: TeamsListProjectsInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListProjectsInOrgResponse, TeamsListProjectsInOrgError, undefined, {}, TeamsListProjectsInOrgQueryParams, TeamsListProjectsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/projects', method: 'get', ...variables, signal, }); /** * Lists the organization projects for a team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. */ export const useTeamsListProjectsInOrg = < TData = TeamsListProjectsInOrgResponse, >( variables: TeamsListProjectsInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListProjectsInOrgResponse, TeamsListProjectsInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListProjectsInOrgResponse, TeamsListProjectsInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/projects', operationId: 'teamsListProjectsInOrg', variables, }), ({ signal }) => fetchTeamsListProjectsInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveProjectInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; projectId: number; }; export type TeamsRemoveProjectInOrgError = Fetcher.ErrorWrapper; export type TeamsRemoveProjectInOrgVariables = { pathParams: TeamsRemoveProjectInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const fetchTeamsRemoveProjectInOrg = ( variables: TeamsRemoveProjectInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveProjectInOrgError, undefined, {}, {}, TeamsRemoveProjectInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/projects/{projectId}', method: 'delete', ...variables, signal, }); /** * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const useTeamsRemoveProjectInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveProjectInOrgError, TeamsRemoveProjectInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveProjectInOrgError, TeamsRemoveProjectInOrgVariables >( (variables: TeamsRemoveProjectInOrgVariables) => fetchTeamsRemoveProjectInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsCheckPermissionsForProjectInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; projectId: number; }; export type TeamsCheckPermissionsForProjectInOrgError = Fetcher.ErrorWrapper; export type TeamsCheckPermissionsForProjectInOrgVariables = { pathParams: TeamsCheckPermissionsForProjectInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const fetchTeamsCheckPermissionsForProjectInOrg = ( variables: TeamsCheckPermissionsForProjectInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamProject, TeamsCheckPermissionsForProjectInOrgError, undefined, {}, {}, TeamsCheckPermissionsForProjectInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/projects/{projectId}', method: 'get', ...variables, signal, }); /** * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const useTeamsCheckPermissionsForProjectInOrg = < TData = Schemas.TeamProject, >( variables: TeamsCheckPermissionsForProjectInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamProject, TeamsCheckPermissionsForProjectInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamProject, TeamsCheckPermissionsForProjectInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/projects/{project_id}', operationId: 'teamsCheckPermissionsForProjectInOrg', variables, }), ({ signal }) => fetchTeamsCheckPermissionsForProjectInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateProjectPermissionsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; projectId: number; }; export type TeamsAddOrUpdateProjectPermissionsInOrgError = Fetcher.ErrorWrapper<{ status: 403; payload: { documentation_url?: string; message?: string; }; }>; export type TeamsAddOrUpdateProjectPermissionsInOrgVariables = { body?: { /** * The permission to grant to the team for this project. Can be one of: * \* `read` - team members can read, but not write to or administer this project. * \* `write` - team members can read and write, but not administer this project. * \* `admin` - team members can read, write and administer this project. * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ permission?: 'read' | 'write' | 'admin'; } | null; pathParams: TeamsAddOrUpdateProjectPermissionsInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const fetchTeamsAddOrUpdateProjectPermissionsInOrg = ( variables: TeamsAddOrUpdateProjectPermissionsInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsAddOrUpdateProjectPermissionsInOrgError, { /** * The permission to grant to the team for this project. Can be one of: * \* `read` - team members can read, but not write to or administer this project. * \* `write` - team members can read and write, but not administer this project. * \* `admin` - team members can read, write and administer this project. * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ permission?: 'read' | 'write' | 'admin'; } | null, {}, {}, TeamsAddOrUpdateProjectPermissionsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/projects/{projectId}', method: 'put', ...variables, signal, }); /** * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. */ export const useTeamsAddOrUpdateProjectPermissionsInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsAddOrUpdateProjectPermissionsInOrgError, TeamsAddOrUpdateProjectPermissionsInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsAddOrUpdateProjectPermissionsInOrgError, TeamsAddOrUpdateProjectPermissionsInOrgVariables >( (variables: TeamsAddOrUpdateProjectPermissionsInOrgVariables) => fetchTeamsAddOrUpdateProjectPermissionsInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListReposInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListReposInOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListReposInOrgError = Fetcher.ErrorWrapper; export type TeamsListReposInOrgResponse = Schemas.MinimalRepository[]; export type TeamsListReposInOrgVariables = { pathParams: TeamsListReposInOrgPathParams; queryParams?: TeamsListReposInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists a team's repositories visible to the authenticated user. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. */ export const fetchTeamsListReposInOrg = ( variables: TeamsListReposInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListReposInOrgResponse, TeamsListReposInOrgError, undefined, {}, TeamsListReposInOrgQueryParams, TeamsListReposInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/repos', method: 'get', ...variables, signal, }); /** * Lists a team's repositories visible to the authenticated user. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. */ export const useTeamsListReposInOrg = ( variables: TeamsListReposInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListReposInOrgResponse, TeamsListReposInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListReposInOrgResponse, TeamsListReposInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/repos', operationId: 'teamsListReposInOrg', variables, }), ({ signal }) => fetchTeamsListReposInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveRepoInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; owner: string; repo: string; }; export type TeamsRemoveRepoInOrgError = Fetcher.ErrorWrapper; export type TeamsRemoveRepoInOrgVariables = { pathParams: TeamsRemoveRepoInOrgPathParams; } & GithubContext['fetcherOptions']; /** * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. */ export const fetchTeamsRemoveRepoInOrg = ( variables: TeamsRemoveRepoInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveRepoInOrgError, undefined, {}, {}, TeamsRemoveRepoInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/repos/{owner}/{repo}', method: 'delete', ...variables, signal, }); /** * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. */ export const useTeamsRemoveRepoInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveRepoInOrgError, TeamsRemoveRepoInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveRepoInOrgError, TeamsRemoveRepoInOrgVariables >( (variables: TeamsRemoveRepoInOrgVariables) => fetchTeamsRemoveRepoInOrg({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsCheckPermissionsForRepoInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; owner: string; repo: string; }; export type TeamsCheckPermissionsForRepoInOrgError = Fetcher.ErrorWrapper; export type TeamsCheckPermissionsForRepoInOrgVariables = { pathParams: TeamsCheckPermissionsForRepoInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. * * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. * * If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. */ export const fetchTeamsCheckPermissionsForRepoInOrg = ( variables: TeamsCheckPermissionsForRepoInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsCheckPermissionsForRepoInOrgError, undefined, {}, {}, TeamsCheckPermissionsForRepoInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/repos/{owner}/{repo}', method: 'get', ...variables, signal, }); /** * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. * * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. * * If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. */ export const useTeamsCheckPermissionsForRepoInOrg = ( variables: TeamsCheckPermissionsForRepoInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, TeamsCheckPermissionsForRepoInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, TeamsCheckPermissionsForRepoInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}', operationId: 'teamsCheckPermissionsForRepoInOrg', variables, }), ({ signal }) => fetchTeamsCheckPermissionsForRepoInOrg( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateRepoPermissionsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; owner: string; repo: string; }; export type TeamsAddOrUpdateRepoPermissionsInOrgError = Fetcher.ErrorWrapper; export type TeamsAddOrUpdateRepoPermissionsInOrgRequestBody = { /** * The permission to grant the team on this repository. Can be one of: * \* `pull` - team members can pull, but not push to or administer this repository. * \* `push` - team members can pull and push, but not administer this repository. * \* `admin` - team members can pull, push and administer this repository. * \* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. * \* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. * * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. */ permission?: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; }; export type TeamsAddOrUpdateRepoPermissionsInOrgVariables = { body?: TeamsAddOrUpdateRepoPermissionsInOrgRequestBody; pathParams: TeamsAddOrUpdateRepoPermissionsInOrgPathParams; } & GithubContext['fetcherOptions']; /** * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. * * For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". */ export const fetchTeamsAddOrUpdateRepoPermissionsInOrg = ( variables: TeamsAddOrUpdateRepoPermissionsInOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsAddOrUpdateRepoPermissionsInOrgError, TeamsAddOrUpdateRepoPermissionsInOrgRequestBody, {}, {}, TeamsAddOrUpdateRepoPermissionsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/repos/{owner}/{repo}', method: 'put', ...variables, signal, }); /** * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. * * For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". */ export const useTeamsAddOrUpdateRepoPermissionsInOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsAddOrUpdateRepoPermissionsInOrgError, TeamsAddOrUpdateRepoPermissionsInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsAddOrUpdateRepoPermissionsInOrgError, TeamsAddOrUpdateRepoPermissionsInOrgVariables >( (variables: TeamsAddOrUpdateRepoPermissionsInOrgVariables) => fetchTeamsAddOrUpdateRepoPermissionsInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListIdpGroupsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListIdpGroupsInOrgError = Fetcher.ErrorWrapper; export type TeamsListIdpGroupsInOrgVariables = { pathParams: TeamsListIdpGroupsInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups connected to a team on GitHub. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. */ export const fetchTeamsListIdpGroupsInOrg = ( variables: TeamsListIdpGroupsInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GroupMapping, TeamsListIdpGroupsInOrgError, undefined, {}, {}, TeamsListIdpGroupsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/team-sync/group-mappings', method: 'get', ...variables, signal, }); /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups connected to a team on GitHub. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. */ export const useTeamsListIdpGroupsInOrg = ( variables: TeamsListIdpGroupsInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GroupMapping, TeamsListIdpGroupsInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.GroupMapping, TeamsListIdpGroupsInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/team-sync/group-mappings', operationId: 'teamsListIdpGroupsInOrg', variables, }), ({ signal }) => fetchTeamsListIdpGroupsInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgError = Fetcher.ErrorWrapper; export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgRequestBody = { /** * The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. */ groups: { /** * Description of the IdP group. */ group_description: string; /** * ID of the IdP group. */ group_id: string; /** * Name of the IdP group. */ group_name: string; }[]; }; export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgVariables = { body: TeamsCreateOrUpdateIdpGroupConnectionsInOrgRequestBody; pathParams: TeamsCreateOrUpdateIdpGroupConnectionsInOrgPathParams; } & GithubContext['fetcherOptions']; /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. */ export const fetchTeamsCreateOrUpdateIdpGroupConnectionsInOrg = ( variables: TeamsCreateOrUpdateIdpGroupConnectionsInOrgVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsInOrgError, TeamsCreateOrUpdateIdpGroupConnectionsInOrgRequestBody, {}, {}, TeamsCreateOrUpdateIdpGroupConnectionsInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/team-sync/group-mappings', method: 'patch', ...variables, signal, }); /** * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. */ export const useTeamsCreateOrUpdateIdpGroupConnectionsInOrg = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsInOrgError, TeamsCreateOrUpdateIdpGroupConnectionsInOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsInOrgError, TeamsCreateOrUpdateIdpGroupConnectionsInOrgVariables >( (variables: TeamsCreateOrUpdateIdpGroupConnectionsInOrgVariables) => fetchTeamsCreateOrUpdateIdpGroupConnectionsInOrg({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListChildInOrgPathParams = { org: string; /** * team_slug parameter */ teamSlug: string; }; export type TeamsListChildInOrgQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListChildInOrgError = Fetcher.ErrorWrapper; export type TeamsListChildInOrgResponse = Schemas.Team[]; export type TeamsListChildInOrgVariables = { pathParams: TeamsListChildInOrgPathParams; queryParams?: TeamsListChildInOrgQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the child teams of the team specified by `{team_slug}`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. */ export const fetchTeamsListChildInOrg = ( variables: TeamsListChildInOrgVariables, signal?: AbortSignal, ) => githubFetch< TeamsListChildInOrgResponse, TeamsListChildInOrgError, undefined, {}, TeamsListChildInOrgQueryParams, TeamsListChildInOrgPathParams >({ url: '/orgs/{org}/teams/{teamSlug}/teams', method: 'get', ...variables, signal, }); /** * Lists the child teams of the team specified by `{team_slug}`. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. */ export const useTeamsListChildInOrg = ( variables: TeamsListChildInOrgVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListChildInOrgResponse, TeamsListChildInOrgError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListChildInOrgResponse, TeamsListChildInOrgError, TData >( queryKeyFn({ path: '/orgs/{org}/teams/{team_slug}/teams', operationId: 'teamsListChildInOrg', variables, }), ({ signal }) => fetchTeamsListChildInOrg({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsDeleteCardPathParams = { /** * card_id parameter */ cardId: number; }; export type ProjectsDeleteCardError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: { documentation_url?: string; errors?: string[]; message?: string; }; } | { status: 404; payload: Responses.NotFound; } >; export type ProjectsDeleteCardVariables = { pathParams: ProjectsDeleteCardPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsDeleteCard = ( variables: ProjectsDeleteCardVariables, signal?: AbortSignal, ) => githubFetch< undefined, ProjectsDeleteCardError, undefined, {}, {}, ProjectsDeleteCardPathParams >({ url: '/projects/columns/cards/{cardId}', method: 'delete', ...variables, signal, }); export const useProjectsDeleteCard = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ProjectsDeleteCardError, ProjectsDeleteCardVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ProjectsDeleteCardError, ProjectsDeleteCardVariables >( (variables: ProjectsDeleteCardVariables) => fetchProjectsDeleteCard({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsGetCardPathParams = { /** * card_id parameter */ cardId: number; }; export type ProjectsGetCardError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ProjectsGetCardVariables = { pathParams: ProjectsGetCardPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsGetCard = ( variables: ProjectsGetCardVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectCard, ProjectsGetCardError, undefined, {}, {}, ProjectsGetCardPathParams >({ url: '/projects/columns/cards/{cardId}', method: 'get', ...variables, signal, }); export const useProjectsGetCard = ( variables: ProjectsGetCardVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ProjectCard, ProjectsGetCardError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/projects/columns/cards/{card_id}', operationId: 'projectsGetCard', variables, }), ({ signal }) => fetchProjectsGetCard({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsUpdateCardPathParams = { /** * card_id parameter */ cardId: number; }; export type ProjectsUpdateCardError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsUpdateCardRequestBody = { /** * Whether or not the card is archived * * @example false */ archived?: boolean; /** * The project card's note * * @example Update all gems */ note?: string | null; }; export type ProjectsUpdateCardVariables = { body?: ProjectsUpdateCardRequestBody; pathParams: ProjectsUpdateCardPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsUpdateCard = ( variables: ProjectsUpdateCardVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectCard, ProjectsUpdateCardError, ProjectsUpdateCardRequestBody, {}, {}, ProjectsUpdateCardPathParams >({ url: '/projects/columns/cards/{cardId}', method: 'patch', ...variables, signal, }); export const useProjectsUpdateCard = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProjectCard, ProjectsUpdateCardError, ProjectsUpdateCardVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProjectCard, ProjectsUpdateCardError, ProjectsUpdateCardVariables >( (variables: ProjectsUpdateCardVariables) => fetchProjectsUpdateCard({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsMoveCardPathParams = { /** * card_id parameter */ cardId: number; }; export type ProjectsMoveCardError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: { documentation_url?: string; errors?: { code?: string; field?: string; message?: string; resource?: string; }[]; message?: string; }; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: { code?: string; documentation_url?: string; errors?: { code?: string; message?: string; }[]; message?: string; }; } >; export type ProjectsMoveCardRequestBody = { /** * The unique identifier of the column the card should be moved to * * @example 42 */ column_id?: number; /** * The position of the card in a column * * @example bottom * @pattern ^(?:top|bottom|after:\d+)$ */ position: string; }; export type ProjectsMoveCardVariables = { body: ProjectsMoveCardRequestBody; pathParams: ProjectsMoveCardPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsMoveCard = ( variables: ProjectsMoveCardVariables, signal?: AbortSignal, ) => githubFetch< {}, ProjectsMoveCardError, ProjectsMoveCardRequestBody, {}, {}, ProjectsMoveCardPathParams >({ url: '/projects/columns/cards/{cardId}/moves', method: 'post', ...variables, signal, }); export const useProjectsMoveCard = ( options?: Omit< reactQuery.UseMutationOptions< {}, ProjectsMoveCardError, ProjectsMoveCardVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< {}, ProjectsMoveCardError, ProjectsMoveCardVariables >( (variables: ProjectsMoveCardVariables) => fetchProjectsMoveCard({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsDeleteColumnPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsDeleteColumnError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ProjectsDeleteColumnVariables = { pathParams: ProjectsDeleteColumnPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsDeleteColumn = ( variables: ProjectsDeleteColumnVariables, signal?: AbortSignal, ) => githubFetch< undefined, ProjectsDeleteColumnError, undefined, {}, {}, ProjectsDeleteColumnPathParams >({ url: '/projects/columns/{columnId}', method: 'delete', ...variables, signal, }); export const useProjectsDeleteColumn = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ProjectsDeleteColumnError, ProjectsDeleteColumnVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ProjectsDeleteColumnError, ProjectsDeleteColumnVariables >( (variables: ProjectsDeleteColumnVariables) => fetchProjectsDeleteColumn({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsGetColumnPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsGetColumnError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ProjectsGetColumnVariables = { pathParams: ProjectsGetColumnPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsGetColumn = ( variables: ProjectsGetColumnVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectColumn, ProjectsGetColumnError, undefined, {}, {}, ProjectsGetColumnPathParams >({ url: '/projects/columns/{columnId}', method: 'get', ...variables, signal, }); export const useProjectsGetColumn = ( variables: ProjectsGetColumnVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ProjectColumn, ProjectsGetColumnError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ProjectColumn, ProjectsGetColumnError, TData >( queryKeyFn({ path: '/projects/columns/{column_id}', operationId: 'projectsGetColumn', variables, }), ({ signal }) => fetchProjectsGetColumn({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsUpdateColumnPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsUpdateColumnError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ProjectsUpdateColumnRequestBody = { /** * Name of the project column * * @example Remaining tasks */ name: string; }; export type ProjectsUpdateColumnVariables = { body: ProjectsUpdateColumnRequestBody; pathParams: ProjectsUpdateColumnPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsUpdateColumn = ( variables: ProjectsUpdateColumnVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectColumn, ProjectsUpdateColumnError, ProjectsUpdateColumnRequestBody, {}, {}, ProjectsUpdateColumnPathParams >({ url: '/projects/columns/{columnId}', method: 'patch', ...variables, signal, }); export const useProjectsUpdateColumn = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProjectColumn, ProjectsUpdateColumnError, ProjectsUpdateColumnVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProjectColumn, ProjectsUpdateColumnError, ProjectsUpdateColumnVariables >( (variables: ProjectsUpdateColumnVariables) => fetchProjectsUpdateColumn({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsListCardsPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsListCardsQueryParams = { /** * Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`. * * @default not_archived */ archived_state?: 'all' | 'archived' | 'not_archived'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListCardsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ProjectsListCardsResponse = Schemas.ProjectCard[]; export type ProjectsListCardsVariables = { pathParams: ProjectsListCardsPathParams; queryParams?: ProjectsListCardsQueryParams; } & GithubContext['fetcherOptions']; export const fetchProjectsListCards = ( variables: ProjectsListCardsVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListCardsResponse, ProjectsListCardsError, undefined, {}, ProjectsListCardsQueryParams, ProjectsListCardsPathParams >({ url: '/projects/columns/{columnId}/cards', method: 'get', ...variables, signal, }); export const useProjectsListCards = ( variables: ProjectsListCardsVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListCardsResponse, ProjectsListCardsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListCardsResponse, ProjectsListCardsError, TData >( queryKeyFn({ path: '/projects/columns/{column_id}/cards', operationId: 'projectsListCards', variables, }), ({ signal }) => fetchProjectsListCards({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsCreateCardPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsCreateCardError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Schemas.ValidationError | Schemas.ValidationErrorSimple; } | { status: 503; payload: { code?: string; documentation_url?: string; errors?: { code?: string; message?: string; }[]; message?: string; }; } >; export type ProjectsCreateCardVariables = { body?: | { /** * The project card's note * * @example Update all gems */ note: string | null; } | { /** * The unique identifier of the content associated with the card * * @example 42 */ content_id: number; /** * The piece of content associated with the card * * @example PullRequest */ content_type: string; }; pathParams: ProjectsCreateCardPathParams; } & GithubContext['fetcherOptions']; /** * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. * * Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchProjectsCreateCard = ( variables: ProjectsCreateCardVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectCard, ProjectsCreateCardError, | { /** * The project card's note * * @example Update all gems */ note: string | null; } | { /** * The unique identifier of the content associated with the card * * @example 42 */ content_id: number; /** * The piece of content associated with the card * * @example PullRequest */ content_type: string; }, {}, {}, ProjectsCreateCardPathParams >({ url: '/projects/columns/{columnId}/cards', method: 'post', ...variables, signal, }); /** * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. * * Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useProjectsCreateCard = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProjectCard, ProjectsCreateCardError, ProjectsCreateCardVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProjectCard, ProjectsCreateCardError, ProjectsCreateCardVariables >( (variables: ProjectsCreateCardVariables) => fetchProjectsCreateCard({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsMoveColumnPathParams = { /** * column_id parameter */ columnId: number; }; export type ProjectsMoveColumnError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsMoveColumnRequestBody = { /** * The position of the column in a project * * @example last * @pattern ^(?:first|last|after:\d+)$ */ position: string; }; export type ProjectsMoveColumnVariables = { body: ProjectsMoveColumnRequestBody; pathParams: ProjectsMoveColumnPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsMoveColumn = ( variables: ProjectsMoveColumnVariables, signal?: AbortSignal, ) => githubFetch< {}, ProjectsMoveColumnError, ProjectsMoveColumnRequestBody, {}, {}, ProjectsMoveColumnPathParams >({ url: '/projects/columns/{columnId}/moves', method: 'post', ...variables, signal, }); export const useProjectsMoveColumn = ( options?: Omit< reactQuery.UseMutationOptions< {}, ProjectsMoveColumnError, ProjectsMoveColumnVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< {}, ProjectsMoveColumnError, ProjectsMoveColumnVariables >( (variables: ProjectsMoveColumnVariables) => fetchProjectsMoveColumn({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsDeletePathParams = { projectId: number; }; export type ProjectsDeleteError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: { documentation_url?: string; errors?: string[]; message?: string; }; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } >; export type ProjectsDeleteVariables = { pathParams: ProjectsDeletePathParams; } & GithubContext['fetcherOptions']; /** * Deletes a project board. Returns a `404 Not Found` status if projects are disabled. */ export const fetchProjectsDelete = ( variables: ProjectsDeleteVariables, signal?: AbortSignal, ) => githubFetch< undefined, ProjectsDeleteError, undefined, {}, {}, ProjectsDeletePathParams >({ url: '/projects/{projectId}', method: 'delete', ...variables, signal }); /** * Deletes a project board. Returns a `404 Not Found` status if projects are disabled. */ export const useProjectsDelete = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ProjectsDeleteError, ProjectsDeleteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ProjectsDeleteError, ProjectsDeleteVariables >( (variables: ProjectsDeleteVariables) => fetchProjectsDelete({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsGetPathParams = { projectId: number; }; export type ProjectsGetError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ProjectsGetVariables = { pathParams: ProjectsGetPathParams; } & GithubContext['fetcherOptions']; /** * Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsGet = ( variables: ProjectsGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Project, ProjectsGetError, undefined, {}, {}, ProjectsGetPathParams >({ url: '/projects/{projectId}', method: 'get', ...variables, signal }); /** * Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsGet = ( variables: ProjectsGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/projects/{project_id}', operationId: 'projectsGet', variables, }), ({ signal }) => fetchProjectsGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsUpdatePathParams = { projectId: number; }; export type ProjectsUpdateError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: { documentation_url?: string; errors?: string[]; message?: string; }; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsUpdateRequestBody = { /** * Body of the project * * @example This project represents the sprint of the first week in January */ body?: string | null; /** * Name of the project * * @example Week One Sprint */ name?: string; /** * The baseline permission that all organization members have on this project */ organization_permission?: 'read' | 'write' | 'admin' | 'none'; /** * Whether or not this project can be seen by everyone. */ private?: boolean; /** * State of the project; either 'open' or 'closed' * * @example open */ state?: string; }; export type ProjectsUpdateVariables = { body?: ProjectsUpdateRequestBody; pathParams: ProjectsUpdatePathParams; } & GithubContext['fetcherOptions']; /** * Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsUpdate = ( variables: ProjectsUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Project, ProjectsUpdateError, ProjectsUpdateRequestBody, {}, {}, ProjectsUpdatePathParams >({ url: '/projects/{projectId}', method: 'patch', ...variables, signal }); /** * Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Project, ProjectsUpdateError, ProjectsUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Project, ProjectsUpdateError, ProjectsUpdateVariables >( (variables: ProjectsUpdateVariables) => fetchProjectsUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsListCollaboratorsPathParams = { projectId: number; }; export type ProjectsListCollaboratorsQueryParams = { /** * Filters the collaborators by their affiliation. Can be one of: * \* `outside`: Outside collaborators of a project that are not a member of the project's organization. * \* `direct`: Collaborators with permissions to a project, regardless of organization membership status. * \* `all`: All collaborators the authenticated user can see. * * @default all */ affiliation?: 'outside' | 'direct' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListCollaboratorsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ProjectsListCollaboratorsResponse = Schemas.SimpleUser[]; export type ProjectsListCollaboratorsVariables = { pathParams: ProjectsListCollaboratorsPathParams; queryParams?: ProjectsListCollaboratorsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. */ export const fetchProjectsListCollaborators = ( variables: ProjectsListCollaboratorsVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListCollaboratorsResponse, ProjectsListCollaboratorsError, undefined, {}, ProjectsListCollaboratorsQueryParams, ProjectsListCollaboratorsPathParams >({ url: '/projects/{projectId}/collaborators', method: 'get', ...variables, signal, }); /** * Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. */ export const useProjectsListCollaborators = < TData = ProjectsListCollaboratorsResponse, >( variables: ProjectsListCollaboratorsVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListCollaboratorsResponse, ProjectsListCollaboratorsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListCollaboratorsResponse, ProjectsListCollaboratorsError, TData >( queryKeyFn({ path: '/projects/{project_id}/collaborators', operationId: 'projectsListCollaborators', variables, }), ({ signal }) => fetchProjectsListCollaborators( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ProjectsRemoveCollaboratorPathParams = { projectId: number; username: string; }; export type ProjectsRemoveCollaboratorError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ProjectsRemoveCollaboratorVariables = { pathParams: ProjectsRemoveCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. */ export const fetchProjectsRemoveCollaborator = ( variables: ProjectsRemoveCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, ProjectsRemoveCollaboratorError, undefined, {}, {}, ProjectsRemoveCollaboratorPathParams >({ url: '/projects/{projectId}/collaborators/{username}', method: 'delete', ...variables, signal, }); /** * Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. */ export const useProjectsRemoveCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ProjectsRemoveCollaboratorError, ProjectsRemoveCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ProjectsRemoveCollaboratorError, ProjectsRemoveCollaboratorVariables >( (variables: ProjectsRemoveCollaboratorVariables) => fetchProjectsRemoveCollaborator({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsAddCollaboratorPathParams = { projectId: number; username: string; }; export type ProjectsAddCollaboratorError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ProjectsAddCollaboratorRequestBody = { /** * The permission to grant the collaborator. * * @default write * @example write */ permission?: 'read' | 'write' | 'admin'; }; export type ProjectsAddCollaboratorVariables = { body?: ProjectsAddCollaboratorRequestBody; pathParams: ProjectsAddCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. */ export const fetchProjectsAddCollaborator = ( variables: ProjectsAddCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, ProjectsAddCollaboratorError, ProjectsAddCollaboratorRequestBody, {}, {}, ProjectsAddCollaboratorPathParams >({ url: '/projects/{projectId}/collaborators/{username}', method: 'put', ...variables, signal, }); /** * Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. */ export const useProjectsAddCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ProjectsAddCollaboratorError, ProjectsAddCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ProjectsAddCollaboratorError, ProjectsAddCollaboratorVariables >( (variables: ProjectsAddCollaboratorVariables) => fetchProjectsAddCollaborator({ ...fetcherOptions, ...variables }), options, ); }; export type ProjectsGetPermissionForUserPathParams = { projectId: number; username: string; }; export type ProjectsGetPermissionForUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ProjectsGetPermissionForUserVariables = { pathParams: ProjectsGetPermissionForUserPathParams; } & GithubContext['fetcherOptions']; /** * Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. */ export const fetchProjectsGetPermissionForUser = ( variables: ProjectsGetPermissionForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositoryCollaboratorPermission, ProjectsGetPermissionForUserError, undefined, {}, {}, ProjectsGetPermissionForUserPathParams >({ url: '/projects/{projectId}/collaborators/{username}/permission', method: 'get', ...variables, signal, }); /** * Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. */ export const useProjectsGetPermissionForUser = < TData = Schemas.RepositoryCollaboratorPermission, >( variables: ProjectsGetPermissionForUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RepositoryCollaboratorPermission, ProjectsGetPermissionForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RepositoryCollaboratorPermission, ProjectsGetPermissionForUserError, TData >( queryKeyFn({ path: '/projects/{project_id}/collaborators/{username}/permission', operationId: 'projectsGetPermissionForUser', variables, }), ({ signal }) => fetchProjectsGetPermissionForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ProjectsListColumnsPathParams = { projectId: number; }; export type ProjectsListColumnsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListColumnsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ProjectsListColumnsResponse = Schemas.ProjectColumn[]; export type ProjectsListColumnsVariables = { pathParams: ProjectsListColumnsPathParams; queryParams?: ProjectsListColumnsQueryParams; } & GithubContext['fetcherOptions']; export const fetchProjectsListColumns = ( variables: ProjectsListColumnsVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListColumnsResponse, ProjectsListColumnsError, undefined, {}, ProjectsListColumnsQueryParams, ProjectsListColumnsPathParams >({ url: '/projects/{projectId}/columns', method: 'get', ...variables, signal, }); export const useProjectsListColumns = ( variables: ProjectsListColumnsVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListColumnsResponse, ProjectsListColumnsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListColumnsResponse, ProjectsListColumnsError, TData >( queryKeyFn({ path: '/projects/{project_id}/columns', operationId: 'projectsListColumns', variables, }), ({ signal }) => fetchProjectsListColumns({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsCreateColumnPathParams = { projectId: number; }; export type ProjectsCreateColumnError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsCreateColumnRequestBody = { /** * Name of the project column * * @example Remaining tasks */ name: string; }; export type ProjectsCreateColumnVariables = { body: ProjectsCreateColumnRequestBody; pathParams: ProjectsCreateColumnPathParams; } & GithubContext['fetcherOptions']; export const fetchProjectsCreateColumn = ( variables: ProjectsCreateColumnVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProjectColumn, ProjectsCreateColumnError, ProjectsCreateColumnRequestBody, {}, {}, ProjectsCreateColumnPathParams >({ url: '/projects/{projectId}/columns', method: 'post', ...variables, signal, }); export const useProjectsCreateColumn = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProjectColumn, ProjectsCreateColumnError, ProjectsCreateColumnVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProjectColumn, ProjectsCreateColumnError, ProjectsCreateColumnVariables >( (variables: ProjectsCreateColumnVariables) => fetchProjectsCreateColumn({ ...fetcherOptions, ...variables }), options, ); }; export type RateLimitGetError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } >; export type RateLimitGetVariables = GithubContext['fetcherOptions']; /** * **Note:** Accessing this endpoint does not count against your REST API rate limit. * * **Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. */ export const fetchRateLimitGet = ( variables: RateLimitGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RateLimitOverview, RateLimitGetError, undefined, {}, {}, {} >({ url: '/rate_limit', method: 'get', ...variables, signal }); /** * **Note:** Accessing this endpoint does not count against your REST API rate limit. * * **Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. */ export const useRateLimitGet = ( variables: RateLimitGetVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RateLimitOverview, RateLimitGetError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RateLimitOverview, RateLimitGetError, TData >( queryKeyFn({ path: '/rate_limit', operationId: 'rateLimitGet', variables }), ({ signal }) => fetchRateLimitGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReactionsDeleteLegacyPathParams = { reactionId: number; }; export type ReactionsDeleteLegacyError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 410; payload: Responses.Gone; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReactionsDeleteLegacyVariables = { pathParams: ReactionsDeleteLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). * * OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). */ export const fetchReactionsDeleteLegacy = ( variables: ReactionsDeleteLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteLegacyError, undefined, {}, {}, ReactionsDeleteLegacyPathParams >({ url: '/reactions/{reactionId}', method: 'delete', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). * * OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). */ export const useReactionsDeleteLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteLegacyError, ReactionsDeleteLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteLegacyError, ReactionsDeleteLegacyVariables >( (variables: ReactionsDeleteLegacyVariables) => fetchReactionsDeleteLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeletePathParams = { owner: string; repo: string; }; export type ReposDeleteError = Fetcher.ErrorWrapper< | { status: 403; payload: { documentation_url?: string; message?: string; }; } | { status: 404; payload: Responses.NotFound; } >; export type ReposDeleteVariables = { pathParams: ReposDeletePathParams; } & GithubContext['fetcherOptions']; /** * Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. * * If an organization owner has configured the organization to prevent members from deleting organization-owned * repositories, you will get a `403 Forbidden` response. */ export const fetchReposDelete = ( variables: ReposDeleteVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteError, undefined, {}, {}, ReposDeletePathParams >({ url: '/repos/{owner}/{repo}', method: 'delete', ...variables, signal }); /** * Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. * * If an organization owner has configured the organization to prevent members from deleting organization-owned * repositories, you will get a `403 Forbidden` response. */ export const useReposDelete = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteError, ReposDeleteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteError, ReposDeleteVariables >( (variables: ReposDeleteVariables) => fetchReposDelete({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetPathParams = { owner: string; repo: string; }; export type ReposGetError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ReposGetVariables = { pathParams: ReposGetPathParams; } & GithubContext['fetcherOptions']; /** * When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. * * The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. */ export const fetchReposGet = ( variables: ReposGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.FullRepository, ReposGetError, undefined, {}, {}, ReposGetPathParams >({ url: '/repos/{owner}/{repo}', method: 'get', ...variables, signal }); /** * When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. * * The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. */ export const useReposGet = ( variables: ReposGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}', operationId: 'reposGet', variables, }), ({ signal }) => fetchReposGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUpdatePathParams = { owner: string; repo: string; }; export type ReposUpdateError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposUpdateRequestBody = { /** * Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. * * @default true */ allow_merge_commit?: boolean; /** * Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. * * @default true */ allow_rebase_merge?: boolean; /** * Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. * * @default true */ allow_squash_merge?: boolean; /** * `true` to archive this repository. **Note**: You cannot unarchive repositories through the API. * * @default false */ archived?: boolean; /** * Updates the default branch for this repository. */ default_branch?: string; /** * Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. * * @default false */ delete_branch_on_merge?: boolean; /** * A short description of the repository. */ description?: string; /** * Either `true` to enable issues for this repository or `false` to disable them. * * @default true */ has_issues?: boolean; /** * Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. * * @default true */ has_projects?: boolean; /** * Either `true` to enable the wiki for this repository or `false` to disable it. * * @default true */ has_wiki?: boolean; /** * A URL with more information about the repository. */ homepage?: string; /** * Either `true` to make this repo available as a template repository or `false` to prevent it. * * @default false */ is_template?: boolean; /** * The name of the repository. */ name?: string; /** * Either `true` to make the repository private or `false` to make it public. Default: `false`. * **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. * * @default false */ private?: boolean; /** * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. The `visibility` parameter overrides the `private` parameter when you use both along with the `nebula-preview` preview header. */ visibility?: 'public' | 'private' | 'visibility' | 'internal'; }; export type ReposUpdateVariables = { body?: ReposUpdateRequestBody; pathParams: ReposUpdatePathParams; } & GithubContext['fetcherOptions']; /** * **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. */ export const fetchReposUpdate = ( variables: ReposUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.FullRepository, ReposUpdateError, ReposUpdateRequestBody, {}, {}, ReposUpdatePathParams >({ url: '/repos/{owner}/{repo}', method: 'patch', ...variables, signal }); /** * **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. */ export const useReposUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.FullRepository, ReposUpdateError, ReposUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.FullRepository, ReposUpdateError, ReposUpdateVariables >( (variables: ReposUpdateVariables) => fetchReposUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsListArtifactsForRepoPathParams = { owner: string; repo: string; }; export type ActionsListArtifactsForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListArtifactsForRepoError = Fetcher.ErrorWrapper; export type ActionsListArtifactsForRepoResponse = { artifacts: Schemas.Artifact[]; total_count: number; }; export type ActionsListArtifactsForRepoVariables = { pathParams: ActionsListArtifactsForRepoPathParams; queryParams?: ActionsListArtifactsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsListArtifactsForRepo = ( variables: ActionsListArtifactsForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActionsListArtifactsForRepoResponse, ActionsListArtifactsForRepoError, undefined, {}, ActionsListArtifactsForRepoQueryParams, ActionsListArtifactsForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/artifacts', method: 'get', ...variables, signal, }); /** * Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsListArtifactsForRepo = < TData = ActionsListArtifactsForRepoResponse, >( variables: ActionsListArtifactsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListArtifactsForRepoResponse, ActionsListArtifactsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListArtifactsForRepoResponse, ActionsListArtifactsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/artifacts', operationId: 'actionsListArtifactsForRepo', variables, }), ({ signal }) => fetchActionsListArtifactsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteArtifactPathParams = { owner: string; repo: string; /** * artifact_id parameter */ artifactId: number; }; export type ActionsDeleteArtifactError = Fetcher.ErrorWrapper; export type ActionsDeleteArtifactVariables = { pathParams: ActionsDeleteArtifactPathParams; } & GithubContext['fetcherOptions']; /** * Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsDeleteArtifact = ( variables: ActionsDeleteArtifactVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteArtifactError, undefined, {}, {}, ActionsDeleteArtifactPathParams >({ url: '/repos/{owner}/{repo}/actions/artifacts/{artifactId}', method: 'delete', ...variables, signal, }); /** * Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsDeleteArtifact = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteArtifactError, ActionsDeleteArtifactVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteArtifactError, ActionsDeleteArtifactVariables >( (variables: ActionsDeleteArtifactVariables) => fetchActionsDeleteArtifact({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetArtifactPathParams = { owner: string; repo: string; /** * artifact_id parameter */ artifactId: number; }; export type ActionsGetArtifactError = Fetcher.ErrorWrapper; export type ActionsGetArtifactVariables = { pathParams: ActionsGetArtifactPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetArtifact = ( variables: ActionsGetArtifactVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Artifact, ActionsGetArtifactError, undefined, {}, {}, ActionsGetArtifactPathParams >({ url: '/repos/{owner}/{repo}/actions/artifacts/{artifactId}', method: 'get', ...variables, signal, }); /** * Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetArtifact = ( variables: ActionsGetArtifactVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Artifact, ActionsGetArtifactError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/artifacts/{artifact_id}', operationId: 'actionsGetArtifact', variables, }), ({ signal }) => fetchActionsGetArtifact({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsDownloadArtifactPathParams = { owner: string; repo: string; /** * artifact_id parameter */ artifactId: number; archiveFormat: string; }; export type ActionsDownloadArtifactError = Fetcher.ErrorWrapper; export type ActionsDownloadArtifactVariables = { pathParams: ActionsDownloadArtifactPathParams; } & GithubContext['fetcherOptions']; /** * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in * the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to * the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. * GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsDownloadArtifact = ( variables: ActionsDownloadArtifactVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDownloadArtifactError, undefined, {}, {}, ActionsDownloadArtifactPathParams >({ url: '/repos/{owner}/{repo}/actions/artifacts/{artifactId}/{archiveFormat}', method: 'get', ...variables, signal, }); /** * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in * the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to * the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. * GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsDownloadArtifact = ( variables: ActionsDownloadArtifactVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', operationId: 'actionsDownloadArtifact', variables, }), ({ signal }) => fetchActionsDownloadArtifact({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsGetJobForWorkflowRunPathParams = { owner: string; repo: string; /** * job_id parameter */ jobId: number; }; export type ActionsGetJobForWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsGetJobForWorkflowRunVariables = { pathParams: ActionsGetJobForWorkflowRunPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetJobForWorkflowRun = ( variables: ActionsGetJobForWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Job, ActionsGetJobForWorkflowRunError, undefined, {}, {}, ActionsGetJobForWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/jobs/{jobId}', method: 'get', ...variables, signal, }); /** * Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetJobForWorkflowRun = ( variables: ActionsGetJobForWorkflowRunVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Job, ActionsGetJobForWorkflowRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Job, ActionsGetJobForWorkflowRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/jobs/{job_id}', operationId: 'actionsGetJobForWorkflowRun', variables, }), ({ signal }) => fetchActionsGetJobForWorkflowRun( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsDownloadJobLogsForWorkflowRunPathParams = { owner: string; repo: string; /** * job_id parameter */ jobId: number; }; export type ActionsDownloadJobLogsForWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsDownloadJobLogsForWorkflowRunVariables = { pathParams: ActionsDownloadJobLogsForWorkflowRunPathParams; } & GithubContext['fetcherOptions']; /** * Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look * for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can * use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must * have the `actions:read` permission to use this endpoint. */ export const fetchActionsDownloadJobLogsForWorkflowRun = ( variables: ActionsDownloadJobLogsForWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDownloadJobLogsForWorkflowRunError, undefined, {}, {}, ActionsDownloadJobLogsForWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/jobs/{jobId}/logs', method: 'get', ...variables, signal, }); /** * Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look * for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can * use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must * have the `actions:read` permission to use this endpoint. */ export const useActionsDownloadJobLogsForWorkflowRun = ( variables: ActionsDownloadJobLogsForWorkflowRunVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ActionsDownloadJobLogsForWorkflowRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ActionsDownloadJobLogsForWorkflowRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/jobs/{job_id}/logs', operationId: 'actionsDownloadJobLogsForWorkflowRun', variables, }), ({ signal }) => fetchActionsDownloadJobLogsForWorkflowRun( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsGetGithubActionsPermissionsRepositoryPathParams = { owner: string; repo: string; }; export type ActionsGetGithubActionsPermissionsRepositoryError = Fetcher.ErrorWrapper; export type ActionsGetGithubActionsPermissionsRepositoryVariables = { pathParams: ActionsGetGithubActionsPermissionsRepositoryPathParams; } & GithubContext['fetcherOptions']; /** * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. * * You must authenticate using an access token with the `repo` scope to use this * endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const fetchActionsGetGithubActionsPermissionsRepository = ( variables: ActionsGetGithubActionsPermissionsRepositoryVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsRepositoryPermissions, ActionsGetGithubActionsPermissionsRepositoryError, undefined, {}, {}, ActionsGetGithubActionsPermissionsRepositoryPathParams >({ url: '/repos/{owner}/{repo}/actions/permissions', method: 'get', ...variables, signal, }); /** * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. * * You must authenticate using an access token with the `repo` scope to use this * endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const useActionsGetGithubActionsPermissionsRepository = < TData = Schemas.ActionsRepositoryPermissions, >( variables: ActionsGetGithubActionsPermissionsRepositoryVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsRepositoryPermissions, ActionsGetGithubActionsPermissionsRepositoryError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsRepositoryPermissions, ActionsGetGithubActionsPermissionsRepositoryError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/permissions', operationId: 'actionsGetGithubActionsPermissionsRepository', variables, }), ({ signal }) => fetchActionsGetGithubActionsPermissionsRepository( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetGithubActionsPermissionsRepositoryPathParams = { owner: string; repo: string; }; export type ActionsSetGithubActionsPermissionsRepositoryError = Fetcher.ErrorWrapper; export type ActionsSetGithubActionsPermissionsRepositoryRequestBody = { allowed_actions?: Schemas.AllowedActions; enabled: Schemas.ActionsEnabled; }; export type ActionsSetGithubActionsPermissionsRepositoryVariables = { body: ActionsSetGithubActionsPermissionsRepositoryRequestBody; pathParams: ActionsSetGithubActionsPermissionsRepositoryPathParams; } & GithubContext['fetcherOptions']; /** * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. * * If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const fetchActionsSetGithubActionsPermissionsRepository = ( variables: ActionsSetGithubActionsPermissionsRepositoryVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetGithubActionsPermissionsRepositoryError, ActionsSetGithubActionsPermissionsRepositoryRequestBody, {}, {}, ActionsSetGithubActionsPermissionsRepositoryPathParams >({ url: '/repos/{owner}/{repo}/actions/permissions', method: 'put', ...variables, signal, }); /** * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. * * If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const useActionsSetGithubActionsPermissionsRepository = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetGithubActionsPermissionsRepositoryError, ActionsSetGithubActionsPermissionsRepositoryVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetGithubActionsPermissionsRepositoryError, ActionsSetGithubActionsPermissionsRepositoryVariables >( (variables: ActionsSetGithubActionsPermissionsRepositoryVariables) => fetchActionsSetGithubActionsPermissionsRepository({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsGetAllowedActionsRepositoryPathParams = { owner: string; repo: string; }; export type ActionsGetAllowedActionsRepositoryError = Fetcher.ErrorWrapper; export type ActionsGetAllowedActionsRepositoryVariables = { pathParams: ActionsGetAllowedActionsRepositoryPathParams; } & GithubContext['fetcherOptions']; /** * Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const fetchActionsGetAllowedActionsRepository = ( variables: ActionsGetAllowedActionsRepositoryVariables, signal?: AbortSignal, ) => githubFetch< Schemas.SelectedActions, ActionsGetAllowedActionsRepositoryError, undefined, {}, {}, ActionsGetAllowedActionsRepositoryPathParams >({ url: '/repos/{owner}/{repo}/actions/permissions/selected-actions', method: 'get', ...variables, signal, }); /** * Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const useActionsGetAllowedActionsRepository = < TData = Schemas.SelectedActions, >( variables: ActionsGetAllowedActionsRepositoryVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.SelectedActions, ActionsGetAllowedActionsRepositoryError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.SelectedActions, ActionsGetAllowedActionsRepositoryError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/permissions/selected-actions', operationId: 'actionsGetAllowedActionsRepository', variables, }), ({ signal }) => fetchActionsGetAllowedActionsRepository( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsSetAllowedActionsRepositoryPathParams = { owner: string; repo: string; }; export type ActionsSetAllowedActionsRepositoryError = Fetcher.ErrorWrapper; export type ActionsSetAllowedActionsRepositoryVariables = { body: Schemas.SelectedActions; pathParams: ActionsSetAllowedActionsRepositoryPathParams; } & GithubContext['fetcherOptions']; /** * Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." * * If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. * * To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const fetchActionsSetAllowedActionsRepository = ( variables: ActionsSetAllowedActionsRepositoryVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsSetAllowedActionsRepositoryError, Schemas.SelectedActions, {}, {}, ActionsSetAllowedActionsRepositoryPathParams >({ url: '/repos/{owner}/{repo}/actions/permissions/selected-actions', method: 'put', ...variables, signal, }); /** * Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." * * If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. * * To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. */ export const useActionsSetAllowedActionsRepository = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsSetAllowedActionsRepositoryError, ActionsSetAllowedActionsRepositoryVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsSetAllowedActionsRepositoryError, ActionsSetAllowedActionsRepositoryVariables >( (variables: ActionsSetAllowedActionsRepositoryVariables) => fetchActionsSetAllowedActionsRepository({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsListSelfHostedRunnersForRepoPathParams = { owner: string; repo: string; }; export type ActionsListSelfHostedRunnersForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListSelfHostedRunnersForRepoError = Fetcher.ErrorWrapper; export type ActionsListSelfHostedRunnersForRepoResponse = { runners: Schemas.Runner[]; total_count: number; }; export type ActionsListSelfHostedRunnersForRepoVariables = { pathParams: ActionsListSelfHostedRunnersForRepoPathParams; queryParams?: ActionsListSelfHostedRunnersForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. */ export const fetchActionsListSelfHostedRunnersForRepo = ( variables: ActionsListSelfHostedRunnersForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActionsListSelfHostedRunnersForRepoResponse, ActionsListSelfHostedRunnersForRepoError, undefined, {}, ActionsListSelfHostedRunnersForRepoQueryParams, ActionsListSelfHostedRunnersForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners', method: 'get', ...variables, signal, }); /** * Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. */ export const useActionsListSelfHostedRunnersForRepo = < TData = ActionsListSelfHostedRunnersForRepoResponse, >( variables: ActionsListSelfHostedRunnersForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListSelfHostedRunnersForRepoResponse, ActionsListSelfHostedRunnersForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListSelfHostedRunnersForRepoResponse, ActionsListSelfHostedRunnersForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runners', operationId: 'actionsListSelfHostedRunnersForRepo', variables, }), ({ signal }) => fetchActionsListSelfHostedRunnersForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsListRunnerApplicationsForRepoPathParams = { owner: string; repo: string; }; export type ActionsListRunnerApplicationsForRepoError = Fetcher.ErrorWrapper; export type ActionsListRunnerApplicationsForRepoResponse = Schemas.RunnerApplication[]; export type ActionsListRunnerApplicationsForRepoVariables = { pathParams: ActionsListRunnerApplicationsForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `repo` scope to use this endpoint. */ export const fetchActionsListRunnerApplicationsForRepo = ( variables: ActionsListRunnerApplicationsForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActionsListRunnerApplicationsForRepoResponse, ActionsListRunnerApplicationsForRepoError, undefined, {}, {}, ActionsListRunnerApplicationsForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners/downloads', method: 'get', ...variables, signal, }); /** * Lists binaries for the runner application that you can download and run. * * You must authenticate using an access token with the `repo` scope to use this endpoint. */ export const useActionsListRunnerApplicationsForRepo = < TData = ActionsListRunnerApplicationsForRepoResponse, >( variables: ActionsListRunnerApplicationsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListRunnerApplicationsForRepoResponse, ActionsListRunnerApplicationsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListRunnerApplicationsForRepoResponse, ActionsListRunnerApplicationsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runners/downloads', operationId: 'actionsListRunnerApplicationsForRepo', variables, }), ({ signal }) => fetchActionsListRunnerApplicationsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsCreateRegistrationTokenForRepoPathParams = { owner: string; repo: string; }; export type ActionsCreateRegistrationTokenForRepoError = Fetcher.ErrorWrapper; export type ActionsCreateRegistrationTokenForRepoVariables = { pathParams: ActionsCreateRegistrationTokenForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate * using an access token with the `repo` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN * ``` */ export const fetchActionsCreateRegistrationTokenForRepo = ( variables: ActionsCreateRegistrationTokenForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForRepoError, undefined, {}, {}, ActionsCreateRegistrationTokenForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners/registration-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate * using an access token with the `repo` scope to use this endpoint. * * #### Example using registration token * * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` * ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN * ``` */ export const useActionsCreateRegistrationTokenForRepo = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForRepoError, ActionsCreateRegistrationTokenForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, ActionsCreateRegistrationTokenForRepoError, ActionsCreateRegistrationTokenForRepoVariables >( (variables: ActionsCreateRegistrationTokenForRepoVariables) => fetchActionsCreateRegistrationTokenForRepo({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsCreateRemoveTokenForRepoPathParams = { owner: string; repo: string; }; export type ActionsCreateRemoveTokenForRepoError = Fetcher.ErrorWrapper; export type ActionsCreateRemoveTokenForRepoVariables = { pathParams: ActionsCreateRemoveTokenForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. * You must authenticate using an access token with the `repo` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const fetchActionsCreateRemoveTokenForRepo = ( variables: ActionsCreateRemoveTokenForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForRepoError, undefined, {}, {}, ActionsCreateRemoveTokenForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners/remove-token', method: 'post', ...variables, signal, }); /** * Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. * You must authenticate using an access token with the `repo` scope to use this endpoint. * * #### Example using remove token * * To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. * * ``` * ./config.sh remove --token TOKEN * ``` */ export const useActionsCreateRemoveTokenForRepo = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForRepoError, ActionsCreateRemoveTokenForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.AuthenticationToken, ActionsCreateRemoveTokenForRepoError, ActionsCreateRemoveTokenForRepoVariables >( (variables: ActionsCreateRemoveTokenForRepoVariables) => fetchActionsCreateRemoveTokenForRepo({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsDeleteSelfHostedRunnerFromRepoPathParams = { owner: string; repo: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsDeleteSelfHostedRunnerFromRepoError = Fetcher.ErrorWrapper; export type ActionsDeleteSelfHostedRunnerFromRepoVariables = { pathParams: ActionsDeleteSelfHostedRunnerFromRepoPathParams; } & GithubContext['fetcherOptions']; /** * Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `repo` * scope to use this endpoint. */ export const fetchActionsDeleteSelfHostedRunnerFromRepo = ( variables: ActionsDeleteSelfHostedRunnerFromRepoVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteSelfHostedRunnerFromRepoError, undefined, {}, {}, ActionsDeleteSelfHostedRunnerFromRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners/{runnerId}', method: 'delete', ...variables, signal, }); /** * Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. * * You must authenticate using an access token with the `repo` * scope to use this endpoint. */ export const useActionsDeleteSelfHostedRunnerFromRepo = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteSelfHostedRunnerFromRepoError, ActionsDeleteSelfHostedRunnerFromRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteSelfHostedRunnerFromRepoError, ActionsDeleteSelfHostedRunnerFromRepoVariables >( (variables: ActionsDeleteSelfHostedRunnerFromRepoVariables) => fetchActionsDeleteSelfHostedRunnerFromRepo({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsGetSelfHostedRunnerForRepoPathParams = { owner: string; repo: string; /** * Unique identifier of the self-hosted runner. */ runnerId: number; }; export type ActionsGetSelfHostedRunnerForRepoError = Fetcher.ErrorWrapper; export type ActionsGetSelfHostedRunnerForRepoVariables = { pathParams: ActionsGetSelfHostedRunnerForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific self-hosted runner configured in a repository. * * You must authenticate using an access token with the `repo` scope to use this * endpoint. */ export const fetchActionsGetSelfHostedRunnerForRepo = ( variables: ActionsGetSelfHostedRunnerForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Runner, ActionsGetSelfHostedRunnerForRepoError, undefined, {}, {}, ActionsGetSelfHostedRunnerForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runners/{runnerId}', method: 'get', ...variables, signal, }); /** * Gets a specific self-hosted runner configured in a repository. * * You must authenticate using an access token with the `repo` scope to use this * endpoint. */ export const useActionsGetSelfHostedRunnerForRepo = ( variables: ActionsGetSelfHostedRunnerForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Runner, ActionsGetSelfHostedRunnerForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Runner, ActionsGetSelfHostedRunnerForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runners/{runner_id}', operationId: 'actionsGetSelfHostedRunnerForRepo', variables, }), ({ signal }) => fetchActionsGetSelfHostedRunnerForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsListWorkflowRunsForRepoPathParams = { owner: string; repo: string; }; export type ActionsListWorkflowRunsForRepoQueryParams = { /** * Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. */ actor?: string; /** * Returns workflow runs associated with a branch. Use the name of the branch of the `push`. */ branch?: string; /** * Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ event?: string; /** * Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ status?: | 'completed' | 'action_required' | 'cancelled' | 'failure' | 'neutral' | 'skipped' | 'stale' | 'success' | 'timed_out' | 'in_progress' | 'queued' | 'requested' | 'waiting'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListWorkflowRunsForRepoError = Fetcher.ErrorWrapper; export type ActionsListWorkflowRunsForRepoResponse = { total_count: number; workflow_runs: Schemas.WorkflowRun[]; }; export type ActionsListWorkflowRunsForRepoVariables = { pathParams: ActionsListWorkflowRunsForRepoPathParams; queryParams?: ActionsListWorkflowRunsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsListWorkflowRunsForRepo = ( variables: ActionsListWorkflowRunsForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActionsListWorkflowRunsForRepoResponse, ActionsListWorkflowRunsForRepoError, undefined, {}, ActionsListWorkflowRunsForRepoQueryParams, ActionsListWorkflowRunsForRepoPathParams >({ url: '/repos/{owner}/{repo}/actions/runs', method: 'get', ...variables, signal, }); /** * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsListWorkflowRunsForRepo = < TData = ActionsListWorkflowRunsForRepoResponse, >( variables: ActionsListWorkflowRunsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListWorkflowRunsForRepoResponse, ActionsListWorkflowRunsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListWorkflowRunsForRepoResponse, ActionsListWorkflowRunsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs', operationId: 'actionsListWorkflowRunsForRepo', variables, }), ({ signal }) => fetchActionsListWorkflowRunsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteWorkflowRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsDeleteWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsDeleteWorkflowRunVariables = { pathParams: ActionsDeleteWorkflowRunPathParams; } & GithubContext['fetcherOptions']; /** * Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is * private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use * this endpoint. */ export const fetchActionsDeleteWorkflowRun = ( variables: ActionsDeleteWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteWorkflowRunError, undefined, {}, {}, ActionsDeleteWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}', method: 'delete', ...variables, signal, }); /** * Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is * private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use * this endpoint. */ export const useActionsDeleteWorkflowRun = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteWorkflowRunError, ActionsDeleteWorkflowRunVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteWorkflowRunError, ActionsDeleteWorkflowRunVariables >( (variables: ActionsDeleteWorkflowRunVariables) => fetchActionsDeleteWorkflowRun({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetWorkflowRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsGetWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsGetWorkflowRunVariables = { pathParams: ActionsGetWorkflowRunPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetWorkflowRun = ( variables: ActionsGetWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WorkflowRun, ActionsGetWorkflowRunError, undefined, {}, {}, ActionsGetWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}', method: 'get', ...variables, signal, }); /** * Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetWorkflowRun = ( variables: ActionsGetWorkflowRunVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WorkflowRun, ActionsGetWorkflowRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WorkflowRun, ActionsGetWorkflowRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}', operationId: 'actionsGetWorkflowRun', variables, }), ({ signal }) => fetchActionsGetWorkflowRun({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsGetReviewsForRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsGetReviewsForRunError = Fetcher.ErrorWrapper; export type ActionsGetReviewsForRunResponse = Schemas.EnvironmentApprovals[]; export type ActionsGetReviewsForRunVariables = { pathParams: ActionsGetReviewsForRunPathParams; } & GithubContext['fetcherOptions']; /** * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetReviewsForRun = ( variables: ActionsGetReviewsForRunVariables, signal?: AbortSignal, ) => githubFetch< ActionsGetReviewsForRunResponse, ActionsGetReviewsForRunError, undefined, {}, {}, ActionsGetReviewsForRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/approvals', method: 'get', ...variables, signal, }); /** * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetReviewsForRun = < TData = ActionsGetReviewsForRunResponse, >( variables: ActionsGetReviewsForRunVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsGetReviewsForRunResponse, ActionsGetReviewsForRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsGetReviewsForRunResponse, ActionsGetReviewsForRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/approvals', operationId: 'actionsGetReviewsForRun', variables, }), ({ signal }) => fetchActionsGetReviewsForRun({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsListWorkflowRunArtifactsPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsListWorkflowRunArtifactsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListWorkflowRunArtifactsError = Fetcher.ErrorWrapper; export type ActionsListWorkflowRunArtifactsResponse = { artifacts: Schemas.Artifact[]; total_count: number; }; export type ActionsListWorkflowRunArtifactsVariables = { pathParams: ActionsListWorkflowRunArtifactsPathParams; queryParams?: ActionsListWorkflowRunArtifactsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsListWorkflowRunArtifacts = ( variables: ActionsListWorkflowRunArtifactsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListWorkflowRunArtifactsResponse, ActionsListWorkflowRunArtifactsError, undefined, {}, ActionsListWorkflowRunArtifactsQueryParams, ActionsListWorkflowRunArtifactsPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/artifacts', method: 'get', ...variables, signal, }); /** * Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsListWorkflowRunArtifacts = < TData = ActionsListWorkflowRunArtifactsResponse, >( variables: ActionsListWorkflowRunArtifactsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListWorkflowRunArtifactsResponse, ActionsListWorkflowRunArtifactsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListWorkflowRunArtifactsResponse, ActionsListWorkflowRunArtifactsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', operationId: 'actionsListWorkflowRunArtifacts', variables, }), ({ signal }) => fetchActionsListWorkflowRunArtifacts( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsCancelWorkflowRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsCancelWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsCancelWorkflowRunVariables = { pathParams: ActionsCancelWorkflowRunPathParams; } & GithubContext['fetcherOptions']; /** * Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsCancelWorkflowRun = ( variables: ActionsCancelWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsCancelWorkflowRunError, undefined, {}, {}, ActionsCancelWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/cancel', method: 'post', ...variables, signal, }); /** * Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsCancelWorkflowRun = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsCancelWorkflowRunError, ActionsCancelWorkflowRunVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsCancelWorkflowRunError, ActionsCancelWorkflowRunVariables >( (variables: ActionsCancelWorkflowRunVariables) => fetchActionsCancelWorkflowRun({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsListJobsForWorkflowRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsListJobsForWorkflowRunQueryParams = { /** * Filters jobs by their `completed_at` timestamp. Can be one of: * \* `latest`: Returns jobs from the most recent execution of the workflow run. * \* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run. * * @default latest */ filter?: 'latest' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListJobsForWorkflowRunError = Fetcher.ErrorWrapper; export type ActionsListJobsForWorkflowRunResponse = { jobs: Schemas.Job[]; total_count: number; }; export type ActionsListJobsForWorkflowRunVariables = { pathParams: ActionsListJobsForWorkflowRunPathParams; queryParams?: ActionsListJobsForWorkflowRunQueryParams; } & GithubContext['fetcherOptions']; /** * Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). */ export const fetchActionsListJobsForWorkflowRun = ( variables: ActionsListJobsForWorkflowRunVariables, signal?: AbortSignal, ) => githubFetch< ActionsListJobsForWorkflowRunResponse, ActionsListJobsForWorkflowRunError, undefined, {}, ActionsListJobsForWorkflowRunQueryParams, ActionsListJobsForWorkflowRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/jobs', method: 'get', ...variables, signal, }); /** * Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). */ export const useActionsListJobsForWorkflowRun = < TData = ActionsListJobsForWorkflowRunResponse, >( variables: ActionsListJobsForWorkflowRunVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListJobsForWorkflowRunResponse, ActionsListJobsForWorkflowRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListJobsForWorkflowRunResponse, ActionsListJobsForWorkflowRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/jobs', operationId: 'actionsListJobsForWorkflowRun', variables, }), ({ signal }) => fetchActionsListJobsForWorkflowRun( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteWorkflowRunLogsPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsDeleteWorkflowRunLogsError = Fetcher.ErrorWrapper; export type ActionsDeleteWorkflowRunLogsVariables = { pathParams: ActionsDeleteWorkflowRunLogsPathParams; } & GithubContext['fetcherOptions']; /** * Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsDeleteWorkflowRunLogs = ( variables: ActionsDeleteWorkflowRunLogsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteWorkflowRunLogsError, undefined, {}, {}, ActionsDeleteWorkflowRunLogsPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/logs', method: 'delete', ...variables, signal, }); /** * Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsDeleteWorkflowRunLogs = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteWorkflowRunLogsError, ActionsDeleteWorkflowRunLogsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteWorkflowRunLogsError, ActionsDeleteWorkflowRunLogsVariables >( (variables: ActionsDeleteWorkflowRunLogsVariables) => fetchActionsDeleteWorkflowRunLogs({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsDownloadWorkflowRunLogsPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsDownloadWorkflowRunLogsError = Fetcher.ErrorWrapper; export type ActionsDownloadWorkflowRunLogsVariables = { pathParams: ActionsDownloadWorkflowRunLogsPathParams; } & GithubContext['fetcherOptions']; /** * Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for * `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use * this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have * the `actions:read` permission to use this endpoint. */ export const fetchActionsDownloadWorkflowRunLogs = ( variables: ActionsDownloadWorkflowRunLogsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDownloadWorkflowRunLogsError, undefined, {}, {}, ActionsDownloadWorkflowRunLogsPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/logs', method: 'get', ...variables, signal, }); /** * Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for * `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use * this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have * the `actions:read` permission to use this endpoint. */ export const useActionsDownloadWorkflowRunLogs = ( variables: ActionsDownloadWorkflowRunLogsVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ActionsDownloadWorkflowRunLogsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ActionsDownloadWorkflowRunLogsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/logs', operationId: 'actionsDownloadWorkflowRunLogs', variables, }), ({ signal }) => fetchActionsDownloadWorkflowRunLogs( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsGetPendingDeploymentsForRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsGetPendingDeploymentsForRunError = Fetcher.ErrorWrapper; export type ActionsGetPendingDeploymentsForRunResponse = Schemas.PendingDeployment[]; export type ActionsGetPendingDeploymentsForRunVariables = { pathParams: ActionsGetPendingDeploymentsForRunPathParams; } & GithubContext['fetcherOptions']; /** * Get all deployment environments for a workflow run that are waiting for protection rules to pass. * * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetPendingDeploymentsForRun = ( variables: ActionsGetPendingDeploymentsForRunVariables, signal?: AbortSignal, ) => githubFetch< ActionsGetPendingDeploymentsForRunResponse, ActionsGetPendingDeploymentsForRunError, undefined, {}, {}, ActionsGetPendingDeploymentsForRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/pending_deployments', method: 'get', ...variables, signal, }); /** * Get all deployment environments for a workflow run that are waiting for protection rules to pass. * * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetPendingDeploymentsForRun = < TData = ActionsGetPendingDeploymentsForRunResponse, >( variables: ActionsGetPendingDeploymentsForRunVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsGetPendingDeploymentsForRunResponse, ActionsGetPendingDeploymentsForRunError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsGetPendingDeploymentsForRunResponse, ActionsGetPendingDeploymentsForRunError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments', operationId: 'actionsGetPendingDeploymentsForRun', variables, }), ({ signal }) => fetchActionsGetPendingDeploymentsForRun( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsReviewPendingDeploymentsForRunPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsReviewPendingDeploymentsForRunError = Fetcher.ErrorWrapper; export type ActionsReviewPendingDeploymentsForRunResponse = Schemas.Deployment[]; export type ActionsReviewPendingDeploymentsForRunRequestBody = { /** * A comment to accompany the deployment review * * @example Ship it! */ comment: string; /** * The list of environment ids to approve or reject * * @example 161171787 * @example 161171795 */ environment_ids: number[]; /** * Whether to approve or reject deployment to the specified environments. Must be one of: `approved` or `rejected` * * @example approved */ state: 'approved' | 'rejected'; }; export type ActionsReviewPendingDeploymentsForRunVariables = { body: ActionsReviewPendingDeploymentsForRunRequestBody; pathParams: ActionsReviewPendingDeploymentsForRunPathParams; } & GithubContext['fetcherOptions']; /** * Approve or reject pending deployments that are waiting on approval by a required reviewer. * * Anyone with read access to the repository contents and deployments can use this endpoint. */ export const fetchActionsReviewPendingDeploymentsForRun = ( variables: ActionsReviewPendingDeploymentsForRunVariables, signal?: AbortSignal, ) => githubFetch< ActionsReviewPendingDeploymentsForRunResponse, ActionsReviewPendingDeploymentsForRunError, ActionsReviewPendingDeploymentsForRunRequestBody, {}, {}, ActionsReviewPendingDeploymentsForRunPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/pending_deployments', method: 'post', ...variables, signal, }); /** * Approve or reject pending deployments that are waiting on approval by a required reviewer. * * Anyone with read access to the repository contents and deployments can use this endpoint. */ export const useActionsReviewPendingDeploymentsForRun = ( options?: Omit< reactQuery.UseMutationOptions< ActionsReviewPendingDeploymentsForRunResponse, ActionsReviewPendingDeploymentsForRunError, ActionsReviewPendingDeploymentsForRunVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ActionsReviewPendingDeploymentsForRunResponse, ActionsReviewPendingDeploymentsForRunError, ActionsReviewPendingDeploymentsForRunVariables >( (variables: ActionsReviewPendingDeploymentsForRunVariables) => fetchActionsReviewPendingDeploymentsForRun({ ...fetcherOptions, ...variables, }), options, ); }; export type ActionsReRunWorkflowPathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsReRunWorkflowError = Fetcher.ErrorWrapper; export type ActionsReRunWorkflowVariables = { pathParams: ActionsReRunWorkflowPathParams; } & GithubContext['fetcherOptions']; /** * Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsReRunWorkflow = ( variables: ActionsReRunWorkflowVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsReRunWorkflowError, undefined, {}, {}, ActionsReRunWorkflowPathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/rerun', method: 'post', ...variables, signal, }); /** * Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsReRunWorkflow = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsReRunWorkflowError, ActionsReRunWorkflowVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsReRunWorkflowError, ActionsReRunWorkflowVariables >( (variables: ActionsReRunWorkflowVariables) => fetchActionsReRunWorkflow({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetWorkflowRunUsagePathParams = { owner: string; repo: string; /** * The id of the workflow run */ runId: number; }; export type ActionsGetWorkflowRunUsageError = Fetcher.ErrorWrapper; export type ActionsGetWorkflowRunUsageVariables = { pathParams: ActionsGetWorkflowRunUsagePathParams; } & GithubContext['fetcherOptions']; /** * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetWorkflowRunUsage = ( variables: ActionsGetWorkflowRunUsageVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WorkflowRunUsage, ActionsGetWorkflowRunUsageError, undefined, {}, {}, ActionsGetWorkflowRunUsagePathParams >({ url: '/repos/{owner}/{repo}/actions/runs/{runId}/timing', method: 'get', ...variables, signal, }); /** * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetWorkflowRunUsage = ( variables: ActionsGetWorkflowRunUsageVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WorkflowRunUsage, ActionsGetWorkflowRunUsageError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WorkflowRunUsage, ActionsGetWorkflowRunUsageError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/runs/{run_id}/timing', operationId: 'actionsGetWorkflowRunUsage', variables, }), ({ signal }) => fetchActionsGetWorkflowRunUsage( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsListRepoSecretsPathParams = { owner: string; repo: string; }; export type ActionsListRepoSecretsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListRepoSecretsError = Fetcher.ErrorWrapper; export type ActionsListRepoSecretsResponse = { secrets: Schemas.ActionsSecret[]; total_count: number; }; export type ActionsListRepoSecretsVariables = { pathParams: ActionsListRepoSecretsPathParams; queryParams?: ActionsListRepoSecretsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsListRepoSecrets = ( variables: ActionsListRepoSecretsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListRepoSecretsResponse, ActionsListRepoSecretsError, undefined, {}, ActionsListRepoSecretsQueryParams, ActionsListRepoSecretsPathParams >({ url: '/repos/{owner}/{repo}/actions/secrets', method: 'get', ...variables, signal, }); /** * Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsListRepoSecrets = < TData = ActionsListRepoSecretsResponse, >( variables: ActionsListRepoSecretsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListRepoSecretsResponse, ActionsListRepoSecretsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListRepoSecretsResponse, ActionsListRepoSecretsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/secrets', operationId: 'actionsListRepoSecrets', variables, }), ({ signal }) => fetchActionsListRepoSecrets({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsGetRepoPublicKeyPathParams = { owner: string; repo: string; }; export type ActionsGetRepoPublicKeyError = Fetcher.ErrorWrapper; export type ActionsGetRepoPublicKeyVariables = { pathParams: ActionsGetRepoPublicKeyPathParams; } & GithubContext['fetcherOptions']; /** * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsGetRepoPublicKey = ( variables: ActionsGetRepoPublicKeyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsPublicKey, ActionsGetRepoPublicKeyError, undefined, {}, {}, ActionsGetRepoPublicKeyPathParams >({ url: '/repos/{owner}/{repo}/actions/secrets/public-key', method: 'get', ...variables, signal, }); /** * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsGetRepoPublicKey = ( variables: ActionsGetRepoPublicKeyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsPublicKey, ActionsGetRepoPublicKeyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsPublicKey, ActionsGetRepoPublicKeyError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/secrets/public-key', operationId: 'actionsGetRepoPublicKey', variables, }), ({ signal }) => fetchActionsGetRepoPublicKey({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteRepoSecretPathParams = { owner: string; repo: string; /** * secret_name parameter */ secretName: string; }; export type ActionsDeleteRepoSecretError = Fetcher.ErrorWrapper; export type ActionsDeleteRepoSecretVariables = { pathParams: ActionsDeleteRepoSecretPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsDeleteRepoSecret = ( variables: ActionsDeleteRepoSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteRepoSecretError, undefined, {}, {}, ActionsDeleteRepoSecretPathParams >({ url: '/repos/{owner}/{repo}/actions/secrets/{secretName}', method: 'delete', ...variables, signal, }); /** * Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsDeleteRepoSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteRepoSecretError, ActionsDeleteRepoSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteRepoSecretError, ActionsDeleteRepoSecretVariables >( (variables: ActionsDeleteRepoSecretVariables) => fetchActionsDeleteRepoSecret({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetRepoSecretPathParams = { owner: string; repo: string; /** * secret_name parameter */ secretName: string; }; export type ActionsGetRepoSecretError = Fetcher.ErrorWrapper; export type ActionsGetRepoSecretVariables = { pathParams: ActionsGetRepoSecretPathParams; } & GithubContext['fetcherOptions']; /** * Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsGetRepoSecret = ( variables: ActionsGetRepoSecretVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsSecret, ActionsGetRepoSecretError, undefined, {}, {}, ActionsGetRepoSecretPathParams >({ url: '/repos/{owner}/{repo}/actions/secrets/{secretName}', method: 'get', ...variables, signal, }); /** * Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsGetRepoSecret = ( variables: ActionsGetRepoSecretVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsSecret, ActionsGetRepoSecretError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsSecret, ActionsGetRepoSecretError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/secrets/{secret_name}', operationId: 'actionsGetRepoSecret', variables, }), ({ signal }) => fetchActionsGetRepoSecret({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsCreateOrUpdateRepoSecretPathParams = { owner: string; repo: string; /** * secret_name parameter */ secretName: string; }; export type ActionsCreateOrUpdateRepoSecretError = Fetcher.ErrorWrapper; export type ActionsCreateOrUpdateRepoSecretRequestBody = { /** * Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. * * @pattern ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$ */ encrypted_value?: string; /** * ID of the key you used to encrypt the secret. */ key_id?: string; }; export type ActionsCreateOrUpdateRepoSecretVariables = { body?: ActionsCreateOrUpdateRepoSecretRequestBody; pathParams: ActionsCreateOrUpdateRepoSecretPathParams; } & GithubContext['fetcherOptions']; /** * Creates or updates a repository secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use * this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const fetchActionsCreateOrUpdateRepoSecret = ( variables: ActionsCreateOrUpdateRepoSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsCreateOrUpdateRepoSecretError, ActionsCreateOrUpdateRepoSecretRequestBody, {}, {}, ActionsCreateOrUpdateRepoSecretPathParams >({ url: '/repos/{owner}/{repo}/actions/secrets/{secretName}', method: 'put', ...variables, signal, }); /** * Creates or updates a repository secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use * this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const useActionsCreateOrUpdateRepoSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsCreateOrUpdateRepoSecretError, ActionsCreateOrUpdateRepoSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsCreateOrUpdateRepoSecretError, ActionsCreateOrUpdateRepoSecretVariables >( (variables: ActionsCreateOrUpdateRepoSecretVariables) => fetchActionsCreateOrUpdateRepoSecret({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsListRepoWorkflowsPathParams = { owner: string; repo: string; }; export type ActionsListRepoWorkflowsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListRepoWorkflowsError = Fetcher.ErrorWrapper; export type ActionsListRepoWorkflowsResponse = { total_count: number; workflows: Schemas.Workflow[]; }; export type ActionsListRepoWorkflowsVariables = { pathParams: ActionsListRepoWorkflowsPathParams; queryParams?: ActionsListRepoWorkflowsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsListRepoWorkflows = ( variables: ActionsListRepoWorkflowsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListRepoWorkflowsResponse, ActionsListRepoWorkflowsError, undefined, {}, ActionsListRepoWorkflowsQueryParams, ActionsListRepoWorkflowsPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows', method: 'get', ...variables, signal, }); /** * Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsListRepoWorkflows = < TData = ActionsListRepoWorkflowsResponse, >( variables: ActionsListRepoWorkflowsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListRepoWorkflowsResponse, ActionsListRepoWorkflowsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListRepoWorkflowsResponse, ActionsListRepoWorkflowsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/workflows', operationId: 'actionsListRepoWorkflows', variables, }), ({ signal }) => fetchActionsListRepoWorkflows( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsGetWorkflowPathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsGetWorkflowError = Fetcher.ErrorWrapper; export type ActionsGetWorkflowVariables = { pathParams: ActionsGetWorkflowPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetWorkflow = ( variables: ActionsGetWorkflowVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Workflow, ActionsGetWorkflowError, undefined, {}, {}, ActionsGetWorkflowPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}', method: 'get', ...variables, signal, }); /** * Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetWorkflow = ( variables: ActionsGetWorkflowVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Workflow, ActionsGetWorkflowError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}', operationId: 'actionsGetWorkflow', variables, }), ({ signal }) => fetchActionsGetWorkflow({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsDisableWorkflowPathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsDisableWorkflowError = Fetcher.ErrorWrapper; export type ActionsDisableWorkflowVariables = { pathParams: ActionsDisableWorkflowPathParams; } & GithubContext['fetcherOptions']; /** * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsDisableWorkflow = ( variables: ActionsDisableWorkflowVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDisableWorkflowError, undefined, {}, {}, ActionsDisableWorkflowPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}/disable', method: 'put', ...variables, signal, }); /** * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsDisableWorkflow = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDisableWorkflowError, ActionsDisableWorkflowVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDisableWorkflowError, ActionsDisableWorkflowVariables >( (variables: ActionsDisableWorkflowVariables) => fetchActionsDisableWorkflow({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsCreateWorkflowDispatchPathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsCreateWorkflowDispatchError = Fetcher.ErrorWrapper; export type ActionsCreateWorkflowDispatchRequestBody = { /** * Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. * * @maxProperties 10 */ inputs?: { [key: string]: string; }; /** * The git reference for the workflow. The reference can be a branch or tag name. */ ref: string; }; export type ActionsCreateWorkflowDispatchVariables = { body: ActionsCreateWorkflowDispatchRequestBody; pathParams: ActionsCreateWorkflowDispatchPathParams; } & GithubContext['fetcherOptions']; /** * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." */ export const fetchActionsCreateWorkflowDispatch = ( variables: ActionsCreateWorkflowDispatchVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsCreateWorkflowDispatchError, ActionsCreateWorkflowDispatchRequestBody, {}, {}, ActionsCreateWorkflowDispatchPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}/dispatches', method: 'post', ...variables, signal, }); /** * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." */ export const useActionsCreateWorkflowDispatch = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsCreateWorkflowDispatchError, ActionsCreateWorkflowDispatchVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsCreateWorkflowDispatchError, ActionsCreateWorkflowDispatchVariables >( (variables: ActionsCreateWorkflowDispatchVariables) => fetchActionsCreateWorkflowDispatch({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsEnableWorkflowPathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsEnableWorkflowError = Fetcher.ErrorWrapper; export type ActionsEnableWorkflowVariables = { pathParams: ActionsEnableWorkflowPathParams; } & GithubContext['fetcherOptions']; /** * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const fetchActionsEnableWorkflow = ( variables: ActionsEnableWorkflowVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsEnableWorkflowError, undefined, {}, {}, ActionsEnableWorkflowPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}/enable', method: 'put', ...variables, signal, }); /** * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ export const useActionsEnableWorkflow = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsEnableWorkflowError, ActionsEnableWorkflowVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsEnableWorkflowError, ActionsEnableWorkflowVariables >( (variables: ActionsEnableWorkflowVariables) => fetchActionsEnableWorkflow({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsListWorkflowRunsPathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsListWorkflowRunsQueryParams = { /** * Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. */ actor?: string; /** * Returns workflow runs associated with a branch. Use the name of the branch of the `push`. */ branch?: string; /** * Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ event?: string; /** * Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ status?: | 'completed' | 'action_required' | 'cancelled' | 'failure' | 'neutral' | 'skipped' | 'stale' | 'success' | 'timed_out' | 'in_progress' | 'queued' | 'requested' | 'waiting'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListWorkflowRunsError = Fetcher.ErrorWrapper; export type ActionsListWorkflowRunsResponse = { total_count: number; workflow_runs: Schemas.WorkflowRun[]; }; export type ActionsListWorkflowRunsVariables = { pathParams: ActionsListWorkflowRunsPathParams; queryParams?: ActionsListWorkflowRunsQueryParams; } & GithubContext['fetcherOptions']; /** * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. */ export const fetchActionsListWorkflowRuns = ( variables: ActionsListWorkflowRunsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListWorkflowRunsResponse, ActionsListWorkflowRunsError, undefined, {}, ActionsListWorkflowRunsQueryParams, ActionsListWorkflowRunsPathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}/runs', method: 'get', ...variables, signal, }); /** * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. */ export const useActionsListWorkflowRuns = < TData = ActionsListWorkflowRunsResponse, >( variables: ActionsListWorkflowRunsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListWorkflowRunsResponse, ActionsListWorkflowRunsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListWorkflowRunsResponse, ActionsListWorkflowRunsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs', operationId: 'actionsListWorkflowRuns', variables, }), ({ signal }) => fetchActionsListWorkflowRuns({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsGetWorkflowUsagePathParams = { owner: string; repo: string; /** * The ID of the workflow. You can also pass the workflow file name as a string. */ workflowId: number | string; }; export type ActionsGetWorkflowUsageError = Fetcher.ErrorWrapper; export type ActionsGetWorkflowUsageVariables = { pathParams: ActionsGetWorkflowUsagePathParams; } & GithubContext['fetcherOptions']; /** * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchActionsGetWorkflowUsage = ( variables: ActionsGetWorkflowUsageVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WorkflowUsage, ActionsGetWorkflowUsageError, undefined, {}, {}, ActionsGetWorkflowUsagePathParams >({ url: '/repos/{owner}/{repo}/actions/workflows/{workflowId}/timing', method: 'get', ...variables, signal, }); /** * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useActionsGetWorkflowUsage = ( variables: ActionsGetWorkflowUsageVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WorkflowUsage, ActionsGetWorkflowUsageError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WorkflowUsage, ActionsGetWorkflowUsageError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing', operationId: 'actionsGetWorkflowUsage', variables, }), ({ signal }) => fetchActionsGetWorkflowUsage({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesListAssigneesPathParams = { owner: string; repo: string; }; export type IssuesListAssigneesQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListAssigneesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesListAssigneesResponse = Schemas.SimpleUser[]; export type IssuesListAssigneesVariables = { pathParams: IssuesListAssigneesPathParams; queryParams?: IssuesListAssigneesQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. */ export const fetchIssuesListAssignees = ( variables: IssuesListAssigneesVariables, signal?: AbortSignal, ) => githubFetch< IssuesListAssigneesResponse, IssuesListAssigneesError, undefined, {}, IssuesListAssigneesQueryParams, IssuesListAssigneesPathParams >({ url: '/repos/{owner}/{repo}/assignees', method: 'get', ...variables, signal, }); /** * Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. */ export const useIssuesListAssignees = ( variables: IssuesListAssigneesVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListAssigneesResponse, IssuesListAssigneesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListAssigneesResponse, IssuesListAssigneesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/assignees', operationId: 'issuesListAssignees', variables, }), ({ signal }) => fetchIssuesListAssignees({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesCheckUserCanBeAssignedPathParams = { owner: string; repo: string; assignee: string; }; export type IssuesCheckUserCanBeAssignedError = Fetcher.ErrorWrapper<{ status: 404; payload: Schemas.BasicError; }>; export type IssuesCheckUserCanBeAssignedVariables = { pathParams: IssuesCheckUserCanBeAssignedPathParams; } & GithubContext['fetcherOptions']; /** * Checks if a user has permission to be assigned to an issue in this repository. * * If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. * * Otherwise a `404` status code is returned. */ export const fetchIssuesCheckUserCanBeAssigned = ( variables: IssuesCheckUserCanBeAssignedVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesCheckUserCanBeAssignedError, undefined, {}, {}, IssuesCheckUserCanBeAssignedPathParams >({ url: '/repos/{owner}/{repo}/assignees/{assignee}', method: 'get', ...variables, signal, }); /** * Checks if a user has permission to be assigned to an issue in this repository. * * If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. * * Otherwise a `404` status code is returned. */ export const useIssuesCheckUserCanBeAssigned = ( variables: IssuesCheckUserCanBeAssignedVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, IssuesCheckUserCanBeAssignedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, IssuesCheckUserCanBeAssignedError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/assignees/{assignee}', operationId: 'issuesCheckUserCanBeAssigned', variables, }), ({ signal }) => fetchIssuesCheckUserCanBeAssigned( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposDisableAutomatedSecurityFixesPathParams = { owner: string; repo: string; }; export type ReposDisableAutomatedSecurityFixesError = Fetcher.ErrorWrapper; export type ReposDisableAutomatedSecurityFixesVariables = { pathParams: ReposDisableAutomatedSecurityFixesPathParams; } & GithubContext['fetcherOptions']; /** * Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ export const fetchReposDisableAutomatedSecurityFixes = ( variables: ReposDisableAutomatedSecurityFixesVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDisableAutomatedSecurityFixesError, undefined, {}, {}, ReposDisableAutomatedSecurityFixesPathParams >({ url: '/repos/{owner}/{repo}/automated-security-fixes', method: 'delete', ...variables, signal, }); /** * Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ export const useReposDisableAutomatedSecurityFixes = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDisableAutomatedSecurityFixesError, ReposDisableAutomatedSecurityFixesVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDisableAutomatedSecurityFixesError, ReposDisableAutomatedSecurityFixesVariables >( (variables: ReposDisableAutomatedSecurityFixesVariables) => fetchReposDisableAutomatedSecurityFixes({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposEnableAutomatedSecurityFixesPathParams = { owner: string; repo: string; }; export type ReposEnableAutomatedSecurityFixesError = Fetcher.ErrorWrapper; export type ReposEnableAutomatedSecurityFixesVariables = { pathParams: ReposEnableAutomatedSecurityFixesPathParams; } & GithubContext['fetcherOptions']; /** * Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ export const fetchReposEnableAutomatedSecurityFixes = ( variables: ReposEnableAutomatedSecurityFixesVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposEnableAutomatedSecurityFixesError, undefined, {}, {}, ReposEnableAutomatedSecurityFixesPathParams >({ url: '/repos/{owner}/{repo}/automated-security-fixes', method: 'put', ...variables, signal, }); /** * Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ export const useReposEnableAutomatedSecurityFixes = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposEnableAutomatedSecurityFixesError, ReposEnableAutomatedSecurityFixesVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposEnableAutomatedSecurityFixesError, ReposEnableAutomatedSecurityFixesVariables >( (variables: ReposEnableAutomatedSecurityFixesVariables) => fetchReposEnableAutomatedSecurityFixes({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposListBranchesPathParams = { owner: string; repo: string; }; export type ReposListBranchesQueryParams = { /** * Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. */ protected?: boolean; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListBranchesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposListBranchesResponse = Schemas.ShortBranch[]; export type ReposListBranchesVariables = { pathParams: ReposListBranchesPathParams; queryParams?: ReposListBranchesQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListBranches = ( variables: ReposListBranchesVariables, signal?: AbortSignal, ) => githubFetch< ReposListBranchesResponse, ReposListBranchesError, undefined, {}, ReposListBranchesQueryParams, ReposListBranchesPathParams >({ url: '/repos/{owner}/{repo}/branches', method: 'get', ...variables, signal, }); export const useReposListBranches = ( variables: ReposListBranchesVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListBranchesResponse, ReposListBranchesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListBranchesResponse, ReposListBranchesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches', operationId: 'reposListBranches', variables, }), ({ signal }) => fetchReposListBranches({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetBranchPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetBranchError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReposGetBranchVariables = { pathParams: ReposGetBranchPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetBranch = ( variables: ReposGetBranchVariables, signal?: AbortSignal, ) => githubFetch< Schemas.BranchWithProtection, ReposGetBranchError, undefined, {}, {}, ReposGetBranchPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}', method: 'get', ...variables, signal, }); export const useReposGetBranch = ( variables: ReposGetBranchVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.BranchWithProtection, ReposGetBranchError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.BranchWithProtection, ReposGetBranchError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}', operationId: 'reposGetBranch', variables, }), ({ signal }) => fetchReposGetBranch({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDeleteBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposDeleteBranchProtectionError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ReposDeleteBranchProtectionVariables = { pathParams: ReposDeleteBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposDeleteBranchProtection = ( variables: ReposDeleteBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteBranchProtectionError, undefined, {}, {}, ReposDeleteBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposDeleteBranchProtection = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteBranchProtectionError, ReposDeleteBranchProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteBranchProtectionError, ReposDeleteBranchProtectionVariables >( (variables: ReposDeleteBranchProtectionVariables) => fetchReposDeleteBranchProtection({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetBranchProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetBranchProtectionVariables = { pathParams: ReposGetBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposGetBranchProtection = ( variables: ReposGetBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.BranchProtection, ReposGetBranchProtectionError, undefined, {}, {}, ReposGetBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposGetBranchProtection = ( variables: ReposGetBranchProtectionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.BranchProtection, ReposGetBranchProtectionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.BranchProtection, ReposGetBranchProtectionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection', operationId: 'reposGetBranchProtection', variables, }), ({ signal }) => fetchReposGetBranchProtection( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposUpdateBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposUpdateBranchProtectionError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ReposUpdateBranchProtectionRequestBody = { /** * Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ allow_deletions?: boolean; /** * Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ allow_force_pushes?: boolean | null; /** * Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. */ enforce_admins: boolean | null; /** * Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ required_linear_history?: boolean; /** * Require at least one approving review on a pull request, before merging. Set to `null` to disable. */ required_pull_request_reviews: { /** * Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ dismiss_stale_reviews?: boolean; /** * Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ dismissal_restrictions?: { /** * The list of team `slug`s with dismissal access */ teams?: string[]; /** * The list of user `login`s with dismissal access */ users?: string[]; }; /** * Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ require_code_owner_reviews?: boolean; /** * Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ required_approving_review_count?: number; } | null; /** * Require status checks to pass before merging. Set to `null` to disable. */ required_status_checks: { /** * The list of status checks to require in order to merge into this branch */ contexts: string[]; /** * Require branches to be up to date before merging. */ strict: boolean; } | null; /** * Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. */ restrictions: { /** * The list of app `slug`s with push access */ apps?: string[]; /** * The list of team `slug`s with push access */ teams: string[]; /** * The list of user `login`s with push access */ users: string[]; } | null; }; export type ReposUpdateBranchProtectionVariables = { body: ReposUpdateBranchProtectionRequestBody; pathParams: ReposUpdateBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Protecting a branch requires admin or owner permissions to the repository. * * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. * * **Note**: The list of users, apps, and teams in total is limited to 100 items. */ export const fetchReposUpdateBranchProtection = ( variables: ReposUpdateBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranch, ReposUpdateBranchProtectionError, ReposUpdateBranchProtectionRequestBody, {}, {}, ReposUpdateBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection', method: 'put', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Protecting a branch requires admin or owner permissions to the repository. * * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. * * **Note**: The list of users, apps, and teams in total is limited to 100 items. */ export const useReposUpdateBranchProtection = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProtectedBranch, ReposUpdateBranchProtectionError, ReposUpdateBranchProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProtectedBranch, ReposUpdateBranchProtectionError, ReposUpdateBranchProtectionVariables >( (variables: ReposUpdateBranchProtectionVariables) => fetchReposUpdateBranchProtection({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteAdminBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposDeleteAdminBranchProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposDeleteAdminBranchProtectionVariables = { pathParams: ReposDeleteAdminBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ export const fetchReposDeleteAdminBranchProtection = ( variables: ReposDeleteAdminBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteAdminBranchProtectionError, undefined, {}, {}, ReposDeleteAdminBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ export const useReposDeleteAdminBranchProtection = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteAdminBranchProtectionError, ReposDeleteAdminBranchProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteAdminBranchProtectionError, ReposDeleteAdminBranchProtectionVariables >( (variables: ReposDeleteAdminBranchProtectionVariables) => fetchReposDeleteAdminBranchProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetAdminBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetAdminBranchProtectionError = Fetcher.ErrorWrapper; export type ReposGetAdminBranchProtectionVariables = { pathParams: ReposGetAdminBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposGetAdminBranchProtection = ( variables: ReposGetAdminBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranchAdminEnforced, ReposGetAdminBranchProtectionError, undefined, {}, {}, ReposGetAdminBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposGetAdminBranchProtection = < TData = Schemas.ProtectedBranchAdminEnforced, >( variables: ReposGetAdminBranchProtectionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ProtectedBranchAdminEnforced, ReposGetAdminBranchProtectionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ProtectedBranchAdminEnforced, ReposGetAdminBranchProtectionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins', operationId: 'reposGetAdminBranchProtection', variables, }), ({ signal }) => fetchReposGetAdminBranchProtection( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposSetAdminBranchProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposSetAdminBranchProtectionError = Fetcher.ErrorWrapper; export type ReposSetAdminBranchProtectionVariables = { pathParams: ReposSetAdminBranchProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ export const fetchReposSetAdminBranchProtection = ( variables: ReposSetAdminBranchProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranchAdminEnforced, ReposSetAdminBranchProtectionError, undefined, {}, {}, ReposSetAdminBranchProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ export const useReposSetAdminBranchProtection = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProtectedBranchAdminEnforced, ReposSetAdminBranchProtectionError, ReposSetAdminBranchProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProtectedBranchAdminEnforced, ReposSetAdminBranchProtectionError, ReposSetAdminBranchProtectionVariables >( (variables: ReposSetAdminBranchProtectionVariables) => fetchReposSetAdminBranchProtection({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeletePullRequestReviewProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposDeletePullRequestReviewProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposDeletePullRequestReviewProtectionVariables = { pathParams: ReposDeletePullRequestReviewProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposDeletePullRequestReviewProtection = ( variables: ReposDeletePullRequestReviewProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeletePullRequestReviewProtectionError, undefined, {}, {}, ReposDeletePullRequestReviewProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposDeletePullRequestReviewProtection = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeletePullRequestReviewProtectionError, ReposDeletePullRequestReviewProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeletePullRequestReviewProtectionError, ReposDeletePullRequestReviewProtectionVariables >( (variables: ReposDeletePullRequestReviewProtectionVariables) => fetchReposDeletePullRequestReviewProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetPullRequestReviewProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetPullRequestReviewProtectionError = Fetcher.ErrorWrapper; export type ReposGetPullRequestReviewProtectionVariables = { pathParams: ReposGetPullRequestReviewProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposGetPullRequestReviewProtection = ( variables: ReposGetPullRequestReviewProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposGetPullRequestReviewProtectionError, undefined, {}, {}, ReposGetPullRequestReviewProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposGetPullRequestReviewProtection = ( variables: ReposGetPullRequestReviewProtectionVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ReposGetPullRequestReviewProtectionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ReposGetPullRequestReviewProtectionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews', operationId: 'reposGetPullRequestReviewProtection', variables, }), ({ signal }) => fetchReposGetPullRequestReviewProtection( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposUpdatePullRequestReviewProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposUpdatePullRequestReviewProtectionError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposUpdatePullRequestReviewProtectionRequestBody = { /** * Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ dismiss_stale_reviews?: boolean; /** * Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ dismissal_restrictions?: { /** * The list of team `slug`s with dismissal access */ teams?: string[]; /** * The list of user `login`s with dismissal access */ users?: string[]; }; /** * Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ require_code_owner_reviews?: boolean; /** * Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ required_approving_review_count?: number; }; export type ReposUpdatePullRequestReviewProtectionVariables = { body?: ReposUpdatePullRequestReviewProtectionRequestBody; pathParams: ReposUpdatePullRequestReviewProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. */ export const fetchReposUpdatePullRequestReviewProtection = ( variables: ReposUpdatePullRequestReviewProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranchPullRequestReview, ReposUpdatePullRequestReviewProtectionError, ReposUpdatePullRequestReviewProtectionRequestBody, {}, {}, ReposUpdatePullRequestReviewProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews', method: 'patch', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. */ export const useReposUpdatePullRequestReviewProtection = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProtectedBranchPullRequestReview, ReposUpdatePullRequestReviewProtectionError, ReposUpdatePullRequestReviewProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProtectedBranchPullRequestReview, ReposUpdatePullRequestReviewProtectionError, ReposUpdatePullRequestReviewProtectionVariables >( (variables: ReposUpdatePullRequestReviewProtectionVariables) => fetchReposUpdatePullRequestReviewProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposDeleteCommitSignatureProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposDeleteCommitSignatureProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposDeleteCommitSignatureProtectionVariables = { pathParams: ReposDeleteCommitSignatureProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. */ export const fetchReposDeleteCommitSignatureProtection = ( variables: ReposDeleteCommitSignatureProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteCommitSignatureProtectionError, undefined, {}, {}, ReposDeleteCommitSignatureProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. */ export const useReposDeleteCommitSignatureProtection = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteCommitSignatureProtectionError, ReposDeleteCommitSignatureProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteCommitSignatureProtectionError, ReposDeleteCommitSignatureProtectionVariables >( (variables: ReposDeleteCommitSignatureProtectionVariables) => fetchReposDeleteCommitSignatureProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetCommitSignatureProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetCommitSignatureProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetCommitSignatureProtectionVariables = { pathParams: ReposGetCommitSignatureProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. * * **Note**: You must enable branch protection to require signed commits. */ export const fetchReposGetCommitSignatureProtection = ( variables: ReposGetCommitSignatureProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranchAdminEnforced, ReposGetCommitSignatureProtectionError, undefined, {}, {}, ReposGetCommitSignatureProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. * * **Note**: You must enable branch protection to require signed commits. */ export const useReposGetCommitSignatureProtection = < TData = Schemas.ProtectedBranchAdminEnforced, >( variables: ReposGetCommitSignatureProtectionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ProtectedBranchAdminEnforced, ReposGetCommitSignatureProtectionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ProtectedBranchAdminEnforced, ReposGetCommitSignatureProtectionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures', operationId: 'reposGetCommitSignatureProtection', variables, }), ({ signal }) => fetchReposGetCommitSignatureProtection( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateCommitSignatureProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposCreateCommitSignatureProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposCreateCommitSignatureProtectionVariables = { pathParams: ReposCreateCommitSignatureProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. */ export const fetchReposCreateCommitSignatureProtection = ( variables: ReposCreateCommitSignatureProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ProtectedBranchAdminEnforced, ReposCreateCommitSignatureProtectionError, undefined, {}, {}, ReposCreateCommitSignatureProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. */ export const useReposCreateCommitSignatureProtection = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ProtectedBranchAdminEnforced, ReposCreateCommitSignatureProtectionError, ReposCreateCommitSignatureProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ProtectedBranchAdminEnforced, ReposCreateCommitSignatureProtectionError, ReposCreateCommitSignatureProtectionVariables >( (variables: ReposCreateCommitSignatureProtectionVariables) => fetchReposCreateCommitSignatureProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposRemoveStatusCheckProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRemoveStatusCheckProtectionError = Fetcher.ErrorWrapper; export type ReposRemoveStatusCheckProtectionVariables = { pathParams: ReposRemoveStatusCheckProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposRemoveStatusCheckProtection = ( variables: ReposRemoveStatusCheckProtectionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposRemoveStatusCheckProtectionError, undefined, {}, {}, ReposRemoveStatusCheckProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposRemoveStatusCheckProtection = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposRemoveStatusCheckProtectionError, ReposRemoveStatusCheckProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposRemoveStatusCheckProtectionError, ReposRemoveStatusCheckProtectionVariables >( (variables: ReposRemoveStatusCheckProtectionVariables) => fetchReposRemoveStatusCheckProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetStatusChecksProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetStatusChecksProtectionError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetStatusChecksProtectionVariables = { pathParams: ReposGetStatusChecksProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposGetStatusChecksProtection = ( variables: ReposGetStatusChecksProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.StatusCheckPolicy, ReposGetStatusChecksProtectionError, undefined, {}, {}, ReposGetStatusChecksProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposGetStatusChecksProtection = < TData = Schemas.StatusCheckPolicy, >( variables: ReposGetStatusChecksProtectionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.StatusCheckPolicy, ReposGetStatusChecksProtectionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.StatusCheckPolicy, ReposGetStatusChecksProtectionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks', operationId: 'reposGetStatusChecksProtection', variables, }), ({ signal }) => fetchReposGetStatusChecksProtection( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposUpdateStatusCheckProtectionPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposUpdateStatusCheckProtectionError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposUpdateStatusCheckProtectionRequestBody = { /** * The list of status checks to require in order to merge into this branch */ contexts?: string[]; /** * Require branches to be up to date before merging. */ strict?: boolean; }; export type ReposUpdateStatusCheckProtectionVariables = { body?: ReposUpdateStatusCheckProtectionRequestBody; pathParams: ReposUpdateStatusCheckProtectionPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. */ export const fetchReposUpdateStatusCheckProtection = ( variables: ReposUpdateStatusCheckProtectionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.StatusCheckPolicy, ReposUpdateStatusCheckProtectionError, ReposUpdateStatusCheckProtectionRequestBody, {}, {}, ReposUpdateStatusCheckProtectionPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks', method: 'patch', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. */ export const useReposUpdateStatusCheckProtection = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.StatusCheckPolicy, ReposUpdateStatusCheckProtectionError, ReposUpdateStatusCheckProtectionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.StatusCheckPolicy, ReposUpdateStatusCheckProtectionError, ReposUpdateStatusCheckProtectionVariables >( (variables: ReposUpdateStatusCheckProtectionVariables) => fetchReposUpdateStatusCheckProtection({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposRemoveStatusCheckContextsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRemoveStatusCheckContextsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposRemoveStatusCheckContextsResponse = string[]; export type ReposRemoveStatusCheckContextsRequestBody = { /** * contexts parameter */ contexts: string[]; }; export type ReposRemoveStatusCheckContextsVariables = { body: ReposRemoveStatusCheckContextsRequestBody; pathParams: ReposRemoveStatusCheckContextsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposRemoveStatusCheckContexts = ( variables: ReposRemoveStatusCheckContextsVariables, signal?: AbortSignal, ) => githubFetch< ReposRemoveStatusCheckContextsResponse, ReposRemoveStatusCheckContextsError, ReposRemoveStatusCheckContextsRequestBody, {}, {}, ReposRemoveStatusCheckContextsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposRemoveStatusCheckContexts = ( options?: Omit< reactQuery.UseMutationOptions< ReposRemoveStatusCheckContextsResponse, ReposRemoveStatusCheckContextsError, ReposRemoveStatusCheckContextsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposRemoveStatusCheckContextsResponse, ReposRemoveStatusCheckContextsError, ReposRemoveStatusCheckContextsVariables >( (variables: ReposRemoveStatusCheckContextsVariables) => fetchReposRemoveStatusCheckContexts({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetAllStatusCheckContextsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetAllStatusCheckContextsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetAllStatusCheckContextsResponse = string[]; export type ReposGetAllStatusCheckContextsVariables = { pathParams: ReposGetAllStatusCheckContextsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposGetAllStatusCheckContexts = ( variables: ReposGetAllStatusCheckContextsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetAllStatusCheckContextsResponse, ReposGetAllStatusCheckContextsError, undefined, {}, {}, ReposGetAllStatusCheckContextsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposGetAllStatusCheckContexts = < TData = ReposGetAllStatusCheckContextsResponse, >( variables: ReposGetAllStatusCheckContextsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetAllStatusCheckContextsResponse, ReposGetAllStatusCheckContextsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetAllStatusCheckContextsResponse, ReposGetAllStatusCheckContextsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts', operationId: 'reposGetAllStatusCheckContexts', variables, }), ({ signal }) => fetchReposGetAllStatusCheckContexts( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposAddStatusCheckContextsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposAddStatusCheckContextsError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposAddStatusCheckContextsResponse = string[]; export type ReposAddStatusCheckContextsRequestBody = { /** * contexts parameter */ contexts: string[]; }; export type ReposAddStatusCheckContextsVariables = { body: ReposAddStatusCheckContextsRequestBody; pathParams: ReposAddStatusCheckContextsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposAddStatusCheckContexts = ( variables: ReposAddStatusCheckContextsVariables, signal?: AbortSignal, ) => githubFetch< ReposAddStatusCheckContextsResponse, ReposAddStatusCheckContextsError, ReposAddStatusCheckContextsRequestBody, {}, {}, ReposAddStatusCheckContextsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposAddStatusCheckContexts = ( options?: Omit< reactQuery.UseMutationOptions< ReposAddStatusCheckContextsResponse, ReposAddStatusCheckContextsError, ReposAddStatusCheckContextsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposAddStatusCheckContextsResponse, ReposAddStatusCheckContextsError, ReposAddStatusCheckContextsVariables >( (variables: ReposAddStatusCheckContextsVariables) => fetchReposAddStatusCheckContexts({ ...fetcherOptions, ...variables }), options, ); }; export type ReposSetStatusCheckContextsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposSetStatusCheckContextsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposSetStatusCheckContextsResponse = string[]; export type ReposSetStatusCheckContextsRequestBody = { /** * contexts parameter */ contexts: string[]; }; export type ReposSetStatusCheckContextsVariables = { body: ReposSetStatusCheckContextsRequestBody; pathParams: ReposSetStatusCheckContextsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchReposSetStatusCheckContexts = ( variables: ReposSetStatusCheckContextsVariables, signal?: AbortSignal, ) => githubFetch< ReposSetStatusCheckContextsResponse, ReposSetStatusCheckContextsError, ReposSetStatusCheckContextsRequestBody, {}, {}, ReposSetStatusCheckContextsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts', method: 'put', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const useReposSetStatusCheckContexts = ( options?: Omit< reactQuery.UseMutationOptions< ReposSetStatusCheckContextsResponse, ReposSetStatusCheckContextsError, ReposSetStatusCheckContextsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposSetStatusCheckContextsResponse, ReposSetStatusCheckContextsError, ReposSetStatusCheckContextsVariables >( (variables: ReposSetStatusCheckContextsVariables) => fetchReposSetStatusCheckContexts({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposDeleteAccessRestrictionsError = Fetcher.ErrorWrapper; export type ReposDeleteAccessRestrictionsVariables = { pathParams: ReposDeleteAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Disables the ability to restrict who can push to this branch. */ export const fetchReposDeleteAccessRestrictions = ( variables: ReposDeleteAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteAccessRestrictionsError, undefined, {}, {}, ReposDeleteAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Disables the ability to restrict who can push to this branch. */ export const useReposDeleteAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteAccessRestrictionsError, ReposDeleteAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteAccessRestrictionsError, ReposDeleteAccessRestrictionsVariables >( (variables: ReposDeleteAccessRestrictionsVariables) => fetchReposDeleteAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetAccessRestrictionsVariables = { pathParams: ReposGetAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists who has access to this protected branch. * * **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. */ export const fetchReposGetAccessRestrictions = ( variables: ReposGetAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.BranchRestrictionPolicy, ReposGetAccessRestrictionsError, undefined, {}, {}, ReposGetAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists who has access to this protected branch. * * **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. */ export const useReposGetAccessRestrictions = < TData = Schemas.BranchRestrictionPolicy, >( variables: ReposGetAccessRestrictionsVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.BranchRestrictionPolicy, ReposGetAccessRestrictionsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.BranchRestrictionPolicy, ReposGetAccessRestrictionsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions', operationId: 'reposGetAccessRestrictions', variables, }), ({ signal }) => fetchReposGetAccessRestrictions( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposRemoveAppAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRemoveAppAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposRemoveAppAccessRestrictionsResponse = Schemas.Integration[]; export type ReposRemoveAppAccessRestrictionsRequestBody = { /** * apps parameter */ apps: string[]; }; export type ReposRemoveAppAccessRestrictionsVariables = { body: ReposRemoveAppAccessRestrictionsRequestBody; pathParams: ReposRemoveAppAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposRemoveAppAccessRestrictions = ( variables: ReposRemoveAppAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposRemoveAppAccessRestrictionsResponse, ReposRemoveAppAccessRestrictionsError, ReposRemoveAppAccessRestrictionsRequestBody, {}, {}, ReposRemoveAppAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposRemoveAppAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposRemoveAppAccessRestrictionsResponse, ReposRemoveAppAccessRestrictionsError, ReposRemoveAppAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposRemoveAppAccessRestrictionsResponse, ReposRemoveAppAccessRestrictionsError, ReposRemoveAppAccessRestrictionsVariables >( (variables: ReposRemoveAppAccessRestrictionsVariables) => fetchReposRemoveAppAccessRestrictions({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetAppsWithAccessToProtectedBranchPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetAppsWithAccessToProtectedBranchError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetAppsWithAccessToProtectedBranchResponse = Schemas.Integration[]; export type ReposGetAppsWithAccessToProtectedBranchVariables = { pathParams: ReposGetAppsWithAccessToProtectedBranchPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. */ export const fetchReposGetAppsWithAccessToProtectedBranch = ( variables: ReposGetAppsWithAccessToProtectedBranchVariables, signal?: AbortSignal, ) => githubFetch< ReposGetAppsWithAccessToProtectedBranchResponse, ReposGetAppsWithAccessToProtectedBranchError, undefined, {}, {}, ReposGetAppsWithAccessToProtectedBranchPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. */ export const useReposGetAppsWithAccessToProtectedBranch = < TData = ReposGetAppsWithAccessToProtectedBranchResponse, >( variables: ReposGetAppsWithAccessToProtectedBranchVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetAppsWithAccessToProtectedBranchResponse, ReposGetAppsWithAccessToProtectedBranchError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetAppsWithAccessToProtectedBranchResponse, ReposGetAppsWithAccessToProtectedBranchError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps', operationId: 'reposGetAppsWithAccessToProtectedBranch', variables, }), ({ signal }) => fetchReposGetAppsWithAccessToProtectedBranch( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposAddAppAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposAddAppAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposAddAppAccessRestrictionsResponse = Schemas.Integration[]; export type ReposAddAppAccessRestrictionsRequestBody = { /** * apps parameter */ apps: string[]; }; export type ReposAddAppAccessRestrictionsVariables = { body: ReposAddAppAccessRestrictionsRequestBody; pathParams: ReposAddAppAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposAddAppAccessRestrictions = ( variables: ReposAddAppAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposAddAppAccessRestrictionsResponse, ReposAddAppAccessRestrictionsError, ReposAddAppAccessRestrictionsRequestBody, {}, {}, ReposAddAppAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposAddAppAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposAddAppAccessRestrictionsResponse, ReposAddAppAccessRestrictionsError, ReposAddAppAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposAddAppAccessRestrictionsResponse, ReposAddAppAccessRestrictionsError, ReposAddAppAccessRestrictionsVariables >( (variables: ReposAddAppAccessRestrictionsVariables) => fetchReposAddAppAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposSetAppAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposSetAppAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposSetAppAccessRestrictionsResponse = Schemas.Integration[]; export type ReposSetAppAccessRestrictionsRequestBody = { /** * apps parameter */ apps: string[]; }; export type ReposSetAppAccessRestrictionsVariables = { body: ReposSetAppAccessRestrictionsRequestBody; pathParams: ReposSetAppAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposSetAppAccessRestrictions = ( variables: ReposSetAppAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposSetAppAccessRestrictionsResponse, ReposSetAppAccessRestrictionsError, ReposSetAppAccessRestrictionsRequestBody, {}, {}, ReposSetAppAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps', method: 'put', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * * | Type | Description | * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposSetAppAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposSetAppAccessRestrictionsResponse, ReposSetAppAccessRestrictionsError, ReposSetAppAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposSetAppAccessRestrictionsResponse, ReposSetAppAccessRestrictionsError, ReposSetAppAccessRestrictionsVariables >( (variables: ReposSetAppAccessRestrictionsVariables) => fetchReposSetAppAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposRemoveTeamAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRemoveTeamAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposRemoveTeamAccessRestrictionsResponse = Schemas.Team[]; export type ReposRemoveTeamAccessRestrictionsRequestBody = { /** * teams parameter */ teams: string[]; }; export type ReposRemoveTeamAccessRestrictionsVariables = { body: ReposRemoveTeamAccessRestrictionsRequestBody; pathParams: ReposRemoveTeamAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a team to push to this branch. You can also remove push access for child teams. * * | Type | Description | * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposRemoveTeamAccessRestrictions = ( variables: ReposRemoveTeamAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposRemoveTeamAccessRestrictionsResponse, ReposRemoveTeamAccessRestrictionsError, ReposRemoveTeamAccessRestrictionsRequestBody, {}, {}, ReposRemoveTeamAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a team to push to this branch. You can also remove push access for child teams. * * | Type | Description | * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposRemoveTeamAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposRemoveTeamAccessRestrictionsResponse, ReposRemoveTeamAccessRestrictionsError, ReposRemoveTeamAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposRemoveTeamAccessRestrictionsResponse, ReposRemoveTeamAccessRestrictionsError, ReposRemoveTeamAccessRestrictionsVariables >( (variables: ReposRemoveTeamAccessRestrictionsVariables) => fetchReposRemoveTeamAccessRestrictions({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetTeamsWithAccessToProtectedBranchPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetTeamsWithAccessToProtectedBranchError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetTeamsWithAccessToProtectedBranchResponse = Schemas.Team[]; export type ReposGetTeamsWithAccessToProtectedBranchVariables = { pathParams: ReposGetTeamsWithAccessToProtectedBranchPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the teams who have push access to this branch. The list includes child teams. */ export const fetchReposGetTeamsWithAccessToProtectedBranch = ( variables: ReposGetTeamsWithAccessToProtectedBranchVariables, signal?: AbortSignal, ) => githubFetch< ReposGetTeamsWithAccessToProtectedBranchResponse, ReposGetTeamsWithAccessToProtectedBranchError, undefined, {}, {}, ReposGetTeamsWithAccessToProtectedBranchPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the teams who have push access to this branch. The list includes child teams. */ export const useReposGetTeamsWithAccessToProtectedBranch = < TData = ReposGetTeamsWithAccessToProtectedBranchResponse, >( variables: ReposGetTeamsWithAccessToProtectedBranchVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetTeamsWithAccessToProtectedBranchResponse, ReposGetTeamsWithAccessToProtectedBranchError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetTeamsWithAccessToProtectedBranchResponse, ReposGetTeamsWithAccessToProtectedBranchError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams', operationId: 'reposGetTeamsWithAccessToProtectedBranch', variables, }), ({ signal }) => fetchReposGetTeamsWithAccessToProtectedBranch( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposAddTeamAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposAddTeamAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposAddTeamAccessRestrictionsResponse = Schemas.Team[]; export type ReposAddTeamAccessRestrictionsRequestBody = { /** * teams parameter */ teams: string[]; }; export type ReposAddTeamAccessRestrictionsVariables = { body: ReposAddTeamAccessRestrictionsRequestBody; pathParams: ReposAddTeamAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified teams push access for this branch. You can also give push access to child teams. * * | Type | Description | * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposAddTeamAccessRestrictions = ( variables: ReposAddTeamAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposAddTeamAccessRestrictionsResponse, ReposAddTeamAccessRestrictionsError, ReposAddTeamAccessRestrictionsRequestBody, {}, {}, ReposAddTeamAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified teams push access for this branch. You can also give push access to child teams. * * | Type | Description | * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposAddTeamAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposAddTeamAccessRestrictionsResponse, ReposAddTeamAccessRestrictionsError, ReposAddTeamAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposAddTeamAccessRestrictionsResponse, ReposAddTeamAccessRestrictionsError, ReposAddTeamAccessRestrictionsVariables >( (variables: ReposAddTeamAccessRestrictionsVariables) => fetchReposAddTeamAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposSetTeamAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposSetTeamAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposSetTeamAccessRestrictionsResponse = Schemas.Team[]; export type ReposSetTeamAccessRestrictionsRequestBody = { /** * teams parameter */ teams: string[]; }; export type ReposSetTeamAccessRestrictionsVariables = { body: ReposSetTeamAccessRestrictionsRequestBody; pathParams: ReposSetTeamAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. * * | Type | Description | * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposSetTeamAccessRestrictions = ( variables: ReposSetTeamAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposSetTeamAccessRestrictionsResponse, ReposSetTeamAccessRestrictionsError, ReposSetTeamAccessRestrictionsRequestBody, {}, {}, ReposSetTeamAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams', method: 'put', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. * * | Type | Description | * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposSetTeamAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposSetTeamAccessRestrictionsResponse, ReposSetTeamAccessRestrictionsError, ReposSetTeamAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposSetTeamAccessRestrictionsResponse, ReposSetTeamAccessRestrictionsError, ReposSetTeamAccessRestrictionsVariables >( (variables: ReposSetTeamAccessRestrictionsVariables) => fetchReposSetTeamAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposRemoveUserAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRemoveUserAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposRemoveUserAccessRestrictionsResponse = Schemas.SimpleUser[]; export type ReposRemoveUserAccessRestrictionsRequestBody = { /** * users parameter */ users: string[]; }; export type ReposRemoveUserAccessRestrictionsVariables = { body: ReposRemoveUserAccessRestrictionsRequestBody; pathParams: ReposRemoveUserAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a user to push to this branch. * * | Type | Description | * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposRemoveUserAccessRestrictions = ( variables: ReposRemoveUserAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposRemoveUserAccessRestrictionsResponse, ReposRemoveUserAccessRestrictionsError, ReposRemoveUserAccessRestrictionsRequestBody, {}, {}, ReposRemoveUserAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users', method: 'delete', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a user to push to this branch. * * | Type | Description | * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposRemoveUserAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposRemoveUserAccessRestrictionsResponse, ReposRemoveUserAccessRestrictionsError, ReposRemoveUserAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposRemoveUserAccessRestrictionsResponse, ReposRemoveUserAccessRestrictionsError, ReposRemoveUserAccessRestrictionsVariables >( (variables: ReposRemoveUserAccessRestrictionsVariables) => fetchReposRemoveUserAccessRestrictions({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposGetUsersWithAccessToProtectedBranchPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposGetUsersWithAccessToProtectedBranchError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetUsersWithAccessToProtectedBranchResponse = Schemas.SimpleUser[]; export type ReposGetUsersWithAccessToProtectedBranchVariables = { pathParams: ReposGetUsersWithAccessToProtectedBranchPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the people who have push access to this branch. */ export const fetchReposGetUsersWithAccessToProtectedBranch = ( variables: ReposGetUsersWithAccessToProtectedBranchVariables, signal?: AbortSignal, ) => githubFetch< ReposGetUsersWithAccessToProtectedBranchResponse, ReposGetUsersWithAccessToProtectedBranchError, undefined, {}, {}, ReposGetUsersWithAccessToProtectedBranchPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the people who have push access to this branch. */ export const useReposGetUsersWithAccessToProtectedBranch = < TData = ReposGetUsersWithAccessToProtectedBranchResponse, >( variables: ReposGetUsersWithAccessToProtectedBranchVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetUsersWithAccessToProtectedBranchResponse, ReposGetUsersWithAccessToProtectedBranchError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetUsersWithAccessToProtectedBranchResponse, ReposGetUsersWithAccessToProtectedBranchError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users', operationId: 'reposGetUsersWithAccessToProtectedBranch', variables, }), ({ signal }) => fetchReposGetUsersWithAccessToProtectedBranch( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposAddUserAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposAddUserAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposAddUserAccessRestrictionsResponse = Schemas.SimpleUser[]; export type ReposAddUserAccessRestrictionsRequestBody = { /** * users parameter */ users: string[]; }; export type ReposAddUserAccessRestrictionsVariables = { body: ReposAddUserAccessRestrictionsRequestBody; pathParams: ReposAddUserAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified people push access for this branch. * * | Type | Description | * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposAddUserAccessRestrictions = ( variables: ReposAddUserAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposAddUserAccessRestrictionsResponse, ReposAddUserAccessRestrictionsError, ReposAddUserAccessRestrictionsRequestBody, {}, {}, ReposAddUserAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users', method: 'post', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified people push access for this branch. * * | Type | Description | * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposAddUserAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposAddUserAccessRestrictionsResponse, ReposAddUserAccessRestrictionsError, ReposAddUserAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposAddUserAccessRestrictionsResponse, ReposAddUserAccessRestrictionsError, ReposAddUserAccessRestrictionsVariables >( (variables: ReposAddUserAccessRestrictionsVariables) => fetchReposAddUserAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposSetUserAccessRestrictionsPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposSetUserAccessRestrictionsError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposSetUserAccessRestrictionsResponse = Schemas.SimpleUser[]; export type ReposSetUserAccessRestrictionsRequestBody = { /** * users parameter */ users: string[]; }; export type ReposSetUserAccessRestrictionsVariables = { body: ReposSetUserAccessRestrictionsRequestBody; pathParams: ReposSetUserAccessRestrictionsPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. * * | Type | Description | * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const fetchReposSetUserAccessRestrictions = ( variables: ReposSetUserAccessRestrictionsVariables, signal?: AbortSignal, ) => githubFetch< ReposSetUserAccessRestrictionsResponse, ReposSetUserAccessRestrictionsError, ReposSetUserAccessRestrictionsRequestBody, {}, {}, ReposSetUserAccessRestrictionsPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users', method: 'put', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. * * | Type | Description | * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | */ export const useReposSetUserAccessRestrictions = ( options?: Omit< reactQuery.UseMutationOptions< ReposSetUserAccessRestrictionsResponse, ReposSetUserAccessRestrictionsError, ReposSetUserAccessRestrictionsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< ReposSetUserAccessRestrictionsResponse, ReposSetUserAccessRestrictionsError, ReposSetUserAccessRestrictionsVariables >( (variables: ReposSetUserAccessRestrictionsVariables) => fetchReposSetUserAccessRestrictions({ ...fetcherOptions, ...variables }), options, ); }; export type ReposRenameBranchPathParams = { owner: string; repo: string; /** * The name of the branch. */ branch: string; }; export type ReposRenameBranchError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposRenameBranchRequestBody = { /** * The new name of the branch. */ new_name: string; }; export type ReposRenameBranchVariables = { body: ReposRenameBranchRequestBody; pathParams: ReposRenameBranchPathParams; } & GithubContext['fetcherOptions']; /** * Renames a branch in a repository. * * **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". * * The permissions required to use this endpoint depends on whether you are renaming the default branch. * * To rename a non-default branch: * * * Users must have push access. * * GitHub Apps must have the `contents:write` repository permission. * * To rename the default branch: * * * Users must have admin or owner permissions. * * GitHub Apps must have the `administration:write` repository permission. */ export const fetchReposRenameBranch = ( variables: ReposRenameBranchVariables, signal?: AbortSignal, ) => githubFetch< Schemas.BranchWithProtection, ReposRenameBranchError, ReposRenameBranchRequestBody, {}, {}, ReposRenameBranchPathParams >({ url: '/repos/{owner}/{repo}/branches/{branch}/rename', method: 'post', ...variables, signal, }); /** * Renames a branch in a repository. * * **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". * * The permissions required to use this endpoint depends on whether you are renaming the default branch. * * To rename a non-default branch: * * * Users must have push access. * * GitHub Apps must have the `contents:write` repository permission. * * To rename the default branch: * * * Users must have admin or owner permissions. * * GitHub Apps must have the `administration:write` repository permission. */ export const useReposRenameBranch = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.BranchWithProtection, ReposRenameBranchError, ReposRenameBranchVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.BranchWithProtection, ReposRenameBranchError, ReposRenameBranchVariables >( (variables: ReposRenameBranchVariables) => fetchReposRenameBranch({ ...fetcherOptions, ...variables }), options, ); }; export type ChecksCreatePathParams = { owner: string; repo: string; }; export type ChecksCreateError = Fetcher.ErrorWrapper; export type ChecksCreateVariables = { body: | ({ status: 'completed'; } & { [key: string]: any; }) | ({ status?: 'queued' | 'in_progress'; } & { [key: string]: any; }); pathParams: ChecksCreatePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. * * In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. */ export const fetchChecksCreate = ( variables: ChecksCreateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckRun, ChecksCreateError, | ({ status: 'completed'; } & { [key: string]: any; }) | ({ status?: 'queued' | 'in_progress'; } & { [key: string]: any; }), {}, {}, ChecksCreatePathParams >({ url: '/repos/{owner}/{repo}/check-runs', method: 'post', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. * * In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. */ export const useChecksCreate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CheckRun, ChecksCreateError, ChecksCreateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CheckRun, ChecksCreateError, ChecksCreateVariables >( (variables: ChecksCreateVariables) => fetchChecksCreate({ ...fetcherOptions, ...variables }), options, ); }; export type ChecksGetPathParams = { owner: string; repo: string; /** * check_run_id parameter */ checkRunId: number; }; export type ChecksGetError = Fetcher.ErrorWrapper; export type ChecksGetVariables = { pathParams: ChecksGetPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Gets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const fetchChecksGet = ( variables: ChecksGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckRun, ChecksGetError, undefined, {}, {}, ChecksGetPathParams >({ url: '/repos/{owner}/{repo}/check-runs/{checkRunId}', method: 'get', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Gets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const useChecksGet = ( variables: ChecksGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/check-runs/{check_run_id}', operationId: 'checksGet', variables, }), ({ signal }) => fetchChecksGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksUpdatePathParams = { owner: string; repo: string; /** * check_run_id parameter */ checkRunId: number; }; export type ChecksUpdateError = Fetcher.ErrorWrapper; export type ChecksUpdateVariables = { body?: | ({ status?: 'completed'; } & { [key: string]: any; }) | ({ status?: 'queued' | 'in_progress'; } & { [key: string]: any; }); pathParams: ChecksUpdatePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs. */ export const fetchChecksUpdate = ( variables: ChecksUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckRun, ChecksUpdateError, | ({ status?: 'completed'; } & { [key: string]: any; }) | ({ status?: 'queued' | 'in_progress'; } & { [key: string]: any; }), {}, {}, ChecksUpdatePathParams >({ url: '/repos/{owner}/{repo}/check-runs/{checkRunId}', method: 'patch', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs. */ export const useChecksUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CheckRun, ChecksUpdateError, ChecksUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CheckRun, ChecksUpdateError, ChecksUpdateVariables >( (variables: ChecksUpdateVariables) => fetchChecksUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type ChecksListAnnotationsPathParams = { owner: string; repo: string; /** * check_run_id parameter */ checkRunId: number; }; export type ChecksListAnnotationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ChecksListAnnotationsError = Fetcher.ErrorWrapper; export type ChecksListAnnotationsResponse = Schemas.CheckAnnotation[]; export type ChecksListAnnotationsVariables = { pathParams: ChecksListAnnotationsPathParams; queryParams?: ChecksListAnnotationsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository. */ export const fetchChecksListAnnotations = ( variables: ChecksListAnnotationsVariables, signal?: AbortSignal, ) => githubFetch< ChecksListAnnotationsResponse, ChecksListAnnotationsError, undefined, {}, ChecksListAnnotationsQueryParams, ChecksListAnnotationsPathParams >({ url: '/repos/{owner}/{repo}/check-runs/{checkRunId}/annotations', method: 'get', ...variables, signal, }); /** * Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository. */ export const useChecksListAnnotations = ( variables: ChecksListAnnotationsVariables, options?: Omit< reactQuery.UseQueryOptions< ChecksListAnnotationsResponse, ChecksListAnnotationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ChecksListAnnotationsResponse, ChecksListAnnotationsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations', operationId: 'checksListAnnotations', variables, }), ({ signal }) => fetchChecksListAnnotations({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksCreateSuitePathParams = { owner: string; repo: string; }; export type ChecksCreateSuiteError = Fetcher.ErrorWrapper; export type ChecksCreateSuiteRequestBody = { /** * The sha of the head commit. */ head_sha: string; }; export type ChecksCreateSuiteVariables = { body: ChecksCreateSuiteRequestBody; pathParams: ChecksCreateSuitePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. */ export const fetchChecksCreateSuite = ( variables: ChecksCreateSuiteVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckSuite, ChecksCreateSuiteError, ChecksCreateSuiteRequestBody, {}, {}, ChecksCreateSuitePathParams >({ url: '/repos/{owner}/{repo}/check-suites', method: 'post', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. */ export const useChecksCreateSuite = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CheckSuite, ChecksCreateSuiteError, ChecksCreateSuiteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CheckSuite, ChecksCreateSuiteError, ChecksCreateSuiteVariables >( (variables: ChecksCreateSuiteVariables) => fetchChecksCreateSuite({ ...fetcherOptions, ...variables }), options, ); }; export type ChecksSetSuitesPreferencesPathParams = { owner: string; repo: string; }; export type ChecksSetSuitesPreferencesError = Fetcher.ErrorWrapper; export type ChecksSetSuitesPreferencesRequestBody = { /** * Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [`auto_trigger_checks` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ auto_trigger_checks?: { /** * The `id` of the GitHub App. */ app_id: number; /** * Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. * * @default true */ setting: boolean; }[]; }; export type ChecksSetSuitesPreferencesVariables = { body?: ChecksSetSuitesPreferencesRequestBody; pathParams: ChecksSetSuitesPreferencesPathParams; } & GithubContext['fetcherOptions']; /** * Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. */ export const fetchChecksSetSuitesPreferences = ( variables: ChecksSetSuitesPreferencesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckSuitePreference, ChecksSetSuitesPreferencesError, ChecksSetSuitesPreferencesRequestBody, {}, {}, ChecksSetSuitesPreferencesPathParams >({ url: '/repos/{owner}/{repo}/check-suites/preferences', method: 'patch', ...variables, signal, }); /** * Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. */ export const useChecksSetSuitesPreferences = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CheckSuitePreference, ChecksSetSuitesPreferencesError, ChecksSetSuitesPreferencesVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CheckSuitePreference, ChecksSetSuitesPreferencesError, ChecksSetSuitesPreferencesVariables >( (variables: ChecksSetSuitesPreferencesVariables) => fetchChecksSetSuitesPreferences({ ...fetcherOptions, ...variables }), options, ); }; export type ChecksGetSuitePathParams = { owner: string; repo: string; /** * check_suite_id parameter */ checkSuiteId: number; }; export type ChecksGetSuiteError = Fetcher.ErrorWrapper; export type ChecksGetSuiteVariables = { pathParams: ChecksGetSuitePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * Gets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. */ export const fetchChecksGetSuite = ( variables: ChecksGetSuiteVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CheckSuite, ChecksGetSuiteError, undefined, {}, {}, ChecksGetSuitePathParams >({ url: '/repos/{owner}/{repo}/check-suites/{checkSuiteId}', method: 'get', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * Gets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. */ export const useChecksGetSuite = ( variables: ChecksGetSuiteVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/check-suites/{check_suite_id}', operationId: 'checksGetSuite', variables, }), ({ signal }) => fetchChecksGetSuite({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksListForSuitePathParams = { owner: string; repo: string; /** * check_suite_id parameter */ checkSuiteId: number; }; export type ChecksListForSuiteQueryParams = { /** * Returns check runs with the specified `name`. */ check_name?: string; /** * Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. */ status?: 'queued' | 'in_progress' | 'completed'; /** * Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. * * @default latest */ filter?: 'latest' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ChecksListForSuiteError = Fetcher.ErrorWrapper; export type ChecksListForSuiteResponse = { check_runs: Schemas.CheckRun[]; total_count: number; }; export type ChecksListForSuiteVariables = { pathParams: ChecksListForSuitePathParams; queryParams?: ChecksListForSuiteQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Lists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const fetchChecksListForSuite = ( variables: ChecksListForSuiteVariables, signal?: AbortSignal, ) => githubFetch< ChecksListForSuiteResponse, ChecksListForSuiteError, undefined, {}, ChecksListForSuiteQueryParams, ChecksListForSuitePathParams >({ url: '/repos/{owner}/{repo}/check-suites/{checkSuiteId}/check-runs', method: 'get', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Lists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const useChecksListForSuite = ( variables: ChecksListForSuiteVariables, options?: Omit< reactQuery.UseQueryOptions< ChecksListForSuiteResponse, ChecksListForSuiteError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ChecksListForSuiteResponse, ChecksListForSuiteError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs', operationId: 'checksListForSuite', variables, }), ({ signal }) => fetchChecksListForSuite({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksRerequestSuitePathParams = { owner: string; repo: string; /** * check_suite_id parameter */ checkSuiteId: number; }; export type ChecksRerequestSuiteError = Fetcher.ErrorWrapper; export type ChecksRerequestSuiteVariables = { pathParams: ChecksRerequestSuitePathParams; } & GithubContext['fetcherOptions']; /** * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. * * To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. */ export const fetchChecksRerequestSuite = ( variables: ChecksRerequestSuiteVariables, signal?: AbortSignal, ) => githubFetch< undefined, ChecksRerequestSuiteError, undefined, {}, {}, ChecksRerequestSuitePathParams >({ url: '/repos/{owner}/{repo}/check-suites/{checkSuiteId}/rerequest', method: 'post', ...variables, signal, }); /** * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. * * To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. */ export const useChecksRerequestSuite = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ChecksRerequestSuiteError, ChecksRerequestSuiteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ChecksRerequestSuiteError, ChecksRerequestSuiteVariables >( (variables: ChecksRerequestSuiteVariables) => fetchChecksRerequestSuite({ ...fetcherOptions, ...variables }), options, ); }; export type CodeScanningListAlertsForRepoPathParams = { owner: string; repo: string; }; export type CodeScanningListAlertsForRepoQueryParams = { /** * The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ tool_name?: Schemas.CodeScanningAnalysisToolName; /** * The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ tool_guid?: Schemas.CodeScanningAnalysisToolGuid; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: Schemas.CodeScanningRef; /** * Set to `open`, `fixed`, or `dismissed` to list code scanning alerts in a specific state. */ state?: Schemas.CodeScanningAlertState; }; export type CodeScanningListAlertsForRepoError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningListAlertsForRepoResponse = Schemas.CodeScanningAlertItems[]; export type CodeScanningListAlertsForRepoVariables = { pathParams: CodeScanningListAlertsForRepoPathParams; queryParams?: CodeScanningListAlertsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all open code scanning alerts for the default branch (usually `main` * or `master`). You must use an access token with the `security_events` scope to use * this endpoint. GitHub Apps must have the `security_events` read permission to use * this endpoint. * * The response includes a `most_recent_instance` object. * This provides details of the most recent instance of this alert * for the default branch or for the specified Git reference * (if you used `ref` in the request). */ export const fetchCodeScanningListAlertsForRepo = ( variables: CodeScanningListAlertsForRepoVariables, signal?: AbortSignal, ) => githubFetch< CodeScanningListAlertsForRepoResponse, CodeScanningListAlertsForRepoError, undefined, {}, CodeScanningListAlertsForRepoQueryParams, CodeScanningListAlertsForRepoPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/alerts', method: 'get', ...variables, signal, }); /** * Lists all open code scanning alerts for the default branch (usually `main` * or `master`). You must use an access token with the `security_events` scope to use * this endpoint. GitHub Apps must have the `security_events` read permission to use * this endpoint. * * The response includes a `most_recent_instance` object. * This provides details of the most recent instance of this alert * for the default branch or for the specified Git reference * (if you used `ref` in the request). */ export const useCodeScanningListAlertsForRepo = < TData = CodeScanningListAlertsForRepoResponse, >( variables: CodeScanningListAlertsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< CodeScanningListAlertsForRepoResponse, CodeScanningListAlertsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< CodeScanningListAlertsForRepoResponse, CodeScanningListAlertsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/alerts', operationId: 'codeScanningListAlertsForRepo', variables, }), ({ signal }) => fetchCodeScanningListAlertsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type CodeScanningGetAlertPathParams = { owner: string; repo: string; /** * The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alertNumber: Schemas.AlertNumber; }; export type CodeScanningGetAlertError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningGetAlertVariables = { pathParams: CodeScanningGetAlertPathParams; } & GithubContext['fetcherOptions']; /** * Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. * * **Deprecation notice**: * The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`. */ export const fetchCodeScanningGetAlert = ( variables: CodeScanningGetAlertVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningAlert, CodeScanningGetAlertError, undefined, {}, {}, CodeScanningGetAlertPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/alerts/{alertNumber}', method: 'get', ...variables, signal, }); /** * Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. * * **Deprecation notice**: * The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`. */ export const useCodeScanningGetAlert = ( variables: CodeScanningGetAlertVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CodeScanningAlert, CodeScanningGetAlertError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CodeScanningAlert, CodeScanningGetAlertError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}', operationId: 'codeScanningGetAlert', variables, }), ({ signal }) => fetchCodeScanningGetAlert({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type CodeScanningUpdateAlertPathParams = { owner: string; repo: string; /** * The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alertNumber: Schemas.AlertNumber; }; export type CodeScanningUpdateAlertError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenWrite; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningUpdateAlertRequestBody = { dismissed_reason?: Schemas.CodeScanningAlertDismissedReason; state: Schemas.CodeScanningAlertSetState; }; export type CodeScanningUpdateAlertVariables = { body: CodeScanningUpdateAlertRequestBody; pathParams: CodeScanningUpdateAlertPathParams; } & GithubContext['fetcherOptions']; /** * Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ export const fetchCodeScanningUpdateAlert = ( variables: CodeScanningUpdateAlertVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningAlert, CodeScanningUpdateAlertError, CodeScanningUpdateAlertRequestBody, {}, {}, CodeScanningUpdateAlertPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/alerts/{alertNumber}', method: 'patch', ...variables, signal, }); /** * Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ export const useCodeScanningUpdateAlert = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CodeScanningAlert, CodeScanningUpdateAlertError, CodeScanningUpdateAlertVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CodeScanningAlert, CodeScanningUpdateAlertError, CodeScanningUpdateAlertVariables >( (variables: CodeScanningUpdateAlertVariables) => fetchCodeScanningUpdateAlert({ ...fetcherOptions, ...variables }), options, ); }; export type CodeScanningListAlertsInstancesPathParams = { owner: string; repo: string; /** * The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alertNumber: Schemas.AlertNumber; }; export type CodeScanningListAlertsInstancesQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: Schemas.CodeScanningRef; }; export type CodeScanningListAlertsInstancesError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningListAlertsInstancesResponse = Schemas.CodeScanningAlertInstance[]; export type CodeScanningListAlertsInstancesVariables = { pathParams: CodeScanningListAlertsInstancesPathParams; queryParams?: CodeScanningListAlertsInstancesQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ export const fetchCodeScanningListAlertsInstances = ( variables: CodeScanningListAlertsInstancesVariables, signal?: AbortSignal, ) => githubFetch< CodeScanningListAlertsInstancesResponse, CodeScanningListAlertsInstancesError, undefined, {}, CodeScanningListAlertsInstancesQueryParams, CodeScanningListAlertsInstancesPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/alerts/{alertNumber}/instances', method: 'get', ...variables, signal, }); /** * Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ export const useCodeScanningListAlertsInstances = < TData = CodeScanningListAlertsInstancesResponse, >( variables: CodeScanningListAlertsInstancesVariables, options?: Omit< reactQuery.UseQueryOptions< CodeScanningListAlertsInstancesResponse, CodeScanningListAlertsInstancesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< CodeScanningListAlertsInstancesResponse, CodeScanningListAlertsInstancesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances', operationId: 'codeScanningListAlertsInstances', variables, }), ({ signal }) => fetchCodeScanningListAlertsInstances( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type CodeScanningListRecentAnalysesPathParams = { owner: string; repo: string; }; export type CodeScanningListRecentAnalysesQueryParams = { /** * The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ tool_name?: Schemas.CodeScanningAnalysisToolName; /** * The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ tool_guid?: Schemas.CodeScanningAnalysisToolGuid; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: Schemas.CodeScanningRef; /** * Filter analyses belonging to the same SARIF upload. */ sarif_id?: Schemas.CodeScanningAnalysisSarifId; }; export type CodeScanningListRecentAnalysesError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningListRecentAnalysesResponse = Schemas.CodeScanningAnalysis[]; export type CodeScanningListRecentAnalysesVariables = { pathParams: CodeScanningListRecentAnalysesPathParams; queryParams?: CodeScanningListRecentAnalysesQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the details of all code scanning analyses for a repository, * starting with the most recent. * The response is paginated and you can use the `page` and `per_page` parameters * to list the analyses you're interested in. * By default 30 analyses are listed per page. * * The `rules_count` field in the response give the number of rules * that were run in the analysis. * For very old analyses this data is not available, * and `0` is returned in this field. * * You must use an access token with the `security_events` scope to use this endpoint. * GitHub Apps must have the `security_events` read permission to use this endpoint. * * **Deprecation notice**: * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. */ export const fetchCodeScanningListRecentAnalyses = ( variables: CodeScanningListRecentAnalysesVariables, signal?: AbortSignal, ) => githubFetch< CodeScanningListRecentAnalysesResponse, CodeScanningListRecentAnalysesError, undefined, {}, CodeScanningListRecentAnalysesQueryParams, CodeScanningListRecentAnalysesPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/analyses', method: 'get', ...variables, signal, }); /** * Lists the details of all code scanning analyses for a repository, * starting with the most recent. * The response is paginated and you can use the `page` and `per_page` parameters * to list the analyses you're interested in. * By default 30 analyses are listed per page. * * The `rules_count` field in the response give the number of rules * that were run in the analysis. * For very old analyses this data is not available, * and `0` is returned in this field. * * You must use an access token with the `security_events` scope to use this endpoint. * GitHub Apps must have the `security_events` read permission to use this endpoint. * * **Deprecation notice**: * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. */ export const useCodeScanningListRecentAnalyses = < TData = CodeScanningListRecentAnalysesResponse, >( variables: CodeScanningListRecentAnalysesVariables, options?: Omit< reactQuery.UseQueryOptions< CodeScanningListRecentAnalysesResponse, CodeScanningListRecentAnalysesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< CodeScanningListRecentAnalysesResponse, CodeScanningListRecentAnalysesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/analyses', operationId: 'codeScanningListRecentAnalyses', variables, }), ({ signal }) => fetchCodeScanningListRecentAnalyses( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type CodeScanningDeleteAnalysisPathParams = { owner: string; repo: string; /** * The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ analysisId: number; }; export type CodeScanningDeleteAnalysisQueryParams = { /** * Allow deletion if the specified analysis is the last in a set. The parameter can be used without a value as the parameter value is not considered. If you attempt to delete the final analysis in a set without using this parameter you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.` */ confirm_delete?: string | null; }; export type CodeScanningDeleteAnalysisError = Fetcher.ErrorWrapper< | { status: 400; payload: Responses.BadRequest; } | { status: 403; payload: Responses.CodeScanningForbiddenWrite; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningDeleteAnalysisVariables = { pathParams: CodeScanningDeleteAnalysisPathParams; queryParams?: CodeScanningDeleteAnalysisQueryParams; } & GithubContext['fetcherOptions']; /** * Deletes a specified code scanning analysis from a repository. For * private repositories, you must use an access token with the `repo` scope. For public repositories, * you must use an access token with `public_repo` and `repo:security_events` scopes. * GitHub Apps must have the `security_events` write permission to use this endpoint. * * You can delete one analysis at a time. * To delete a series of analyses, start with the most recent analysis and work backwards. * Conceptually, the process is similar to the undo function in a text editor. * * When you list the analyses for a repository, * one or more will be identified as deletable in the response: * * ``` * "deletable": true * ``` * * An analysis is deletable when it's the most recent in a set of analyses. * Typically, a repository will have multiple sets of analyses * for each enabled code scanning tool, * where a set is determined by a unique combination of analysis values: * * * `ref` * * `tool` * * `analysis_key` * * `environment` * * If you attempt to delete an analysis that is not the most recent in a set, * you'll get a 400 response with the message: * * ``` * Analysis specified is not deletable. * ``` * * The response from a successful `DELETE` operation provides you with * two alternative URLs for deleting the next analysis in the set * (see the example default response below). * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis * in the set. This is a useful option if you want to preserve at least one analysis * for the specified tool in your repository. * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. * When you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url` * in the 200 response is `null`. * * As an example of the deletion process, * let's imagine that you added a workflow that configured a particular code scanning tool * to analyze the code in a repository. This tool has added 15 analyses: * 10 on the default branch, and another 5 on a topic branch. * You therefore have two separate sets of analyses for this tool. * You've now decided that you want to remove all of the analyses for the tool. * To do this you must make 15 separate deletion requests. * To start, you must find the deletable analysis for one of the sets, * step through deleting the analyses in that set, * and then repeat the process for the second set. * The procedure therefore consists of a nested loop: * * **Outer loop**: * * List the analyses for the repository, filtered by tool. * * Parse this list to find a deletable analysis. If found: * * **Inner loop**: * * Delete the identified analysis. * * Parse the response for the value of `next_analysis_url` and, if found, use this in the next iteration. * * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `next_analysis_url` value. Alternatively, you could use the `confirm_delete_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. */ export const fetchCodeScanningDeleteAnalysis = ( variables: CodeScanningDeleteAnalysisVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningAnalysisDeletion, CodeScanningDeleteAnalysisError, undefined, {}, CodeScanningDeleteAnalysisQueryParams, CodeScanningDeleteAnalysisPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/analyses/{analysisId}', method: 'delete', ...variables, signal, }); /** * Deletes a specified code scanning analysis from a repository. For * private repositories, you must use an access token with the `repo` scope. For public repositories, * you must use an access token with `public_repo` and `repo:security_events` scopes. * GitHub Apps must have the `security_events` write permission to use this endpoint. * * You can delete one analysis at a time. * To delete a series of analyses, start with the most recent analysis and work backwards. * Conceptually, the process is similar to the undo function in a text editor. * * When you list the analyses for a repository, * one or more will be identified as deletable in the response: * * ``` * "deletable": true * ``` * * An analysis is deletable when it's the most recent in a set of analyses. * Typically, a repository will have multiple sets of analyses * for each enabled code scanning tool, * where a set is determined by a unique combination of analysis values: * * * `ref` * * `tool` * * `analysis_key` * * `environment` * * If you attempt to delete an analysis that is not the most recent in a set, * you'll get a 400 response with the message: * * ``` * Analysis specified is not deletable. * ``` * * The response from a successful `DELETE` operation provides you with * two alternative URLs for deleting the next analysis in the set * (see the example default response below). * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis * in the set. This is a useful option if you want to preserve at least one analysis * for the specified tool in your repository. * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. * When you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url` * in the 200 response is `null`. * * As an example of the deletion process, * let's imagine that you added a workflow that configured a particular code scanning tool * to analyze the code in a repository. This tool has added 15 analyses: * 10 on the default branch, and another 5 on a topic branch. * You therefore have two separate sets of analyses for this tool. * You've now decided that you want to remove all of the analyses for the tool. * To do this you must make 15 separate deletion requests. * To start, you must find the deletable analysis for one of the sets, * step through deleting the analyses in that set, * and then repeat the process for the second set. * The procedure therefore consists of a nested loop: * * **Outer loop**: * * List the analyses for the repository, filtered by tool. * * Parse this list to find a deletable analysis. If found: * * **Inner loop**: * * Delete the identified analysis. * * Parse the response for the value of `next_analysis_url` and, if found, use this in the next iteration. * * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `next_analysis_url` value. Alternatively, you could use the `confirm_delete_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. */ export const useCodeScanningDeleteAnalysis = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CodeScanningAnalysisDeletion, CodeScanningDeleteAnalysisError, CodeScanningDeleteAnalysisVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CodeScanningAnalysisDeletion, CodeScanningDeleteAnalysisError, CodeScanningDeleteAnalysisVariables >( (variables: CodeScanningDeleteAnalysisVariables) => fetchCodeScanningDeleteAnalysis({ ...fetcherOptions, ...variables }), options, ); }; export type CodeScanningGetAnalysisPathParams = { owner: string; repo: string; /** * The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ analysisId: number; }; export type CodeScanningGetAnalysisError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningGetAnalysisVariables = { pathParams: CodeScanningGetAnalysisPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specified code scanning analysis for a repository. * You must use an access token with the `security_events` scope to use this endpoint. * GitHub Apps must have the `security_events` read permission to use this endpoint. * * The default JSON response contains fields that describe the analysis. * This includes the Git reference and commit SHA to which the analysis relates, * the datetime of the analysis, the name of the code scanning tool, * and the number of alerts. * * The `rules_count` field in the default response give the number of rules * that were run in the analysis. * For very old analyses this data is not available, * and `0` is returned in this field. * * If you use the Accept header `application/sarif+json`, * the response contains the analysis data that was uploaded. * This is formatted as * [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). * For an example response, see "[Custom media type for code scanning](#custom-media-type-for-code-scanning)." * * **Deprecation notice**: * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. */ export const fetchCodeScanningGetAnalysis = ( variables: CodeScanningGetAnalysisVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningAnalysis, CodeScanningGetAnalysisError, undefined, {}, {}, CodeScanningGetAnalysisPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/analyses/{analysisId}', method: 'get', ...variables, signal, }); /** * Gets a specified code scanning analysis for a repository. * You must use an access token with the `security_events` scope to use this endpoint. * GitHub Apps must have the `security_events` read permission to use this endpoint. * * The default JSON response contains fields that describe the analysis. * This includes the Git reference and commit SHA to which the analysis relates, * the datetime of the analysis, the name of the code scanning tool, * and the number of alerts. * * The `rules_count` field in the default response give the number of rules * that were run in the analysis. * For very old analyses this data is not available, * and `0` is returned in this field. * * If you use the Accept header `application/sarif+json`, * the response contains the analysis data that was uploaded. * This is formatted as * [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). * For an example response, see "[Custom media type for code scanning](#custom-media-type-for-code-scanning)." * * **Deprecation notice**: * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. */ export const useCodeScanningGetAnalysis = < TData = Schemas.CodeScanningAnalysis, >( variables: CodeScanningGetAnalysisVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CodeScanningAnalysis, CodeScanningGetAnalysisError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CodeScanningAnalysis, CodeScanningGetAnalysisError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}', operationId: 'codeScanningGetAnalysis', variables, }), ({ signal }) => fetchCodeScanningGetAnalysis({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type CodeScanningUploadSarifPathParams = { owner: string; repo: string; }; export type CodeScanningUploadSarifError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenWrite; } | { status: 404; payload: Responses.NotFound; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningUploadSarifRequestBody = { /** * The base directory used in the analysis, as it appears in the SARIF file. * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. * * @example file:///github/workspace/ * @format uri */ checkout_uri?: string; commit_sha: Schemas.CodeScanningAnalysisCommitSha; ref: Schemas.CodeScanningRef; sarif: Schemas.CodeScanningAnalysisSarifFile; /** * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. * * @format date */ started_at?: string; /** * The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. */ tool_name?: string; }; export type CodeScanningUploadSarifVariables = { body: CodeScanningUploadSarifRequestBody; pathParams: CodeScanningUploadSarifPathParams; } & GithubContext['fetcherOptions']; /** * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. * * There are two places where you can upload code scanning results. * - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests)." * - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." * * You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: * * ``` * gzip -c analysis-data.sarif | base64 * ``` * * SARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries. * * The `202 Accepted`, response includes an `id` value. * You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint. * For more information, see "[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload)." */ export const fetchCodeScanningUploadSarif = ( variables: CodeScanningUploadSarifVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningSarifsReceipt, CodeScanningUploadSarifError, CodeScanningUploadSarifRequestBody, {}, {}, CodeScanningUploadSarifPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/sarifs', method: 'post', ...variables, signal, }); /** * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. * * There are two places where you can upload code scanning results. * - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/github/finding-security-vulnerabilities-and-errors-in-your-code/triaging-code-scanning-alerts-in-pull-requests)." * - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/github/finding-security-vulnerabilities-and-errors-in-your-code/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." * * You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: * * ``` * gzip -c analysis-data.sarif | base64 * ``` * * SARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries. * * The `202 Accepted`, response includes an `id` value. * You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint. * For more information, see "[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload)." */ export const useCodeScanningUploadSarif = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CodeScanningSarifsReceipt, CodeScanningUploadSarifError, CodeScanningUploadSarifVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CodeScanningSarifsReceipt, CodeScanningUploadSarifError, CodeScanningUploadSarifVariables >( (variables: CodeScanningUploadSarifVariables) => fetchCodeScanningUploadSarif({ ...fetcherOptions, ...variables }), options, ); }; export type CodeScanningGetSarifPathParams = { owner: string; repo: string; /** * The SARIF ID obtained after uploading. */ sarifId: string; }; export type CodeScanningGetSarifError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.CodeScanningForbiddenRead; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type CodeScanningGetSarifVariables = { pathParams: CodeScanningGetSarifPathParams; } & GithubContext['fetcherOptions']; /** * Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ export const fetchCodeScanningGetSarif = ( variables: CodeScanningGetSarifVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeScanningSarifsStatus, CodeScanningGetSarifError, undefined, {}, {}, CodeScanningGetSarifPathParams >({ url: '/repos/{owner}/{repo}/code-scanning/sarifs/{sarifId}', method: 'get', ...variables, signal, }); /** * Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ export const useCodeScanningGetSarif = < TData = Schemas.CodeScanningSarifsStatus, >( variables: CodeScanningGetSarifVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CodeScanningSarifsStatus, CodeScanningGetSarifError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CodeScanningSarifsStatus, CodeScanningGetSarifError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}', operationId: 'codeScanningGetSarif', variables, }), ({ signal }) => fetchCodeScanningGetSarif({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListCollaboratorsPathParams = { owner: string; repo: string; }; export type ReposListCollaboratorsQueryParams = { /** * Filter collaborators returned by their affiliation. Can be one of: * \* `outside`: All outside collaborators of an organization-owned repository. * \* `direct`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. * \* `all`: All collaborators the authenticated user can see. * * @default all */ affiliation?: 'outside' | 'direct' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListCollaboratorsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposListCollaboratorsResponse = Schemas.Collaborator[]; export type ReposListCollaboratorsVariables = { pathParams: ReposListCollaboratorsPathParams; queryParams?: ReposListCollaboratorsQueryParams; } & GithubContext['fetcherOptions']; /** * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. * * Team members will include the members of child teams. */ export const fetchReposListCollaborators = ( variables: ReposListCollaboratorsVariables, signal?: AbortSignal, ) => githubFetch< ReposListCollaboratorsResponse, ReposListCollaboratorsError, undefined, {}, ReposListCollaboratorsQueryParams, ReposListCollaboratorsPathParams >({ url: '/repos/{owner}/{repo}/collaborators', method: 'get', ...variables, signal, }); /** * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. * * Team members will include the members of child teams. */ export const useReposListCollaborators = < TData = ReposListCollaboratorsResponse, >( variables: ReposListCollaboratorsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListCollaboratorsResponse, ReposListCollaboratorsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListCollaboratorsResponse, ReposListCollaboratorsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/collaborators', operationId: 'reposListCollaborators', variables, }), ({ signal }) => fetchReposListCollaborators({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposRemoveCollaboratorPathParams = { owner: string; repo: string; username: string; }; export type ReposRemoveCollaboratorError = Fetcher.ErrorWrapper; export type ReposRemoveCollaboratorVariables = { pathParams: ReposRemoveCollaboratorPathParams; } & GithubContext['fetcherOptions']; export const fetchReposRemoveCollaborator = ( variables: ReposRemoveCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposRemoveCollaboratorError, undefined, {}, {}, ReposRemoveCollaboratorPathParams >({ url: '/repos/{owner}/{repo}/collaborators/{username}', method: 'delete', ...variables, signal, }); export const useReposRemoveCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposRemoveCollaboratorError, ReposRemoveCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposRemoveCollaboratorError, ReposRemoveCollaboratorVariables >( (variables: ReposRemoveCollaboratorVariables) => fetchReposRemoveCollaborator({ ...fetcherOptions, ...variables }), options, ); }; export type ReposCheckCollaboratorPathParams = { owner: string; repo: string; username: string; }; export type ReposCheckCollaboratorError = Fetcher.ErrorWrapper; export type ReposCheckCollaboratorVariables = { pathParams: ReposCheckCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. * * Team members will include the members of child teams. */ export const fetchReposCheckCollaborator = ( variables: ReposCheckCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposCheckCollaboratorError, undefined, {}, {}, ReposCheckCollaboratorPathParams >({ url: '/repos/{owner}/{repo}/collaborators/{username}', method: 'get', ...variables, signal, }); /** * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. * * Team members will include the members of child teams. */ export const useReposCheckCollaborator = ( variables: ReposCheckCollaboratorVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/collaborators/{username}', operationId: 'reposCheckCollaborator', variables, }), ({ signal }) => fetchReposCheckCollaborator({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposAddCollaboratorPathParams = { owner: string; repo: string; username: string; }; export type ReposAddCollaboratorError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposAddCollaboratorRequestBody = { /** * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: * \* `pull` - can pull, but not push to or administer this repository. * \* `push` - can pull and push, but not administer this repository. * \* `admin` - can pull, push and administer this repository. * \* `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. * \* `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access. * * @default push */ permission?: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; /** * @example "push" */ permissions?: string; }; export type ReposAddCollaboratorVariables = { body?: ReposAddCollaboratorRequestBody; pathParams: ReposAddCollaboratorPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). * * **Rate limits** * * To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. */ export const fetchReposAddCollaborator = ( variables: ReposAddCollaboratorVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositoryInvitation, ReposAddCollaboratorError, ReposAddCollaboratorRequestBody, {}, {}, ReposAddCollaboratorPathParams >({ url: '/repos/{owner}/{repo}/collaborators/{username}', method: 'put', ...variables, signal, }); /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). * * **Rate limits** * * To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. */ export const useReposAddCollaborator = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RepositoryInvitation, ReposAddCollaboratorError, ReposAddCollaboratorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RepositoryInvitation, ReposAddCollaboratorError, ReposAddCollaboratorVariables >( (variables: ReposAddCollaboratorVariables) => fetchReposAddCollaborator({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetCollaboratorPermissionLevelPathParams = { owner: string; repo: string; username: string; }; export type ReposGetCollaboratorPermissionLevelError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetCollaboratorPermissionLevelVariables = { pathParams: ReposGetCollaboratorPermissionLevelPathParams; } & GithubContext['fetcherOptions']; /** * Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`. */ export const fetchReposGetCollaboratorPermissionLevel = ( variables: ReposGetCollaboratorPermissionLevelVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositoryCollaboratorPermission, ReposGetCollaboratorPermissionLevelError, undefined, {}, {}, ReposGetCollaboratorPermissionLevelPathParams >({ url: '/repos/{owner}/{repo}/collaborators/{username}/permission', method: 'get', ...variables, signal, }); /** * Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`. */ export const useReposGetCollaboratorPermissionLevel = < TData = Schemas.RepositoryCollaboratorPermission, >( variables: ReposGetCollaboratorPermissionLevelVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RepositoryCollaboratorPermission, ReposGetCollaboratorPermissionLevelError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RepositoryCollaboratorPermission, ReposGetCollaboratorPermissionLevelError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/collaborators/{username}/permission', operationId: 'reposGetCollaboratorPermissionLevel', variables, }), ({ signal }) => fetchReposGetCollaboratorPermissionLevel( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListCommitCommentsForRepoPathParams = { owner: string; repo: string; }; export type ReposListCommitCommentsForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListCommitCommentsForRepoError = Fetcher.ErrorWrapper; export type ReposListCommitCommentsForRepoResponse = Schemas.CommitComment[]; export type ReposListCommitCommentsForRepoVariables = { pathParams: ReposListCommitCommentsForRepoPathParams; queryParams?: ReposListCommitCommentsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). * * Comments are ordered by ascending ID. */ export const fetchReposListCommitCommentsForRepo = ( variables: ReposListCommitCommentsForRepoVariables, signal?: AbortSignal, ) => githubFetch< ReposListCommitCommentsForRepoResponse, ReposListCommitCommentsForRepoError, undefined, {}, ReposListCommitCommentsForRepoQueryParams, ReposListCommitCommentsForRepoPathParams >({ url: '/repos/{owner}/{repo}/comments', method: 'get', ...variables, signal, }); /** * Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). * * Comments are ordered by ascending ID. */ export const useReposListCommitCommentsForRepo = < TData = ReposListCommitCommentsForRepoResponse, >( variables: ReposListCommitCommentsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListCommitCommentsForRepoResponse, ReposListCommitCommentsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListCommitCommentsForRepoResponse, ReposListCommitCommentsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/comments', operationId: 'reposListCommitCommentsForRepo', variables, }), ({ signal }) => fetchReposListCommitCommentsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposDeleteCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReposDeleteCommitCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposDeleteCommitCommentVariables = { pathParams: ReposDeleteCommitCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeleteCommitComment = ( variables: ReposDeleteCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteCommitCommentError, undefined, {}, {}, ReposDeleteCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}', method: 'delete', ...variables, signal, }); export const useReposDeleteCommitComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteCommitCommentError, ReposDeleteCommitCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteCommitCommentError, ReposDeleteCommitCommentVariables >( (variables: ReposDeleteCommitCommentVariables) => fetchReposDeleteCommitComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReposGetCommitCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetCommitCommentVariables = { pathParams: ReposGetCommitCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetCommitComment = ( variables: ReposGetCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CommitComment, ReposGetCommitCommentError, undefined, {}, {}, ReposGetCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}', method: 'get', ...variables, signal, }); export const useReposGetCommitComment = ( variables: ReposGetCommitCommentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CommitComment, ReposGetCommitCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CommitComment, ReposGetCommitCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/comments/{comment_id}', operationId: 'reposGetCommitComment', variables, }), ({ signal }) => fetchReposGetCommitComment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUpdateCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReposUpdateCommitCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposUpdateCommitCommentRequestBody = { /** * The contents of the comment */ body: string; }; export type ReposUpdateCommitCommentVariables = { body: ReposUpdateCommitCommentRequestBody; pathParams: ReposUpdateCommitCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchReposUpdateCommitComment = ( variables: ReposUpdateCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CommitComment, ReposUpdateCommitCommentError, ReposUpdateCommitCommentRequestBody, {}, {}, ReposUpdateCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}', method: 'patch', ...variables, signal, }); export const useReposUpdateCommitComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CommitComment, ReposUpdateCommitCommentError, ReposUpdateCommitCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CommitComment, ReposUpdateCommitCommentError, ReposUpdateCommitCommentVariables >( (variables: ReposUpdateCommitCommentVariables) => fetchReposUpdateCommitComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsListForCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsListForCommitCommentQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForCommitCommentError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReactionsListForCommitCommentResponse = Schemas.Reaction[]; export type ReactionsListForCommitCommentVariables = { pathParams: ReactionsListForCommitCommentPathParams; queryParams?: ReactionsListForCommitCommentQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ export const fetchReactionsListForCommitComment = ( variables: ReactionsListForCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForCommitCommentResponse, ReactionsListForCommitCommentError, undefined, {}, ReactionsListForCommitCommentQueryParams, ReactionsListForCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ export const useReactionsListForCommitComment = < TData = ReactionsListForCommitCommentResponse, >( variables: ReactionsListForCommitCommentVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForCommitCommentResponse, ReactionsListForCommitCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForCommitCommentResponse, ReactionsListForCommitCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/comments/{comment_id}/reactions', operationId: 'reactionsListForCommitComment', variables, }), ({ signal }) => fetchReactionsListForCommitComment( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsCreateForCommitCommentError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReactionsCreateForCommitCommentRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForCommitCommentVariables = { body: ReactionsCreateForCommitCommentRequestBody; pathParams: ReactionsCreateForCommitCommentPathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this commit comment. */ export const fetchReactionsCreateForCommitComment = ( variables: ReactionsCreateForCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForCommitCommentError, ReactionsCreateForCommitCommentRequestBody, {}, {}, ReactionsCreateForCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this commit comment. */ export const useReactionsCreateForCommitComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForCommitCommentError, ReactionsCreateForCommitCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForCommitCommentError, ReactionsCreateForCommitCommentVariables >( (variables: ReactionsCreateForCommitCommentVariables) => fetchReactionsCreateForCommitComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsDeleteForCommitCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; reactionId: number; }; export type ReactionsDeleteForCommitCommentError = Fetcher.ErrorWrapper; export type ReactionsDeleteForCommitCommentVariables = { pathParams: ReactionsDeleteForCommitCommentPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. * * Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ export const fetchReactionsDeleteForCommitComment = ( variables: ReactionsDeleteForCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForCommitCommentError, undefined, {}, {}, ReactionsDeleteForCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/comments/{commentId}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. * * Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ export const useReactionsDeleteForCommitComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForCommitCommentError, ReactionsDeleteForCommitCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForCommitCommentError, ReactionsDeleteForCommitCommentVariables >( (variables: ReactionsDeleteForCommitCommentVariables) => fetchReactionsDeleteForCommitComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListCommitsPathParams = { owner: string; repo: string; }; export type ReposListCommitsQueryParams = { /** * SHA or branch to start listing commits from. Default: the repository’s default branch (usually `master`). */ sha?: string; /** * Only commits containing this file path will be returned. */ path?: string; /** * GitHub login or email address by which to filter by commit author. */ author?: string; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ until?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * legacy parameter for pagination. */ top?: string; /** * legacy parameter for pagination. */ last_sha?: string; }; export type ReposListCommitsError = Fetcher.ErrorWrapper< | { status: 400; payload: Responses.BadRequest; } | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } | { status: 500; payload: Responses.InternalError; } >; export type ReposListCommitsResponse = Schemas.Commit[]; export type ReposListCommitsVariables = { pathParams: ReposListCommitsPathParams; queryParams?: ReposListCommitsQueryParams; } & GithubContext['fetcherOptions']; /** * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchReposListCommits = ( variables: ReposListCommitsVariables, signal?: AbortSignal, ) => githubFetch< ReposListCommitsResponse, ReposListCommitsError, undefined, {}, ReposListCommitsQueryParams, ReposListCommitsPathParams >({ url: '/repos/{owner}/{repo}/commits', method: 'get', ...variables, signal, }); /** * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useReposListCommits = ( variables: ReposListCommitsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListCommitsResponse, ReposListCommitsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListCommitsResponse, ReposListCommitsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits', operationId: 'reposListCommits', variables, }), ({ signal }) => fetchReposListCommits({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListBranchesForHeadCommitPathParams = { owner: string; repo: string; /** * commit_sha parameter */ commitSha: string; }; export type ReposListBranchesForHeadCommitError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposListBranchesForHeadCommitResponse = Schemas.BranchShort[]; export type ReposListBranchesForHeadCommitVariables = { pathParams: ReposListBranchesForHeadCommitPathParams; } & GithubContext['fetcherOptions']; /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. */ export const fetchReposListBranchesForHeadCommit = ( variables: ReposListBranchesForHeadCommitVariables, signal?: AbortSignal, ) => githubFetch< ReposListBranchesForHeadCommitResponse, ReposListBranchesForHeadCommitError, undefined, {}, {}, ReposListBranchesForHeadCommitPathParams >({ url: '/repos/{owner}/{repo}/commits/{commitSha}/branches-where-head', method: 'get', ...variables, signal, }); /** * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. */ export const useReposListBranchesForHeadCommit = < TData = ReposListBranchesForHeadCommitResponse, >( variables: ReposListBranchesForHeadCommitVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListBranchesForHeadCommitResponse, ReposListBranchesForHeadCommitError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListBranchesForHeadCommitResponse, ReposListBranchesForHeadCommitError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head', operationId: 'reposListBranchesForHeadCommit', variables, }), ({ signal }) => fetchReposListBranchesForHeadCommit( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListCommentsForCommitPathParams = { owner: string; repo: string; /** * commit_sha parameter */ commitSha: string; }; export type ReposListCommentsForCommitQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListCommentsForCommitError = Fetcher.ErrorWrapper; export type ReposListCommentsForCommitResponse = Schemas.CommitComment[]; export type ReposListCommentsForCommitVariables = { pathParams: ReposListCommentsForCommitPathParams; queryParams?: ReposListCommentsForCommitQueryParams; } & GithubContext['fetcherOptions']; /** * Use the `:commit_sha` to specify the commit that will have its comments listed. */ export const fetchReposListCommentsForCommit = ( variables: ReposListCommentsForCommitVariables, signal?: AbortSignal, ) => githubFetch< ReposListCommentsForCommitResponse, ReposListCommentsForCommitError, undefined, {}, ReposListCommentsForCommitQueryParams, ReposListCommentsForCommitPathParams >({ url: '/repos/{owner}/{repo}/commits/{commitSha}/comments', method: 'get', ...variables, signal, }); /** * Use the `:commit_sha` to specify the commit that will have its comments listed. */ export const useReposListCommentsForCommit = < TData = ReposListCommentsForCommitResponse, >( variables: ReposListCommentsForCommitVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListCommentsForCommitResponse, ReposListCommentsForCommitError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListCommentsForCommitResponse, ReposListCommentsForCommitError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{commit_sha}/comments', operationId: 'reposListCommentsForCommit', variables, }), ({ signal }) => fetchReposListCommentsForCommit( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateCommitCommentPathParams = { owner: string; repo: string; /** * commit_sha parameter */ commitSha: string; }; export type ReposCreateCommitCommentError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateCommitCommentRequestBody = { /** * The contents of the comment. */ body: string; /** * **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ line?: number; /** * Relative path of the file to comment on. */ path?: string; /** * Line index in the diff to comment on. */ position?: number; }; export type ReposCreateCommitCommentVariables = { body: ReposCreateCommitCommentRequestBody; pathParams: ReposCreateCommitCommentPathParams; } & GithubContext['fetcherOptions']; /** * Create a comment for a commit using its `:commit_sha`. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchReposCreateCommitComment = ( variables: ReposCreateCommitCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CommitComment, ReposCreateCommitCommentError, ReposCreateCommitCommentRequestBody, {}, {}, ReposCreateCommitCommentPathParams >({ url: '/repos/{owner}/{repo}/commits/{commitSha}/comments', method: 'post', ...variables, signal, }); /** * Create a comment for a commit using its `:commit_sha`. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const useReposCreateCommitComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.CommitComment, ReposCreateCommitCommentError, ReposCreateCommitCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.CommitComment, ReposCreateCommitCommentError, ReposCreateCommitCommentVariables >( (variables: ReposCreateCommitCommentVariables) => fetchReposCreateCommitComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListPullRequestsAssociatedWithCommitPathParams = { owner: string; repo: string; /** * commit_sha parameter */ commitSha: string; }; export type ReposListPullRequestsAssociatedWithCommitQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListPullRequestsAssociatedWithCommitError = Fetcher.ErrorWrapper<{ status: 415; payload: Responses.PreviewHeaderMissing; }>; export type ReposListPullRequestsAssociatedWithCommitResponse = Schemas.PullRequestSimple[]; export type ReposListPullRequestsAssociatedWithCommitVariables = { pathParams: ReposListPullRequestsAssociatedWithCommitPathParams; queryParams?: ReposListPullRequestsAssociatedWithCommitQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. */ export const fetchReposListPullRequestsAssociatedWithCommit = ( variables: ReposListPullRequestsAssociatedWithCommitVariables, signal?: AbortSignal, ) => githubFetch< ReposListPullRequestsAssociatedWithCommitResponse, ReposListPullRequestsAssociatedWithCommitError, undefined, {}, ReposListPullRequestsAssociatedWithCommitQueryParams, ReposListPullRequestsAssociatedWithCommitPathParams >({ url: '/repos/{owner}/{repo}/commits/{commitSha}/pulls', method: 'get', ...variables, signal, }); /** * Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. */ export const useReposListPullRequestsAssociatedWithCommit = < TData = ReposListPullRequestsAssociatedWithCommitResponse, >( variables: ReposListPullRequestsAssociatedWithCommitVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListPullRequestsAssociatedWithCommitResponse, ReposListPullRequestsAssociatedWithCommitError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListPullRequestsAssociatedWithCommitResponse, ReposListPullRequestsAssociatedWithCommitError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{commit_sha}/pulls', operationId: 'reposListPullRequestsAssociatedWithCommit', variables, }), ({ signal }) => fetchReposListPullRequestsAssociatedWithCommit( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetCommitPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type ReposGetCommitQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type ReposGetCommitError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 500; payload: Responses.InternalError; } >; export type ReposGetCommitVariables = { pathParams: ReposGetCommitPathParams; queryParams?: ReposGetCommitQueryParams; } & GithubContext['fetcherOptions']; /** * Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint. * * **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. * * You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. * * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchReposGetCommit = ( variables: ReposGetCommitVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Commit, ReposGetCommitError, undefined, {}, ReposGetCommitQueryParams, ReposGetCommitPathParams >({ url: '/repos/{owner}/{repo}/commits/{ref}', method: 'get', ...variables, signal, }); /** * Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint. * * **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. * * You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. * * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useReposGetCommit = ( variables: ReposGetCommitVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{ref}', operationId: 'reposGetCommit', variables, }), ({ signal }) => fetchReposGetCommit({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksListForRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type ChecksListForRefQueryParams = { /** * Returns check runs with the specified `name`. */ check_name?: string; /** * Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. */ status?: 'queued' | 'in_progress' | 'completed'; /** * Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. * * @default latest */ filter?: 'latest' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; app_id?: number; }; export type ChecksListForRefError = Fetcher.ErrorWrapper; export type ChecksListForRefResponse = { check_runs: Schemas.CheckRun[]; total_count: number; }; export type ChecksListForRefVariables = { pathParams: ChecksListForRefPathParams; queryParams?: ChecksListForRefQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const fetchChecksListForRef = ( variables: ChecksListForRefVariables, signal?: AbortSignal, ) => githubFetch< ChecksListForRefResponse, ChecksListForRefError, undefined, {}, ChecksListForRefQueryParams, ChecksListForRefPathParams >({ url: '/repos/{owner}/{repo}/commits/{ref}/check-runs', method: 'get', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. */ export const useChecksListForRef = ( variables: ChecksListForRefVariables, options?: Omit< reactQuery.UseQueryOptions< ChecksListForRefResponse, ChecksListForRefError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ChecksListForRefResponse, ChecksListForRefError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{ref}/check-runs', operationId: 'checksListForRef', variables, }), ({ signal }) => fetchChecksListForRef({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ChecksListSuitesForRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type ChecksListSuitesForRefQueryParams = { /** * Filters check suites by GitHub App `id`. */ app_id?: number; /** * Returns check runs with the specified `name`. */ check_name?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ChecksListSuitesForRefError = Fetcher.ErrorWrapper; export type ChecksListSuitesForRefResponse = { check_suites: Schemas.CheckSuite[]; total_count: number; }; export type ChecksListSuitesForRefVariables = { pathParams: ChecksListSuitesForRefPathParams; queryParams?: ChecksListSuitesForRefQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. */ export const fetchChecksListSuitesForRef = ( variables: ChecksListSuitesForRefVariables, signal?: AbortSignal, ) => githubFetch< ChecksListSuitesForRefResponse, ChecksListSuitesForRefError, undefined, {}, ChecksListSuitesForRefQueryParams, ChecksListSuitesForRefPathParams >({ url: '/repos/{owner}/{repo}/commits/{ref}/check-suites', method: 'get', ...variables, signal, }); /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * * Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. */ export const useChecksListSuitesForRef = < TData = ChecksListSuitesForRefResponse, >( variables: ChecksListSuitesForRefVariables, options?: Omit< reactQuery.UseQueryOptions< ChecksListSuitesForRefResponse, ChecksListSuitesForRefError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ChecksListSuitesForRefResponse, ChecksListSuitesForRefError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{ref}/check-suites', operationId: 'checksListSuitesForRef', variables, }), ({ signal }) => fetchChecksListSuitesForRef({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetCombinedStatusForRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type ReposGetCombinedStatusForRefQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposGetCombinedStatusForRefError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetCombinedStatusForRefVariables = { pathParams: ReposGetCombinedStatusForRefPathParams; queryParams?: ReposGetCombinedStatusForRefQueryParams; } & GithubContext['fetcherOptions']; /** * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. * * The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. * * Additionally, a combined `state` is returned. The `state` is one of: * * * **failure** if any of the contexts report as `error` or `failure` * * **pending** if there are no statuses or a context is `pending` * * **success** if the latest status for all contexts is `success` */ export const fetchReposGetCombinedStatusForRef = ( variables: ReposGetCombinedStatusForRefVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CombinedCommitStatus, ReposGetCombinedStatusForRefError, undefined, {}, ReposGetCombinedStatusForRefQueryParams, ReposGetCombinedStatusForRefPathParams >({ url: '/repos/{owner}/{repo}/commits/{ref}/status', method: 'get', ...variables, signal, }); /** * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. * * The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. * * Additionally, a combined `state` is returned. The `state` is one of: * * * **failure** if any of the contexts report as `error` or `failure` * * **pending** if there are no statuses or a context is `pending` * * **success** if the latest status for all contexts is `success` */ export const useReposGetCombinedStatusForRef = < TData = Schemas.CombinedCommitStatus, >( variables: ReposGetCombinedStatusForRefVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CombinedCommitStatus, ReposGetCombinedStatusForRefError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CombinedCommitStatus, ReposGetCombinedStatusForRefError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{ref}/status', operationId: 'reposGetCombinedStatusForRef', variables, }), ({ signal }) => fetchReposGetCombinedStatusForRef( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListCommitStatusesForRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type ReposListCommitStatusesForRefQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListCommitStatusesForRefError = Fetcher.ErrorWrapper<{ status: 301; payload: Responses.MovedPermanently; }>; export type ReposListCommitStatusesForRefResponse = Schemas.Status[]; export type ReposListCommitStatusesForRefVariables = { pathParams: ReposListCommitStatusesForRefPathParams; queryParams?: ReposListCommitStatusesForRefQueryParams; } & GithubContext['fetcherOptions']; /** * Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. * * This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. */ export const fetchReposListCommitStatusesForRef = ( variables: ReposListCommitStatusesForRefVariables, signal?: AbortSignal, ) => githubFetch< ReposListCommitStatusesForRefResponse, ReposListCommitStatusesForRefError, undefined, {}, ReposListCommitStatusesForRefQueryParams, ReposListCommitStatusesForRefPathParams >({ url: '/repos/{owner}/{repo}/commits/{ref}/statuses', method: 'get', ...variables, signal, }); /** * Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. * * This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. */ export const useReposListCommitStatusesForRef = < TData = ReposListCommitStatusesForRefResponse, >( variables: ReposListCommitStatusesForRefVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListCommitStatusesForRefResponse, ReposListCommitStatusesForRefError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListCommitStatusesForRefResponse, ReposListCommitStatusesForRefError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/commits/{ref}/statuses', operationId: 'reposListCommitStatusesForRef', variables, }), ({ signal }) => fetchReposListCommitStatusesForRef( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type CodesOfConductGetForRepoPathParams = { owner: string; repo: string; }; export type CodesOfConductGetForRepoError = Fetcher.ErrorWrapper; export type CodesOfConductGetForRepoVariables = { pathParams: CodesOfConductGetForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Returns the contents of the repository's code of conduct file, if one is detected. * * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. */ export const fetchCodesOfConductGetForRepo = ( variables: CodesOfConductGetForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CodeOfConduct, CodesOfConductGetForRepoError, undefined, {}, {}, CodesOfConductGetForRepoPathParams >({ url: '/repos/{owner}/{repo}/community/code_of_conduct', method: 'get', ...variables, signal, }); /** * Returns the contents of the repository's code of conduct file, if one is detected. * * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. */ export const useCodesOfConductGetForRepo = ( variables: CodesOfConductGetForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CodeOfConduct, CodesOfConductGetForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CodeOfConduct, CodesOfConductGetForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/community/code_of_conduct', operationId: 'codesOfConductGetForRepo', variables, }), ({ signal }) => fetchCodesOfConductGetForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetCommunityProfileMetricsPathParams = { owner: string; repo: string; }; export type ReposGetCommunityProfileMetricsError = Fetcher.ErrorWrapper; export type ReposGetCommunityProfileMetricsVariables = { pathParams: ReposGetCommunityProfileMetricsPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint will return all community profile metrics, including an * overall health score, repository description, the presence of documentation, detected * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, * README, and CONTRIBUTING files. * * The `health_percentage` score is defined as a percentage of how many of * these four documents are present: README, CONTRIBUTING, LICENSE, and * CODE_OF_CONDUCT. For example, if all four documents are present, then * the `health_percentage` is `100`. If only one is present, then the * `health_percentage` is `25`. * * `content_reports_enabled` is only returned for organization-owned repositories. */ export const fetchReposGetCommunityProfileMetrics = ( variables: ReposGetCommunityProfileMetricsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CommunityProfile, ReposGetCommunityProfileMetricsError, undefined, {}, {}, ReposGetCommunityProfileMetricsPathParams >({ url: '/repos/{owner}/{repo}/community/profile', method: 'get', ...variables, signal, }); /** * This endpoint will return all community profile metrics, including an * overall health score, repository description, the presence of documentation, detected * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, * README, and CONTRIBUTING files. * * The `health_percentage` score is defined as a percentage of how many of * these four documents are present: README, CONTRIBUTING, LICENSE, and * CODE_OF_CONDUCT. For example, if all four documents are present, then * the `health_percentage` is `100`. If only one is present, then the * `health_percentage` is `25`. * * `content_reports_enabled` is only returned for organization-owned repositories. */ export const useReposGetCommunityProfileMetrics = < TData = Schemas.CommunityProfile, >( variables: ReposGetCommunityProfileMetricsVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CommunityProfile, ReposGetCommunityProfileMetricsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CommunityProfile, ReposGetCommunityProfileMetricsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/community/profile', operationId: 'reposGetCommunityProfileMetrics', variables, }), ({ signal }) => fetchReposGetCommunityProfileMetrics( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCompareCommitsPathParams = { owner: string; repo: string; base: string; head: string; }; export type ReposCompareCommitsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 500; payload: Responses.InternalError; } >; export type ReposCompareCommitsVariables = { pathParams: ReposCompareCommitsPathParams; } & GithubContext['fetcherOptions']; /** * Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. * * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. * * **Working with large comparisons** * * The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. * * For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long * to generate. You can typically resolve this error by using a smaller commit range. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchReposCompareCommits = ( variables: ReposCompareCommitsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CommitComparison, ReposCompareCommitsError, undefined, {}, {}, ReposCompareCommitsPathParams >({ url: '/repos/{owner}/{repo}/compare/{base}...{head}', method: 'get', ...variables, signal, }); /** * Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. * * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. * * **Working with large comparisons** * * The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. * * For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long * to generate. You can typically resolve this error by using a smaller commit range. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useReposCompareCommits = ( variables: ReposCompareCommitsVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CommitComparison, ReposCompareCommitsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CommitComparison, ReposCompareCommitsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/compare/{base}...{head}', operationId: 'reposCompareCommits', variables, }), ({ signal }) => fetchReposCompareCommits({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDeleteFilePathParams = { owner: string; repo: string; /** * path parameter */ path: string; }; export type ReposDeleteFileError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type ReposDeleteFileRequestBody = { /** * object containing information about the author. */ author?: { /** * The email of the author (or committer) of the commit */ email?: string; /** * The name of the author (or committer) of the commit */ name?: string; }; /** * The branch name. Default: the repository’s default branch (usually `master`) */ branch?: string; /** * object containing information about the committer. */ committer?: { /** * The email of the author (or committer) of the commit */ email?: string; /** * The name of the author (or committer) of the commit */ name?: string; }; /** * The commit message. */ message: string; /** * The blob SHA of the file being replaced. */ sha: string; }; export type ReposDeleteFileVariables = { body: ReposDeleteFileRequestBody; pathParams: ReposDeleteFilePathParams; } & GithubContext['fetcherOptions']; /** * Deletes a file in a repository. * * You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author. * * The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used. * * You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code. */ export const fetchReposDeleteFile = ( variables: ReposDeleteFileVariables, signal?: AbortSignal, ) => githubFetch< Schemas.FileCommit, ReposDeleteFileError, ReposDeleteFileRequestBody, {}, {}, ReposDeleteFilePathParams >({ url: '/repos/{owner}/{repo}/contents/{path}', method: 'delete', ...variables, signal, }); /** * Deletes a file in a repository. * * You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author. * * The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used. * * You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code. */ export const useReposDeleteFile = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.FileCommit, ReposDeleteFileError, ReposDeleteFileVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.FileCommit, ReposDeleteFileError, ReposDeleteFileVariables >( (variables: ReposDeleteFileVariables) => fetchReposDeleteFile({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetContentPathParams = { owner: string; repo: string; /** * path parameter */ path: string; }; export type ReposGetContentQueryParams = { /** * The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ ref?: string; }; export type ReposGetContentError = Fetcher.ErrorWrapper< | { status: 302; payload: Responses.Found; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ReposGetContentVariables = { pathParams: ReposGetContentPathParams; queryParams?: ReposGetContentQueryParams; } & GithubContext['fetcherOptions']; /** * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. * * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media * type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent * object format. * * **Note**: * * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees * API](https://docs.github.com/rest/reference/git#get-a-tree). * * This API supports files up to 1 megabyte in size. * * #### If the content is a directory * The response will be an array of objects, one object for each item in the directory. * When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value * _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). * In the next major version of the API, the type will be returned as "submodule". * * #### If the content is a symlink * If the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the * API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object * describing the symlink itself. * * #### If the content is a submodule * The `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific * commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out * the submodule at that specific commit. * * If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the * github.com URLs (`html_url` and `_links["html"]`) will have null values. */ export const fetchReposGetContent = ( variables: ReposGetContentVariables, signal?: AbortSignal, ) => githubFetch< | Schemas.ContentDirectory | Schemas.ContentFile | Schemas.ContentSymlink | Schemas.ContentSubmodule, ReposGetContentError, undefined, {}, ReposGetContentQueryParams, ReposGetContentPathParams >({ url: '/repos/{owner}/{repo}/contents/{path}', method: 'get', ...variables, signal, }); /** * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. * * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media * type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent * object format. * * **Note**: * * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees * API](https://docs.github.com/rest/reference/git#get-a-tree). * * This API supports files up to 1 megabyte in size. * * #### If the content is a directory * The response will be an array of objects, one object for each item in the directory. * When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value * _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). * In the next major version of the API, the type will be returned as "submodule". * * #### If the content is a symlink * If the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the * API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object * describing the symlink itself. * * #### If the content is a submodule * The `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific * commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out * the submodule at that specific commit. * * If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the * github.com URLs (`html_url` and `_links["html"]`) will have null values. */ export const useReposGetContent = < TData = | Schemas.ContentDirectory | Schemas.ContentFile | Schemas.ContentSymlink | Schemas.ContentSubmodule, >( variables: ReposGetContentVariables, options?: Omit< reactQuery.UseQueryOptions< | Schemas.ContentDirectory | Schemas.ContentFile | Schemas.ContentSymlink | Schemas.ContentSubmodule, ReposGetContentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< | Schemas.ContentDirectory | Schemas.ContentFile | Schemas.ContentSymlink | Schemas.ContentSubmodule, ReposGetContentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/contents/{path}', operationId: 'reposGetContent', variables, }), ({ signal }) => fetchReposGetContent({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateOrUpdateFileContentsPathParams = { owner: string; repo: string; /** * path parameter */ path: string; }; export type ReposCreateOrUpdateFileContentsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateOrUpdateFileContentsRequestBody = { /** * The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. */ author?: { /** * @example "2013-01-15T17:13:22+05:00" */ date?: string; /** * The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. */ email: string; /** * The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. */ name: string; }; /** * The branch name. Default: the repository’s default branch (usually `master`) */ branch?: string; /** * The person that committed the file. Default: the authenticated user. */ committer?: { /** * @example "2013-01-05T13:13:22+05:00" */ date?: string; /** * The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. */ email: string; /** * The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. */ name: string; }; /** * The new file content, using Base64 encoding. */ content: string; /** * The commit message. */ message: string; /** * **Required if you are updating a file**. The blob SHA of the file being replaced. */ sha?: string; }; export type ReposCreateOrUpdateFileContentsVariables = { body: ReposCreateOrUpdateFileContentsRequestBody; pathParams: ReposCreateOrUpdateFileContentsPathParams; } & GithubContext['fetcherOptions']; /** * Creates a new file or replaces an existing file in a repository. */ export const fetchReposCreateOrUpdateFileContents = ( variables: ReposCreateOrUpdateFileContentsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.FileCommit, ReposCreateOrUpdateFileContentsError, ReposCreateOrUpdateFileContentsRequestBody, {}, {}, ReposCreateOrUpdateFileContentsPathParams >({ url: '/repos/{owner}/{repo}/contents/{path}', method: 'put', ...variables, signal, }); /** * Creates a new file or replaces an existing file in a repository. */ export const useReposCreateOrUpdateFileContents = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.FileCommit, ReposCreateOrUpdateFileContentsError, ReposCreateOrUpdateFileContentsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.FileCommit, ReposCreateOrUpdateFileContentsError, ReposCreateOrUpdateFileContentsVariables >( (variables: ReposCreateOrUpdateFileContentsVariables) => fetchReposCreateOrUpdateFileContents({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListContributorsPathParams = { owner: string; repo: string; }; export type ReposListContributorsQueryParams = { /** * Set to `1` or `true` to include anonymous contributors in results. */ anon?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListContributorsError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ReposListContributorsResponse = Schemas.Contributor[]; export type ReposListContributorsVariables = { pathParams: ReposListContributorsPathParams; queryParams?: ReposListContributorsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. * * GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. */ export const fetchReposListContributors = ( variables: ReposListContributorsVariables, signal?: AbortSignal, ) => githubFetch< ReposListContributorsResponse, ReposListContributorsError, undefined, {}, ReposListContributorsQueryParams, ReposListContributorsPathParams >({ url: '/repos/{owner}/{repo}/contributors', method: 'get', ...variables, signal, }); /** * Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. * * GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. */ export const useReposListContributors = ( variables: ReposListContributorsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListContributorsResponse, ReposListContributorsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListContributorsResponse, ReposListContributorsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/contributors', operationId: 'reposListContributors', variables, }), ({ signal }) => fetchReposListContributors({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListDeploymentsPathParams = { owner: string; repo: string; }; export type ReposListDeploymentsQueryParams = { /** * The SHA recorded at creation time. * * @default none */ sha?: string; /** * The name of the ref. This can be a branch, tag, or SHA. * * @default none */ ref?: string; /** * The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`). * * @default none */ task?: string; /** * The name of the environment that was deployed to (e.g., `staging` or `production`). * * @default none */ environment?: string | null; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListDeploymentsError = Fetcher.ErrorWrapper; export type ReposListDeploymentsResponse = Schemas.Deployment[]; export type ReposListDeploymentsVariables = { pathParams: ReposListDeploymentsPathParams; queryParams?: ReposListDeploymentsQueryParams; } & GithubContext['fetcherOptions']; /** * Simple filtering of deployments is available via query parameters: */ export const fetchReposListDeployments = ( variables: ReposListDeploymentsVariables, signal?: AbortSignal, ) => githubFetch< ReposListDeploymentsResponse, ReposListDeploymentsError, undefined, {}, ReposListDeploymentsQueryParams, ReposListDeploymentsPathParams >({ url: '/repos/{owner}/{repo}/deployments', method: 'get', ...variables, signal, }); /** * Simple filtering of deployments is available via query parameters: */ export const useReposListDeployments = ( variables: ReposListDeploymentsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListDeploymentsResponse, ReposListDeploymentsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListDeploymentsResponse, ReposListDeploymentsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/deployments', operationId: 'reposListDeployments', variables, }), ({ signal }) => fetchReposListDeployments({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateDeploymentPathParams = { owner: string; repo: string; }; export type ReposCreateDeploymentError = Fetcher.ErrorWrapper< | { status: 409; payload: { /** * @example "https://docs.github.com/rest/reference/repos#create-a-deployment" */ documentation_url?: string; message?: string; }; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateDeploymentRequestBody = { /** * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. * * @default true */ auto_merge?: boolean; /** * @example "1776-07-04T00:00:00.000-07:52" */ created_at?: string; /** * Short description of the deployment. * * @default */ description?: string | null; /** * Name for the target deployment environment (e.g., `production`, `staging`, `qa`). * * @default production */ environment?: string; payload?: | { [key: string]: any; } | string; /** * Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. */ production_environment?: boolean; /** * The ref to deploy. This can be a branch, tag, or SHA. */ ref: string; /** * The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ required_contexts?: string[]; /** * Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). * * @default deploy */ task?: string; /** * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. * * @default false */ transient_environment?: boolean; }; export type ReposCreateDeploymentVariables = { body: ReposCreateDeploymentRequestBody; pathParams: ReposCreateDeploymentPathParams; } & GithubContext['fetcherOptions']; /** * Deployments offer a few configurable parameters with certain defaults. * * The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them * before we merge a pull request. * * The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have * multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter * makes it easier to track which environments have requested deployments. The default environment is `production`. * * The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If * the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, * the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will * return a failure response. * * By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a `success` * state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to * specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do * not require any contexts or create any commit statuses, the deployment will always succeed. * * The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text * field that will be passed on when a deployment event is dispatched. * * The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might * be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an * application with debugging enabled. * * Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref. * * #### Merged branch response * You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating * a deployment. This auto-merge happens when: * * Auto-merge option is enabled in the repository * * Topic branch does not include the latest changes on the base branch, which is `master` in the response example * * There are no merge conflicts * * If there are no new commits in the base branch, a new request to create a deployment should give a successful * response. * * #### Merge conflict response * This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't * be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts. * * #### Failed commit status checks * This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` * status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`. */ export const fetchReposCreateDeployment = ( variables: ReposCreateDeploymentVariables, signal?: AbortSignal, ) => githubFetch< | Schemas.Deployment | { message?: string; }, ReposCreateDeploymentError, ReposCreateDeploymentRequestBody, {}, {}, ReposCreateDeploymentPathParams >({ url: '/repos/{owner}/{repo}/deployments', method: 'post', ...variables, signal, }); /** * Deployments offer a few configurable parameters with certain defaults. * * The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them * before we merge a pull request. * * The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have * multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter * makes it easier to track which environments have requested deployments. The default environment is `production`. * * The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If * the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, * the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will * return a failure response. * * By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a `success` * state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to * specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do * not require any contexts or create any commit statuses, the deployment will always succeed. * * The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text * field that will be passed on when a deployment event is dispatched. * * The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might * be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an * application with debugging enabled. * * Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref. * * #### Merged branch response * You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating * a deployment. This auto-merge happens when: * * Auto-merge option is enabled in the repository * * Topic branch does not include the latest changes on the base branch, which is `master` in the response example * * There are no merge conflicts * * If there are no new commits in the base branch, a new request to create a deployment should give a successful * response. * * #### Merge conflict response * This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't * be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts. * * #### Failed commit status checks * This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` * status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`. */ export const useReposCreateDeployment = ( options?: Omit< reactQuery.UseMutationOptions< | Schemas.Deployment | { message?: string; }, ReposCreateDeploymentError, ReposCreateDeploymentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< | Schemas.Deployment | { message?: string; }, ReposCreateDeploymentError, ReposCreateDeploymentVariables >( (variables: ReposCreateDeploymentVariables) => fetchReposCreateDeployment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteDeploymentPathParams = { owner: string; repo: string; /** * deployment_id parameter */ deploymentId: number; }; export type ReposDeleteDeploymentError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ReposDeleteDeploymentVariables = { pathParams: ReposDeleteDeploymentPathParams; } & GithubContext['fetcherOptions']; /** * To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with `repo` or `repo_deployment` scopes can delete an inactive deployment. * * To set a deployment as inactive, you must: * * * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * * Mark the active deployment as inactive by adding any non-successful deployment status. * * For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." */ export const fetchReposDeleteDeployment = ( variables: ReposDeleteDeploymentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteDeploymentError, undefined, {}, {}, ReposDeleteDeploymentPathParams >({ url: '/repos/{owner}/{repo}/deployments/{deploymentId}', method: 'delete', ...variables, signal, }); /** * To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with `repo` or `repo_deployment` scopes can delete an inactive deployment. * * To set a deployment as inactive, you must: * * * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * * Mark the active deployment as inactive by adding any non-successful deployment status. * * For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." */ export const useReposDeleteDeployment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteDeploymentError, ReposDeleteDeploymentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteDeploymentError, ReposDeleteDeploymentVariables >( (variables: ReposDeleteDeploymentVariables) => fetchReposDeleteDeployment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetDeploymentPathParams = { owner: string; repo: string; /** * deployment_id parameter */ deploymentId: number; }; export type ReposGetDeploymentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetDeploymentVariables = { pathParams: ReposGetDeploymentPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetDeployment = ( variables: ReposGetDeploymentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Deployment, ReposGetDeploymentError, undefined, {}, {}, ReposGetDeploymentPathParams >({ url: '/repos/{owner}/{repo}/deployments/{deploymentId}', method: 'get', ...variables, signal, }); export const useReposGetDeployment = ( variables: ReposGetDeploymentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Deployment, ReposGetDeploymentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Deployment, ReposGetDeploymentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/deployments/{deployment_id}', operationId: 'reposGetDeployment', variables, }), ({ signal }) => fetchReposGetDeployment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListDeploymentStatusesPathParams = { owner: string; repo: string; /** * deployment_id parameter */ deploymentId: number; }; export type ReposListDeploymentStatusesQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListDeploymentStatusesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposListDeploymentStatusesResponse = Schemas.DeploymentStatus[]; export type ReposListDeploymentStatusesVariables = { pathParams: ReposListDeploymentStatusesPathParams; queryParams?: ReposListDeploymentStatusesQueryParams; } & GithubContext['fetcherOptions']; /** * Users with pull access can view deployment statuses for a deployment: */ export const fetchReposListDeploymentStatuses = ( variables: ReposListDeploymentStatusesVariables, signal?: AbortSignal, ) => githubFetch< ReposListDeploymentStatusesResponse, ReposListDeploymentStatusesError, undefined, {}, ReposListDeploymentStatusesQueryParams, ReposListDeploymentStatusesPathParams >({ url: '/repos/{owner}/{repo}/deployments/{deploymentId}/statuses', method: 'get', ...variables, signal, }); /** * Users with pull access can view deployment statuses for a deployment: */ export const useReposListDeploymentStatuses = < TData = ReposListDeploymentStatusesResponse, >( variables: ReposListDeploymentStatusesVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListDeploymentStatusesResponse, ReposListDeploymentStatusesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListDeploymentStatusesResponse, ReposListDeploymentStatusesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/deployments/{deployment_id}/statuses', operationId: 'reposListDeploymentStatuses', variables, }), ({ signal }) => fetchReposListDeploymentStatuses( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateDeploymentStatusPathParams = { owner: string; repo: string; /** * deployment_id parameter */ deploymentId: number; }; export type ReposCreateDeploymentStatusError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposCreateDeploymentStatusRequestBody = { /** * Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` * **Note:** To add an `inactive` status to `production` environments, you must use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. */ auto_inactive?: boolean; /** * A short description of the status. The maximum description length is 140 characters. * * @default */ description?: string; /** * Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. **Note:** This parameter requires you to use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ environment?: 'production' | 'staging' | 'qa'; /** * Sets the URL for accessing your environment. Default: `""` * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. * * @default */ environment_url?: string; /** * The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. * * @default */ log_url?: string; /** * The state of the status. Can be one of `error`, `failure`, `inactive`, `in_progress`, `queued` `pending`, or `success`. **Note:** To use the `inactive` state, you must provide the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the `in_progress` and `queued` states, you must provide the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub. */ state: | 'error' | 'failure' | 'inactive' | 'in_progress' | 'queued' | 'pending' | 'success'; /** * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. * * @default */ target_url?: string; }; export type ReposCreateDeploymentStatusVariables = { body: ReposCreateDeploymentStatusRequestBody; pathParams: ReposCreateDeploymentStatusPathParams; } & GithubContext['fetcherOptions']; /** * Users with `push` access can create deployment statuses for a given deployment. * * GitHub Apps require `read & write` access to "Deployments" and `read-only` access to "Repo contents" (for private repos). OAuth Apps require the `repo_deployment` scope. */ export const fetchReposCreateDeploymentStatus = ( variables: ReposCreateDeploymentStatusVariables, signal?: AbortSignal, ) => githubFetch< Schemas.DeploymentStatus, ReposCreateDeploymentStatusError, ReposCreateDeploymentStatusRequestBody, {}, {}, ReposCreateDeploymentStatusPathParams >({ url: '/repos/{owner}/{repo}/deployments/{deploymentId}/statuses', method: 'post', ...variables, signal, }); /** * Users with `push` access can create deployment statuses for a given deployment. * * GitHub Apps require `read & write` access to "Deployments" and `read-only` access to "Repo contents" (for private repos). OAuth Apps require the `repo_deployment` scope. */ export const useReposCreateDeploymentStatus = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.DeploymentStatus, ReposCreateDeploymentStatusError, ReposCreateDeploymentStatusVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.DeploymentStatus, ReposCreateDeploymentStatusError, ReposCreateDeploymentStatusVariables >( (variables: ReposCreateDeploymentStatusVariables) => fetchReposCreateDeploymentStatus({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetDeploymentStatusPathParams = { owner: string; repo: string; /** * deployment_id parameter */ deploymentId: number; statusId: number; }; export type ReposGetDeploymentStatusError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReposGetDeploymentStatusVariables = { pathParams: ReposGetDeploymentStatusPathParams; } & GithubContext['fetcherOptions']; /** * Users with pull access can view a deployment status for a deployment: */ export const fetchReposGetDeploymentStatus = ( variables: ReposGetDeploymentStatusVariables, signal?: AbortSignal, ) => githubFetch< Schemas.DeploymentStatus, ReposGetDeploymentStatusError, undefined, {}, {}, ReposGetDeploymentStatusPathParams >({ url: '/repos/{owner}/{repo}/deployments/{deploymentId}/statuses/{statusId}', method: 'get', ...variables, signal, }); /** * Users with pull access can view a deployment status for a deployment: */ export const useReposGetDeploymentStatus = ( variables: ReposGetDeploymentStatusVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.DeploymentStatus, ReposGetDeploymentStatusError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.DeploymentStatus, ReposGetDeploymentStatusError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}', operationId: 'reposGetDeploymentStatus', variables, }), ({ signal }) => fetchReposGetDeploymentStatus( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateDispatchEventPathParams = { owner: string; repo: string; }; export type ReposCreateDispatchEventError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposCreateDispatchEventRequestBody = { /** * JSON payload with extra information about the webhook event that your action or worklow may use. */ client_payload?: { [key: string]: any; }; /** * A custom webhook event name. */ event_type: string; }; export type ReposCreateDispatchEventVariables = { body: ReposCreateDispatchEventRequestBody; pathParams: ReposCreateDispatchEventPathParams; } & GithubContext['fetcherOptions']; /** * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." * * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. * * This endpoint requires write access to the repository by providing either: * * - Personal access tokens with `repo` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. * - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. * * This input example shows how you can use the `client_payload` as a test to debug your workflow. */ export const fetchReposCreateDispatchEvent = ( variables: ReposCreateDispatchEventVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposCreateDispatchEventError, ReposCreateDispatchEventRequestBody, {}, {}, ReposCreateDispatchEventPathParams >({ url: '/repos/{owner}/{repo}/dispatches', method: 'post', ...variables, signal, }); /** * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." * * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. * * This endpoint requires write access to the repository by providing either: * * - Personal access tokens with `repo` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. * - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. * * This input example shows how you can use the `client_payload` as a test to debug your workflow. */ export const useReposCreateDispatchEvent = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposCreateDispatchEventError, ReposCreateDispatchEventVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposCreateDispatchEventError, ReposCreateDispatchEventVariables >( (variables: ReposCreateDispatchEventVariables) => fetchReposCreateDispatchEvent({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetAllEnvironmentsPathParams = { owner: string; repo: string; }; export type ReposGetAllEnvironmentsError = Fetcher.ErrorWrapper; export type ReposGetAllEnvironmentsResponse = { environments?: Schemas.Environment[]; /** * The number of environments in this repository * * @example 5 */ total_count?: number; }; export type ReposGetAllEnvironmentsVariables = { pathParams: ReposGetAllEnvironmentsPathParams; } & GithubContext['fetcherOptions']; /** * Get all environments for a repository. * * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchReposGetAllEnvironments = ( variables: ReposGetAllEnvironmentsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetAllEnvironmentsResponse, ReposGetAllEnvironmentsError, undefined, {}, {}, ReposGetAllEnvironmentsPathParams >({ url: '/repos/{owner}/{repo}/environments', method: 'get', ...variables, signal, }); /** * Get all environments for a repository. * * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useReposGetAllEnvironments = < TData = ReposGetAllEnvironmentsResponse, >( variables: ReposGetAllEnvironmentsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetAllEnvironmentsResponse, ReposGetAllEnvironmentsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetAllEnvironmentsResponse, ReposGetAllEnvironmentsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/environments', operationId: 'reposGetAllEnvironments', variables, }), ({ signal }) => fetchReposGetAllEnvironments({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDeleteAnEnvironmentPathParams = { owner: string; repo: string; /** * The name of the environment */ environmentName: string; }; export type ReposDeleteAnEnvironmentError = Fetcher.ErrorWrapper; export type ReposDeleteAnEnvironmentVariables = { pathParams: ReposDeleteAnEnvironmentPathParams; } & GithubContext['fetcherOptions']; /** * You must authenticate using an access token with the repo scope to use this endpoint. */ export const fetchReposDeleteAnEnvironment = ( variables: ReposDeleteAnEnvironmentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteAnEnvironmentError, undefined, {}, {}, ReposDeleteAnEnvironmentPathParams >({ url: '/repos/{owner}/{repo}/environments/{environmentName}', method: 'delete', ...variables, signal, }); /** * You must authenticate using an access token with the repo scope to use this endpoint. */ export const useReposDeleteAnEnvironment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteAnEnvironmentError, ReposDeleteAnEnvironmentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteAnEnvironmentError, ReposDeleteAnEnvironmentVariables >( (variables: ReposDeleteAnEnvironmentVariables) => fetchReposDeleteAnEnvironment({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetEnvironmentPathParams = { owner: string; repo: string; /** * The name of the environment */ environmentName: string; }; export type ReposGetEnvironmentError = Fetcher.ErrorWrapper; export type ReposGetEnvironmentVariables = { pathParams: ReposGetEnvironmentPathParams; } & GithubContext['fetcherOptions']; /** * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const fetchReposGetEnvironment = ( variables: ReposGetEnvironmentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Environment, ReposGetEnvironmentError, undefined, {}, {}, ReposGetEnvironmentPathParams >({ url: '/repos/{owner}/{repo}/environments/{environmentName}', method: 'get', ...variables, signal, }); /** * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ export const useReposGetEnvironment = ( variables: ReposGetEnvironmentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Environment, ReposGetEnvironmentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Environment, ReposGetEnvironmentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/environments/{environment_name}', operationId: 'reposGetEnvironment', variables, }), ({ signal }) => fetchReposGetEnvironment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateOrUpdateEnvironmentPathParams = { owner: string; repo: string; /** * The name of the environment */ environmentName: string; }; export type ReposCreateOrUpdateEnvironmentError = Fetcher.ErrorWrapper<{ status: 422; payload: Schemas.BasicError; }>; export type ReposCreateOrUpdateEnvironmentVariables = { body?: { deployment_branch_policy?: Schemas.DeploymentBranchPolicy; /** * The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ reviewers?: | { /** * The id of the user or team who can review the deployment * * @example 4532992 */ id?: number; type?: Schemas.DeploymentReviewerType; }[] | null; wait_timer?: Schemas.WaitTimer; } | null; pathParams: ReposCreateOrUpdateEnvironmentPathParams; } & GithubContext['fetcherOptions']; /** * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." * * **Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "[Environments](/actions/reference/environments#deployment-branches)." * * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)." * * You must authenticate using an access token with the repo scope to use this endpoint. */ export const fetchReposCreateOrUpdateEnvironment = ( variables: ReposCreateOrUpdateEnvironmentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Environment, ReposCreateOrUpdateEnvironmentError, { deployment_branch_policy?: Schemas.DeploymentBranchPolicy; /** * The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ reviewers?: | { /** * The id of the user or team who can review the deployment * * @example 4532992 */ id?: number; type?: Schemas.DeploymentReviewerType; }[] | null; wait_timer?: Schemas.WaitTimer; } | null, {}, {}, ReposCreateOrUpdateEnvironmentPathParams >({ url: '/repos/{owner}/{repo}/environments/{environmentName}', method: 'put', ...variables, signal, }); /** * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." * * **Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "[Environments](/actions/reference/environments#deployment-branches)." * * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)." * * You must authenticate using an access token with the repo scope to use this endpoint. */ export const useReposCreateOrUpdateEnvironment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Environment, ReposCreateOrUpdateEnvironmentError, ReposCreateOrUpdateEnvironmentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Environment, ReposCreateOrUpdateEnvironmentError, ReposCreateOrUpdateEnvironmentVariables >( (variables: ReposCreateOrUpdateEnvironmentVariables) => fetchReposCreateOrUpdateEnvironment({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityListRepoEventsPathParams = { owner: string; repo: string; }; export type ActivityListRepoEventsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListRepoEventsError = Fetcher.ErrorWrapper; export type ActivityListRepoEventsResponse = Schemas.Event[]; export type ActivityListRepoEventsVariables = { pathParams: ActivityListRepoEventsPathParams; queryParams?: ActivityListRepoEventsQueryParams; } & GithubContext['fetcherOptions']; export const fetchActivityListRepoEvents = ( variables: ActivityListRepoEventsVariables, signal?: AbortSignal, ) => githubFetch< ActivityListRepoEventsResponse, ActivityListRepoEventsError, undefined, {}, ActivityListRepoEventsQueryParams, ActivityListRepoEventsPathParams >({ url: '/repos/{owner}/{repo}/events', method: 'get', ...variables, signal, }); export const useActivityListRepoEvents = < TData = ActivityListRepoEventsResponse, >( variables: ActivityListRepoEventsVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListRepoEventsResponse, ActivityListRepoEventsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListRepoEventsResponse, ActivityListRepoEventsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/events', operationId: 'activityListRepoEvents', variables, }), ({ signal }) => fetchActivityListRepoEvents({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListForksPathParams = { owner: string; repo: string; }; export type ReposListForksQueryParams = { /** * The sort order. Can be either `newest`, `oldest`, or `stargazers`. * * @default newest */ sort?: 'newest' | 'oldest' | 'stargazers' | 'watchers'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * legacy query parameter for specifying the org. */ org?: string; /** * legacy query parameter for specifying the org. */ organization?: string; }; export type ReposListForksError = Fetcher.ErrorWrapper<{ status: 400; payload: Responses.BadRequest; }>; export type ReposListForksResponse = Schemas.MinimalRepository[]; export type ReposListForksVariables = { pathParams: ReposListForksPathParams; queryParams?: ReposListForksQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListForks = ( variables: ReposListForksVariables, signal?: AbortSignal, ) => githubFetch< ReposListForksResponse, ReposListForksError, undefined, {}, ReposListForksQueryParams, ReposListForksPathParams >({ url: '/repos/{owner}/{repo}/forks', method: 'get', ...variables, signal, }); export const useReposListForks = ( variables: ReposListForksVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListForksResponse, ReposListForksError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListForksResponse, ReposListForksError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/forks', operationId: 'reposListForks', variables, }), ({ signal }) => fetchReposListForks({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateForkPathParams = { owner: string; repo: string; }; export type ReposCreateForkQueryParams = { /** * legacy query parameter for specifying the org. */ org?: string; /** * legacy query parameter for specifying the org. */ organization?: string; }; export type ReposCreateForkError = Fetcher.ErrorWrapper< | { status: 400; payload: Responses.BadRequest; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateForkVariables = { body?: { /** * Optional parameter to specify the organization name if forking into an organization. */ organization?: string; } | null; pathParams: ReposCreateForkPathParams; queryParams?: ReposCreateForkQueryParams; } & GithubContext['fetcherOptions']; /** * Create a fork for the authenticated user. * * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). */ export const fetchReposCreateFork = ( variables: ReposCreateForkVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Repository, ReposCreateForkError, { /** * Optional parameter to specify the organization name if forking into an organization. */ organization?: string; } | null, {}, ReposCreateForkQueryParams, ReposCreateForkPathParams >({ url: '/repos/{owner}/{repo}/forks', method: 'post', ...variables, signal, }); /** * Create a fork for the authenticated user. * * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). */ export const useReposCreateFork = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Repository, ReposCreateForkError, ReposCreateForkVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Repository, ReposCreateForkError, ReposCreateForkVariables >( (variables: ReposCreateForkVariables) => fetchReposCreateFork({ ...fetcherOptions, ...variables }), options, ); }; export type GitCreateBlobPathParams = { owner: string; repo: string; }; export type GitCreateBlobError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GitCreateBlobRequestBody = { /** * The new blob's content. */ content: string; /** * The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. * * @default utf-8 */ encoding?: string; }; export type GitCreateBlobVariables = { body: GitCreateBlobRequestBody; pathParams: GitCreateBlobPathParams; } & GithubContext['fetcherOptions']; export const fetchGitCreateBlob = ( variables: GitCreateBlobVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ShortBlob, GitCreateBlobError, GitCreateBlobRequestBody, {}, {}, GitCreateBlobPathParams >({ url: '/repos/{owner}/{repo}/git/blobs', method: 'post', ...variables, signal, }); export const useGitCreateBlob = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ShortBlob, GitCreateBlobError, GitCreateBlobVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ShortBlob, GitCreateBlobError, GitCreateBlobVariables >( (variables: GitCreateBlobVariables) => fetchGitCreateBlob({ ...fetcherOptions, ...variables }), options, ); }; export type GitGetBlobPathParams = { owner: string; repo: string; fileSha: string; }; export type GitGetBlobError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GitGetBlobVariables = { pathParams: GitGetBlobPathParams; } & GithubContext['fetcherOptions']; /** * The `content` in the response will always be Base64 encoded. * * _Note_: This API supports blobs up to 100 megabytes in size. */ export const fetchGitGetBlob = ( variables: GitGetBlobVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Blob, GitGetBlobError, undefined, {}, {}, GitGetBlobPathParams >({ url: '/repos/{owner}/{repo}/git/blobs/{fileSha}', method: 'get', ...variables, signal, }); /** * The `content` in the response will always be Base64 encoded. * * _Note_: This API supports blobs up to 100 megabytes in size. */ export const useGitGetBlob = ( variables: GitGetBlobVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/git/blobs/{file_sha}', operationId: 'gitGetBlob', variables, }), ({ signal }) => fetchGitGetBlob({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitCreateCommitPathParams = { owner: string; repo: string; }; export type GitCreateCommitError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GitCreateCommitRequestBody = { /** * Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. */ author?: { /** * Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ date?: string; /** * The email of the author (or committer) of the commit */ email?: string; /** * The name of the author (or committer) of the commit */ name?: string; }; /** * Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. */ committer?: { /** * Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ date?: string; /** * The email of the author (or committer) of the commit */ email?: string; /** * The name of the author (or committer) of the commit */ name?: string; }; /** * The commit message */ message: string; /** * The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ parents?: string[]; /** * The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ signature?: string; /** * The SHA of the tree object this commit points to */ tree: string; }; export type GitCreateCommitVariables = { body: GitCreateCommitRequestBody; pathParams: GitCreateCommitPathParams; } & GithubContext['fetcherOptions']; /** * Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchGitCreateCommit = ( variables: GitCreateCommitVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitCommit, GitCreateCommitError, GitCreateCommitRequestBody, {}, {}, GitCreateCommitPathParams >({ url: '/repos/{owner}/{repo}/git/commits', method: 'post', ...variables, signal, }); /** * Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useGitCreateCommit = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GitCommit, GitCreateCommitError, GitCreateCommitVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GitCommit, GitCreateCommitError, GitCreateCommitVariables >( (variables: GitCreateCommitVariables) => fetchGitCreateCommit({ ...fetcherOptions, ...variables }), options, ); }; export type GitGetCommitPathParams = { owner: string; repo: string; /** * commit_sha parameter */ commitSha: string; }; export type GitGetCommitError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type GitGetCommitVariables = { pathParams: GitGetCommitPathParams; } & GithubContext['fetcherOptions']; /** * Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchGitGetCommit = ( variables: GitGetCommitVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitCommit, GitGetCommitError, undefined, {}, {}, GitGetCommitPathParams >({ url: '/repos/{owner}/{repo}/git/commits/{commitSha}', method: 'get', ...variables, signal, }); /** * Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useGitGetCommit = ( variables: GitGetCommitVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/git/commits/{commit_sha}', operationId: 'gitGetCommit', variables, }), ({ signal }) => fetchGitGetCommit({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitListMatchingRefsPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type GitListMatchingRefsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GitListMatchingRefsError = Fetcher.ErrorWrapper; export type GitListMatchingRefsResponse = Schemas.GitRef[]; export type GitListMatchingRefsVariables = { pathParams: GitListMatchingRefsPathParams; queryParams?: GitListMatchingRefsQueryParams; } & GithubContext['fetcherOptions']; /** * Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array. * * When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. * * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. */ export const fetchGitListMatchingRefs = ( variables: GitListMatchingRefsVariables, signal?: AbortSignal, ) => githubFetch< GitListMatchingRefsResponse, GitListMatchingRefsError, undefined, {}, GitListMatchingRefsQueryParams, GitListMatchingRefsPathParams >({ url: '/repos/{owner}/{repo}/git/matching-refs/{ref}', method: 'get', ...variables, signal, }); /** * Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array. * * When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. * * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. */ export const useGitListMatchingRefs = ( variables: GitListMatchingRefsVariables, options?: Omit< reactQuery.UseQueryOptions< GitListMatchingRefsResponse, GitListMatchingRefsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GitListMatchingRefsResponse, GitListMatchingRefsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/git/matching-refs/{ref}', operationId: 'gitListMatchingRefs', variables, }), ({ signal }) => fetchGitListMatchingRefs({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitGetRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type GitGetRefError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type GitGetRefVariables = { pathParams: GitGetRefPathParams; } & GithubContext['fetcherOptions']; /** * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned. * * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". */ export const fetchGitGetRef = ( variables: GitGetRefVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitRef, GitGetRefError, undefined, {}, {}, GitGetRefPathParams >({ url: '/repos/{owner}/{repo}/git/ref/{ref}', method: 'get', ...variables, signal, }); /** * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned. * * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". */ export const useGitGetRef = ( variables: GitGetRefVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/git/ref/{ref}', operationId: 'gitGetRef', variables, }), ({ signal }) => fetchGitGetRef({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitCreateRefPathParams = { owner: string; repo: string; }; export type GitCreateRefError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type GitCreateRefRequestBody = { /** * @example "refs/heads/newbranch" */ key?: string; /** * The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ ref: string; /** * The SHA1 value for this reference. */ sha: string; }; export type GitCreateRefVariables = { body: GitCreateRefRequestBody; pathParams: GitCreateRefPathParams; } & GithubContext['fetcherOptions']; /** * Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. */ export const fetchGitCreateRef = ( variables: GitCreateRefVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitRef, GitCreateRefError, GitCreateRefRequestBody, {}, {}, GitCreateRefPathParams >({ url: '/repos/{owner}/{repo}/git/refs', method: 'post', ...variables, signal, }); /** * Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. */ export const useGitCreateRef = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GitRef, GitCreateRefError, GitCreateRefVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GitRef, GitCreateRefError, GitCreateRefVariables >( (variables: GitCreateRefVariables) => fetchGitCreateRef({ ...fetcherOptions, ...variables }), options, ); }; export type GitDeleteRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type GitDeleteRefError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type GitDeleteRefVariables = { pathParams: GitDeleteRefPathParams; } & GithubContext['fetcherOptions']; export const fetchGitDeleteRef = ( variables: GitDeleteRefVariables, signal?: AbortSignal, ) => githubFetch< undefined, GitDeleteRefError, undefined, {}, {}, GitDeleteRefPathParams >({ url: '/repos/{owner}/{repo}/git/refs/{ref}', method: 'delete', ...variables, signal, }); export const useGitDeleteRef = ( options?: Omit< reactQuery.UseMutationOptions< undefined, GitDeleteRefError, GitDeleteRefVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, GitDeleteRefError, GitDeleteRefVariables >( (variables: GitDeleteRefVariables) => fetchGitDeleteRef({ ...fetcherOptions, ...variables }), options, ); }; export type GitUpdateRefPathParams = { owner: string; repo: string; /** * ref parameter */ ref: string; }; export type GitUpdateRefError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type GitUpdateRefRequestBody = { /** * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. * * @default false */ force?: boolean; /** * The SHA1 value to set this reference to */ sha: string; }; export type GitUpdateRefVariables = { body: GitUpdateRefRequestBody; pathParams: GitUpdateRefPathParams; } & GithubContext['fetcherOptions']; export const fetchGitUpdateRef = ( variables: GitUpdateRefVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitRef, GitUpdateRefError, GitUpdateRefRequestBody, {}, {}, GitUpdateRefPathParams >({ url: '/repos/{owner}/{repo}/git/refs/{ref}', method: 'patch', ...variables, signal, }); export const useGitUpdateRef = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GitRef, GitUpdateRefError, GitUpdateRefVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GitRef, GitUpdateRefError, GitUpdateRefVariables >( (variables: GitUpdateRefVariables) => fetchGitUpdateRef({ ...fetcherOptions, ...variables }), options, ); }; export type GitCreateTagPathParams = { owner: string; repo: string; }; export type GitCreateTagError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type GitCreateTagRequestBody = { /** * The tag message. */ message: string; /** * The SHA of the git object this is tagging. */ object: string; /** * The tag's name. This is typically a version (e.g., "v0.0.1"). */ tag: string; /** * An object with information about the individual creating the tag. */ tagger?: { /** * When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ date?: string; /** * The email of the author of the tag */ email?: string; /** * The name of the author of the tag */ name?: string; }; /** * The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. */ type: 'commit' | 'tree' | 'blob'; }; export type GitCreateTagVariables = { body: GitCreateTagRequestBody; pathParams: GitCreateTagPathParams; } & GithubContext['fetcherOptions']; /** * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchGitCreateTag = ( variables: GitCreateTagVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitTag, GitCreateTagError, GitCreateTagRequestBody, {}, {}, GitCreateTagPathParams >({ url: '/repos/{owner}/{repo}/git/tags', method: 'post', ...variables, signal, }); /** * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useGitCreateTag = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GitTag, GitCreateTagError, GitCreateTagVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GitTag, GitCreateTagError, GitCreateTagVariables >( (variables: GitCreateTagVariables) => fetchGitCreateTag({ ...fetcherOptions, ...variables }), options, ); }; export type GitGetTagPathParams = { owner: string; repo: string; tagSha: string; }; export type GitGetTagError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type GitGetTagVariables = { pathParams: GitGetTagPathParams; } & GithubContext['fetcherOptions']; /** * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const fetchGitGetTag = ( variables: GitGetTagVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitTag, GitGetTagError, undefined, {}, {}, GitGetTagPathParams >({ url: '/repos/{owner}/{repo}/git/tags/{tagSha}', method: 'get', ...variables, signal, }); /** * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: * * | Name | Type | Description | * | ---- | ---- | ----------- | * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | * | `signature` | `string` | The signature that was extracted from the commit. | * | `payload` | `string` | The value that was signed. | * * These are the possible values for `reason` in the `verification` object: * * | Value | Description | * | ----- | ----------- | * | `expired_key` | The key that made the signature is expired. | * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | * | `gpgverify_error` | There was an error communicating with the signature verification service. | * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | * | `unsigned` | The object does not include a signature. | * | `unknown_signature_type` | A non-PGP signature was found in the commit. | * | `no_user` | No user was associated with the `committer` email address in the commit. | * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | * | `unknown_key` | The key that made the signature has not been registered with any user's account. | * | `malformed_signature` | There was an error parsing the signature. | * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | * | `valid` | None of the above errors applied, so the signature is considered to be verified. | */ export const useGitGetTag = ( variables: GitGetTagVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/git/tags/{tag_sha}', operationId: 'gitGetTag', variables, }), ({ signal }) => fetchGitGetTag({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type GitCreateTreePathParams = { owner: string; repo: string; }; export type GitCreateTreeError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GitCreateTreeRequestBody = { /** * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. * If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. */ base_tree?: string; /** * Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. */ tree: { /** * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. * * **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. */ content?: string; /** * The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink. */ mode?: '100644' | '100755' | '040000' | '160000' | '120000'; /** * The file referenced in the tree. */ path?: string; /** * The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. * * **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. */ sha?: string | null; /** * Either `blob`, `tree`, or `commit`. */ type?: 'blob' | 'tree' | 'commit'; }[]; }; export type GitCreateTreeVariables = { body: GitCreateTreeRequestBody; pathParams: GitCreateTreePathParams; } & GithubContext['fetcherOptions']; /** * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. * * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." */ export const fetchGitCreateTree = ( variables: GitCreateTreeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitTree, GitCreateTreeError, GitCreateTreeRequestBody, {}, {}, GitCreateTreePathParams >({ url: '/repos/{owner}/{repo}/git/trees', method: 'post', ...variables, signal, }); /** * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. * * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." */ export const useGitCreateTree = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GitTree, GitCreateTreeError, GitCreateTreeVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GitTree, GitCreateTreeError, GitCreateTreeVariables >( (variables: GitCreateTreeVariables) => fetchGitCreateTree({ ...fetcherOptions, ...variables }), options, ); }; export type GitGetTreePathParams = { owner: string; repo: string; treeSha: string; }; export type GitGetTreeQueryParams = { /** * Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees. */ recursive?: string; }; export type GitGetTreeError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type GitGetTreeVariables = { pathParams: GitGetTreePathParams; queryParams?: GitGetTreeQueryParams; } & GithubContext['fetcherOptions']; /** * Returns a single tree using the SHA1 value for that tree. * * If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. */ export const fetchGitGetTree = ( variables: GitGetTreeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GitTree, GitGetTreeError, undefined, {}, GitGetTreeQueryParams, GitGetTreePathParams >({ url: '/repos/{owner}/{repo}/git/trees/{treeSha}', method: 'get', ...variables, signal, }); /** * Returns a single tree using the SHA1 value for that tree. * * If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. */ export const useGitGetTree = ( variables: GitGetTreeVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/git/trees/{tree_sha}', operationId: 'gitGetTree', variables, }), ({ signal }) => fetchGitGetTree({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposListWebhooksPathParams = { owner: string; repo: string; }; export type ReposListWebhooksQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListWebhooksError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposListWebhooksResponse = Schemas.Hook[]; export type ReposListWebhooksVariables = { pathParams: ReposListWebhooksPathParams; queryParams?: ReposListWebhooksQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListWebhooks = ( variables: ReposListWebhooksVariables, signal?: AbortSignal, ) => githubFetch< ReposListWebhooksResponse, ReposListWebhooksError, undefined, {}, ReposListWebhooksQueryParams, ReposListWebhooksPathParams >({ url: '/repos/{owner}/{repo}/hooks', method: 'get', ...variables, signal, }); export const useReposListWebhooks = ( variables: ReposListWebhooksVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListWebhooksResponse, ReposListWebhooksError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListWebhooksResponse, ReposListWebhooksError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/hooks', operationId: 'reposListWebhooks', variables, }), ({ signal }) => fetchReposListWebhooks({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateWebhookPathParams = { owner: string; repo: string; }; export type ReposCreateWebhookError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateWebhookRequestBody = { /** * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. * * @default true */ active?: boolean; /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ config: { content_type?: Schemas.WebhookConfigContentType; /** * @example "sha256" */ digest?: string; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; secret?: Schemas.WebhookConfigSecret; /** * @example "abc" */ token?: string; url: Schemas.WebhookConfigUrl; }; /** * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. * * @default push */ events?: string[]; /** * Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. */ name?: string; }; export type ReposCreateWebhookVariables = { body: ReposCreateWebhookRequestBody; pathParams: ReposCreateWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can * share the same `config` as long as those webhooks do not have any `events` that overlap. */ export const fetchReposCreateWebhook = ( variables: ReposCreateWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Hook, ReposCreateWebhookError, ReposCreateWebhookRequestBody, {}, {}, ReposCreateWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks', method: 'post', ...variables, signal, }); /** * Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can * share the same `config` as long as those webhooks do not have any `events` that overlap. */ export const useReposCreateWebhook = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Hook, ReposCreateWebhookError, ReposCreateWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Hook, ReposCreateWebhookError, ReposCreateWebhookVariables >( (variables: ReposCreateWebhookVariables) => fetchReposCreateWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteWebhookPathParams = { owner: string; repo: string; hookId: number; }; export type ReposDeleteWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposDeleteWebhookVariables = { pathParams: ReposDeleteWebhookPathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeleteWebhook = ( variables: ReposDeleteWebhookVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteWebhookError, undefined, {}, {}, ReposDeleteWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}', method: 'delete', ...variables, signal, }); export const useReposDeleteWebhook = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteWebhookError, ReposDeleteWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteWebhookError, ReposDeleteWebhookVariables >( (variables: ReposDeleteWebhookVariables) => fetchReposDeleteWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetWebhookPathParams = { owner: string; repo: string; hookId: number; }; export type ReposGetWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetWebhookVariables = { pathParams: ReposGetWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." */ export const fetchReposGetWebhook = ( variables: ReposGetWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Hook, ReposGetWebhookError, undefined, {}, {}, ReposGetWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}', method: 'get', ...variables, signal, }); /** * Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." */ export const useReposGetWebhook = ( variables: ReposGetWebhookVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/hooks/{hook_id}', operationId: 'reposGetWebhook', variables, }), ({ signal }) => fetchReposGetWebhook({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUpdateWebhookPathParams = { owner: string; repo: string; hookId: number; }; export type ReposUpdateWebhookError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposUpdateWebhookRequestBody = { /** * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. * * @default true */ active?: boolean; /** * Determines a list of events to be added to the list of events that the Hook triggers for. */ add_events?: string[]; /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ config?: { /** * @example "bar@example.com" */ address?: string; content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; /** * @example "The Serious Room" */ room?: string; secret?: Schemas.WebhookConfigSecret; url: Schemas.WebhookConfigUrl; }; /** * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. * * @default push */ events?: string[]; /** * Determines a list of events to be removed from the list of events that the Hook triggers for. */ remove_events?: string[]; }; export type ReposUpdateWebhookVariables = { body?: ReposUpdateWebhookRequestBody; pathParams: ReposUpdateWebhookPathParams; } & GithubContext['fetcherOptions']; /** * Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." */ export const fetchReposUpdateWebhook = ( variables: ReposUpdateWebhookVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Hook, ReposUpdateWebhookError, ReposUpdateWebhookRequestBody, {}, {}, ReposUpdateWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}', method: 'patch', ...variables, signal, }); /** * Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." */ export const useReposUpdateWebhook = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Hook, ReposUpdateWebhookError, ReposUpdateWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Hook, ReposUpdateWebhookError, ReposUpdateWebhookVariables >( (variables: ReposUpdateWebhookVariables) => fetchReposUpdateWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetWebhookConfigForRepoPathParams = { owner: string; repo: string; hookId: number; }; export type ReposGetWebhookConfigForRepoError = Fetcher.ErrorWrapper; export type ReposGetWebhookConfigForRepoVariables = { pathParams: ReposGetWebhookConfigForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." * * Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission. */ export const fetchReposGetWebhookConfigForRepo = ( variables: ReposGetWebhookConfigForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, ReposGetWebhookConfigForRepoError, undefined, {}, {}, ReposGetWebhookConfigForRepoPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}/config', method: 'get', ...variables, signal, }); /** * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." * * Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission. */ export const useReposGetWebhookConfigForRepo = ( variables: ReposGetWebhookConfigForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.WebhookConfig, ReposGetWebhookConfigForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.WebhookConfig, ReposGetWebhookConfigForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/hooks/{hook_id}/config', operationId: 'reposGetWebhookConfigForRepo', variables, }), ({ signal }) => fetchReposGetWebhookConfigForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposUpdateWebhookConfigForRepoPathParams = { owner: string; repo: string; hookId: number; }; export type ReposUpdateWebhookConfigForRepoError = Fetcher.ErrorWrapper; export type ReposUpdateWebhookConfigForRepoRequestBody = { content_type?: Schemas.WebhookConfigContentType; insecure_ssl?: Schemas.WebhookConfigInsecureSsl; secret?: Schemas.WebhookConfigSecret; url?: Schemas.WebhookConfigUrl; }; export type ReposUpdateWebhookConfigForRepoVariables = { body?: ReposUpdateWebhookConfigForRepoRequestBody; pathParams: ReposUpdateWebhookConfigForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." * * Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission. */ export const fetchReposUpdateWebhookConfigForRepo = ( variables: ReposUpdateWebhookConfigForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.WebhookConfig, ReposUpdateWebhookConfigForRepoError, ReposUpdateWebhookConfigForRepoRequestBody, {}, {}, ReposUpdateWebhookConfigForRepoPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}/config', method: 'patch', ...variables, signal, }); /** * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." * * Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission. */ export const useReposUpdateWebhookConfigForRepo = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.WebhookConfig, ReposUpdateWebhookConfigForRepoError, ReposUpdateWebhookConfigForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.WebhookConfig, ReposUpdateWebhookConfigForRepoError, ReposUpdateWebhookConfigForRepoVariables >( (variables: ReposUpdateWebhookConfigForRepoVariables) => fetchReposUpdateWebhookConfigForRepo({ ...fetcherOptions, ...variables }), options, ); }; export type ReposPingWebhookPathParams = { owner: string; repo: string; hookId: number; }; export type ReposPingWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposPingWebhookVariables = { pathParams: ReposPingWebhookPathParams; } & GithubContext['fetcherOptions']; /** * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ export const fetchReposPingWebhook = ( variables: ReposPingWebhookVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposPingWebhookError, undefined, {}, {}, ReposPingWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}/pings', method: 'post', ...variables, signal, }); /** * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ export const useReposPingWebhook = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposPingWebhookError, ReposPingWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposPingWebhookError, ReposPingWebhookVariables >( (variables: ReposPingWebhookVariables) => fetchReposPingWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type ReposTestPushWebhookPathParams = { owner: string; repo: string; hookId: number; }; export type ReposTestPushWebhookError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposTestPushWebhookVariables = { pathParams: ReposTestPushWebhookPathParams; } & GithubContext['fetcherOptions']; /** * This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated. * * **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` */ export const fetchReposTestPushWebhook = ( variables: ReposTestPushWebhookVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposTestPushWebhookError, undefined, {}, {}, ReposTestPushWebhookPathParams >({ url: '/repos/{owner}/{repo}/hooks/{hookId}/tests', method: 'post', ...variables, signal, }); /** * This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated. * * **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` */ export const useReposTestPushWebhook = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposTestPushWebhookError, ReposTestPushWebhookVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposTestPushWebhookError, ReposTestPushWebhookVariables >( (variables: ReposTestPushWebhookVariables) => fetchReposTestPushWebhook({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsCancelImportPathParams = { owner: string; repo: string; }; export type MigrationsCancelImportError = Fetcher.ErrorWrapper; export type MigrationsCancelImportVariables = { pathParams: MigrationsCancelImportPathParams; } & GithubContext['fetcherOptions']; /** * Stop an import for a repository. */ export const fetchMigrationsCancelImport = ( variables: MigrationsCancelImportVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsCancelImportError, undefined, {}, {}, MigrationsCancelImportPathParams >({ url: '/repos/{owner}/{repo}/import', method: 'delete', ...variables, signal, }); /** * Stop an import for a repository. */ export const useMigrationsCancelImport = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MigrationsCancelImportError, MigrationsCancelImportVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MigrationsCancelImportError, MigrationsCancelImportVariables >( (variables: MigrationsCancelImportVariables) => fetchMigrationsCancelImport({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsGetImportStatusPathParams = { owner: string; repo: string; }; export type MigrationsGetImportStatusError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsGetImportStatusVariables = { pathParams: MigrationsGetImportStatusPathParams; } & GithubContext['fetcherOptions']; /** * View the progress of an import. * * **Import status** * * This section includes details about the possible values of the `status` field of the Import Progress response. * * An import that does not have errors will progress through these steps: * * * `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL. * * `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import). * * `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * * `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects". * * `complete` - the import is complete, and the repository is ready on GitHub. * * If there are problems, you will see one of these in the `status` field: * * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * **The project_choices field** * * When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. * * **Git LFS related fields** * * This section includes details about Git LFS related fields that may be present in the Import Progress response. * * * `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken. * * `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step. * * `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository. * * `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. */ export const fetchMigrationsGetImportStatus = ( variables: MigrationsGetImportStatusVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Import, MigrationsGetImportStatusError, undefined, {}, {}, MigrationsGetImportStatusPathParams >({ url: '/repos/{owner}/{repo}/import', method: 'get', ...variables, signal, }); /** * View the progress of an import. * * **Import status** * * This section includes details about the possible values of the `status` field of the Import Progress response. * * An import that does not have errors will progress through these steps: * * * `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL. * * `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import). * * `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * * `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects". * * `complete` - the import is complete, and the repository is ready on GitHub. * * If there are problems, you will see one of these in the `status` field: * * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * **The project_choices field** * * When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. * * **Git LFS related fields** * * This section includes details about Git LFS related fields that may be present in the Import Progress response. * * * `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken. * * `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step. * * `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository. * * `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. */ export const useMigrationsGetImportStatus = ( variables: MigrationsGetImportStatusVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Import, MigrationsGetImportStatusError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Import, MigrationsGetImportStatusError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/import', operationId: 'migrationsGetImportStatus', variables, }), ({ signal }) => fetchMigrationsGetImportStatus( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsUpdateImportPathParams = { owner: string; repo: string; }; export type MigrationsUpdateImportError = Fetcher.ErrorWrapper; export type MigrationsUpdateImportRequestBody = { /** * @example "project1" */ tfvc_project?: string; /** * @example "git" */ vcs?: string; /** * The password to provide to the originating repository. */ vcs_password?: string; /** * The username to provide to the originating repository. */ vcs_username?: string; }; export type MigrationsUpdateImportVariables = { body?: MigrationsUpdateImportRequestBody; pathParams: MigrationsUpdateImportPathParams; } & GithubContext['fetcherOptions']; /** * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API * request. If no parameters are provided, the import will be restarted. */ export const fetchMigrationsUpdateImport = ( variables: MigrationsUpdateImportVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Import, MigrationsUpdateImportError, MigrationsUpdateImportRequestBody, {}, {}, MigrationsUpdateImportPathParams >({ url: '/repos/{owner}/{repo}/import', method: 'patch', ...variables, signal, }); /** * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API * request. If no parameters are provided, the import will be restarted. */ export const useMigrationsUpdateImport = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Import, MigrationsUpdateImportError, MigrationsUpdateImportVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Import, MigrationsUpdateImportError, MigrationsUpdateImportVariables >( (variables: MigrationsUpdateImportVariables) => fetchMigrationsUpdateImport({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsStartImportPathParams = { owner: string; repo: string; }; export type MigrationsStartImportError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type MigrationsStartImportRequestBody = { /** * For a tfvc import, the name of the project that is being imported. */ tfvc_project?: string; /** * The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ vcs?: 'subversion' | 'git' | 'mercurial' | 'tfvc'; /** * If authentication is required, the password to provide to `vcs_url`. */ vcs_password?: string; /** * The URL of the originating repository. */ vcs_url: string; /** * If authentication is required, the username to provide to `vcs_url`. */ vcs_username?: string; }; export type MigrationsStartImportVariables = { body: MigrationsStartImportRequestBody; pathParams: MigrationsStartImportPathParams; } & GithubContext['fetcherOptions']; /** * Start a source import to a GitHub repository using GitHub Importer. */ export const fetchMigrationsStartImport = ( variables: MigrationsStartImportVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Import, MigrationsStartImportError, MigrationsStartImportRequestBody, {}, {}, MigrationsStartImportPathParams >({ url: '/repos/{owner}/{repo}/import', method: 'put', ...variables, signal, }); /** * Start a source import to a GitHub repository using GitHub Importer. */ export const useMigrationsStartImport = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Import, MigrationsStartImportError, MigrationsStartImportVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Import, MigrationsStartImportError, MigrationsStartImportVariables >( (variables: MigrationsStartImportVariables) => fetchMigrationsStartImport({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsGetCommitAuthorsPathParams = { owner: string; repo: string; }; export type MigrationsGetCommitAuthorsQueryParams = { /** * A user ID. Only return users with an ID greater than this ID. */ since?: number; }; export type MigrationsGetCommitAuthorsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsGetCommitAuthorsResponse = Schemas.PorterAuthor[]; export type MigrationsGetCommitAuthorsVariables = { pathParams: MigrationsGetCommitAuthorsPathParams; queryParams?: MigrationsGetCommitAuthorsQueryParams; } & GithubContext['fetcherOptions']; /** * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `. * * This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. */ export const fetchMigrationsGetCommitAuthors = ( variables: MigrationsGetCommitAuthorsVariables, signal?: AbortSignal, ) => githubFetch< MigrationsGetCommitAuthorsResponse, MigrationsGetCommitAuthorsError, undefined, {}, MigrationsGetCommitAuthorsQueryParams, MigrationsGetCommitAuthorsPathParams >({ url: '/repos/{owner}/{repo}/import/authors', method: 'get', ...variables, signal, }); /** * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `. * * This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. */ export const useMigrationsGetCommitAuthors = < TData = MigrationsGetCommitAuthorsResponse, >( variables: MigrationsGetCommitAuthorsVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsGetCommitAuthorsResponse, MigrationsGetCommitAuthorsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsGetCommitAuthorsResponse, MigrationsGetCommitAuthorsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/import/authors', operationId: 'migrationsGetCommitAuthors', variables, }), ({ signal }) => fetchMigrationsGetCommitAuthors( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsMapCommitAuthorPathParams = { owner: string; repo: string; authorId: number; }; export type MigrationsMapCommitAuthorError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type MigrationsMapCommitAuthorRequestBody = { /** * The new Git author email. */ email?: string; /** * The new Git author name. */ name?: string; /** * @example "can't touch this" */ remote_id?: string; }; export type MigrationsMapCommitAuthorVariables = { body?: MigrationsMapCommitAuthorRequestBody; pathParams: MigrationsMapCommitAuthorPathParams; } & GithubContext['fetcherOptions']; /** * Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. */ export const fetchMigrationsMapCommitAuthor = ( variables: MigrationsMapCommitAuthorVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PorterAuthor, MigrationsMapCommitAuthorError, MigrationsMapCommitAuthorRequestBody, {}, {}, MigrationsMapCommitAuthorPathParams >({ url: '/repos/{owner}/{repo}/import/authors/{authorId}', method: 'patch', ...variables, signal, }); /** * Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. */ export const useMigrationsMapCommitAuthor = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PorterAuthor, MigrationsMapCommitAuthorError, MigrationsMapCommitAuthorVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PorterAuthor, MigrationsMapCommitAuthorError, MigrationsMapCommitAuthorVariables >( (variables: MigrationsMapCommitAuthorVariables) => fetchMigrationsMapCommitAuthor({ ...fetcherOptions, ...variables }), options, ); }; export type MigrationsGetLargeFilesPathParams = { owner: string; repo: string; }; export type MigrationsGetLargeFilesError = Fetcher.ErrorWrapper; export type MigrationsGetLargeFilesResponse = Schemas.PorterLargeFile[]; export type MigrationsGetLargeFilesVariables = { pathParams: MigrationsGetLargeFilesPathParams; } & GithubContext['fetcherOptions']; /** * List files larger than 100MB found during the import */ export const fetchMigrationsGetLargeFiles = ( variables: MigrationsGetLargeFilesVariables, signal?: AbortSignal, ) => githubFetch< MigrationsGetLargeFilesResponse, MigrationsGetLargeFilesError, undefined, {}, {}, MigrationsGetLargeFilesPathParams >({ url: '/repos/{owner}/{repo}/import/large_files', method: 'get', ...variables, signal, }); /** * List files larger than 100MB found during the import */ export const useMigrationsGetLargeFiles = < TData = MigrationsGetLargeFilesResponse, >( variables: MigrationsGetLargeFilesVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsGetLargeFilesResponse, MigrationsGetLargeFilesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsGetLargeFilesResponse, MigrationsGetLargeFilesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/import/large_files', operationId: 'migrationsGetLargeFiles', variables, }), ({ signal }) => fetchMigrationsGetLargeFiles({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type MigrationsSetLfsPreferencePathParams = { owner: string; repo: string; }; export type MigrationsSetLfsPreferenceError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type MigrationsSetLfsPreferenceRequestBody = { /** * Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). */ use_lfs: 'opt_in' | 'opt_out'; }; export type MigrationsSetLfsPreferenceVariables = { body: MigrationsSetLfsPreferenceRequestBody; pathParams: MigrationsSetLfsPreferencePathParams; } & GithubContext['fetcherOptions']; /** * You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). */ export const fetchMigrationsSetLfsPreference = ( variables: MigrationsSetLfsPreferenceVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Import, MigrationsSetLfsPreferenceError, MigrationsSetLfsPreferenceRequestBody, {}, {}, MigrationsSetLfsPreferencePathParams >({ url: '/repos/{owner}/{repo}/import/lfs', method: 'patch', ...variables, signal, }); /** * You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). */ export const useMigrationsSetLfsPreference = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Import, MigrationsSetLfsPreferenceError, MigrationsSetLfsPreferenceVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Import, MigrationsSetLfsPreferenceError, MigrationsSetLfsPreferenceVariables >( (variables: MigrationsSetLfsPreferenceVariables) => fetchMigrationsSetLfsPreference({ ...fetcherOptions, ...variables }), options, ); }; export type AppsGetRepoInstallationPathParams = { owner: string; repo: string; }; export type AppsGetRepoInstallationError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 404; payload: Responses.NotFound; } >; export type AppsGetRepoInstallationVariables = { pathParams: AppsGetRepoInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetRepoInstallation = ( variables: AppsGetRepoInstallationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Installation, AppsGetRepoInstallationError, undefined, {}, {}, AppsGetRepoInstallationPathParams >({ url: '/repos/{owner}/{repo}/installation', method: 'get', ...variables, signal, }); /** * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetRepoInstallation = ( variables: AppsGetRepoInstallationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Installation, AppsGetRepoInstallationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Installation, AppsGetRepoInstallationError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/installation', operationId: 'appsGetRepoInstallation', variables, }), ({ signal }) => fetchAppsGetRepoInstallation({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type InteractionsRemoveRestrictionsForRepoPathParams = { owner: string; repo: string; }; export type InteractionsRemoveRestrictionsForRepoError = Fetcher.ErrorWrapper; export type InteractionsRemoveRestrictionsForRepoVariables = { pathParams: InteractionsRemoveRestrictionsForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ export const fetchInteractionsRemoveRestrictionsForRepo = ( variables: InteractionsRemoveRestrictionsForRepoVariables, signal?: AbortSignal, ) => githubFetch< undefined, InteractionsRemoveRestrictionsForRepoError, undefined, {}, {}, InteractionsRemoveRestrictionsForRepoPathParams >({ url: '/repos/{owner}/{repo}/interaction-limits', method: 'delete', ...variables, signal, }); /** * Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ export const useInteractionsRemoveRestrictionsForRepo = ( options?: Omit< reactQuery.UseMutationOptions< undefined, InteractionsRemoveRestrictionsForRepoError, InteractionsRemoveRestrictionsForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, InteractionsRemoveRestrictionsForRepoError, InteractionsRemoveRestrictionsForRepoVariables >( (variables: InteractionsRemoveRestrictionsForRepoVariables) => fetchInteractionsRemoveRestrictionsForRepo({ ...fetcherOptions, ...variables, }), options, ); }; export type InteractionsGetRestrictionsForRepoPathParams = { owner: string; repo: string; }; export type InteractionsGetRestrictionsForRepoError = Fetcher.ErrorWrapper; export type InteractionsGetRestrictionsForRepoVariables = { pathParams: InteractionsGetRestrictionsForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. */ export const fetchInteractionsGetRestrictionsForRepo = ( variables: InteractionsGetRestrictionsForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForRepoError, undefined, {}, {}, InteractionsGetRestrictionsForRepoPathParams >({ url: '/repos/{owner}/{repo}/interaction-limits', method: 'get', ...variables, signal, }); /** * Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. */ export const useInteractionsGetRestrictionsForRepo = < TData = Schemas.InteractionLimitResponse, >( variables: InteractionsGetRestrictionsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/interaction-limits', operationId: 'interactionsGetRestrictionsForRepo', variables, }), ({ signal }) => fetchInteractionsGetRestrictionsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type InteractionsSetRestrictionsForRepoPathParams = { owner: string; repo: string; }; export type InteractionsSetRestrictionsForRepoError = Fetcher.ErrorWrapper; export type InteractionsSetRestrictionsForRepoVariables = { body: Schemas.InteractionLimit; pathParams: InteractionsSetRestrictionsForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ export const fetchInteractionsSetRestrictionsForRepo = ( variables: InteractionsSetRestrictionsForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForRepoError, Schemas.InteractionLimit, {}, {}, InteractionsSetRestrictionsForRepoPathParams >({ url: '/repos/{owner}/{repo}/interaction-limits', method: 'put', ...variables, signal, }); /** * Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ export const useInteractionsSetRestrictionsForRepo = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForRepoError, InteractionsSetRestrictionsForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForRepoError, InteractionsSetRestrictionsForRepoVariables >( (variables: InteractionsSetRestrictionsForRepoVariables) => fetchInteractionsSetRestrictionsForRepo({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposListInvitationsPathParams = { owner: string; repo: string; }; export type ReposListInvitationsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListInvitationsError = Fetcher.ErrorWrapper; export type ReposListInvitationsResponse = Schemas.RepositoryInvitation[]; export type ReposListInvitationsVariables = { pathParams: ReposListInvitationsPathParams; queryParams?: ReposListInvitationsQueryParams; } & GithubContext['fetcherOptions']; /** * When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. */ export const fetchReposListInvitations = ( variables: ReposListInvitationsVariables, signal?: AbortSignal, ) => githubFetch< ReposListInvitationsResponse, ReposListInvitationsError, undefined, {}, ReposListInvitationsQueryParams, ReposListInvitationsPathParams >({ url: '/repos/{owner}/{repo}/invitations', method: 'get', ...variables, signal, }); /** * When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. */ export const useReposListInvitations = ( variables: ReposListInvitationsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListInvitationsResponse, ReposListInvitationsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListInvitationsResponse, ReposListInvitationsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/invitations', operationId: 'reposListInvitations', variables, }), ({ signal }) => fetchReposListInvitations({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDeleteInvitationPathParams = { owner: string; repo: string; /** * invitation_id parameter */ invitationId: number; }; export type ReposDeleteInvitationError = Fetcher.ErrorWrapper; export type ReposDeleteInvitationVariables = { pathParams: ReposDeleteInvitationPathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeleteInvitation = ( variables: ReposDeleteInvitationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteInvitationError, undefined, {}, {}, ReposDeleteInvitationPathParams >({ url: '/repos/{owner}/{repo}/invitations/{invitationId}', method: 'delete', ...variables, signal, }); export const useReposDeleteInvitation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteInvitationError, ReposDeleteInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteInvitationError, ReposDeleteInvitationVariables >( (variables: ReposDeleteInvitationVariables) => fetchReposDeleteInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type ReposUpdateInvitationPathParams = { owner: string; repo: string; /** * invitation_id parameter */ invitationId: number; }; export type ReposUpdateInvitationError = Fetcher.ErrorWrapper; export type ReposUpdateInvitationRequestBody = { /** * The permissions that the associated user will have on the repository. Valid values are `read`, `write`, `maintain`, `triage`, and `admin`. */ permissions?: 'read' | 'write' | 'maintain' | 'triage' | 'admin'; }; export type ReposUpdateInvitationVariables = { body?: ReposUpdateInvitationRequestBody; pathParams: ReposUpdateInvitationPathParams; } & GithubContext['fetcherOptions']; export const fetchReposUpdateInvitation = ( variables: ReposUpdateInvitationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositoryInvitation, ReposUpdateInvitationError, ReposUpdateInvitationRequestBody, {}, {}, ReposUpdateInvitationPathParams >({ url: '/repos/{owner}/{repo}/invitations/{invitationId}', method: 'patch', ...variables, signal, }); export const useReposUpdateInvitation = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RepositoryInvitation, ReposUpdateInvitationError, ReposUpdateInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RepositoryInvitation, ReposUpdateInvitationError, ReposUpdateInvitationVariables >( (variables: ReposUpdateInvitationVariables) => fetchReposUpdateInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListForRepoPathParams = { owner: string; repo: string; }; export type IssuesListForRepoQueryParams = { /** * If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. */ milestone?: string; /** * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. */ assignee?: string; /** * The user that created the issue. */ creator?: string; /** * A user that's mentioned in the issue. */ mentioned?: string; /** * A list of comma separated label names. Example: `bug,ui,@high` */ labels?: string; /** * What to sort results by. Can be either `created`, `updated`, `comments`. * * @default created */ sort?: 'created' | 'updated' | 'comments'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListForRepoError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesListForRepoResponse = Schemas.IssueSimple[]; export type IssuesListForRepoVariables = { pathParams: IssuesListForRepoPathParams; queryParams?: IssuesListForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * List issues in a repository. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchIssuesListForRepo = ( variables: IssuesListForRepoVariables, signal?: AbortSignal, ) => githubFetch< IssuesListForRepoResponse, IssuesListForRepoError, undefined, {}, IssuesListForRepoQueryParams, IssuesListForRepoPathParams >({ url: '/repos/{owner}/{repo}/issues', method: 'get', ...variables, signal, }); /** * List issues in a repository. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useIssuesListForRepo = ( variables: IssuesListForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListForRepoResponse, IssuesListForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListForRepoResponse, IssuesListForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues', operationId: 'issuesListForRepo', variables, }), ({ signal }) => fetchIssuesListForRepo({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesCreatePathParams = { owner: string; repo: string; }; export type IssuesCreateError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type IssuesCreateRequestBody = { /** * Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ assignee?: string | null; /** * Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ assignees?: string[]; /** * The contents of the issue. */ body?: string; /** * Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ labels?: ( | string | { color?: string | null; description?: string | null; id?: number; name?: string; } )[]; milestone?: string | number | null; /** * The title of the issue. */ title: string | number; }; export type IssuesCreateVariables = { body: IssuesCreateRequestBody; pathParams: IssuesCreatePathParams; } & GithubContext['fetcherOptions']; /** * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const fetchIssuesCreate = ( variables: IssuesCreateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Issue, IssuesCreateError, IssuesCreateRequestBody, {}, {}, IssuesCreatePathParams >({ url: '/repos/{owner}/{repo}/issues', method: 'post', ...variables, signal, }); /** * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const useIssuesCreate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Issue, IssuesCreateError, IssuesCreateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Issue, IssuesCreateError, IssuesCreateVariables >( (variables: IssuesCreateVariables) => fetchIssuesCreate({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListCommentsForRepoPathParams = { owner: string; repo: string; }; export type IssuesListCommentsForRepoQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * Either `asc` or `desc`. Ignored without the `sort` parameter. */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListCommentsForRepoError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesListCommentsForRepoResponse = Schemas.IssueComment[]; export type IssuesListCommentsForRepoVariables = { pathParams: IssuesListCommentsForRepoPathParams; queryParams?: IssuesListCommentsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * By default, Issue Comments are ordered by ascending ID. */ export const fetchIssuesListCommentsForRepo = ( variables: IssuesListCommentsForRepoVariables, signal?: AbortSignal, ) => githubFetch< IssuesListCommentsForRepoResponse, IssuesListCommentsForRepoError, undefined, {}, IssuesListCommentsForRepoQueryParams, IssuesListCommentsForRepoPathParams >({ url: '/repos/{owner}/{repo}/issues/comments', method: 'get', ...variables, signal, }); /** * By default, Issue Comments are ordered by ascending ID. */ export const useIssuesListCommentsForRepo = < TData = IssuesListCommentsForRepoResponse, >( variables: IssuesListCommentsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListCommentsForRepoResponse, IssuesListCommentsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListCommentsForRepoResponse, IssuesListCommentsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/comments', operationId: 'issuesListCommentsForRepo', variables, }), ({ signal }) => fetchIssuesListCommentsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type IssuesDeleteCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type IssuesDeleteCommentError = Fetcher.ErrorWrapper; export type IssuesDeleteCommentVariables = { pathParams: IssuesDeleteCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesDeleteComment = ( variables: IssuesDeleteCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesDeleteCommentError, undefined, {}, {}, IssuesDeleteCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}', method: 'delete', ...variables, signal, }); export const useIssuesDeleteComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesDeleteCommentError, IssuesDeleteCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesDeleteCommentError, IssuesDeleteCommentVariables >( (variables: IssuesDeleteCommentVariables) => fetchIssuesDeleteComment({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesGetCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type IssuesGetCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesGetCommentVariables = { pathParams: IssuesGetCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesGetComment = ( variables: IssuesGetCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueComment, IssuesGetCommentError, undefined, {}, {}, IssuesGetCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}', method: 'get', ...variables, signal, }); export const useIssuesGetComment = ( variables: IssuesGetCommentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.IssueComment, IssuesGetCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.IssueComment, IssuesGetCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/comments/{comment_id}', operationId: 'issuesGetComment', variables, }), ({ signal }) => fetchIssuesGetComment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesUpdateCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type IssuesUpdateCommentError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type IssuesUpdateCommentRequestBody = { /** * The contents of the comment. */ body: string; }; export type IssuesUpdateCommentVariables = { body: IssuesUpdateCommentRequestBody; pathParams: IssuesUpdateCommentPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesUpdateComment = ( variables: IssuesUpdateCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueComment, IssuesUpdateCommentError, IssuesUpdateCommentRequestBody, {}, {}, IssuesUpdateCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}', method: 'patch', ...variables, signal, }); export const useIssuesUpdateComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.IssueComment, IssuesUpdateCommentError, IssuesUpdateCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.IssueComment, IssuesUpdateCommentError, IssuesUpdateCommentVariables >( (variables: IssuesUpdateCommentVariables) => fetchIssuesUpdateComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsListForIssueCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsListForIssueCommentQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForIssueCommentError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReactionsListForIssueCommentResponse = Schemas.Reaction[]; export type ReactionsListForIssueCommentVariables = { pathParams: ReactionsListForIssueCommentPathParams; queryParams?: ReactionsListForIssueCommentQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ export const fetchReactionsListForIssueComment = ( variables: ReactionsListForIssueCommentVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForIssueCommentResponse, ReactionsListForIssueCommentError, undefined, {}, ReactionsListForIssueCommentQueryParams, ReactionsListForIssueCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ export const useReactionsListForIssueComment = < TData = ReactionsListForIssueCommentResponse, >( variables: ReactionsListForIssueCommentVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForIssueCommentResponse, ReactionsListForIssueCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForIssueCommentResponse, ReactionsListForIssueCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', operationId: 'reactionsListForIssueComment', variables, }), ({ signal }) => fetchReactionsListForIssueComment( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForIssueCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsCreateForIssueCommentError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReactionsCreateForIssueCommentRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForIssueCommentVariables = { body: ReactionsCreateForIssueCommentRequestBody; pathParams: ReactionsCreateForIssueCommentPathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this issue comment. */ export const fetchReactionsCreateForIssueComment = ( variables: ReactionsCreateForIssueCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForIssueCommentError, ReactionsCreateForIssueCommentRequestBody, {}, {}, ReactionsCreateForIssueCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this issue comment. */ export const useReactionsCreateForIssueComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForIssueCommentError, ReactionsCreateForIssueCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForIssueCommentError, ReactionsCreateForIssueCommentVariables >( (variables: ReactionsCreateForIssueCommentVariables) => fetchReactionsCreateForIssueComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsDeleteForIssueCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; reactionId: number; }; export type ReactionsDeleteForIssueCommentError = Fetcher.ErrorWrapper; export type ReactionsDeleteForIssueCommentVariables = { pathParams: ReactionsDeleteForIssueCommentPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. * * Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ export const fetchReactionsDeleteForIssueComment = ( variables: ReactionsDeleteForIssueCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForIssueCommentError, undefined, {}, {}, ReactionsDeleteForIssueCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/comments/{commentId}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. * * Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ export const useReactionsDeleteForIssueComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForIssueCommentError, ReactionsDeleteForIssueCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForIssueCommentError, ReactionsDeleteForIssueCommentVariables >( (variables: ReactionsDeleteForIssueCommentVariables) => fetchReactionsDeleteForIssueComment({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListEventsForRepoPathParams = { owner: string; repo: string; }; export type IssuesListEventsForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListEventsForRepoError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type IssuesListEventsForRepoResponse = Schemas.IssueEvent[]; export type IssuesListEventsForRepoVariables = { pathParams: IssuesListEventsForRepoPathParams; queryParams?: IssuesListEventsForRepoQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListEventsForRepo = ( variables: IssuesListEventsForRepoVariables, signal?: AbortSignal, ) => githubFetch< IssuesListEventsForRepoResponse, IssuesListEventsForRepoError, undefined, {}, IssuesListEventsForRepoQueryParams, IssuesListEventsForRepoPathParams >({ url: '/repos/{owner}/{repo}/issues/events', method: 'get', ...variables, signal, }); export const useIssuesListEventsForRepo = < TData = IssuesListEventsForRepoResponse, >( variables: IssuesListEventsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListEventsForRepoResponse, IssuesListEventsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListEventsForRepoResponse, IssuesListEventsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/events', operationId: 'issuesListEventsForRepo', variables, }), ({ signal }) => fetchIssuesListEventsForRepo({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesGetEventPathParams = { owner: string; repo: string; eventId: number; }; export type IssuesGetEventError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } >; export type IssuesGetEventVariables = { pathParams: IssuesGetEventPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesGetEvent = ( variables: IssuesGetEventVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueEvent, IssuesGetEventError, undefined, {}, {}, IssuesGetEventPathParams >({ url: '/repos/{owner}/{repo}/issues/events/{eventId}', method: 'get', ...variables, signal, }); export const useIssuesGetEvent = ( variables: IssuesGetEventVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/events/{event_id}', operationId: 'issuesGetEvent', variables, }), ({ signal }) => fetchIssuesGetEvent({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesGetPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesGetError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } >; export type IssuesGetVariables = { pathParams: IssuesGetPathParams; } & GithubContext['fetcherOptions']; /** * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was * [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If * the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API * returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read * access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe * to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchIssuesGet = ( variables: IssuesGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Issue, IssuesGetError, undefined, {}, {}, IssuesGetPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}', method: 'get', ...variables, signal, }); /** * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was * [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If * the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API * returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read * access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe * to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useIssuesGet = ( variables: IssuesGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}', operationId: 'issuesGet', variables, }), ({ signal }) => fetchIssuesGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesUpdatePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesUpdateError = Fetcher.ErrorWrapper< | { status: 301; payload: Responses.MovedPermanently; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type IssuesUpdateRequestBody = { /** * Login for the user that this issue should be assigned to. **This field is deprecated.** */ assignee?: string | null; /** * Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ assignees?: string[]; /** * The contents of the issue. */ body?: string | null; /** * Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ labels?: ( | string | { color?: string | null; description?: string | null; id?: number; name?: string; } )[]; milestone?: string | number | null; /** * State of the issue. Either `open` or `closed`. */ state?: 'open' | 'closed'; /** * The title of the issue. */ title?: string | number | null; }; export type IssuesUpdateVariables = { body?: IssuesUpdateRequestBody; pathParams: IssuesUpdatePathParams; } & GithubContext['fetcherOptions']; /** * Issue owners and users with push access can edit an issue. */ export const fetchIssuesUpdate = ( variables: IssuesUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Issue, IssuesUpdateError, IssuesUpdateRequestBody, {}, {}, IssuesUpdatePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}', method: 'patch', ...variables, signal, }); /** * Issue owners and users with push access can edit an issue. */ export const useIssuesUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Issue, IssuesUpdateError, IssuesUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Issue, IssuesUpdateError, IssuesUpdateVariables >( (variables: IssuesUpdateVariables) => fetchIssuesUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesRemoveAssigneesPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesRemoveAssigneesError = Fetcher.ErrorWrapper; export type IssuesRemoveAssigneesRequestBody = { /** * Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ assignees?: string[]; }; export type IssuesRemoveAssigneesVariables = { body?: IssuesRemoveAssigneesRequestBody; pathParams: IssuesRemoveAssigneesPathParams; } & GithubContext['fetcherOptions']; /** * Removes one or more assignees from an issue. */ export const fetchIssuesRemoveAssignees = ( variables: IssuesRemoveAssigneesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueSimple, IssuesRemoveAssigneesError, IssuesRemoveAssigneesRequestBody, {}, {}, IssuesRemoveAssigneesPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/assignees', method: 'delete', ...variables, signal, }); /** * Removes one or more assignees from an issue. */ export const useIssuesRemoveAssignees = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.IssueSimple, IssuesRemoveAssigneesError, IssuesRemoveAssigneesVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.IssueSimple, IssuesRemoveAssigneesError, IssuesRemoveAssigneesVariables >( (variables: IssuesRemoveAssigneesVariables) => fetchIssuesRemoveAssignees({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesAddAssigneesPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesAddAssigneesError = Fetcher.ErrorWrapper; export type IssuesAddAssigneesRequestBody = { /** * Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ assignees?: string[]; }; export type IssuesAddAssigneesVariables = { body?: IssuesAddAssigneesRequestBody; pathParams: IssuesAddAssigneesPathParams; } & GithubContext['fetcherOptions']; /** * Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. */ export const fetchIssuesAddAssignees = ( variables: IssuesAddAssigneesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueSimple, IssuesAddAssigneesError, IssuesAddAssigneesRequestBody, {}, {}, IssuesAddAssigneesPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/assignees', method: 'post', ...variables, signal, }); /** * Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. */ export const useIssuesAddAssignees = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.IssueSimple, IssuesAddAssigneesError, IssuesAddAssigneesVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.IssueSimple, IssuesAddAssigneesError, IssuesAddAssigneesVariables >( (variables: IssuesAddAssigneesVariables) => fetchIssuesAddAssignees({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListCommentsPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesListCommentsQueryParams = { /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListCommentsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } >; export type IssuesListCommentsResponse = Schemas.IssueComment[]; export type IssuesListCommentsVariables = { pathParams: IssuesListCommentsPathParams; queryParams?: IssuesListCommentsQueryParams; } & GithubContext['fetcherOptions']; /** * Issue Comments are ordered by ascending ID. */ export const fetchIssuesListComments = ( variables: IssuesListCommentsVariables, signal?: AbortSignal, ) => githubFetch< IssuesListCommentsResponse, IssuesListCommentsError, undefined, {}, IssuesListCommentsQueryParams, IssuesListCommentsPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/comments', method: 'get', ...variables, signal, }); /** * Issue Comments are ordered by ascending ID. */ export const useIssuesListComments = ( variables: IssuesListCommentsVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListCommentsResponse, IssuesListCommentsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListCommentsResponse, IssuesListCommentsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}/comments', operationId: 'issuesListComments', variables, }), ({ signal }) => fetchIssuesListComments({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesCreateCommentPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesCreateCommentError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesCreateCommentRequestBody = { /** * The contents of the comment. */ body: string; }; export type IssuesCreateCommentVariables = { body: IssuesCreateCommentRequestBody; pathParams: IssuesCreateCommentPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const fetchIssuesCreateComment = ( variables: IssuesCreateCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.IssueComment, IssuesCreateCommentError, IssuesCreateCommentRequestBody, {}, {}, IssuesCreateCommentPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/comments', method: 'post', ...variables, signal, }); /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const useIssuesCreateComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.IssueComment, IssuesCreateCommentError, IssuesCreateCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.IssueComment, IssuesCreateCommentError, IssuesCreateCommentVariables >( (variables: IssuesCreateCommentVariables) => fetchIssuesCreateComment({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListEventsPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesListEventsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListEventsError = Fetcher.ErrorWrapper<{ status: 410; payload: Responses.Gone; }>; export type IssuesListEventsResponse = Schemas.IssueEventForIssue[]; export type IssuesListEventsVariables = { pathParams: IssuesListEventsPathParams; queryParams?: IssuesListEventsQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListEvents = ( variables: IssuesListEventsVariables, signal?: AbortSignal, ) => githubFetch< IssuesListEventsResponse, IssuesListEventsError, undefined, {}, IssuesListEventsQueryParams, IssuesListEventsPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/events', method: 'get', ...variables, signal, }); export const useIssuesListEvents = ( variables: IssuesListEventsVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListEventsResponse, IssuesListEventsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListEventsResponse, IssuesListEventsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}/events', operationId: 'issuesListEvents', variables, }), ({ signal }) => fetchIssuesListEvents({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesRemoveAllLabelsPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesRemoveAllLabelsError = Fetcher.ErrorWrapper<{ status: 410; payload: Responses.Gone; }>; export type IssuesRemoveAllLabelsVariables = { pathParams: IssuesRemoveAllLabelsPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesRemoveAllLabels = ( variables: IssuesRemoveAllLabelsVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesRemoveAllLabelsError, undefined, {}, {}, IssuesRemoveAllLabelsPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/labels', method: 'delete', ...variables, signal, }); export const useIssuesRemoveAllLabels = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesRemoveAllLabelsError, IssuesRemoveAllLabelsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesRemoveAllLabelsError, IssuesRemoveAllLabelsVariables >( (variables: IssuesRemoveAllLabelsVariables) => fetchIssuesRemoveAllLabels({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListLabelsOnIssuePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesListLabelsOnIssueQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListLabelsOnIssueError = Fetcher.ErrorWrapper<{ status: 410; payload: Responses.Gone; }>; export type IssuesListLabelsOnIssueResponse = Schemas.Label[]; export type IssuesListLabelsOnIssueVariables = { pathParams: IssuesListLabelsOnIssuePathParams; queryParams?: IssuesListLabelsOnIssueQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListLabelsOnIssue = ( variables: IssuesListLabelsOnIssueVariables, signal?: AbortSignal, ) => githubFetch< IssuesListLabelsOnIssueResponse, IssuesListLabelsOnIssueError, undefined, {}, IssuesListLabelsOnIssueQueryParams, IssuesListLabelsOnIssuePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/labels', method: 'get', ...variables, signal, }); export const useIssuesListLabelsOnIssue = < TData = IssuesListLabelsOnIssueResponse, >( variables: IssuesListLabelsOnIssueVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListLabelsOnIssueResponse, IssuesListLabelsOnIssueError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListLabelsOnIssueResponse, IssuesListLabelsOnIssueError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}/labels', operationId: 'issuesListLabelsOnIssue', variables, }), ({ signal }) => fetchIssuesListLabelsOnIssue({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesAddLabelsPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesAddLabelsError = Fetcher.ErrorWrapper< | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesAddLabelsResponse = Schemas.Label[]; export type IssuesAddLabelsRequestBody = { /** * The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. */ labels: string[]; }; export type IssuesAddLabelsVariables = { body: IssuesAddLabelsRequestBody; pathParams: IssuesAddLabelsPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesAddLabels = ( variables: IssuesAddLabelsVariables, signal?: AbortSignal, ) => githubFetch< IssuesAddLabelsResponse, IssuesAddLabelsError, IssuesAddLabelsRequestBody, {}, {}, IssuesAddLabelsPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/labels', method: 'post', ...variables, signal, }); export const useIssuesAddLabels = ( options?: Omit< reactQuery.UseMutationOptions< IssuesAddLabelsResponse, IssuesAddLabelsError, IssuesAddLabelsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< IssuesAddLabelsResponse, IssuesAddLabelsError, IssuesAddLabelsVariables >( (variables: IssuesAddLabelsVariables) => fetchIssuesAddLabels({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesSetLabelsPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesSetLabelsError = Fetcher.ErrorWrapper< | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesSetLabelsResponse = Schemas.Label[]; export type IssuesSetLabelsRequestBody = { /** * The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. */ labels?: string[]; }; export type IssuesSetLabelsVariables = { body?: IssuesSetLabelsRequestBody; pathParams: IssuesSetLabelsPathParams; } & GithubContext['fetcherOptions']; /** * Removes any previous labels and sets the new labels for an issue. */ export const fetchIssuesSetLabels = ( variables: IssuesSetLabelsVariables, signal?: AbortSignal, ) => githubFetch< IssuesSetLabelsResponse, IssuesSetLabelsError, IssuesSetLabelsRequestBody, {}, {}, IssuesSetLabelsPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/labels', method: 'put', ...variables, signal, }); /** * Removes any previous labels and sets the new labels for an issue. */ export const useIssuesSetLabels = ( options?: Omit< reactQuery.UseMutationOptions< IssuesSetLabelsResponse, IssuesSetLabelsError, IssuesSetLabelsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< IssuesSetLabelsResponse, IssuesSetLabelsError, IssuesSetLabelsVariables >( (variables: IssuesSetLabelsVariables) => fetchIssuesSetLabels({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesRemoveLabelPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; name: string; }; export type IssuesRemoveLabelError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } >; export type IssuesRemoveLabelResponse = Schemas.Label[]; export type IssuesRemoveLabelVariables = { pathParams: IssuesRemoveLabelPathParams; } & GithubContext['fetcherOptions']; /** * Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. */ export const fetchIssuesRemoveLabel = ( variables: IssuesRemoveLabelVariables, signal?: AbortSignal, ) => githubFetch< IssuesRemoveLabelResponse, IssuesRemoveLabelError, undefined, {}, {}, IssuesRemoveLabelPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/labels/{name}', method: 'delete', ...variables, signal, }); /** * Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. */ export const useIssuesRemoveLabel = ( options?: Omit< reactQuery.UseMutationOptions< IssuesRemoveLabelResponse, IssuesRemoveLabelError, IssuesRemoveLabelVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< IssuesRemoveLabelResponse, IssuesRemoveLabelError, IssuesRemoveLabelVariables >( (variables: IssuesRemoveLabelVariables) => fetchIssuesRemoveLabel({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesUnlockPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesUnlockError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type IssuesUnlockVariables = { pathParams: IssuesUnlockPathParams; } & GithubContext['fetcherOptions']; /** * Users with push access can unlock an issue's conversation. */ export const fetchIssuesUnlock = ( variables: IssuesUnlockVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesUnlockError, undefined, {}, {}, IssuesUnlockPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/lock', method: 'delete', ...variables, signal, }); /** * Users with push access can unlock an issue's conversation. */ export const useIssuesUnlock = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesUnlockError, IssuesUnlockVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesUnlockError, IssuesUnlockVariables >( (variables: IssuesUnlockVariables) => fetchIssuesUnlock({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesLockPathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesLockError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesLockVariables = { body?: { /** * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: * \* `off-topic` * \* `too heated` * \* `resolved` * \* `spam` */ lock_reason?: 'off-topic' | 'too heated' | 'resolved' | 'spam'; } | null; pathParams: IssuesLockPathParams; } & GithubContext['fetcherOptions']; /** * Users with push access can lock an issue or pull request's conversation. * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchIssuesLock = ( variables: IssuesLockVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesLockError, { /** * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: * \* `off-topic` * \* `too heated` * \* `resolved` * \* `spam` */ lock_reason?: 'off-topic' | 'too heated' | 'resolved' | 'spam'; } | null, {}, {}, IssuesLockPathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/lock', method: 'put', ...variables, signal, }); /** * Users with push access can lock an issue or pull request's conversation. * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useIssuesLock = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesLockError, IssuesLockVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesLockError, IssuesLockVariables >( (variables: IssuesLockVariables) => fetchIssuesLock({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsListForIssuePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type ReactionsListForIssueQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForIssueError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReactionsListForIssueResponse = Schemas.Reaction[]; export type ReactionsListForIssueVariables = { pathParams: ReactionsListForIssuePathParams; queryParams?: ReactionsListForIssueQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to an [issue](https://docs.github.com/rest/reference/issues). */ export const fetchReactionsListForIssue = ( variables: ReactionsListForIssueVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForIssueResponse, ReactionsListForIssueError, undefined, {}, ReactionsListForIssueQueryParams, ReactionsListForIssuePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to an [issue](https://docs.github.com/rest/reference/issues). */ export const useReactionsListForIssue = ( variables: ReactionsListForIssueVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForIssueResponse, ReactionsListForIssueError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForIssueResponse, ReactionsListForIssueError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}/reactions', operationId: 'reactionsListForIssue', variables, }), ({ signal }) => fetchReactionsListForIssue({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForIssuePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type ReactionsCreateForIssueError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReactionsCreateForIssueRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForIssueVariables = { body: ReactionsCreateForIssueRequestBody; pathParams: ReactionsCreateForIssuePathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a `Status: 200 OK` means that you already added the reaction type to this issue. */ export const fetchReactionsCreateForIssue = ( variables: ReactionsCreateForIssueVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForIssueError, ReactionsCreateForIssueRequestBody, {}, {}, ReactionsCreateForIssuePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a `Status: 200 OK` means that you already added the reaction type to this issue. */ export const useReactionsCreateForIssue = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForIssueError, ReactionsCreateForIssueVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForIssueError, ReactionsCreateForIssueVariables >( (variables: ReactionsCreateForIssueVariables) => fetchReactionsCreateForIssue({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsDeleteForIssuePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; reactionId: number; }; export type ReactionsDeleteForIssueError = Fetcher.ErrorWrapper; export type ReactionsDeleteForIssueVariables = { pathParams: ReactionsDeleteForIssuePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. * * Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). */ export const fetchReactionsDeleteForIssue = ( variables: ReactionsDeleteForIssueVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForIssueError, undefined, {}, {}, ReactionsDeleteForIssuePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. * * Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). */ export const useReactionsDeleteForIssue = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForIssueError, ReactionsDeleteForIssueVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForIssueError, ReactionsDeleteForIssueVariables >( (variables: ReactionsDeleteForIssueVariables) => fetchReactionsDeleteForIssue({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListEventsForTimelinePathParams = { owner: string; repo: string; /** * issue_number parameter */ issueNumber: number; }; export type IssuesListEventsForTimelineQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListEventsForTimelineError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type IssuesListEventsForTimelineResponse = Schemas.IssueEventForIssue[]; export type IssuesListEventsForTimelineVariables = { pathParams: IssuesListEventsForTimelinePathParams; queryParams?: IssuesListEventsForTimelineQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListEventsForTimeline = ( variables: IssuesListEventsForTimelineVariables, signal?: AbortSignal, ) => githubFetch< IssuesListEventsForTimelineResponse, IssuesListEventsForTimelineError, undefined, {}, IssuesListEventsForTimelineQueryParams, IssuesListEventsForTimelinePathParams >({ url: '/repos/{owner}/{repo}/issues/{issueNumber}/timeline', method: 'get', ...variables, signal, }); export const useIssuesListEventsForTimeline = < TData = IssuesListEventsForTimelineResponse, >( variables: IssuesListEventsForTimelineVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListEventsForTimelineResponse, IssuesListEventsForTimelineError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListEventsForTimelineResponse, IssuesListEventsForTimelineError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/issues/{issue_number}/timeline', operationId: 'issuesListEventsForTimeline', variables, }), ({ signal }) => fetchIssuesListEventsForTimeline( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListDeployKeysPathParams = { owner: string; repo: string; }; export type ReposListDeployKeysQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListDeployKeysError = Fetcher.ErrorWrapper; export type ReposListDeployKeysResponse = Schemas.DeployKey[]; export type ReposListDeployKeysVariables = { pathParams: ReposListDeployKeysPathParams; queryParams?: ReposListDeployKeysQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListDeployKeys = ( variables: ReposListDeployKeysVariables, signal?: AbortSignal, ) => githubFetch< ReposListDeployKeysResponse, ReposListDeployKeysError, undefined, {}, ReposListDeployKeysQueryParams, ReposListDeployKeysPathParams >({ url: '/repos/{owner}/{repo}/keys', method: 'get', ...variables, signal }); export const useReposListDeployKeys = ( variables: ReposListDeployKeysVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListDeployKeysResponse, ReposListDeployKeysError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListDeployKeysResponse, ReposListDeployKeysError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/keys', operationId: 'reposListDeployKeys', variables, }), ({ signal }) => fetchReposListDeployKeys({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateDeployKeyPathParams = { owner: string; repo: string; }; export type ReposCreateDeployKeyError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposCreateDeployKeyRequestBody = { /** * The contents of the key. */ key: string; /** * If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. * * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." */ read_only?: boolean; /** * A name for the key. */ title?: string; }; export type ReposCreateDeployKeyVariables = { body: ReposCreateDeployKeyRequestBody; pathParams: ReposCreateDeployKeyPathParams; } & GithubContext['fetcherOptions']; /** * You can create a read-only deploy key. */ export const fetchReposCreateDeployKey = ( variables: ReposCreateDeployKeyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.DeployKey, ReposCreateDeployKeyError, ReposCreateDeployKeyRequestBody, {}, {}, ReposCreateDeployKeyPathParams >({ url: '/repos/{owner}/{repo}/keys', method: 'post', ...variables, signal, }); /** * You can create a read-only deploy key. */ export const useReposCreateDeployKey = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.DeployKey, ReposCreateDeployKeyError, ReposCreateDeployKeyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.DeployKey, ReposCreateDeployKeyError, ReposCreateDeployKeyVariables >( (variables: ReposCreateDeployKeyVariables) => fetchReposCreateDeployKey({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteDeployKeyPathParams = { owner: string; repo: string; /** * key_id parameter */ keyId: number; }; export type ReposDeleteDeployKeyError = Fetcher.ErrorWrapper; export type ReposDeleteDeployKeyVariables = { pathParams: ReposDeleteDeployKeyPathParams; } & GithubContext['fetcherOptions']; /** * Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. */ export const fetchReposDeleteDeployKey = ( variables: ReposDeleteDeployKeyVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteDeployKeyError, undefined, {}, {}, ReposDeleteDeployKeyPathParams >({ url: '/repos/{owner}/{repo}/keys/{keyId}', method: 'delete', ...variables, signal, }); /** * Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. */ export const useReposDeleteDeployKey = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteDeployKeyError, ReposDeleteDeployKeyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteDeployKeyError, ReposDeleteDeployKeyVariables >( (variables: ReposDeleteDeployKeyVariables) => fetchReposDeleteDeployKey({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetDeployKeyPathParams = { owner: string; repo: string; /** * key_id parameter */ keyId: number; }; export type ReposGetDeployKeyError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetDeployKeyVariables = { pathParams: ReposGetDeployKeyPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetDeployKey = ( variables: ReposGetDeployKeyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.DeployKey, ReposGetDeployKeyError, undefined, {}, {}, ReposGetDeployKeyPathParams >({ url: '/repos/{owner}/{repo}/keys/{keyId}', method: 'get', ...variables, signal, }); export const useReposGetDeployKey = ( variables: ReposGetDeployKeyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.DeployKey, ReposGetDeployKeyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/keys/{key_id}', operationId: 'reposGetDeployKey', variables, }), ({ signal }) => fetchReposGetDeployKey({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesListLabelsForRepoPathParams = { owner: string; repo: string; }; export type IssuesListLabelsForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListLabelsForRepoError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesListLabelsForRepoResponse = Schemas.Label[]; export type IssuesListLabelsForRepoVariables = { pathParams: IssuesListLabelsForRepoPathParams; queryParams?: IssuesListLabelsForRepoQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListLabelsForRepo = ( variables: IssuesListLabelsForRepoVariables, signal?: AbortSignal, ) => githubFetch< IssuesListLabelsForRepoResponse, IssuesListLabelsForRepoError, undefined, {}, IssuesListLabelsForRepoQueryParams, IssuesListLabelsForRepoPathParams >({ url: '/repos/{owner}/{repo}/labels', method: 'get', ...variables, signal, }); export const useIssuesListLabelsForRepo = < TData = IssuesListLabelsForRepoResponse, >( variables: IssuesListLabelsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListLabelsForRepoResponse, IssuesListLabelsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListLabelsForRepoResponse, IssuesListLabelsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/labels', operationId: 'issuesListLabelsForRepo', variables, }), ({ signal }) => fetchIssuesListLabelsForRepo({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesCreateLabelPathParams = { owner: string; repo: string; }; export type IssuesCreateLabelError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesCreateLabelRequestBody = { /** * The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. */ color?: string; /** * A short description of the label. */ description?: string; /** * The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ name: string; }; export type IssuesCreateLabelVariables = { body: IssuesCreateLabelRequestBody; pathParams: IssuesCreateLabelPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesCreateLabel = ( variables: IssuesCreateLabelVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Label, IssuesCreateLabelError, IssuesCreateLabelRequestBody, {}, {}, IssuesCreateLabelPathParams >({ url: '/repos/{owner}/{repo}/labels', method: 'post', ...variables, signal, }); export const useIssuesCreateLabel = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Label, IssuesCreateLabelError, IssuesCreateLabelVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Label, IssuesCreateLabelError, IssuesCreateLabelVariables >( (variables: IssuesCreateLabelVariables) => fetchIssuesCreateLabel({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesDeleteLabelPathParams = { owner: string; repo: string; name: string; }; export type IssuesDeleteLabelError = Fetcher.ErrorWrapper; export type IssuesDeleteLabelVariables = { pathParams: IssuesDeleteLabelPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesDeleteLabel = ( variables: IssuesDeleteLabelVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesDeleteLabelError, undefined, {}, {}, IssuesDeleteLabelPathParams >({ url: '/repos/{owner}/{repo}/labels/{name}', method: 'delete', ...variables, signal, }); export const useIssuesDeleteLabel = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesDeleteLabelError, IssuesDeleteLabelVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesDeleteLabelError, IssuesDeleteLabelVariables >( (variables: IssuesDeleteLabelVariables) => fetchIssuesDeleteLabel({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesGetLabelPathParams = { owner: string; repo: string; name: string; }; export type IssuesGetLabelError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesGetLabelVariables = { pathParams: IssuesGetLabelPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesGetLabel = ( variables: IssuesGetLabelVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Label, IssuesGetLabelError, undefined, {}, {}, IssuesGetLabelPathParams >({ url: '/repos/{owner}/{repo}/labels/{name}', method: 'get', ...variables, signal, }); export const useIssuesGetLabel = ( variables: IssuesGetLabelVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/labels/{name}', operationId: 'issuesGetLabel', variables, }), ({ signal }) => fetchIssuesGetLabel({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesUpdateLabelPathParams = { owner: string; repo: string; name: string; }; export type IssuesUpdateLabelError = Fetcher.ErrorWrapper; export type IssuesUpdateLabelRequestBody = { /** * The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. */ color?: string; /** * A short description of the label. */ description?: string; /** * The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ new_name?: string; }; export type IssuesUpdateLabelVariables = { body?: IssuesUpdateLabelRequestBody; pathParams: IssuesUpdateLabelPathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesUpdateLabel = ( variables: IssuesUpdateLabelVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Label, IssuesUpdateLabelError, IssuesUpdateLabelRequestBody, {}, {}, IssuesUpdateLabelPathParams >({ url: '/repos/{owner}/{repo}/labels/{name}', method: 'patch', ...variables, signal, }); export const useIssuesUpdateLabel = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Label, IssuesUpdateLabelError, IssuesUpdateLabelVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Label, IssuesUpdateLabelError, IssuesUpdateLabelVariables >( (variables: IssuesUpdateLabelVariables) => fetchIssuesUpdateLabel({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListLanguagesPathParams = { owner: string; repo: string; }; export type ReposListLanguagesError = Fetcher.ErrorWrapper; export type ReposListLanguagesVariables = { pathParams: ReposListLanguagesPathParams; } & GithubContext['fetcherOptions']; /** * Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. */ export const fetchReposListLanguages = ( variables: ReposListLanguagesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Language, ReposListLanguagesError, undefined, {}, {}, ReposListLanguagesPathParams >({ url: '/repos/{owner}/{repo}/languages', method: 'get', ...variables, signal, }); /** * Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. */ export const useReposListLanguages = ( variables: ReposListLanguagesVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Language, ReposListLanguagesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/languages', operationId: 'reposListLanguages', variables, }), ({ signal }) => fetchReposListLanguages({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type LicensesGetForRepoPathParams = { owner: string; repo: string; }; export type LicensesGetForRepoError = Fetcher.ErrorWrapper; export type LicensesGetForRepoVariables = { pathParams: LicensesGetForRepoPathParams; } & GithubContext['fetcherOptions']; /** * This method returns the contents of the repository's license file, if one is detected. * * Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. */ export const fetchLicensesGetForRepo = ( variables: LicensesGetForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.LicenseContent, LicensesGetForRepoError, undefined, {}, {}, LicensesGetForRepoPathParams >({ url: '/repos/{owner}/{repo}/license', method: 'get', ...variables, signal, }); /** * This method returns the contents of the repository's license file, if one is detected. * * Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. */ export const useLicensesGetForRepo = ( variables: LicensesGetForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.LicenseContent, LicensesGetForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.LicenseContent, LicensesGetForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/license', operationId: 'licensesGetForRepo', variables, }), ({ signal }) => fetchLicensesGetForRepo({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposMergePathParams = { owner: string; repo: string; }; export type ReposMergeError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: { /** * @example "https://docs.github.com/rest/reference/repos#perform-a-merge" */ documentation_url?: string; message?: string; }; } | { status: 409; payload: { /** * @example "https://docs.github.com/rest/reference/repos#perform-a-merge" */ documentation_url?: string; message?: string; }; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposMergeRequestBody = { /** * The name of the base branch that the head will be merged into. */ base: string; /** * Commit message to use for the merge commit. If omitted, a default message will be used. */ commit_message?: string; /** * The head to merge. This can be a branch name or a commit SHA1. */ head: string; }; export type ReposMergeVariables = { body: ReposMergeRequestBody; pathParams: ReposMergePathParams; } & GithubContext['fetcherOptions']; export const fetchReposMerge = ( variables: ReposMergeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Commit, ReposMergeError, ReposMergeRequestBody, {}, {}, ReposMergePathParams >({ url: '/repos/{owner}/{repo}/merges', method: 'post', ...variables, signal, }); export const useReposMerge = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Commit, ReposMergeError, ReposMergeVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Commit, ReposMergeError, ReposMergeVariables >( (variables: ReposMergeVariables) => fetchReposMerge({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListMilestonesPathParams = { owner: string; repo: string; }; export type IssuesListMilestonesQueryParams = { /** * The state of the milestone. Either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * What to sort results by. Either `due_on` or `completeness`. * * @default due_on */ sort?: 'due_on' | 'completeness'; /** * The direction of the sort. Either `asc` or `desc`. * * @default asc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListMilestonesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesListMilestonesResponse = Schemas.Milestone[]; export type IssuesListMilestonesVariables = { pathParams: IssuesListMilestonesPathParams; queryParams?: IssuesListMilestonesQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListMilestones = ( variables: IssuesListMilestonesVariables, signal?: AbortSignal, ) => githubFetch< IssuesListMilestonesResponse, IssuesListMilestonesError, undefined, {}, IssuesListMilestonesQueryParams, IssuesListMilestonesPathParams >({ url: '/repos/{owner}/{repo}/milestones', method: 'get', ...variables, signal, }); export const useIssuesListMilestones = ( variables: IssuesListMilestonesVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListMilestonesResponse, IssuesListMilestonesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListMilestonesResponse, IssuesListMilestonesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/milestones', operationId: 'issuesListMilestones', variables, }), ({ signal }) => fetchIssuesListMilestones({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesCreateMilestonePathParams = { owner: string; repo: string; }; export type IssuesCreateMilestoneError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type IssuesCreateMilestoneRequestBody = { /** * A description of the milestone. */ description?: string; /** * The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ due_on?: string; /** * The state of the milestone. Either `open` or `closed`. * * @default open */ state?: 'open' | 'closed'; /** * The title of the milestone. */ title: string; }; export type IssuesCreateMilestoneVariables = { body: IssuesCreateMilestoneRequestBody; pathParams: IssuesCreateMilestonePathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesCreateMilestone = ( variables: IssuesCreateMilestoneVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Milestone, IssuesCreateMilestoneError, IssuesCreateMilestoneRequestBody, {}, {}, IssuesCreateMilestonePathParams >({ url: '/repos/{owner}/{repo}/milestones', method: 'post', ...variables, signal, }); export const useIssuesCreateMilestone = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Milestone, IssuesCreateMilestoneError, IssuesCreateMilestoneVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Milestone, IssuesCreateMilestoneError, IssuesCreateMilestoneVariables >( (variables: IssuesCreateMilestoneVariables) => fetchIssuesCreateMilestone({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesDeleteMilestonePathParams = { owner: string; repo: string; /** * milestone_number parameter */ milestoneNumber: number; }; export type IssuesDeleteMilestoneError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesDeleteMilestoneVariables = { pathParams: IssuesDeleteMilestonePathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesDeleteMilestone = ( variables: IssuesDeleteMilestoneVariables, signal?: AbortSignal, ) => githubFetch< undefined, IssuesDeleteMilestoneError, undefined, {}, {}, IssuesDeleteMilestonePathParams >({ url: '/repos/{owner}/{repo}/milestones/{milestoneNumber}', method: 'delete', ...variables, signal, }); export const useIssuesDeleteMilestone = ( options?: Omit< reactQuery.UseMutationOptions< undefined, IssuesDeleteMilestoneError, IssuesDeleteMilestoneVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, IssuesDeleteMilestoneError, IssuesDeleteMilestoneVariables >( (variables: IssuesDeleteMilestoneVariables) => fetchIssuesDeleteMilestone({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesGetMilestonePathParams = { owner: string; repo: string; /** * milestone_number parameter */ milestoneNumber: number; }; export type IssuesGetMilestoneError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type IssuesGetMilestoneVariables = { pathParams: IssuesGetMilestonePathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesGetMilestone = ( variables: IssuesGetMilestoneVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Milestone, IssuesGetMilestoneError, undefined, {}, {}, IssuesGetMilestonePathParams >({ url: '/repos/{owner}/{repo}/milestones/{milestoneNumber}', method: 'get', ...variables, signal, }); export const useIssuesGetMilestone = ( variables: IssuesGetMilestoneVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Milestone, IssuesGetMilestoneError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/milestones/{milestone_number}', operationId: 'issuesGetMilestone', variables, }), ({ signal }) => fetchIssuesGetMilestone({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type IssuesUpdateMilestonePathParams = { owner: string; repo: string; /** * milestone_number parameter */ milestoneNumber: number; }; export type IssuesUpdateMilestoneError = Fetcher.ErrorWrapper; export type IssuesUpdateMilestoneRequestBody = { /** * A description of the milestone. */ description?: string; /** * The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ due_on?: string; /** * The state of the milestone. Either `open` or `closed`. * * @default open */ state?: 'open' | 'closed'; /** * The title of the milestone. */ title?: string; }; export type IssuesUpdateMilestoneVariables = { body?: IssuesUpdateMilestoneRequestBody; pathParams: IssuesUpdateMilestonePathParams; } & GithubContext['fetcherOptions']; export const fetchIssuesUpdateMilestone = ( variables: IssuesUpdateMilestoneVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Milestone, IssuesUpdateMilestoneError, IssuesUpdateMilestoneRequestBody, {}, {}, IssuesUpdateMilestonePathParams >({ url: '/repos/{owner}/{repo}/milestones/{milestoneNumber}', method: 'patch', ...variables, signal, }); export const useIssuesUpdateMilestone = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Milestone, IssuesUpdateMilestoneError, IssuesUpdateMilestoneVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Milestone, IssuesUpdateMilestoneError, IssuesUpdateMilestoneVariables >( (variables: IssuesUpdateMilestoneVariables) => fetchIssuesUpdateMilestone({ ...fetcherOptions, ...variables }), options, ); }; export type IssuesListLabelsForMilestonePathParams = { owner: string; repo: string; /** * milestone_number parameter */ milestoneNumber: number; }; export type IssuesListLabelsForMilestoneQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListLabelsForMilestoneError = Fetcher.ErrorWrapper; export type IssuesListLabelsForMilestoneResponse = Schemas.Label[]; export type IssuesListLabelsForMilestoneVariables = { pathParams: IssuesListLabelsForMilestonePathParams; queryParams?: IssuesListLabelsForMilestoneQueryParams; } & GithubContext['fetcherOptions']; export const fetchIssuesListLabelsForMilestone = ( variables: IssuesListLabelsForMilestoneVariables, signal?: AbortSignal, ) => githubFetch< IssuesListLabelsForMilestoneResponse, IssuesListLabelsForMilestoneError, undefined, {}, IssuesListLabelsForMilestoneQueryParams, IssuesListLabelsForMilestonePathParams >({ url: '/repos/{owner}/{repo}/milestones/{milestoneNumber}/labels', method: 'get', ...variables, signal, }); export const useIssuesListLabelsForMilestone = < TData = IssuesListLabelsForMilestoneResponse, >( variables: IssuesListLabelsForMilestoneVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListLabelsForMilestoneResponse, IssuesListLabelsForMilestoneError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListLabelsForMilestoneResponse, IssuesListLabelsForMilestoneError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/milestones/{milestone_number}/labels', operationId: 'issuesListLabelsForMilestone', variables, }), ({ signal }) => fetchIssuesListLabelsForMilestone( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListRepoNotificationsForAuthenticatedUserPathParams = { owner: string; repo: string; }; export type ActivityListRepoNotificationsForAuthenticatedUserQueryParams = { /** * If `true`, show notifications marked as read. * * @default false */ all?: boolean; /** * If `true`, only shows notifications in which the user is directly participating or mentioned. * * @default false */ participating?: boolean; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ before?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListRepoNotificationsForAuthenticatedUserError = Fetcher.ErrorWrapper; export type ActivityListRepoNotificationsForAuthenticatedUserResponse = Schemas.Thread[]; export type ActivityListRepoNotificationsForAuthenticatedUserVariables = { pathParams: ActivityListRepoNotificationsForAuthenticatedUserPathParams; queryParams?: ActivityListRepoNotificationsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List all notifications for the current user. */ export const fetchActivityListRepoNotificationsForAuthenticatedUser = ( variables: ActivityListRepoNotificationsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListRepoNotificationsForAuthenticatedUserResponse, ActivityListRepoNotificationsForAuthenticatedUserError, undefined, {}, ActivityListRepoNotificationsForAuthenticatedUserQueryParams, ActivityListRepoNotificationsForAuthenticatedUserPathParams >({ url: '/repos/{owner}/{repo}/notifications', method: 'get', ...variables, signal, }); /** * List all notifications for the current user. */ export const useActivityListRepoNotificationsForAuthenticatedUser = < TData = ActivityListRepoNotificationsForAuthenticatedUserResponse, >( variables: ActivityListRepoNotificationsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListRepoNotificationsForAuthenticatedUserResponse, ActivityListRepoNotificationsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListRepoNotificationsForAuthenticatedUserResponse, ActivityListRepoNotificationsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/notifications', operationId: 'activityListRepoNotificationsForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListRepoNotificationsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityMarkRepoNotificationsAsReadPathParams = { owner: string; repo: string; }; export type ActivityMarkRepoNotificationsAsReadError = Fetcher.ErrorWrapper; export type ActivityMarkRepoNotificationsAsReadRequestBody = { /** * Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. */ last_read_at?: string; }; export type ActivityMarkRepoNotificationsAsReadVariables = { body?: ActivityMarkRepoNotificationsAsReadRequestBody; pathParams: ActivityMarkRepoNotificationsAsReadPathParams; } & GithubContext['fetcherOptions']; /** * Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ export const fetchActivityMarkRepoNotificationsAsRead = ( variables: ActivityMarkRepoNotificationsAsReadVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityMarkRepoNotificationsAsReadError, ActivityMarkRepoNotificationsAsReadRequestBody, {}, {}, ActivityMarkRepoNotificationsAsReadPathParams >({ url: '/repos/{owner}/{repo}/notifications', method: 'put', ...variables, signal, }); /** * Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ export const useActivityMarkRepoNotificationsAsRead = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityMarkRepoNotificationsAsReadError, ActivityMarkRepoNotificationsAsReadVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityMarkRepoNotificationsAsReadError, ActivityMarkRepoNotificationsAsReadVariables >( (variables: ActivityMarkRepoNotificationsAsReadVariables) => fetchActivityMarkRepoNotificationsAsRead({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposDeletePagesSitePathParams = { owner: string; repo: string; }; export type ReposDeletePagesSiteError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposDeletePagesSiteVariables = { pathParams: ReposDeletePagesSitePathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeletePagesSite = ( variables: ReposDeletePagesSiteVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeletePagesSiteError, undefined, {}, {}, ReposDeletePagesSitePathParams >({ url: '/repos/{owner}/{repo}/pages', method: 'delete', ...variables, signal, }); export const useReposDeletePagesSite = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeletePagesSiteError, ReposDeletePagesSiteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeletePagesSiteError, ReposDeletePagesSiteVariables >( (variables: ReposDeletePagesSiteVariables) => fetchReposDeletePagesSite({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetPagesPathParams = { owner: string; repo: string; }; export type ReposGetPagesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetPagesVariables = { pathParams: ReposGetPagesPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetPages = ( variables: ReposGetPagesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Page, ReposGetPagesError, undefined, {}, {}, ReposGetPagesPathParams >({ url: '/repos/{owner}/{repo}/pages', method: 'get', ...variables, signal, }); export const useReposGetPages = ( variables: ReposGetPagesVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/pages', operationId: 'reposGetPages', variables, }), ({ signal }) => fetchReposGetPages({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreatePagesSitePathParams = { owner: string; repo: string; }; export type ReposCreatePagesSiteError = Fetcher.ErrorWrapper< | { status: 409; payload: Responses.Conflict; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreatePagesSiteRequestBody = { /** * The source branch and directory used to publish your Pages site. */ source: { /** * The repository branch used to publish your site's source files. */ branch: string; /** * The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/` * * @default / */ path?: '/' | '/docs'; }; }; export type ReposCreatePagesSiteVariables = { body: ReposCreatePagesSiteRequestBody; pathParams: ReposCreatePagesSitePathParams; } & GithubContext['fetcherOptions']; /** * Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." */ export const fetchReposCreatePagesSite = ( variables: ReposCreatePagesSiteVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Page, ReposCreatePagesSiteError, ReposCreatePagesSiteRequestBody, {}, {}, ReposCreatePagesSitePathParams >({ url: '/repos/{owner}/{repo}/pages', method: 'post', ...variables, signal, }); /** * Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." */ export const useReposCreatePagesSite = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Page, ReposCreatePagesSiteError, ReposCreatePagesSiteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Page, ReposCreatePagesSiteError, ReposCreatePagesSiteVariables >( (variables: ReposCreatePagesSiteVariables) => fetchReposCreatePagesSite({ ...fetcherOptions, ...variables }), options, ); }; export type ReposUpdateInformationAboutPagesSitePathParams = { owner: string; repo: string; }; export type ReposUpdateInformationAboutPagesSiteError = Fetcher.ErrorWrapper< | { status: 400; payload: Responses.BadRequest; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposUpdateInformationAboutPagesSiteRequestBody = { /** * Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ cname?: string | null; /** * Configures access controls for the GitHub Pages site. If public is set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to `internal` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ public?: boolean; source: | ('gh-pages' | 'master' | 'master /docs') | { /** * The repository branch used to publish your site's source files. */ branch: string; /** * The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. */ path: '/' | '/docs'; }; }; export type ReposUpdateInformationAboutPagesSiteVariables = { body: ReposUpdateInformationAboutPagesSiteRequestBody; pathParams: ReposUpdateInformationAboutPagesSitePathParams; } & GithubContext['fetcherOptions']; /** * Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). */ export const fetchReposUpdateInformationAboutPagesSite = ( variables: ReposUpdateInformationAboutPagesSiteVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposUpdateInformationAboutPagesSiteError, ReposUpdateInformationAboutPagesSiteRequestBody, {}, {}, ReposUpdateInformationAboutPagesSitePathParams >({ url: '/repos/{owner}/{repo}/pages', method: 'put', ...variables, signal, }); /** * Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). */ export const useReposUpdateInformationAboutPagesSite = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposUpdateInformationAboutPagesSiteError, ReposUpdateInformationAboutPagesSiteVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposUpdateInformationAboutPagesSiteError, ReposUpdateInformationAboutPagesSiteVariables >( (variables: ReposUpdateInformationAboutPagesSiteVariables) => fetchReposUpdateInformationAboutPagesSite({ ...fetcherOptions, ...variables, }), options, ); }; export type ReposListPagesBuildsPathParams = { owner: string; repo: string; }; export type ReposListPagesBuildsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListPagesBuildsError = Fetcher.ErrorWrapper; export type ReposListPagesBuildsResponse = Schemas.PageBuild[]; export type ReposListPagesBuildsVariables = { pathParams: ReposListPagesBuildsPathParams; queryParams?: ReposListPagesBuildsQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListPagesBuilds = ( variables: ReposListPagesBuildsVariables, signal?: AbortSignal, ) => githubFetch< ReposListPagesBuildsResponse, ReposListPagesBuildsError, undefined, {}, ReposListPagesBuildsQueryParams, ReposListPagesBuildsPathParams >({ url: '/repos/{owner}/{repo}/pages/builds', method: 'get', ...variables, signal, }); export const useReposListPagesBuilds = ( variables: ReposListPagesBuildsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListPagesBuildsResponse, ReposListPagesBuildsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListPagesBuildsResponse, ReposListPagesBuildsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pages/builds', operationId: 'reposListPagesBuilds', variables, }), ({ signal }) => fetchReposListPagesBuilds({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposRequestPagesBuildPathParams = { owner: string; repo: string; }; export type ReposRequestPagesBuildError = Fetcher.ErrorWrapper; export type ReposRequestPagesBuildVariables = { pathParams: ReposRequestPagesBuildPathParams; } & GithubContext['fetcherOptions']; /** * You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. * * Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. */ export const fetchReposRequestPagesBuild = ( variables: ReposRequestPagesBuildVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PageBuildStatus, ReposRequestPagesBuildError, undefined, {}, {}, ReposRequestPagesBuildPathParams >({ url: '/repos/{owner}/{repo}/pages/builds', method: 'post', ...variables, signal, }); /** * You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. * * Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. */ export const useReposRequestPagesBuild = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PageBuildStatus, ReposRequestPagesBuildError, ReposRequestPagesBuildVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PageBuildStatus, ReposRequestPagesBuildError, ReposRequestPagesBuildVariables >( (variables: ReposRequestPagesBuildVariables) => fetchReposRequestPagesBuild({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetLatestPagesBuildPathParams = { owner: string; repo: string; }; export type ReposGetLatestPagesBuildError = Fetcher.ErrorWrapper; export type ReposGetLatestPagesBuildVariables = { pathParams: ReposGetLatestPagesBuildPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetLatestPagesBuild = ( variables: ReposGetLatestPagesBuildVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PageBuild, ReposGetLatestPagesBuildError, undefined, {}, {}, ReposGetLatestPagesBuildPathParams >({ url: '/repos/{owner}/{repo}/pages/builds/latest', method: 'get', ...variables, signal, }); export const useReposGetLatestPagesBuild = ( variables: ReposGetLatestPagesBuildVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PageBuild, ReposGetLatestPagesBuildError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PageBuild, ReposGetLatestPagesBuildError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pages/builds/latest', operationId: 'reposGetLatestPagesBuild', variables, }), ({ signal }) => fetchReposGetLatestPagesBuild( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetPagesBuildPathParams = { owner: string; repo: string; buildId: number; }; export type ReposGetPagesBuildError = Fetcher.ErrorWrapper; export type ReposGetPagesBuildVariables = { pathParams: ReposGetPagesBuildPathParams; } & GithubContext['fetcherOptions']; export const fetchReposGetPagesBuild = ( variables: ReposGetPagesBuildVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PageBuild, ReposGetPagesBuildError, undefined, {}, {}, ReposGetPagesBuildPathParams >({ url: '/repos/{owner}/{repo}/pages/builds/{buildId}', method: 'get', ...variables, signal, }); export const useReposGetPagesBuild = ( variables: ReposGetPagesBuildVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PageBuild, ReposGetPagesBuildError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/pages/builds/{build_id}', operationId: 'reposGetPagesBuild', variables, }), ({ signal }) => fetchReposGetPagesBuild({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsListForRepoPathParams = { owner: string; repo: string; }; export type ProjectsListForRepoQueryParams = { /** * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListForRepoError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsListForRepoResponse = Schemas.Project[]; export type ProjectsListForRepoVariables = { pathParams: ProjectsListForRepoPathParams; queryParams?: ProjectsListForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsListForRepo = ( variables: ProjectsListForRepoVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListForRepoResponse, ProjectsListForRepoError, undefined, {}, ProjectsListForRepoQueryParams, ProjectsListForRepoPathParams >({ url: '/repos/{owner}/{repo}/projects', method: 'get', ...variables, signal, }); /** * Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsListForRepo = ( variables: ProjectsListForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListForRepoResponse, ProjectsListForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListForRepoResponse, ProjectsListForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/projects', operationId: 'projectsListForRepo', variables, }), ({ signal }) => fetchProjectsListForRepo({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ProjectsCreateForRepoPathParams = { owner: string; repo: string; }; export type ProjectsCreateForRepoError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 410; payload: Responses.Gone; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsCreateForRepoRequestBody = { /** * The description of the project. */ body?: string; /** * The name of the project. */ name: string; }; export type ProjectsCreateForRepoVariables = { body: ProjectsCreateForRepoRequestBody; pathParams: ProjectsCreateForRepoPathParams; } & GithubContext['fetcherOptions']; /** * Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const fetchProjectsCreateForRepo = ( variables: ProjectsCreateForRepoVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Project, ProjectsCreateForRepoError, ProjectsCreateForRepoRequestBody, {}, {}, ProjectsCreateForRepoPathParams >({ url: '/repos/{owner}/{repo}/projects', method: 'post', ...variables, signal, }); /** * Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ export const useProjectsCreateForRepo = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Project, ProjectsCreateForRepoError, ProjectsCreateForRepoVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Project, ProjectsCreateForRepoError, ProjectsCreateForRepoVariables >( (variables: ProjectsCreateForRepoVariables) => fetchProjectsCreateForRepo({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListPathParams = { owner: string; repo: string; }; export type PullsListQueryParams = { /** * Either `open`, `closed`, or `all` to filter by state. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. */ head?: string; /** * Filter pulls by base branch name. Example: `gh-pages`. */ base?: string; /** * What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). * * @default created */ sort?: 'created' | 'updated' | 'popularity' | 'long-running'; /** * The direction of the sort. Can be either `asc` or `desc`. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsListResponse = Schemas.PullRequestSimple[]; export type PullsListVariables = { pathParams: PullsListPathParams; queryParams?: PullsListQueryParams; } & GithubContext['fetcherOptions']; /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const fetchPullsList = ( variables: PullsListVariables, signal?: AbortSignal, ) => githubFetch< PullsListResponse, PullsListError, undefined, {}, PullsListQueryParams, PullsListPathParams >({ url: '/repos/{owner}/{repo}/pulls', method: 'get', ...variables, signal, }); /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ export const usePullsList = ( variables: PullsListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls', operationId: 'pullsList', variables, }), ({ signal }) => fetchPullsList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsCreatePathParams = { owner: string; repo: string; }; export type PullsCreateError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsCreateRequestBody = { /** * The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ base: string; /** * The contents of the pull request. */ body?: string; /** * Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ draft?: boolean; /** * The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. */ head: string; /** * @example 1 */ issue?: number; /** * Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ maintainer_can_modify?: boolean; /** * The title of the new pull request. */ title?: string; }; export type PullsCreateVariables = { body: PullsCreateRequestBody; pathParams: PullsCreatePathParams; } & GithubContext['fetcherOptions']; /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. * * You can create a new pull request. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchPullsCreate = ( variables: PullsCreateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequest, PullsCreateError, PullsCreateRequestBody, {}, {}, PullsCreatePathParams >({ url: '/repos/{owner}/{repo}/pulls', method: 'post', ...variables, signal, }); /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. * * You can create a new pull request. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const usePullsCreate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequest, PullsCreateError, PullsCreateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequest, PullsCreateError, PullsCreateVariables >( (variables: PullsCreateVariables) => fetchPullsCreate({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListReviewCommentsForRepoPathParams = { owner: string; repo: string; }; export type PullsListReviewCommentsForRepoQueryParams = { sort?: 'created' | 'updated' | 'created_at'; /** * Can be either `asc` or `desc`. Ignored without `sort` parameter. */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListReviewCommentsForRepoError = Fetcher.ErrorWrapper; export type PullsListReviewCommentsForRepoResponse = Schemas.PullRequestReviewComment[]; export type PullsListReviewCommentsForRepoVariables = { pathParams: PullsListReviewCommentsForRepoPathParams; queryParams?: PullsListReviewCommentsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. */ export const fetchPullsListReviewCommentsForRepo = ( variables: PullsListReviewCommentsForRepoVariables, signal?: AbortSignal, ) => githubFetch< PullsListReviewCommentsForRepoResponse, PullsListReviewCommentsForRepoError, undefined, {}, PullsListReviewCommentsForRepoQueryParams, PullsListReviewCommentsForRepoPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments', method: 'get', ...variables, signal, }); /** * Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. */ export const usePullsListReviewCommentsForRepo = < TData = PullsListReviewCommentsForRepoResponse, >( variables: PullsListReviewCommentsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListReviewCommentsForRepoResponse, PullsListReviewCommentsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListReviewCommentsForRepoResponse, PullsListReviewCommentsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/comments', operationId: 'pullsListReviewCommentsForRepo', variables, }), ({ signal }) => fetchPullsListReviewCommentsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PullsDeleteReviewCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type PullsDeleteReviewCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type PullsDeleteReviewCommentVariables = { pathParams: PullsDeleteReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a review comment. */ export const fetchPullsDeleteReviewComment = ( variables: PullsDeleteReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, PullsDeleteReviewCommentError, undefined, {}, {}, PullsDeleteReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}', method: 'delete', ...variables, signal, }); /** * Deletes a review comment. */ export const usePullsDeleteReviewComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PullsDeleteReviewCommentError, PullsDeleteReviewCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PullsDeleteReviewCommentError, PullsDeleteReviewCommentVariables >( (variables: PullsDeleteReviewCommentVariables) => fetchPullsDeleteReviewComment({ ...fetcherOptions, ...variables }), options, ); }; export type PullsGetReviewCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type PullsGetReviewCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type PullsGetReviewCommentVariables = { pathParams: PullsGetReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Provides details for a review comment. */ export const fetchPullsGetReviewComment = ( variables: PullsGetReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReviewComment, PullsGetReviewCommentError, undefined, {}, {}, PullsGetReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}', method: 'get', ...variables, signal, }); /** * Provides details for a review comment. */ export const usePullsGetReviewComment = < TData = Schemas.PullRequestReviewComment, >( variables: PullsGetReviewCommentVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PullRequestReviewComment, PullsGetReviewCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PullRequestReviewComment, PullsGetReviewCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/comments/{comment_id}', operationId: 'pullsGetReviewComment', variables, }), ({ signal }) => fetchPullsGetReviewComment({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsUpdateReviewCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type PullsUpdateReviewCommentError = Fetcher.ErrorWrapper; export type PullsUpdateReviewCommentRequestBody = { /** * The text of the reply to the review comment. */ body: string; }; export type PullsUpdateReviewCommentVariables = { body: PullsUpdateReviewCommentRequestBody; pathParams: PullsUpdateReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Enables you to edit a review comment. */ export const fetchPullsUpdateReviewComment = ( variables: PullsUpdateReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReviewComment, PullsUpdateReviewCommentError, PullsUpdateReviewCommentRequestBody, {}, {}, PullsUpdateReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}', method: 'patch', ...variables, signal, }); /** * Enables you to edit a review comment. */ export const usePullsUpdateReviewComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReviewComment, PullsUpdateReviewCommentError, PullsUpdateReviewCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReviewComment, PullsUpdateReviewCommentError, PullsUpdateReviewCommentVariables >( (variables: PullsUpdateReviewCommentVariables) => fetchPullsUpdateReviewComment({ ...fetcherOptions, ...variables }), options, ); }; export type ReactionsListForPullRequestReviewCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsListForPullRequestReviewCommentQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForPullRequestReviewCommentError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReactionsListForPullRequestReviewCommentResponse = Schemas.Reaction[]; export type ReactionsListForPullRequestReviewCommentVariables = { pathParams: ReactionsListForPullRequestReviewCommentPathParams; queryParams?: ReactionsListForPullRequestReviewCommentQueryParams; } & GithubContext['fetcherOptions']; /** * List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ export const fetchReactionsListForPullRequestReviewComment = ( variables: ReactionsListForPullRequestReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForPullRequestReviewCommentResponse, ReactionsListForPullRequestReviewCommentError, undefined, {}, ReactionsListForPullRequestReviewCommentQueryParams, ReactionsListForPullRequestReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}/reactions', method: 'get', ...variables, signal, }); /** * List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ export const useReactionsListForPullRequestReviewComment = < TData = ReactionsListForPullRequestReviewCommentResponse, >( variables: ReactionsListForPullRequestReviewCommentVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForPullRequestReviewCommentResponse, ReactionsListForPullRequestReviewCommentError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForPullRequestReviewCommentResponse, ReactionsListForPullRequestReviewCommentError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions', operationId: 'reactionsListForPullRequestReviewComment', variables, }), ({ signal }) => fetchReactionsListForPullRequestReviewComment( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForPullRequestReviewCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; }; export type ReactionsCreateForPullRequestReviewCommentError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReactionsCreateForPullRequestReviewCommentRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForPullRequestReviewCommentVariables = { body: ReactionsCreateForPullRequestReviewCommentRequestBody; pathParams: ReactionsCreateForPullRequestReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this pull request review comment. */ export const fetchReactionsCreateForPullRequestReviewComment = ( variables: ReactionsCreateForPullRequestReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForPullRequestReviewCommentError, ReactionsCreateForPullRequestReviewCommentRequestBody, {}, {}, ReactionsCreateForPullRequestReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}/reactions', method: 'post', ...variables, signal, }); /** * Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a `Status: 200 OK` means that you already added the reaction type to this pull request review comment. */ export const useReactionsCreateForPullRequestReviewComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForPullRequestReviewCommentError, ReactionsCreateForPullRequestReviewCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForPullRequestReviewCommentError, ReactionsCreateForPullRequestReviewCommentVariables >( (variables: ReactionsCreateForPullRequestReviewCommentVariables) => fetchReactionsCreateForPullRequestReviewComment({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsDeleteForPullRequestCommentPathParams = { owner: string; repo: string; /** * comment_id parameter */ commentId: number; reactionId: number; }; export type ReactionsDeleteForPullRequestCommentError = Fetcher.ErrorWrapper; export type ReactionsDeleteForPullRequestCommentVariables = { pathParams: ReactionsDeleteForPullRequestCommentPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` * * Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ export const fetchReactionsDeleteForPullRequestComment = ( variables: ReactionsDeleteForPullRequestCommentVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReactionsDeleteForPullRequestCommentError, undefined, {}, {}, ReactionsDeleteForPullRequestCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/comments/{commentId}/reactions/{reactionId}', method: 'delete', ...variables, signal, }); /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` * * Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ export const useReactionsDeleteForPullRequestComment = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReactionsDeleteForPullRequestCommentError, ReactionsDeleteForPullRequestCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReactionsDeleteForPullRequestCommentError, ReactionsDeleteForPullRequestCommentVariables >( (variables: ReactionsDeleteForPullRequestCommentVariables) => fetchReactionsDeleteForPullRequestComment({ ...fetcherOptions, ...variables, }), options, ); }; export type PullsGetPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsGetError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } | { status: 500; payload: Responses.InternalError; } >; export type PullsGetVariables = { pathParams: PullsGetPathParams; } & GithubContext['fetcherOptions']; /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists details of a pull request by providing its number. * * When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit. * * The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request: * * * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. * * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. * * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. * * Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. */ export const fetchPullsGet = ( variables: PullsGetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequest, PullsGetError, undefined, {}, {}, PullsGetPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}', method: 'get', ...variables, signal, }); /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists details of a pull request by providing its number. * * When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit. * * The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request: * * * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. * * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. * * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. * * Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. */ export const usePullsGet = ( variables: PullsGetVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}', operationId: 'pullsGet', variables, }), ({ signal }) => fetchPullsGet({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsUpdatePathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsUpdateError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsUpdateRequestBody = { /** * The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ base?: string; /** * The contents of the pull request. */ body?: string; /** * Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ maintainer_can_modify?: boolean; /** * State of this Pull Request. Either `open` or `closed`. */ state?: 'open' | 'closed'; /** * The title of the pull request. */ title?: string; }; export type PullsUpdateVariables = { body?: PullsUpdateRequestBody; pathParams: PullsUpdatePathParams; } & GithubContext['fetcherOptions']; /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. */ export const fetchPullsUpdate = ( variables: PullsUpdateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequest, PullsUpdateError, PullsUpdateRequestBody, {}, {}, PullsUpdatePathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}', method: 'patch', ...variables, signal, }); /** * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. */ export const usePullsUpdate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequest, PullsUpdateError, PullsUpdateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequest, PullsUpdateError, PullsUpdateVariables >( (variables: PullsUpdateVariables) => fetchPullsUpdate({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListReviewCommentsPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsListReviewCommentsQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * Can be either `asc` or `desc`. Ignored without `sort` parameter. */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListReviewCommentsError = Fetcher.ErrorWrapper; export type PullsListReviewCommentsResponse = Schemas.PullRequestReviewComment[]; export type PullsListReviewCommentsVariables = { pathParams: PullsListReviewCommentsPathParams; queryParams?: PullsListReviewCommentsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all review comments for a pull request. By default, review comments are in ascending order by ID. */ export const fetchPullsListReviewComments = ( variables: PullsListReviewCommentsVariables, signal?: AbortSignal, ) => githubFetch< PullsListReviewCommentsResponse, PullsListReviewCommentsError, undefined, {}, PullsListReviewCommentsQueryParams, PullsListReviewCommentsPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/comments', method: 'get', ...variables, signal, }); /** * Lists all review comments for a pull request. By default, review comments are in ascending order by ID. */ export const usePullsListReviewComments = < TData = PullsListReviewCommentsResponse, >( variables: PullsListReviewCommentsVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListReviewCommentsResponse, PullsListReviewCommentsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListReviewCommentsResponse, PullsListReviewCommentsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/comments', operationId: 'pullsListReviewComments', variables, }), ({ signal }) => fetchPullsListReviewComments({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsCreateReviewCommentPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsCreateReviewCommentError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsCreateReviewCommentRequestBody = { /** * The text of the review comment. */ body: string; /** * The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. */ commit_id?: string; /** * @example 2 */ in_reply_to?: number; /** * **Required with `comfort-fade` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ line?: number; /** * The relative path to the file that necessitates a comment. */ path?: string; /** * **Required without `comfort-fade` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ position?: number; /** * **Required with `comfort-fade` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ side?: 'LEFT' | 'RIGHT'; /** * **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ start_line?: number; /** * **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. */ start_side?: 'LEFT' | 'RIGHT' | 'side'; }; export type PullsCreateReviewCommentVariables = { body: PullsCreateReviewCommentRequestBody; pathParams: PullsCreateReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. * * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). * * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchPullsCreateReviewComment = ( variables: PullsCreateReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReviewComment, PullsCreateReviewCommentError, PullsCreateReviewCommentRequestBody, {}, {}, PullsCreateReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/comments', method: 'post', ...variables, signal, }); /** * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. * * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). * * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const usePullsCreateReviewComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReviewComment, PullsCreateReviewCommentError, PullsCreateReviewCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReviewComment, PullsCreateReviewCommentError, PullsCreateReviewCommentVariables >( (variables: PullsCreateReviewCommentVariables) => fetchPullsCreateReviewComment({ ...fetcherOptions, ...variables }), options, ); }; export type PullsCreateReplyForReviewCommentPathParams = { owner: string; repo: string; pullNumber: number; /** * comment_id parameter */ commentId: number; }; export type PullsCreateReplyForReviewCommentError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type PullsCreateReplyForReviewCommentRequestBody = { /** * The text of the review comment. */ body: string; }; export type PullsCreateReplyForReviewCommentVariables = { body: PullsCreateReplyForReviewCommentRequestBody; pathParams: PullsCreateReplyForReviewCommentPathParams; } & GithubContext['fetcherOptions']; /** * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchPullsCreateReplyForReviewComment = ( variables: PullsCreateReplyForReviewCommentVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReviewComment, PullsCreateReplyForReviewCommentError, PullsCreateReplyForReviewCommentRequestBody, {}, {}, PullsCreateReplyForReviewCommentPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/comments/{commentId}/replies', method: 'post', ...variables, signal, }); /** * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const usePullsCreateReplyForReviewComment = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReviewComment, PullsCreateReplyForReviewCommentError, PullsCreateReplyForReviewCommentVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReviewComment, PullsCreateReplyForReviewCommentError, PullsCreateReplyForReviewCommentVariables >( (variables: PullsCreateReplyForReviewCommentVariables) => fetchPullsCreateReplyForReviewComment({ ...fetcherOptions, ...variables, }), options, ); }; export type PullsListCommitsPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsListCommitsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListCommitsError = Fetcher.ErrorWrapper; export type PullsListCommitsResponse = Schemas.Commit[]; export type PullsListCommitsVariables = { pathParams: PullsListCommitsPathParams; queryParams?: PullsListCommitsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. */ export const fetchPullsListCommits = ( variables: PullsListCommitsVariables, signal?: AbortSignal, ) => githubFetch< PullsListCommitsResponse, PullsListCommitsError, undefined, {}, PullsListCommitsQueryParams, PullsListCommitsPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/commits', method: 'get', ...variables, signal, }); /** * Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. */ export const usePullsListCommits = ( variables: PullsListCommitsVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListCommitsResponse, PullsListCommitsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListCommitsResponse, PullsListCommitsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/commits', operationId: 'pullsListCommits', variables, }), ({ signal }) => fetchPullsListCommits({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsListFilesPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsListFilesQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListFilesError = Fetcher.ErrorWrapper< | { status: 422; payload: Responses.ValidationFailed; } | { status: 500; payload: Responses.InternalError; } >; export type PullsListFilesResponse = Schemas.DiffEntry[]; export type PullsListFilesVariables = { pathParams: PullsListFilesPathParams; queryParams?: PullsListFilesQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. */ export const fetchPullsListFiles = ( variables: PullsListFilesVariables, signal?: AbortSignal, ) => githubFetch< PullsListFilesResponse, PullsListFilesError, undefined, {}, PullsListFilesQueryParams, PullsListFilesPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/files', method: 'get', ...variables, signal, }); /** * **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. */ export const usePullsListFiles = ( variables: PullsListFilesVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListFilesResponse, PullsListFilesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListFilesResponse, PullsListFilesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/files', operationId: 'pullsListFiles', variables, }), ({ signal }) => fetchPullsListFiles({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsCheckIfMergedPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsCheckIfMergedError = Fetcher.ErrorWrapper; export type PullsCheckIfMergedVariables = { pathParams: PullsCheckIfMergedPathParams; } & GithubContext['fetcherOptions']; export const fetchPullsCheckIfMerged = ( variables: PullsCheckIfMergedVariables, signal?: AbortSignal, ) => githubFetch< undefined, PullsCheckIfMergedError, undefined, {}, {}, PullsCheckIfMergedPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/merge', method: 'get', ...variables, signal, }); export const usePullsCheckIfMerged = ( variables: PullsCheckIfMergedVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/merge', operationId: 'pullsCheckIfMerged', variables, }), ({ signal }) => fetchPullsCheckIfMerged({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsMergePathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsMergeError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 405; payload: { documentation_url?: string; message?: string; }; } | { status: 409; payload: { documentation_url?: string; message?: string; }; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsMergeVariables = { body?: { /** * Extra detail to append to automatic commit message. */ commit_message?: string; /** * Title for the automatic commit message. */ commit_title?: string; /** * Merge method to use. Possible values are `merge`, `squash` or `rebase`. Default is `merge`. */ merge_method?: 'merge' | 'squash' | 'rebase'; /** * SHA that pull request head must match to allow merge. */ sha?: string; } | null; pathParams: PullsMergePathParams; } & GithubContext['fetcherOptions']; /** * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const fetchPullsMerge = ( variables: PullsMergeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestMergeResult, PullsMergeError, { /** * Extra detail to append to automatic commit message. */ commit_message?: string; /** * Title for the automatic commit message. */ commit_title?: string; /** * Merge method to use. Possible values are `merge`, `squash` or `rebase`. Default is `merge`. */ merge_method?: 'merge' | 'squash' | 'rebase'; /** * SHA that pull request head must match to allow merge. */ sha?: string; } | null, {}, {}, PullsMergePathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/merge', method: 'put', ...variables, signal, }); /** * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const usePullsMerge = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestMergeResult, PullsMergeError, PullsMergeVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestMergeResult, PullsMergeError, PullsMergeVariables >( (variables: PullsMergeVariables) => fetchPullsMerge({ ...fetcherOptions, ...variables }), options, ); }; export type PullsRemoveRequestedReviewersPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsRemoveRequestedReviewersError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type PullsRemoveRequestedReviewersRequestBody = { /** * An array of user `login`s that will be removed. */ reviewers: string[]; /** * An array of team `slug`s that will be removed. */ team_reviewers?: string[]; }; export type PullsRemoveRequestedReviewersVariables = { body: PullsRemoveRequestedReviewersRequestBody; pathParams: PullsRemoveRequestedReviewersPathParams; } & GithubContext['fetcherOptions']; export const fetchPullsRemoveRequestedReviewers = ( variables: PullsRemoveRequestedReviewersVariables, signal?: AbortSignal, ) => githubFetch< undefined, PullsRemoveRequestedReviewersError, PullsRemoveRequestedReviewersRequestBody, {}, {}, PullsRemoveRequestedReviewersPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/requested_reviewers', method: 'delete', ...variables, signal, }); export const usePullsRemoveRequestedReviewers = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PullsRemoveRequestedReviewersError, PullsRemoveRequestedReviewersVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PullsRemoveRequestedReviewersError, PullsRemoveRequestedReviewersVariables >( (variables: PullsRemoveRequestedReviewersVariables) => fetchPullsRemoveRequestedReviewers({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListRequestedReviewersPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsListRequestedReviewersQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListRequestedReviewersError = Fetcher.ErrorWrapper; export type PullsListRequestedReviewersVariables = { pathParams: PullsListRequestedReviewersPathParams; queryParams?: PullsListRequestedReviewersQueryParams; } & GithubContext['fetcherOptions']; export const fetchPullsListRequestedReviewers = ( variables: PullsListRequestedReviewersVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReviewRequest, PullsListRequestedReviewersError, undefined, {}, PullsListRequestedReviewersQueryParams, PullsListRequestedReviewersPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/requested_reviewers', method: 'get', ...variables, signal, }); export const usePullsListRequestedReviewers = < TData = Schemas.PullRequestReviewRequest, >( variables: PullsListRequestedReviewersVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PullRequestReviewRequest, PullsListRequestedReviewersError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PullRequestReviewRequest, PullsListRequestedReviewersError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers', operationId: 'pullsListRequestedReviewers', variables, }), ({ signal }) => fetchPullsListRequestedReviewers( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PullsRequestReviewersPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsRequestReviewersError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type PullsRequestReviewersVariables = { body?: | { /** * An array of user `login`s that will be requested. */ reviewers: string[]; /** * An array of team `slug`s that will be requested. */ team_reviewers?: string[]; } | { /** * An array of user `login`s that will be requested. */ reviewers?: string[]; /** * An array of team `slug`s that will be requested. */ team_reviewers: string[]; }; pathParams: PullsRequestReviewersPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const fetchPullsRequestReviewers = ( variables: PullsRequestReviewersVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestSimple, PullsRequestReviewersError, | { /** * An array of user `login`s that will be requested. */ reviewers: string[]; /** * An array of team `slug`s that will be requested. */ team_reviewers?: string[]; } | { /** * An array of user `login`s that will be requested. */ reviewers?: string[]; /** * An array of team `slug`s that will be requested. */ team_reviewers: string[]; }, {}, {}, PullsRequestReviewersPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/requested_reviewers', method: 'post', ...variables, signal, }); /** * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. */ export const usePullsRequestReviewers = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestSimple, PullsRequestReviewersError, PullsRequestReviewersVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestSimple, PullsRequestReviewersError, PullsRequestReviewersVariables >( (variables: PullsRequestReviewersVariables) => fetchPullsRequestReviewers({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListReviewsPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsListReviewsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListReviewsError = Fetcher.ErrorWrapper; export type PullsListReviewsResponse = Schemas.PullRequestReview[]; export type PullsListReviewsVariables = { pathParams: PullsListReviewsPathParams; queryParams?: PullsListReviewsQueryParams; } & GithubContext['fetcherOptions']; /** * The list of reviews returns in chronological order. */ export const fetchPullsListReviews = ( variables: PullsListReviewsVariables, signal?: AbortSignal, ) => githubFetch< PullsListReviewsResponse, PullsListReviewsError, undefined, {}, PullsListReviewsQueryParams, PullsListReviewsPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews', method: 'get', ...variables, signal, }); /** * The list of reviews returns in chronological order. */ export const usePullsListReviews = ( variables: PullsListReviewsVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListReviewsResponse, PullsListReviewsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListReviewsResponse, PullsListReviewsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews', operationId: 'pullsListReviews', variables, }), ({ signal }) => fetchPullsListReviews({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsCreateReviewPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsCreateReviewError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type PullsCreateReviewRequestBody = { /** * **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. */ body?: string; /** * Use the following table to specify the location, destination, and contents of the draft review comment. */ comments?: { /** * Text of the review comment. */ body: string; /** * @example 28 */ line?: number; /** * The relative path to the file that necessitates a review comment. */ path: string; /** * The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ position?: number; /** * @example RIGHT */ side?: string; /** * @example 26 */ start_line?: number; /** * @example LEFT */ start_side?: string; }[]; /** * The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. */ commit_id?: string; /** * The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ event?: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT'; }; export type PullsCreateReviewVariables = { body?: PullsCreateReviewRequestBody; pathParams: PullsCreateReviewPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response. * * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. * * The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. */ export const fetchPullsCreateReview = ( variables: PullsCreateReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsCreateReviewError, PullsCreateReviewRequestBody, {}, {}, PullsCreateReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews', method: 'post', ...variables, signal, }); /** * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * * Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response. * * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. * * The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. */ export const usePullsCreateReview = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReview, PullsCreateReviewError, PullsCreateReviewVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReview, PullsCreateReviewError, PullsCreateReviewVariables >( (variables: PullsCreateReviewVariables) => fetchPullsCreateReview({ ...fetcherOptions, ...variables }), options, ); }; export type PullsDeletePendingReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsDeletePendingReviewError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type PullsDeletePendingReviewVariables = { pathParams: PullsDeletePendingReviewPathParams; } & GithubContext['fetcherOptions']; export const fetchPullsDeletePendingReview = ( variables: PullsDeletePendingReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsDeletePendingReviewError, undefined, {}, {}, PullsDeletePendingReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}', method: 'delete', ...variables, signal, }); export const usePullsDeletePendingReview = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReview, PullsDeletePendingReviewError, PullsDeletePendingReviewVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReview, PullsDeletePendingReviewError, PullsDeletePendingReviewVariables >( (variables: PullsDeletePendingReviewVariables) => fetchPullsDeletePendingReview({ ...fetcherOptions, ...variables }), options, ); }; export type PullsGetReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsGetReviewError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type PullsGetReviewVariables = { pathParams: PullsGetReviewPathParams; } & GithubContext['fetcherOptions']; export const fetchPullsGetReview = ( variables: PullsGetReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsGetReviewError, undefined, {}, {}, PullsGetReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}', method: 'get', ...variables, signal, }); export const usePullsGetReview = ( variables: PullsGetReviewVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PullRequestReview, PullsGetReviewError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PullRequestReview, PullsGetReviewError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}', operationId: 'pullsGetReview', variables, }), ({ signal }) => fetchPullsGetReview({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PullsUpdateReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsUpdateReviewError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailedSimple; }>; export type PullsUpdateReviewRequestBody = { /** * The body text of the pull request review. */ body: string; }; export type PullsUpdateReviewVariables = { body: PullsUpdateReviewRequestBody; pathParams: PullsUpdateReviewPathParams; } & GithubContext['fetcherOptions']; /** * Update the review summary comment with new text. */ export const fetchPullsUpdateReview = ( variables: PullsUpdateReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsUpdateReviewError, PullsUpdateReviewRequestBody, {}, {}, PullsUpdateReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}', method: 'put', ...variables, signal, }); /** * Update the review summary comment with new text. */ export const usePullsUpdateReview = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReview, PullsUpdateReviewError, PullsUpdateReviewVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReview, PullsUpdateReviewError, PullsUpdateReviewVariables >( (variables: PullsUpdateReviewVariables) => fetchPullsUpdateReview({ ...fetcherOptions, ...variables }), options, ); }; export type PullsListCommentsForReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsListCommentsForReviewQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type PullsListCommentsForReviewError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type PullsListCommentsForReviewResponse = Schemas.ReviewComment[]; export type PullsListCommentsForReviewVariables = { pathParams: PullsListCommentsForReviewPathParams; queryParams?: PullsListCommentsForReviewQueryParams; } & GithubContext['fetcherOptions']; /** * List comments for a specific pull request review. */ export const fetchPullsListCommentsForReview = ( variables: PullsListCommentsForReviewVariables, signal?: AbortSignal, ) => githubFetch< PullsListCommentsForReviewResponse, PullsListCommentsForReviewError, undefined, {}, PullsListCommentsForReviewQueryParams, PullsListCommentsForReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}/comments', method: 'get', ...variables, signal, }); /** * List comments for a specific pull request review. */ export const usePullsListCommentsForReview = < TData = PullsListCommentsForReviewResponse, >( variables: PullsListCommentsForReviewVariables, options?: Omit< reactQuery.UseQueryOptions< PullsListCommentsForReviewResponse, PullsListCommentsForReviewError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PullsListCommentsForReviewResponse, PullsListCommentsForReviewError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments', operationId: 'pullsListCommentsForReview', variables, }), ({ signal }) => fetchPullsListCommentsForReview( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PullsDismissReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsDismissReviewError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type PullsDismissReviewRequestBody = { /** * @example "APPROVE" */ event?: string; /** * The message for the pull request review dismissal */ message: string; }; export type PullsDismissReviewVariables = { body: PullsDismissReviewRequestBody; pathParams: PullsDismissReviewPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. */ export const fetchPullsDismissReview = ( variables: PullsDismissReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsDismissReviewError, PullsDismissReviewRequestBody, {}, {}, PullsDismissReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}/dismissals', method: 'put', ...variables, signal, }); /** * **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. */ export const usePullsDismissReview = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReview, PullsDismissReviewError, PullsDismissReviewVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReview, PullsDismissReviewError, PullsDismissReviewVariables >( (variables: PullsDismissReviewVariables) => fetchPullsDismissReview({ ...fetcherOptions, ...variables }), options, ); }; export type PullsSubmitReviewPathParams = { owner: string; repo: string; pullNumber: number; /** * review_id parameter */ reviewId: number; }; export type PullsSubmitReviewError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type PullsSubmitReviewRequestBody = { /** * The body text of the pull request review */ body?: string; /** * The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action. */ event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT'; }; export type PullsSubmitReviewVariables = { body: PullsSubmitReviewRequestBody; pathParams: PullsSubmitReviewPathParams; } & GithubContext['fetcherOptions']; export const fetchPullsSubmitReview = ( variables: PullsSubmitReviewVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PullRequestReview, PullsSubmitReviewError, PullsSubmitReviewRequestBody, {}, {}, PullsSubmitReviewPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/reviews/{reviewId}/events', method: 'post', ...variables, signal, }); export const usePullsSubmitReview = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PullRequestReview, PullsSubmitReviewError, PullsSubmitReviewVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PullRequestReview, PullsSubmitReviewError, PullsSubmitReviewVariables >( (variables: PullsSubmitReviewVariables) => fetchPullsSubmitReview({ ...fetcherOptions, ...variables }), options, ); }; export type PullsUpdateBranchPathParams = { owner: string; repo: string; pullNumber: number; }; export type PullsUpdateBranchError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type PullsUpdateBranchResponse = { message?: string; url?: string; }; export type PullsUpdateBranchVariables = { body?: { /** * The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ expected_head_sha?: string; } | null; pathParams: PullsUpdateBranchPathParams; } & GithubContext['fetcherOptions']; /** * Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. */ export const fetchPullsUpdateBranch = ( variables: PullsUpdateBranchVariables, signal?: AbortSignal, ) => githubFetch< PullsUpdateBranchResponse, PullsUpdateBranchError, { /** * The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ expected_head_sha?: string; } | null, {}, {}, PullsUpdateBranchPathParams >({ url: '/repos/{owner}/{repo}/pulls/{pullNumber}/update-branch', method: 'put', ...variables, signal, }); /** * Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. */ export const usePullsUpdateBranch = ( options?: Omit< reactQuery.UseMutationOptions< PullsUpdateBranchResponse, PullsUpdateBranchError, PullsUpdateBranchVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< PullsUpdateBranchResponse, PullsUpdateBranchError, PullsUpdateBranchVariables >( (variables: PullsUpdateBranchVariables) => fetchPullsUpdateBranch({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetReadmePathParams = { owner: string; repo: string; }; export type ReposGetReadmeQueryParams = { /** * The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ ref?: string; }; export type ReposGetReadmeError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposGetReadmeVariables = { pathParams: ReposGetReadmePathParams; queryParams?: ReposGetReadmeQueryParams; } & GithubContext['fetcherOptions']; /** * Gets the preferred README for a repository. * * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. */ export const fetchReposGetReadme = ( variables: ReposGetReadmeVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ContentFile, ReposGetReadmeError, undefined, {}, ReposGetReadmeQueryParams, ReposGetReadmePathParams >({ url: '/repos/{owner}/{repo}/readme', method: 'get', ...variables, signal, }); /** * Gets the preferred README for a repository. * * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. */ export const useReposGetReadme = ( variables: ReposGetReadmeVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/readme', operationId: 'reposGetReadme', variables, }), ({ signal }) => fetchReposGetReadme({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetReadmeFromAltPathPathParams = { owner: string; repo: string; /** * The alternate path to look for a README file */ dir: string; }; export type ReposGetReadmeFromAltPathQueryParams = { /** * The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ ref?: string; }; export type ReposGetReadmeFromAltPathError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposGetReadmeFromAltPathVariables = { pathParams: ReposGetReadmeFromAltPathPathParams; queryParams?: ReposGetReadmeFromAltPathQueryParams; } & GithubContext['fetcherOptions']; /** * Gets the preferred README for a repository. * * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. */ export const fetchReposGetReadmeFromAltPath = ( variables: ReposGetReadmeFromAltPathVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ContentFile, ReposGetReadmeFromAltPathError, undefined, {}, ReposGetReadmeFromAltPathQueryParams, ReposGetReadmeFromAltPathPathParams >({ url: '/repos/{owner}/{repo}/readme/{dir}', method: 'get', ...variables, signal, }); /** * Gets the preferred README for a repository. * * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. */ export const useReposGetReadmeFromAltPath = ( variables: ReposGetReadmeFromAltPathVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ContentFile, ReposGetReadmeFromAltPathError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ContentFile, ReposGetReadmeFromAltPathError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/readme/{dir}', operationId: 'reposGetReadmeFromAltPath', variables, }), ({ signal }) => fetchReposGetReadmeFromAltPath( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListReleasesPathParams = { owner: string; repo: string; }; export type ReposListReleasesQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListReleasesError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposListReleasesResponse = Schemas.Release[]; export type ReposListReleasesVariables = { pathParams: ReposListReleasesPathParams; queryParams?: ReposListReleasesQueryParams; } & GithubContext['fetcherOptions']; /** * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). * * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. */ export const fetchReposListReleases = ( variables: ReposListReleasesVariables, signal?: AbortSignal, ) => githubFetch< ReposListReleasesResponse, ReposListReleasesError, undefined, {}, ReposListReleasesQueryParams, ReposListReleasesPathParams >({ url: '/repos/{owner}/{repo}/releases', method: 'get', ...variables, signal, }); /** * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). * * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. */ export const useReposListReleases = ( variables: ReposListReleasesVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListReleasesResponse, ReposListReleasesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListReleasesResponse, ReposListReleasesError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/releases', operationId: 'reposListReleases', variables, }), ({ signal }) => fetchReposListReleases({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateReleasePathParams = { owner: string; repo: string; }; export type ReposCreateReleaseError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ReposCreateReleaseRequestBody = { /** * Text describing the contents of the tag. */ body?: string; /** * `true` to create a draft (unpublished) release, `false` to create a published one. * * @default false */ draft?: boolean; /** * The name of the release. */ name?: string; /** * `true` to identify the release as a prerelease. `false` to identify the release as a full release. * * @default false */ prerelease?: boolean; /** * The name of the tag. */ tag_name: string; /** * Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). */ target_commitish?: string; }; export type ReposCreateReleaseVariables = { body: ReposCreateReleaseRequestBody; pathParams: ReposCreateReleasePathParams; } & GithubContext['fetcherOptions']; /** * Users with push access to the repository can create a release. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchReposCreateRelease = ( variables: ReposCreateReleaseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Release, ReposCreateReleaseError, ReposCreateReleaseRequestBody, {}, {}, ReposCreateReleasePathParams >({ url: '/repos/{owner}/{repo}/releases', method: 'post', ...variables, signal, }); /** * Users with push access to the repository can create a release. * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const useReposCreateRelease = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Release, ReposCreateReleaseError, ReposCreateReleaseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Release, ReposCreateReleaseError, ReposCreateReleaseVariables >( (variables: ReposCreateReleaseVariables) => fetchReposCreateRelease({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDeleteReleaseAssetPathParams = { owner: string; repo: string; /** * asset_id parameter */ assetId: number; }; export type ReposDeleteReleaseAssetError = Fetcher.ErrorWrapper; export type ReposDeleteReleaseAssetVariables = { pathParams: ReposDeleteReleaseAssetPathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeleteReleaseAsset = ( variables: ReposDeleteReleaseAssetVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteReleaseAssetError, undefined, {}, {}, ReposDeleteReleaseAssetPathParams >({ url: '/repos/{owner}/{repo}/releases/assets/{assetId}', method: 'delete', ...variables, signal, }); export const useReposDeleteReleaseAsset = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteReleaseAssetError, ReposDeleteReleaseAssetVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteReleaseAssetError, ReposDeleteReleaseAssetVariables >( (variables: ReposDeleteReleaseAssetVariables) => fetchReposDeleteReleaseAsset({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetReleaseAssetPathParams = { owner: string; repo: string; /** * asset_id parameter */ assetId: number; }; export type ReposGetReleaseAssetError = Fetcher.ErrorWrapper< | { status: 302; payload: Responses.Found; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReposGetReleaseAssetVariables = { pathParams: ReposGetReleaseAssetPathParams; } & GithubContext['fetcherOptions']; /** * To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ export const fetchReposGetReleaseAsset = ( variables: ReposGetReleaseAssetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ReleaseAsset, ReposGetReleaseAssetError, undefined, {}, {}, ReposGetReleaseAssetPathParams >({ url: '/repos/{owner}/{repo}/releases/assets/{assetId}', method: 'get', ...variables, signal, }); /** * To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ export const useReposGetReleaseAsset = ( variables: ReposGetReleaseAssetVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ReleaseAsset, ReposGetReleaseAssetError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ReleaseAsset, ReposGetReleaseAssetError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/releases/assets/{asset_id}', operationId: 'reposGetReleaseAsset', variables, }), ({ signal }) => fetchReposGetReleaseAsset({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUpdateReleaseAssetPathParams = { owner: string; repo: string; /** * asset_id parameter */ assetId: number; }; export type ReposUpdateReleaseAssetError = Fetcher.ErrorWrapper; export type ReposUpdateReleaseAssetRequestBody = { /** * An alternate short description of the asset. Used in place of the filename. */ label?: string; /** * The file name of the asset. */ name?: string; /** * @example "uploaded" */ state?: string; }; export type ReposUpdateReleaseAssetVariables = { body?: ReposUpdateReleaseAssetRequestBody; pathParams: ReposUpdateReleaseAssetPathParams; } & GithubContext['fetcherOptions']; /** * Users with push access to the repository can edit a release asset. */ export const fetchReposUpdateReleaseAsset = ( variables: ReposUpdateReleaseAssetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ReleaseAsset, ReposUpdateReleaseAssetError, ReposUpdateReleaseAssetRequestBody, {}, {}, ReposUpdateReleaseAssetPathParams >({ url: '/repos/{owner}/{repo}/releases/assets/{assetId}', method: 'patch', ...variables, signal, }); /** * Users with push access to the repository can edit a release asset. */ export const useReposUpdateReleaseAsset = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ReleaseAsset, ReposUpdateReleaseAssetError, ReposUpdateReleaseAssetVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ReleaseAsset, ReposUpdateReleaseAssetError, ReposUpdateReleaseAssetVariables >( (variables: ReposUpdateReleaseAssetVariables) => fetchReposUpdateReleaseAsset({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetLatestReleasePathParams = { owner: string; repo: string; }; export type ReposGetLatestReleaseError = Fetcher.ErrorWrapper; export type ReposGetLatestReleaseVariables = { pathParams: ReposGetLatestReleasePathParams; } & GithubContext['fetcherOptions']; /** * View the latest published full release for the repository. * * The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. */ export const fetchReposGetLatestRelease = ( variables: ReposGetLatestReleaseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Release, ReposGetLatestReleaseError, undefined, {}, {}, ReposGetLatestReleasePathParams >({ url: '/repos/{owner}/{repo}/releases/latest', method: 'get', ...variables, signal, }); /** * View the latest published full release for the repository. * * The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. */ export const useReposGetLatestRelease = ( variables: ReposGetLatestReleaseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Release, ReposGetLatestReleaseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Release, ReposGetLatestReleaseError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/releases/latest', operationId: 'reposGetLatestRelease', variables, }), ({ signal }) => fetchReposGetLatestRelease({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetReleaseByTagPathParams = { owner: string; repo: string; /** * tag parameter */ tag: string; }; export type ReposGetReleaseByTagError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetReleaseByTagVariables = { pathParams: ReposGetReleaseByTagPathParams; } & GithubContext['fetcherOptions']; /** * Get a published release with the specified tag. */ export const fetchReposGetReleaseByTag = ( variables: ReposGetReleaseByTagVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Release, ReposGetReleaseByTagError, undefined, {}, {}, ReposGetReleaseByTagPathParams >({ url: '/repos/{owner}/{repo}/releases/tags/{tag}', method: 'get', ...variables, signal, }); /** * Get a published release with the specified tag. */ export const useReposGetReleaseByTag = ( variables: ReposGetReleaseByTagVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Release, ReposGetReleaseByTagError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/releases/tags/{tag}', operationId: 'reposGetReleaseByTag', variables, }), ({ signal }) => fetchReposGetReleaseByTag({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDeleteReleasePathParams = { owner: string; repo: string; /** * release_id parameter */ releaseId: number; }; export type ReposDeleteReleaseError = Fetcher.ErrorWrapper; export type ReposDeleteReleaseVariables = { pathParams: ReposDeleteReleasePathParams; } & GithubContext['fetcherOptions']; /** * Users with push access to the repository can delete a release. */ export const fetchReposDeleteRelease = ( variables: ReposDeleteReleaseVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeleteReleaseError, undefined, {}, {}, ReposDeleteReleasePathParams >({ url: '/repos/{owner}/{repo}/releases/{releaseId}', method: 'delete', ...variables, signal, }); /** * Users with push access to the repository can delete a release. */ export const useReposDeleteRelease = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeleteReleaseError, ReposDeleteReleaseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeleteReleaseError, ReposDeleteReleaseVariables >( (variables: ReposDeleteReleaseVariables) => fetchReposDeleteRelease({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetReleasePathParams = { owner: string; repo: string; /** * release_id parameter */ releaseId: number; }; export type ReposGetReleaseError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetReleaseVariables = { pathParams: ReposGetReleasePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ export const fetchReposGetRelease = ( variables: ReposGetReleaseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Release, ReposGetReleaseError, undefined, {}, {}, ReposGetReleasePathParams >({ url: '/repos/{owner}/{repo}/releases/{releaseId}', method: 'get', ...variables, signal, }); /** * **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ export const useReposGetRelease = ( variables: ReposGetReleaseVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/releases/{release_id}', operationId: 'reposGetRelease', variables, }), ({ signal }) => fetchReposGetRelease({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUpdateReleasePathParams = { owner: string; repo: string; /** * release_id parameter */ releaseId: number; }; export type ReposUpdateReleaseError = Fetcher.ErrorWrapper; export type ReposUpdateReleaseRequestBody = { /** * Text describing the contents of the tag. */ body?: string; /** * `true` makes the release a draft, and `false` publishes the release. */ draft?: boolean; /** * The name of the release. */ name?: string; /** * `true` to identify the release as a prerelease, `false` to identify the release as a full release. */ prerelease?: boolean; /** * The name of the tag. */ tag_name?: string; /** * Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). */ target_commitish?: string; }; export type ReposUpdateReleaseVariables = { body?: ReposUpdateReleaseRequestBody; pathParams: ReposUpdateReleasePathParams; } & GithubContext['fetcherOptions']; /** * Users with push access to the repository can edit a release. */ export const fetchReposUpdateRelease = ( variables: ReposUpdateReleaseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Release, ReposUpdateReleaseError, ReposUpdateReleaseRequestBody, {}, {}, ReposUpdateReleasePathParams >({ url: '/repos/{owner}/{repo}/releases/{releaseId}', method: 'patch', ...variables, signal, }); /** * Users with push access to the repository can edit a release. */ export const useReposUpdateRelease = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Release, ReposUpdateReleaseError, ReposUpdateReleaseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Release, ReposUpdateReleaseError, ReposUpdateReleaseVariables >( (variables: ReposUpdateReleaseVariables) => fetchReposUpdateRelease({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListReleaseAssetsPathParams = { owner: string; repo: string; /** * release_id parameter */ releaseId: number; }; export type ReposListReleaseAssetsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListReleaseAssetsError = Fetcher.ErrorWrapper; export type ReposListReleaseAssetsResponse = Schemas.ReleaseAsset[]; export type ReposListReleaseAssetsVariables = { pathParams: ReposListReleaseAssetsPathParams; queryParams?: ReposListReleaseAssetsQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListReleaseAssets = ( variables: ReposListReleaseAssetsVariables, signal?: AbortSignal, ) => githubFetch< ReposListReleaseAssetsResponse, ReposListReleaseAssetsError, undefined, {}, ReposListReleaseAssetsQueryParams, ReposListReleaseAssetsPathParams >({ url: '/repos/{owner}/{repo}/releases/{releaseId}/assets', method: 'get', ...variables, signal, }); export const useReposListReleaseAssets = < TData = ReposListReleaseAssetsResponse, >( variables: ReposListReleaseAssetsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListReleaseAssetsResponse, ReposListReleaseAssetsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListReleaseAssetsResponse, ReposListReleaseAssetsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/releases/{release_id}/assets', operationId: 'reposListReleaseAssets', variables, }), ({ signal }) => fetchReposListReleaseAssets({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposUploadReleaseAssetPathParams = { owner: string; repo: string; /** * release_id parameter */ releaseId: number; }; export type ReposUploadReleaseAssetQueryParams = { name?: string; label?: string; }; export type ReposUploadReleaseAssetError = Fetcher.ErrorWrapper; export type ReposUploadReleaseAssetVariables = { body?: string; pathParams: ReposUploadReleaseAssetPathParams; queryParams?: ReposUploadReleaseAssetQueryParams; } & GithubContext['fetcherOptions']; /** * This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in * the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. * * You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. * * Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: * * `application/zip` * * GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, * you'll still need to pass your authentication to be able to upload an asset. * * When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted. * * **Notes:** * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. */ export const fetchReposUploadReleaseAsset = ( variables: ReposUploadReleaseAssetVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ReleaseAsset, ReposUploadReleaseAssetError, string, {}, ReposUploadReleaseAssetQueryParams, ReposUploadReleaseAssetPathParams >({ url: '/repos/{owner}/{repo}/releases/{releaseId}/assets', method: 'post', ...variables, signal, }); /** * This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in * the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. * * You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. * * Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: * * `application/zip` * * GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, * you'll still need to pass your authentication to be able to upload an asset. * * When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted. * * **Notes:** * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. */ export const useReposUploadReleaseAsset = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ReleaseAsset, ReposUploadReleaseAssetError, ReposUploadReleaseAssetVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ReleaseAsset, ReposUploadReleaseAssetError, ReposUploadReleaseAssetVariables >( (variables: ReposUploadReleaseAssetVariables) => fetchReposUploadReleaseAsset({ ...fetcherOptions, ...variables }), options, ); }; export type SecretScanningListAlertsForRepoPathParams = { owner: string; repo: string; }; export type SecretScanningListAlertsForRepoQueryParams = { /** * Set to `open` or `resolved` to only list secret scanning alerts in a specific state. */ state?: 'open' | 'resolved'; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type SecretScanningListAlertsForRepoError = Fetcher.ErrorWrapper<{ status: 503; payload: Responses.ServiceUnavailable; }>; export type SecretScanningListAlertsForRepoResponse = Schemas.SecretScanningAlert[]; export type SecretScanningListAlertsForRepoVariables = { pathParams: SecretScanningListAlertsForRepoPathParams; queryParams?: SecretScanningListAlertsForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. */ export const fetchSecretScanningListAlertsForRepo = ( variables: SecretScanningListAlertsForRepoVariables, signal?: AbortSignal, ) => githubFetch< SecretScanningListAlertsForRepoResponse, SecretScanningListAlertsForRepoError, undefined, {}, SecretScanningListAlertsForRepoQueryParams, SecretScanningListAlertsForRepoPathParams >({ url: '/repos/{owner}/{repo}/secret-scanning/alerts', method: 'get', ...variables, signal, }); /** * Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. */ export const useSecretScanningListAlertsForRepo = < TData = SecretScanningListAlertsForRepoResponse, >( variables: SecretScanningListAlertsForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< SecretScanningListAlertsForRepoResponse, SecretScanningListAlertsForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< SecretScanningListAlertsForRepoResponse, SecretScanningListAlertsForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/secret-scanning/alerts', operationId: 'secretScanningListAlertsForRepo', variables, }), ({ signal }) => fetchSecretScanningListAlertsForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type SecretScanningGetAlertPathParams = { owner: string; repo: string; /** * The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alertNumber: Schemas.AlertNumber; }; export type SecretScanningGetAlertError = Fetcher.ErrorWrapper<{ status: 503; payload: Responses.ServiceUnavailable; }>; export type SecretScanningGetAlertVariables = { pathParams: SecretScanningGetAlertPathParams; } & GithubContext['fetcherOptions']; /** * Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. */ export const fetchSecretScanningGetAlert = ( variables: SecretScanningGetAlertVariables, signal?: AbortSignal, ) => githubFetch< Schemas.SecretScanningAlert, SecretScanningGetAlertError, undefined, {}, {}, SecretScanningGetAlertPathParams >({ url: '/repos/{owner}/{repo}/secret-scanning/alerts/{alertNumber}', method: 'get', ...variables, signal, }); /** * Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. */ export const useSecretScanningGetAlert = ( variables: SecretScanningGetAlertVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.SecretScanningAlert, SecretScanningGetAlertError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.SecretScanningAlert, SecretScanningGetAlertError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}', operationId: 'secretScanningGetAlert', variables, }), ({ signal }) => fetchSecretScanningGetAlert({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SecretScanningUpdateAlertPathParams = { owner: string; repo: string; /** * The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alertNumber: Schemas.AlertNumber; }; export type SecretScanningUpdateAlertError = Fetcher.ErrorWrapper<{ status: 503; payload: Responses.ServiceUnavailable; }>; export type SecretScanningUpdateAlertRequestBody = { resolution?: Schemas.SecretScanningAlertResolution; state: Schemas.SecretScanningAlertState; }; export type SecretScanningUpdateAlertVariables = { body: SecretScanningUpdateAlertRequestBody; pathParams: SecretScanningUpdateAlertPathParams; } & GithubContext['fetcherOptions']; /** * Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. */ export const fetchSecretScanningUpdateAlert = ( variables: SecretScanningUpdateAlertVariables, signal?: AbortSignal, ) => githubFetch< Schemas.SecretScanningAlert, SecretScanningUpdateAlertError, SecretScanningUpdateAlertRequestBody, {}, {}, SecretScanningUpdateAlertPathParams >({ url: '/repos/{owner}/{repo}/secret-scanning/alerts/{alertNumber}', method: 'patch', ...variables, signal, }); /** * Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. * * GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. */ export const useSecretScanningUpdateAlert = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.SecretScanningAlert, SecretScanningUpdateAlertError, SecretScanningUpdateAlertVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.SecretScanningAlert, SecretScanningUpdateAlertError, SecretScanningUpdateAlertVariables >( (variables: SecretScanningUpdateAlertVariables) => fetchSecretScanningUpdateAlert({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityListStargazersForRepoPathParams = { owner: string; repo: string; }; export type ActivityListStargazersForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListStargazersForRepoError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type ActivityListStargazersForRepoResponse = Schemas.SimpleUser[]; export type ActivityListStargazersForRepoVariables = { pathParams: ActivityListStargazersForRepoPathParams; queryParams?: ActivityListStargazersForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people that have starred the repository. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const fetchActivityListStargazersForRepo = ( variables: ActivityListStargazersForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActivityListStargazersForRepoResponse, ActivityListStargazersForRepoError, undefined, {}, ActivityListStargazersForRepoQueryParams, ActivityListStargazersForRepoPathParams >({ url: '/repos/{owner}/{repo}/stargazers', method: 'get', ...variables, signal, }); /** * Lists the people that have starred the repository. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const useActivityListStargazersForRepo = < TData = ActivityListStargazersForRepoResponse, >( variables: ActivityListStargazersForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListStargazersForRepoResponse, ActivityListStargazersForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListStargazersForRepoResponse, ActivityListStargazersForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stargazers', operationId: 'activityListStargazersForRepo', variables, }), ({ signal }) => fetchActivityListStargazersForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetCodeFrequencyStatsPathParams = { owner: string; repo: string; }; export type ReposGetCodeFrequencyStatsError = Fetcher.ErrorWrapper; export type ReposGetCodeFrequencyStatsResponse = Schemas.CodeFrequencyStat[]; export type ReposGetCodeFrequencyStatsVariables = { pathParams: ReposGetCodeFrequencyStatsPathParams; } & GithubContext['fetcherOptions']; /** * Returns a weekly aggregate of the number of additions and deletions pushed to a repository. */ export const fetchReposGetCodeFrequencyStats = ( variables: ReposGetCodeFrequencyStatsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetCodeFrequencyStatsResponse, ReposGetCodeFrequencyStatsError, undefined, {}, {}, ReposGetCodeFrequencyStatsPathParams >({ url: '/repos/{owner}/{repo}/stats/code_frequency', method: 'get', ...variables, signal, }); /** * Returns a weekly aggregate of the number of additions and deletions pushed to a repository. */ export const useReposGetCodeFrequencyStats = < TData = ReposGetCodeFrequencyStatsResponse, >( variables: ReposGetCodeFrequencyStatsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetCodeFrequencyStatsResponse, ReposGetCodeFrequencyStatsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetCodeFrequencyStatsResponse, ReposGetCodeFrequencyStatsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stats/code_frequency', operationId: 'reposGetCodeFrequencyStats', variables, }), ({ signal }) => fetchReposGetCodeFrequencyStats( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetCommitActivityStatsPathParams = { owner: string; repo: string; }; export type ReposGetCommitActivityStatsError = Fetcher.ErrorWrapper; export type ReposGetCommitActivityStatsResponse = Schemas.CommitActivity[]; export type ReposGetCommitActivityStatsVariables = { pathParams: ReposGetCommitActivityStatsPathParams; } & GithubContext['fetcherOptions']; /** * Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. */ export const fetchReposGetCommitActivityStats = ( variables: ReposGetCommitActivityStatsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetCommitActivityStatsResponse, ReposGetCommitActivityStatsError, undefined, {}, {}, ReposGetCommitActivityStatsPathParams >({ url: '/repos/{owner}/{repo}/stats/commit_activity', method: 'get', ...variables, signal, }); /** * Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. */ export const useReposGetCommitActivityStats = < TData = ReposGetCommitActivityStatsResponse, >( variables: ReposGetCommitActivityStatsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetCommitActivityStatsResponse, ReposGetCommitActivityStatsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetCommitActivityStatsResponse, ReposGetCommitActivityStatsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stats/commit_activity', operationId: 'reposGetCommitActivityStats', variables, }), ({ signal }) => fetchReposGetCommitActivityStats( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetContributorsStatsPathParams = { owner: string; repo: string; }; export type ReposGetContributorsStatsError = Fetcher.ErrorWrapper; export type ReposGetContributorsStatsResponse = Schemas.ContributorActivity[]; export type ReposGetContributorsStatsVariables = { pathParams: ReposGetContributorsStatsPathParams; } & GithubContext['fetcherOptions']; /** * Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information: * * * `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * * `a` - Number of additions * * `d` - Number of deletions * * `c` - Number of commits */ export const fetchReposGetContributorsStats = ( variables: ReposGetContributorsStatsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetContributorsStatsResponse, ReposGetContributorsStatsError, undefined, {}, {}, ReposGetContributorsStatsPathParams >({ url: '/repos/{owner}/{repo}/stats/contributors', method: 'get', ...variables, signal, }); /** * Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information: * * * `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * * `a` - Number of additions * * `d` - Number of deletions * * `c` - Number of commits */ export const useReposGetContributorsStats = < TData = ReposGetContributorsStatsResponse, >( variables: ReposGetContributorsStatsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetContributorsStatsResponse, ReposGetContributorsStatsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetContributorsStatsResponse, ReposGetContributorsStatsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stats/contributors', operationId: 'reposGetContributorsStats', variables, }), ({ signal }) => fetchReposGetContributorsStats( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetParticipationStatsPathParams = { owner: string; repo: string; }; export type ReposGetParticipationStatsError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type ReposGetParticipationStatsVariables = { pathParams: ReposGetParticipationStatsPathParams; } & GithubContext['fetcherOptions']; /** * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`. * * The array order is oldest week (index 0) to most recent week. */ export const fetchReposGetParticipationStats = ( variables: ReposGetParticipationStatsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ParticipationStats, ReposGetParticipationStatsError, undefined, {}, {}, ReposGetParticipationStatsPathParams >({ url: '/repos/{owner}/{repo}/stats/participation', method: 'get', ...variables, signal, }); /** * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`. * * The array order is oldest week (index 0) to most recent week. */ export const useReposGetParticipationStats = < TData = Schemas.ParticipationStats, >( variables: ReposGetParticipationStatsVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ParticipationStats, ReposGetParticipationStatsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ParticipationStats, ReposGetParticipationStatsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stats/participation', operationId: 'reposGetParticipationStats', variables, }), ({ signal }) => fetchReposGetParticipationStats( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposGetPunchCardStatsPathParams = { owner: string; repo: string; }; export type ReposGetPunchCardStatsError = Fetcher.ErrorWrapper; export type ReposGetPunchCardStatsResponse = Schemas.CodeFrequencyStat[]; export type ReposGetPunchCardStatsVariables = { pathParams: ReposGetPunchCardStatsPathParams; } & GithubContext['fetcherOptions']; /** * Each array contains the day number, hour number, and number of commits: * * * `0-6`: Sunday - Saturday * * `0-23`: Hour of day * * Number of commits * * For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. */ export const fetchReposGetPunchCardStats = ( variables: ReposGetPunchCardStatsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetPunchCardStatsResponse, ReposGetPunchCardStatsError, undefined, {}, {}, ReposGetPunchCardStatsPathParams >({ url: '/repos/{owner}/{repo}/stats/punch_card', method: 'get', ...variables, signal, }); /** * Each array contains the day number, hour number, and number of commits: * * * `0-6`: Sunday - Saturday * * `0-23`: Hour of day * * Number of commits * * For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. */ export const useReposGetPunchCardStats = < TData = ReposGetPunchCardStatsResponse, >( variables: ReposGetPunchCardStatsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetPunchCardStatsResponse, ReposGetPunchCardStatsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetPunchCardStatsResponse, ReposGetPunchCardStatsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/stats/punch_card', operationId: 'reposGetPunchCardStats', variables, }), ({ signal }) => fetchReposGetPunchCardStats({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposCreateCommitStatusPathParams = { owner: string; repo: string; sha: string; }; export type ReposCreateCommitStatusError = Fetcher.ErrorWrapper; export type ReposCreateCommitStatusRequestBody = { /** * A string label to differentiate this status from the status of other systems. This field is case-insensitive. * * @default default */ context?: string; /** * A short description of the status. */ description?: string; /** * The state of the status. Can be one of `error`, `failure`, `pending`, or `success`. */ state: 'error' | 'failure' | 'pending' | 'success'; /** * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: * `http://ci.example.com/user/repo/build/sha` */ target_url?: string; }; export type ReposCreateCommitStatusVariables = { body: ReposCreateCommitStatusRequestBody; pathParams: ReposCreateCommitStatusPathParams; } & GithubContext['fetcherOptions']; /** * Users with push access in a repository can create commit statuses for a given SHA. * * Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. */ export const fetchReposCreateCommitStatus = ( variables: ReposCreateCommitStatusVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Status, ReposCreateCommitStatusError, ReposCreateCommitStatusRequestBody, {}, {}, ReposCreateCommitStatusPathParams >({ url: '/repos/{owner}/{repo}/statuses/{sha}', method: 'post', ...variables, signal, }); /** * Users with push access in a repository can create commit statuses for a given SHA. * * Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. */ export const useReposCreateCommitStatus = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Status, ReposCreateCommitStatusError, ReposCreateCommitStatusVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Status, ReposCreateCommitStatusError, ReposCreateCommitStatusVariables >( (variables: ReposCreateCommitStatusVariables) => fetchReposCreateCommitStatus({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityListWatchersForRepoPathParams = { owner: string; repo: string; }; export type ActivityListWatchersForRepoQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListWatchersForRepoError = Fetcher.ErrorWrapper; export type ActivityListWatchersForRepoResponse = Schemas.SimpleUser[]; export type ActivityListWatchersForRepoVariables = { pathParams: ActivityListWatchersForRepoPathParams; queryParams?: ActivityListWatchersForRepoQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people watching the specified repository. */ export const fetchActivityListWatchersForRepo = ( variables: ActivityListWatchersForRepoVariables, signal?: AbortSignal, ) => githubFetch< ActivityListWatchersForRepoResponse, ActivityListWatchersForRepoError, undefined, {}, ActivityListWatchersForRepoQueryParams, ActivityListWatchersForRepoPathParams >({ url: '/repos/{owner}/{repo}/subscribers', method: 'get', ...variables, signal, }); /** * Lists the people watching the specified repository. */ export const useActivityListWatchersForRepo = < TData = ActivityListWatchersForRepoResponse, >( variables: ActivityListWatchersForRepoVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListWatchersForRepoResponse, ActivityListWatchersForRepoError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListWatchersForRepoResponse, ActivityListWatchersForRepoError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/subscribers', operationId: 'activityListWatchersForRepo', variables, }), ({ signal }) => fetchActivityListWatchersForRepo( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityDeleteRepoSubscriptionPathParams = { owner: string; repo: string; }; export type ActivityDeleteRepoSubscriptionError = Fetcher.ErrorWrapper; export type ActivityDeleteRepoSubscriptionVariables = { pathParams: ActivityDeleteRepoSubscriptionPathParams; } & GithubContext['fetcherOptions']; /** * This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). */ export const fetchActivityDeleteRepoSubscription = ( variables: ActivityDeleteRepoSubscriptionVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityDeleteRepoSubscriptionError, undefined, {}, {}, ActivityDeleteRepoSubscriptionPathParams >({ url: '/repos/{owner}/{repo}/subscription', method: 'delete', ...variables, signal, }); /** * This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). */ export const useActivityDeleteRepoSubscription = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityDeleteRepoSubscriptionError, ActivityDeleteRepoSubscriptionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityDeleteRepoSubscriptionError, ActivityDeleteRepoSubscriptionVariables >( (variables: ActivityDeleteRepoSubscriptionVariables) => fetchActivityDeleteRepoSubscription({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityGetRepoSubscriptionPathParams = { owner: string; repo: string; }; export type ActivityGetRepoSubscriptionError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ActivityGetRepoSubscriptionVariables = { pathParams: ActivityGetRepoSubscriptionPathParams; } & GithubContext['fetcherOptions']; export const fetchActivityGetRepoSubscription = ( variables: ActivityGetRepoSubscriptionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositorySubscription, ActivityGetRepoSubscriptionError, undefined, {}, {}, ActivityGetRepoSubscriptionPathParams >({ url: '/repos/{owner}/{repo}/subscription', method: 'get', ...variables, signal, }); export const useActivityGetRepoSubscription = < TData = Schemas.RepositorySubscription, >( variables: ActivityGetRepoSubscriptionVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.RepositorySubscription, ActivityGetRepoSubscriptionError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.RepositorySubscription, ActivityGetRepoSubscriptionError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/subscription', operationId: 'activityGetRepoSubscription', variables, }), ({ signal }) => fetchActivityGetRepoSubscription( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivitySetRepoSubscriptionPathParams = { owner: string; repo: string; }; export type ActivitySetRepoSubscriptionError = Fetcher.ErrorWrapper; export type ActivitySetRepoSubscriptionRequestBody = { /** * Determines if all notifications should be blocked from this repository. */ ignored?: boolean; /** * Determines if notifications should be received from this repository. */ subscribed?: boolean; }; export type ActivitySetRepoSubscriptionVariables = { body?: ActivitySetRepoSubscriptionRequestBody; pathParams: ActivitySetRepoSubscriptionPathParams; } & GithubContext['fetcherOptions']; /** * If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. */ export const fetchActivitySetRepoSubscription = ( variables: ActivitySetRepoSubscriptionVariables, signal?: AbortSignal, ) => githubFetch< Schemas.RepositorySubscription, ActivitySetRepoSubscriptionError, ActivitySetRepoSubscriptionRequestBody, {}, {}, ActivitySetRepoSubscriptionPathParams >({ url: '/repos/{owner}/{repo}/subscription', method: 'put', ...variables, signal, }); /** * If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. */ export const useActivitySetRepoSubscription = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.RepositorySubscription, ActivitySetRepoSubscriptionError, ActivitySetRepoSubscriptionVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.RepositorySubscription, ActivitySetRepoSubscriptionError, ActivitySetRepoSubscriptionVariables >( (variables: ActivitySetRepoSubscriptionVariables) => fetchActivitySetRepoSubscription({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListTagsPathParams = { owner: string; repo: string; }; export type ReposListTagsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListTagsError = Fetcher.ErrorWrapper; export type ReposListTagsResponse = Schemas.Tag[]; export type ReposListTagsVariables = { pathParams: ReposListTagsPathParams; queryParams?: ReposListTagsQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListTags = ( variables: ReposListTagsVariables, signal?: AbortSignal, ) => githubFetch< ReposListTagsResponse, ReposListTagsError, undefined, {}, ReposListTagsQueryParams, ReposListTagsPathParams >({ url: '/repos/{owner}/{repo}/tags', method: 'get', ...variables, signal }); export const useReposListTags = ( variables: ReposListTagsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListTagsResponse, ReposListTagsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/tags', operationId: 'reposListTags', variables, }), ({ signal }) => fetchReposListTags({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposDownloadTarballArchivePathParams = { owner: string; repo: string; ref: string; }; export type ReposDownloadTarballArchiveError = Fetcher.ErrorWrapper; export type ReposDownloadTarballArchiveVariables = { pathParams: ReposDownloadTarballArchivePathParams; } & GithubContext['fetcherOptions']; /** * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * **Note**: For private repositories, these links are temporary and expire after five minutes. */ export const fetchReposDownloadTarballArchive = ( variables: ReposDownloadTarballArchiveVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDownloadTarballArchiveError, undefined, {}, {}, ReposDownloadTarballArchivePathParams >({ url: '/repos/{owner}/{repo}/tarball/{ref}', method: 'get', ...variables, signal, }); /** * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * **Note**: For private repositories, these links are temporary and expire after five minutes. */ export const useReposDownloadTarballArchive = ( variables: ReposDownloadTarballArchiveVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ReposDownloadTarballArchiveError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ReposDownloadTarballArchiveError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/tarball/{ref}', operationId: 'reposDownloadTarballArchive', variables, }), ({ signal }) => fetchReposDownloadTarballArchive( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListTeamsPathParams = { owner: string; repo: string; }; export type ReposListTeamsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListTeamsError = Fetcher.ErrorWrapper; export type ReposListTeamsResponse = Schemas.Team[]; export type ReposListTeamsVariables = { pathParams: ReposListTeamsPathParams; queryParams?: ReposListTeamsQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposListTeams = ( variables: ReposListTeamsVariables, signal?: AbortSignal, ) => githubFetch< ReposListTeamsResponse, ReposListTeamsError, undefined, {}, ReposListTeamsQueryParams, ReposListTeamsPathParams >({ url: '/repos/{owner}/{repo}/teams', method: 'get', ...variables, signal, }); export const useReposListTeams = ( variables: ReposListTeamsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListTeamsResponse, ReposListTeamsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListTeamsResponse, ReposListTeamsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/teams', operationId: 'reposListTeams', variables, }), ({ signal }) => fetchReposListTeams({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetAllTopicsPathParams = { owner: string; repo: string; }; export type ReposGetAllTopicsQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type ReposGetAllTopicsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type ReposGetAllTopicsVariables = { pathParams: ReposGetAllTopicsPathParams; queryParams?: ReposGetAllTopicsQueryParams; } & GithubContext['fetcherOptions']; export const fetchReposGetAllTopics = ( variables: ReposGetAllTopicsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Topic, ReposGetAllTopicsError, undefined, {}, ReposGetAllTopicsQueryParams, ReposGetAllTopicsPathParams >({ url: '/repos/{owner}/{repo}/topics', method: 'get', ...variables, signal, }); export const useReposGetAllTopics = ( variables: ReposGetAllTopicsVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/topics', operationId: 'reposGetAllTopics', variables, }), ({ signal }) => fetchReposGetAllTopics({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposReplaceAllTopicsPathParams = { owner: string; repo: string; }; export type ReposReplaceAllTopicsError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ReposReplaceAllTopicsRequestBody = { /** * An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. */ names: string[]; }; export type ReposReplaceAllTopicsVariables = { body: ReposReplaceAllTopicsRequestBody; pathParams: ReposReplaceAllTopicsPathParams; } & GithubContext['fetcherOptions']; export const fetchReposReplaceAllTopics = ( variables: ReposReplaceAllTopicsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Topic, ReposReplaceAllTopicsError, ReposReplaceAllTopicsRequestBody, {}, {}, ReposReplaceAllTopicsPathParams >({ url: '/repos/{owner}/{repo}/topics', method: 'put', ...variables, signal, }); export const useReposReplaceAllTopics = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Topic, ReposReplaceAllTopicsError, ReposReplaceAllTopicsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Topic, ReposReplaceAllTopicsError, ReposReplaceAllTopicsVariables >( (variables: ReposReplaceAllTopicsVariables) => fetchReposReplaceAllTopics({ ...fetcherOptions, ...variables }), options, ); }; export type ReposGetClonesPathParams = { owner: string; repo: string; }; export type ReposGetClonesQueryParams = { /** * Must be one of: `day`, `week`. * * @default day */ per?: '' | 'day' | 'week'; }; export type ReposGetClonesError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ReposGetClonesVariables = { pathParams: ReposGetClonesPathParams; queryParams?: ReposGetClonesQueryParams; } & GithubContext['fetcherOptions']; /** * Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ export const fetchReposGetClones = ( variables: ReposGetClonesVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CloneTraffic, ReposGetClonesError, undefined, {}, ReposGetClonesQueryParams, ReposGetClonesPathParams >({ url: '/repos/{owner}/{repo}/traffic/clones', method: 'get', ...variables, signal, }); /** * Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ export const useReposGetClones = ( variables: ReposGetClonesVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CloneTraffic, ReposGetClonesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/traffic/clones', operationId: 'reposGetClones', variables, }), ({ signal }) => fetchReposGetClones({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetTopPathsPathParams = { owner: string; repo: string; }; export type ReposGetTopPathsError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ReposGetTopPathsResponse = Schemas.ContentTraffic[]; export type ReposGetTopPathsVariables = { pathParams: ReposGetTopPathsPathParams; } & GithubContext['fetcherOptions']; /** * Get the top 10 popular contents over the last 14 days. */ export const fetchReposGetTopPaths = ( variables: ReposGetTopPathsVariables, signal?: AbortSignal, ) => githubFetch< ReposGetTopPathsResponse, ReposGetTopPathsError, undefined, {}, {}, ReposGetTopPathsPathParams >({ url: '/repos/{owner}/{repo}/traffic/popular/paths', method: 'get', ...variables, signal, }); /** * Get the top 10 popular contents over the last 14 days. */ export const useReposGetTopPaths = ( variables: ReposGetTopPathsVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetTopPathsResponse, ReposGetTopPathsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetTopPathsResponse, ReposGetTopPathsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/traffic/popular/paths', operationId: 'reposGetTopPaths', variables, }), ({ signal }) => fetchReposGetTopPaths({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetTopReferrersPathParams = { owner: string; repo: string; }; export type ReposGetTopReferrersError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ReposGetTopReferrersResponse = Schemas.ReferrerTraffic[]; export type ReposGetTopReferrersVariables = { pathParams: ReposGetTopReferrersPathParams; } & GithubContext['fetcherOptions']; /** * Get the top 10 referrers over the last 14 days. */ export const fetchReposGetTopReferrers = ( variables: ReposGetTopReferrersVariables, signal?: AbortSignal, ) => githubFetch< ReposGetTopReferrersResponse, ReposGetTopReferrersError, undefined, {}, {}, ReposGetTopReferrersPathParams >({ url: '/repos/{owner}/{repo}/traffic/popular/referrers', method: 'get', ...variables, signal, }); /** * Get the top 10 referrers over the last 14 days. */ export const useReposGetTopReferrers = ( variables: ReposGetTopReferrersVariables, options?: Omit< reactQuery.UseQueryOptions< ReposGetTopReferrersResponse, ReposGetTopReferrersError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposGetTopReferrersResponse, ReposGetTopReferrersError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/traffic/popular/referrers', operationId: 'reposGetTopReferrers', variables, }), ({ signal }) => fetchReposGetTopReferrers({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposGetViewsPathParams = { owner: string; repo: string; }; export type ReposGetViewsQueryParams = { /** * Must be one of: `day`, `week`. * * @default day */ per?: '' | 'day' | 'week'; }; export type ReposGetViewsError = Fetcher.ErrorWrapper<{ status: 403; payload: Responses.Forbidden; }>; export type ReposGetViewsVariables = { pathParams: ReposGetViewsPathParams; queryParams?: ReposGetViewsQueryParams; } & GithubContext['fetcherOptions']; /** * Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ export const fetchReposGetViews = ( variables: ReposGetViewsVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ViewTraffic, ReposGetViewsError, undefined, {}, ReposGetViewsQueryParams, ReposGetViewsPathParams >({ url: '/repos/{owner}/{repo}/traffic/views', method: 'get', ...variables, signal, }); /** * Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ export const useReposGetViews = ( variables: ReposGetViewsVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/repos/{owner}/{repo}/traffic/views', operationId: 'reposGetViews', variables, }), ({ signal }) => fetchReposGetViews({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ReposTransferPathParams = { owner: string; repo: string; }; export type ReposTransferError = Fetcher.ErrorWrapper; export type ReposTransferRequestBody = { /** * The username or organization name the repository will be transferred to. */ new_owner: string; /** * ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ team_ids?: number[]; }; export type ReposTransferVariables = { body: ReposTransferRequestBody; pathParams: ReposTransferPathParams; } & GithubContext['fetcherOptions']; /** * A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). */ export const fetchReposTransfer = ( variables: ReposTransferVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Repository, ReposTransferError, ReposTransferRequestBody, {}, {}, ReposTransferPathParams >({ url: '/repos/{owner}/{repo}/transfer', method: 'post', ...variables, signal, }); /** * A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). */ export const useReposTransfer = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Repository, ReposTransferError, ReposTransferVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Repository, ReposTransferError, ReposTransferVariables >( (variables: ReposTransferVariables) => fetchReposTransfer({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDisableVulnerabilityAlertsPathParams = { owner: string; repo: string; }; export type ReposDisableVulnerabilityAlertsError = Fetcher.ErrorWrapper; export type ReposDisableVulnerabilityAlertsVariables = { pathParams: ReposDisableVulnerabilityAlertsPathParams; } & GithubContext['fetcherOptions']; /** * Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const fetchReposDisableVulnerabilityAlerts = ( variables: ReposDisableVulnerabilityAlertsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDisableVulnerabilityAlertsError, undefined, {}, {}, ReposDisableVulnerabilityAlertsPathParams >({ url: '/repos/{owner}/{repo}/vulnerability-alerts', method: 'delete', ...variables, signal, }); /** * Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const useReposDisableVulnerabilityAlerts = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDisableVulnerabilityAlertsError, ReposDisableVulnerabilityAlertsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDisableVulnerabilityAlertsError, ReposDisableVulnerabilityAlertsVariables >( (variables: ReposDisableVulnerabilityAlertsVariables) => fetchReposDisableVulnerabilityAlerts({ ...fetcherOptions, ...variables }), options, ); }; export type ReposCheckVulnerabilityAlertsPathParams = { owner: string; repo: string; }; export type ReposCheckVulnerabilityAlertsError = Fetcher.ErrorWrapper; export type ReposCheckVulnerabilityAlertsVariables = { pathParams: ReposCheckVulnerabilityAlertsPathParams; } & GithubContext['fetcherOptions']; /** * Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const fetchReposCheckVulnerabilityAlerts = ( variables: ReposCheckVulnerabilityAlertsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposCheckVulnerabilityAlertsError, undefined, {}, {}, ReposCheckVulnerabilityAlertsPathParams >({ url: '/repos/{owner}/{repo}/vulnerability-alerts', method: 'get', ...variables, signal, }); /** * Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const useReposCheckVulnerabilityAlerts = ( variables: ReposCheckVulnerabilityAlertsVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ReposCheckVulnerabilityAlertsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ReposCheckVulnerabilityAlertsError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/vulnerability-alerts', operationId: 'reposCheckVulnerabilityAlerts', variables, }), ({ signal }) => fetchReposCheckVulnerabilityAlerts( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposEnableVulnerabilityAlertsPathParams = { owner: string; repo: string; }; export type ReposEnableVulnerabilityAlertsError = Fetcher.ErrorWrapper; export type ReposEnableVulnerabilityAlertsVariables = { pathParams: ReposEnableVulnerabilityAlertsPathParams; } & GithubContext['fetcherOptions']; /** * Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const fetchReposEnableVulnerabilityAlerts = ( variables: ReposEnableVulnerabilityAlertsVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposEnableVulnerabilityAlertsError, undefined, {}, {}, ReposEnableVulnerabilityAlertsPathParams >({ url: '/repos/{owner}/{repo}/vulnerability-alerts', method: 'put', ...variables, signal, }); /** * Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ export const useReposEnableVulnerabilityAlerts = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposEnableVulnerabilityAlertsError, ReposEnableVulnerabilityAlertsVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposEnableVulnerabilityAlertsError, ReposEnableVulnerabilityAlertsVariables >( (variables: ReposEnableVulnerabilityAlertsVariables) => fetchReposEnableVulnerabilityAlerts({ ...fetcherOptions, ...variables }), options, ); }; export type ReposDownloadZipballArchivePathParams = { owner: string; repo: string; ref: string; }; export type ReposDownloadZipballArchiveError = Fetcher.ErrorWrapper; export type ReposDownloadZipballArchiveVariables = { pathParams: ReposDownloadZipballArchivePathParams; } & GithubContext['fetcherOptions']; /** * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * **Note**: For private repositories, these links are temporary and expire after five minutes. */ export const fetchReposDownloadZipballArchive = ( variables: ReposDownloadZipballArchiveVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDownloadZipballArchiveError, undefined, {}, {}, ReposDownloadZipballArchivePathParams >({ url: '/repos/{owner}/{repo}/zipball/{ref}', method: 'get', ...variables, signal, }); /** * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. * **Note**: For private repositories, these links are temporary and expire after five minutes. */ export const useReposDownloadZipballArchive = ( variables: ReposDownloadZipballArchiveVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ReposDownloadZipballArchiveError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ReposDownloadZipballArchiveError, TData >( queryKeyFn({ path: '/repos/{owner}/{repo}/zipball/{ref}', operationId: 'reposDownloadZipballArchive', variables, }), ({ signal }) => fetchReposDownloadZipballArchive( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateUsingTemplatePathParams = { templateOwner: string; templateRepo: string; }; export type ReposCreateUsingTemplateError = Fetcher.ErrorWrapper; export type ReposCreateUsingTemplateRequestBody = { /** * A short description of the new repository. */ description?: string; /** * Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. * * @default false */ include_all_branches?: boolean; /** * The name of the new repository. */ name: string; /** * The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ owner?: string; /** * Either `true` to create a new private repository or `false` to create a new public one. * * @default false */ private?: boolean; }; export type ReposCreateUsingTemplateVariables = { body: ReposCreateUsingTemplateRequestBody; pathParams: ReposCreateUsingTemplatePathParams; } & GithubContext['fetcherOptions']; /** * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ export const fetchReposCreateUsingTemplate = ( variables: ReposCreateUsingTemplateVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Repository, ReposCreateUsingTemplateError, ReposCreateUsingTemplateRequestBody, {}, {}, ReposCreateUsingTemplatePathParams >({ url: '/repos/{templateOwner}/{templateRepo}/generate', method: 'post', ...variables, signal, }); /** * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ export const useReposCreateUsingTemplate = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Repository, ReposCreateUsingTemplateError, ReposCreateUsingTemplateVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Repository, ReposCreateUsingTemplateError, ReposCreateUsingTemplateVariables >( (variables: ReposCreateUsingTemplateVariables) => fetchReposCreateUsingTemplate({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListPublicQueryParams = { /** * A repository ID. Only return repositories with an ID greater than this ID. */ since?: number; }; export type ReposListPublicError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposListPublicResponse = Schemas.MinimalRepository[]; export type ReposListPublicVariables = { queryParams?: ReposListPublicQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all public repositories in the order that they were created. * * Notes: * - For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. */ export const fetchReposListPublic = ( variables: ReposListPublicVariables, signal?: AbortSignal, ) => githubFetch< ReposListPublicResponse, ReposListPublicError, undefined, {}, ReposListPublicQueryParams, {} >({ url: '/repositories', method: 'get', ...variables, signal }); /** * Lists all public repositories in the order that they were created. * * Notes: * - For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. */ export const useReposListPublic = ( variables: ReposListPublicVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListPublicResponse, ReposListPublicError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListPublicResponse, ReposListPublicError, TData >( queryKeyFn({ path: '/repositories', operationId: 'reposListPublic', variables, }), ({ signal }) => fetchReposListPublic({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActionsListEnvironmentSecretsPathParams = { repositoryId: number; /** * The name of the environment */ environmentName: string; }; export type ActionsListEnvironmentSecretsQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActionsListEnvironmentSecretsError = Fetcher.ErrorWrapper; export type ActionsListEnvironmentSecretsResponse = { secrets: Schemas.ActionsSecret[]; total_count: number; }; export type ActionsListEnvironmentSecretsVariables = { pathParams: ActionsListEnvironmentSecretsPathParams; queryParams?: ActionsListEnvironmentSecretsQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsListEnvironmentSecrets = ( variables: ActionsListEnvironmentSecretsVariables, signal?: AbortSignal, ) => githubFetch< ActionsListEnvironmentSecretsResponse, ActionsListEnvironmentSecretsError, undefined, {}, ActionsListEnvironmentSecretsQueryParams, ActionsListEnvironmentSecretsPathParams >({ url: '/repositories/{repositoryId}/environments/{environmentName}/secrets', method: 'get', ...variables, signal, }); /** * Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsListEnvironmentSecrets = < TData = ActionsListEnvironmentSecretsResponse, >( variables: ActionsListEnvironmentSecretsVariables, options?: Omit< reactQuery.UseQueryOptions< ActionsListEnvironmentSecretsResponse, ActionsListEnvironmentSecretsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActionsListEnvironmentSecretsResponse, ActionsListEnvironmentSecretsError, TData >( queryKeyFn({ path: '/repositories/{repository_id}/environments/{environment_name}/secrets', operationId: 'actionsListEnvironmentSecrets', variables, }), ({ signal }) => fetchActionsListEnvironmentSecrets( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsGetEnvironmentPublicKeyPathParams = { repositoryId: number; /** * The name of the environment */ environmentName: string; }; export type ActionsGetEnvironmentPublicKeyError = Fetcher.ErrorWrapper; export type ActionsGetEnvironmentPublicKeyVariables = { pathParams: ActionsGetEnvironmentPublicKeyPathParams; } & GithubContext['fetcherOptions']; /** * Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsGetEnvironmentPublicKey = ( variables: ActionsGetEnvironmentPublicKeyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsPublicKey, ActionsGetEnvironmentPublicKeyError, undefined, {}, {}, ActionsGetEnvironmentPublicKeyPathParams >({ url: '/repositories/{repositoryId}/environments/{environmentName}/secrets/public-key', method: 'get', ...variables, signal, }); /** * Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsGetEnvironmentPublicKey = < TData = Schemas.ActionsPublicKey, >( variables: ActionsGetEnvironmentPublicKeyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsPublicKey, ActionsGetEnvironmentPublicKeyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsPublicKey, ActionsGetEnvironmentPublicKeyError, TData >( queryKeyFn({ path: '/repositories/{repository_id}/environments/{environment_name}/secrets/public-key', operationId: 'actionsGetEnvironmentPublicKey', variables, }), ({ signal }) => fetchActionsGetEnvironmentPublicKey( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsDeleteEnvironmentSecretPathParams = { repositoryId: number; /** * The name of the environment */ environmentName: string; /** * secret_name parameter */ secretName: string; }; export type ActionsDeleteEnvironmentSecretError = Fetcher.ErrorWrapper; export type ActionsDeleteEnvironmentSecretVariables = { pathParams: ActionsDeleteEnvironmentSecretPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsDeleteEnvironmentSecret = ( variables: ActionsDeleteEnvironmentSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsDeleteEnvironmentSecretError, undefined, {}, {}, ActionsDeleteEnvironmentSecretPathParams >({ url: '/repositories/{repositoryId}/environments/{environmentName}/secrets/{secretName}', method: 'delete', ...variables, signal, }); /** * Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsDeleteEnvironmentSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsDeleteEnvironmentSecretError, ActionsDeleteEnvironmentSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsDeleteEnvironmentSecretError, ActionsDeleteEnvironmentSecretVariables >( (variables: ActionsDeleteEnvironmentSecretVariables) => fetchActionsDeleteEnvironmentSecret({ ...fetcherOptions, ...variables }), options, ); }; export type ActionsGetEnvironmentSecretPathParams = { repositoryId: number; /** * The name of the environment */ environmentName: string; /** * secret_name parameter */ secretName: string; }; export type ActionsGetEnvironmentSecretError = Fetcher.ErrorWrapper; export type ActionsGetEnvironmentSecretVariables = { pathParams: ActionsGetEnvironmentSecretPathParams; } & GithubContext['fetcherOptions']; /** * Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const fetchActionsGetEnvironmentSecret = ( variables: ActionsGetEnvironmentSecretVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsSecret, ActionsGetEnvironmentSecretError, undefined, {}, {}, ActionsGetEnvironmentSecretPathParams >({ url: '/repositories/{repositoryId}/environments/{environmentName}/secrets/{secretName}', method: 'get', ...variables, signal, }); /** * Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ export const useActionsGetEnvironmentSecret = ( variables: ActionsGetEnvironmentSecretVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsSecret, ActionsGetEnvironmentSecretError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsSecret, ActionsGetEnvironmentSecretError, TData >( queryKeyFn({ path: '/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}', operationId: 'actionsGetEnvironmentSecret', variables, }), ({ signal }) => fetchActionsGetEnvironmentSecret( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActionsCreateOrUpdateEnvironmentSecretPathParams = { repositoryId: number; /** * The name of the environment */ environmentName: string; /** * secret_name parameter */ secretName: string; }; export type ActionsCreateOrUpdateEnvironmentSecretError = Fetcher.ErrorWrapper; export type ActionsCreateOrUpdateEnvironmentSecretRequestBody = { /** * Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/reference/actions#get-an-environment-public-key) endpoint. * * @pattern ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$ */ encrypted_value?: string; /** * ID of the key you used to encrypt the secret. */ key_id?: string; }; export type ActionsCreateOrUpdateEnvironmentSecretVariables = { body?: ActionsCreateOrUpdateEnvironmentSecretRequestBody; pathParams: ActionsCreateOrUpdateEnvironmentSecretPathParams; } & GithubContext['fetcherOptions']; /** * Creates or updates an environment secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use * this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const fetchActionsCreateOrUpdateEnvironmentSecret = ( variables: ActionsCreateOrUpdateEnvironmentSecretVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActionsCreateOrUpdateEnvironmentSecretError, ActionsCreateOrUpdateEnvironmentSecretRequestBody, {}, {}, ActionsCreateOrUpdateEnvironmentSecretPathParams >({ url: '/repositories/{repositoryId}/environments/{environmentName}/secrets/{secretName}', method: 'put', ...variables, signal, }); /** * Creates or updates an environment secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use * this endpoint. * * #### Example encrypting a secret using Node.js * * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. * * ``` * const sodium = require('tweetsodium'); * * const key = "base64-encoded-public-key"; * const value = "plain-text-secret"; * * // Convert the message and key to Uint8Array's (Buffer implements that interface) * const messageBytes = Buffer.from(value); * const keyBytes = Buffer.from(key, 'base64'); * * // Encrypt using LibSodium. * const encryptedBytes = sodium.seal(messageBytes, keyBytes); * * // Base64 the encrypted secret * const encrypted = Buffer.from(encryptedBytes).toString('base64'); * * console.log(encrypted); * ``` * * * #### Example encrypting a secret using Python * * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. * * ``` * from base64 import b64encode * from nacl import encoding, public * * def encrypt(public_key: str, secret_value: str) -> str: * """Encrypt a Unicode string using the public key.""" * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) * sealed_box = public.SealedBox(public_key) * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) * return b64encode(encrypted).decode("utf-8") * ``` * * #### Example encrypting a secret using C# * * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. * * ``` * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); * * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); * * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); * ``` * * #### Example encrypting a secret using Ruby * * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. * * ```ruby * require "rbnacl" * require "base64" * * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") * public_key = RbNaCl::PublicKey.new(key) * * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) * encrypted_secret = box.encrypt("my_secret") * * # Print the base64 encoded secret * puts Base64.strict_encode64(encrypted_secret) * ``` */ export const useActionsCreateOrUpdateEnvironmentSecret = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActionsCreateOrUpdateEnvironmentSecretError, ActionsCreateOrUpdateEnvironmentSecretVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActionsCreateOrUpdateEnvironmentSecretError, ActionsCreateOrUpdateEnvironmentSecretVariables >( (variables: ActionsCreateOrUpdateEnvironmentSecretVariables) => fetchActionsCreateOrUpdateEnvironmentSecret({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListProvisionedGroupsEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListProvisionedGroupsEnterpriseQueryParams = { /** * Used for pagination: the index of the first result to return. */ startIndex?: number; /** * Used for pagination: the number of results to return. */ count?: number; /** * filter results */ filter?: string; /** * attributes to exclude */ excludedAttributes?: string; }; export type EnterpriseAdminListProvisionedGroupsEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListProvisionedGroupsEnterpriseVariables = { pathParams: EnterpriseAdminListProvisionedGroupsEnterprisePathParams; queryParams?: EnterpriseAdminListProvisionedGroupsEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const fetchEnterpriseAdminListProvisionedGroupsEnterprise = ( variables: EnterpriseAdminListProvisionedGroupsEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimGroupListEnterprise, EnterpriseAdminListProvisionedGroupsEnterpriseError, undefined, {}, EnterpriseAdminListProvisionedGroupsEnterpriseQueryParams, EnterpriseAdminListProvisionedGroupsEnterprisePathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups', method: 'get', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const useEnterpriseAdminListProvisionedGroupsEnterprise = < TData = Schemas.ScimGroupListEnterprise, >( variables: EnterpriseAdminListProvisionedGroupsEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ScimGroupListEnterprise, EnterpriseAdminListProvisionedGroupsEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ScimGroupListEnterprise, EnterpriseAdminListProvisionedGroupsEnterpriseError, TData >( queryKeyFn({ path: '/scim/v2/enterprises/{enterprise}/Groups', operationId: 'enterpriseAdminListProvisionedGroupsEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListProvisionedGroupsEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminProvisionAndInviteEnterpriseGroupPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminProvisionAndInviteEnterpriseGroupError = Fetcher.ErrorWrapper; export type EnterpriseAdminProvisionAndInviteEnterpriseGroupRequestBody = { /** * The name of the SCIM group. This must match the GitHub organization that the group maps to. */ displayName: string; members?: { /** * The SCIM user ID for a user. */ value: string; }[]; /** * The SCIM schema URIs. */ schemas: string[]; }; export type EnterpriseAdminProvisionAndInviteEnterpriseGroupVariables = { body: EnterpriseAdminProvisionAndInviteEnterpriseGroupRequestBody; pathParams: EnterpriseAdminProvisionAndInviteEnterpriseGroupPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. */ export const fetchEnterpriseAdminProvisionAndInviteEnterpriseGroup = ( variables: EnterpriseAdminProvisionAndInviteEnterpriseGroupVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseGroup, EnterpriseAdminProvisionAndInviteEnterpriseGroupError, EnterpriseAdminProvisionAndInviteEnterpriseGroupRequestBody, {}, {}, EnterpriseAdminProvisionAndInviteEnterpriseGroupPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups', method: 'post', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. */ export const useEnterpriseAdminProvisionAndInviteEnterpriseGroup = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseGroup, EnterpriseAdminProvisionAndInviteEnterpriseGroupError, EnterpriseAdminProvisionAndInviteEnterpriseGroupVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseGroup, EnterpriseAdminProvisionAndInviteEnterpriseGroupError, EnterpriseAdminProvisionAndInviteEnterpriseGroupVariables >( (variables: EnterpriseAdminProvisionAndInviteEnterpriseGroupVariables) => fetchEnterpriseAdminProvisionAndInviteEnterpriseGroup({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminDeleteScimGroupFromEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Identifier generated by the GitHub SCIM endpoint. */ scimGroupId: string; }; export type EnterpriseAdminDeleteScimGroupFromEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminDeleteScimGroupFromEnterpriseVariables = { pathParams: EnterpriseAdminDeleteScimGroupFromEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const fetchEnterpriseAdminDeleteScimGroupFromEnterprise = ( variables: EnterpriseAdminDeleteScimGroupFromEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminDeleteScimGroupFromEnterpriseError, undefined, {}, {}, EnterpriseAdminDeleteScimGroupFromEnterprisePathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups/{scimGroupId}', method: 'delete', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const useEnterpriseAdminDeleteScimGroupFromEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminDeleteScimGroupFromEnterpriseError, EnterpriseAdminDeleteScimGroupFromEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminDeleteScimGroupFromEnterpriseError, EnterpriseAdminDeleteScimGroupFromEnterpriseVariables >( (variables: EnterpriseAdminDeleteScimGroupFromEnterpriseVariables) => fetchEnterpriseAdminDeleteScimGroupFromEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Identifier generated by the GitHub SCIM endpoint. */ scimGroupId: string; }; export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupQueryParams = { /** * Attributes to exclude. */ excludedAttributes?: string; }; export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupVariables = { pathParams: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupPathParams; queryParams?: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const fetchEnterpriseAdminGetProvisioningInformationForEnterpriseGroup = ( variables: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseGroup, EnterpriseAdminGetProvisioningInformationForEnterpriseGroupError, undefined, {}, EnterpriseAdminGetProvisioningInformationForEnterpriseGroupQueryParams, EnterpriseAdminGetProvisioningInformationForEnterpriseGroupPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups/{scimGroupId}', method: 'get', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const useEnterpriseAdminGetProvisioningInformationForEnterpriseGroup = < TData = Schemas.ScimEnterpriseGroup, >( variables: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ScimEnterpriseGroup, EnterpriseAdminGetProvisioningInformationForEnterpriseGroupError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ScimEnterpriseGroup, EnterpriseAdminGetProvisioningInformationForEnterpriseGroupError, TData >( queryKeyFn({ path: '/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}', operationId: 'enterpriseAdminGetProvisioningInformationForEnterpriseGroup', variables, }), ({ signal }) => fetchEnterpriseAdminGetProvisioningInformationForEnterpriseGroup( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminUpdateAttributeForEnterpriseGroupPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Identifier generated by the GitHub SCIM endpoint. */ scimGroupId: string; }; export type EnterpriseAdminUpdateAttributeForEnterpriseGroupError = Fetcher.ErrorWrapper; export type EnterpriseAdminUpdateAttributeForEnterpriseGroupRequestBody = { /** * Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). * * @minItems 1 */ Operations: { op: 'add' | 'Add' | 'remove' | 'Remove' | 'replace' | 'Replace'; path?: string; value?: string | Record | any[]; }[]; /** * The SCIM schema URIs. */ schemas: string[]; }; export type EnterpriseAdminUpdateAttributeForEnterpriseGroupVariables = { body: EnterpriseAdminUpdateAttributeForEnterpriseGroupRequestBody; pathParams: EnterpriseAdminUpdateAttributeForEnterpriseGroupPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ export const fetchEnterpriseAdminUpdateAttributeForEnterpriseGroup = ( variables: EnterpriseAdminUpdateAttributeForEnterpriseGroupVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseGroup, EnterpriseAdminUpdateAttributeForEnterpriseGroupError, EnterpriseAdminUpdateAttributeForEnterpriseGroupRequestBody, {}, {}, EnterpriseAdminUpdateAttributeForEnterpriseGroupPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups/{scimGroupId}', method: 'patch', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ export const useEnterpriseAdminUpdateAttributeForEnterpriseGroup = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseGroup, EnterpriseAdminUpdateAttributeForEnterpriseGroupError, EnterpriseAdminUpdateAttributeForEnterpriseGroupVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseGroup, EnterpriseAdminUpdateAttributeForEnterpriseGroupError, EnterpriseAdminUpdateAttributeForEnterpriseGroupVariables >( (variables: EnterpriseAdminUpdateAttributeForEnterpriseGroupVariables) => fetchEnterpriseAdminUpdateAttributeForEnterpriseGroup({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * Identifier generated by the GitHub SCIM endpoint. */ scimGroupId: string; }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupRequestBody = { /** * The name of the SCIM group. This must match the GitHub organization that the group maps to. */ displayName: string; members?: { /** * The SCIM user ID for a user. */ value: string; }[]; /** * The SCIM schema URIs. */ schemas: string[]; }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupVariables = { body: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupRequestBody; pathParams: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. */ export const fetchEnterpriseAdminSetInformationForProvisionedEnterpriseGroup = ( variables: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseGroup, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupError, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupRequestBody, {}, {}, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Groups/{scimGroupId}', method: 'put', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. */ export const useEnterpriseAdminSetInformationForProvisionedEnterpriseGroup = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseGroup, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupError, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseGroup, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupError, EnterpriseAdminSetInformationForProvisionedEnterpriseGroupVariables >( ( variables: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupVariables, ) => fetchEnterpriseAdminSetInformationForProvisionedEnterpriseGroup({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminListProvisionedIdentitiesEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminListProvisionedIdentitiesEnterpriseQueryParams = { /** * Used for pagination: the index of the first result to return. */ startIndex?: number; /** * Used for pagination: the number of results to return. */ count?: number; /** * filter results */ filter?: string; }; export type EnterpriseAdminListProvisionedIdentitiesEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminListProvisionedIdentitiesEnterpriseVariables = { pathParams: EnterpriseAdminListProvisionedIdentitiesEnterprisePathParams; queryParams?: EnterpriseAdminListProvisionedIdentitiesEnterpriseQueryParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Retrieves a paginated list of all provisioned enterprise members, including pending invitations. * * When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: * - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. * * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: * * 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. * * 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. * * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: * - If the user signs in, their GitHub account is linked to this entry. * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity `null` entry remains in place. */ export const fetchEnterpriseAdminListProvisionedIdentitiesEnterprise = ( variables: EnterpriseAdminListProvisionedIdentitiesEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimUserListEnterprise, EnterpriseAdminListProvisionedIdentitiesEnterpriseError, undefined, {}, EnterpriseAdminListProvisionedIdentitiesEnterpriseQueryParams, EnterpriseAdminListProvisionedIdentitiesEnterprisePathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users', method: 'get', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Retrieves a paginated list of all provisioned enterprise members, including pending invitations. * * When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: * - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. * * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: * * 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. * * 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. * * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: * - If the user signs in, their GitHub account is linked to this entry. * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity `null` entry remains in place. */ export const useEnterpriseAdminListProvisionedIdentitiesEnterprise = < TData = Schemas.ScimUserListEnterprise, >( variables: EnterpriseAdminListProvisionedIdentitiesEnterpriseVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ScimUserListEnterprise, EnterpriseAdminListProvisionedIdentitiesEnterpriseError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ScimUserListEnterprise, EnterpriseAdminListProvisionedIdentitiesEnterpriseError, TData >( queryKeyFn({ path: '/scim/v2/enterprises/{enterprise}/Users', operationId: 'enterpriseAdminListProvisionedIdentitiesEnterprise', variables, }), ({ signal }) => fetchEnterpriseAdminListProvisionedIdentitiesEnterprise( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminProvisionAndInviteEnterpriseUserPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; }; export type EnterpriseAdminProvisionAndInviteEnterpriseUserError = Fetcher.ErrorWrapper; export type EnterpriseAdminProvisionAndInviteEnterpriseUserRequestBody = { /** * List of user emails. */ emails: { /** * Whether this email address is the primary address. */ primary: boolean; /** * The type of email address. */ type: string; /** * The email address. */ value: string; }[]; /** * List of SCIM group IDs the user is a member of. */ groups?: { value?: string; }[]; name: { /** * The last name of the user. */ familyName: string; /** * The first name of the user. */ givenName: string; }; /** * The SCIM schema URIs. */ schemas: string[]; /** * The username for the user. */ userName: string; }; export type EnterpriseAdminProvisionAndInviteEnterpriseUserVariables = { body: EnterpriseAdminProvisionAndInviteEnterpriseUserRequestBody; pathParams: EnterpriseAdminProvisionAndInviteEnterpriseUserPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Provision enterprise membership for a user, and send organization invitation emails to the email address. * * You can optionally include the groups a user will be invited to join. If you do not provide a list of `groups`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. */ export const fetchEnterpriseAdminProvisionAndInviteEnterpriseUser = ( variables: EnterpriseAdminProvisionAndInviteEnterpriseUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseUser, EnterpriseAdminProvisionAndInviteEnterpriseUserError, EnterpriseAdminProvisionAndInviteEnterpriseUserRequestBody, {}, {}, EnterpriseAdminProvisionAndInviteEnterpriseUserPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users', method: 'post', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Provision enterprise membership for a user, and send organization invitation emails to the email address. * * You can optionally include the groups a user will be invited to join. If you do not provide a list of `groups`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. */ export const useEnterpriseAdminProvisionAndInviteEnterpriseUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseUser, EnterpriseAdminProvisionAndInviteEnterpriseUserError, EnterpriseAdminProvisionAndInviteEnterpriseUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseUser, EnterpriseAdminProvisionAndInviteEnterpriseUserError, EnterpriseAdminProvisionAndInviteEnterpriseUserVariables >( (variables: EnterpriseAdminProvisionAndInviteEnterpriseUserVariables) => fetchEnterpriseAdminProvisionAndInviteEnterpriseUser({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminDeleteUserFromEnterprisePathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * scim_user_id parameter */ scimUserId: string; }; export type EnterpriseAdminDeleteUserFromEnterpriseError = Fetcher.ErrorWrapper; export type EnterpriseAdminDeleteUserFromEnterpriseVariables = { pathParams: EnterpriseAdminDeleteUserFromEnterprisePathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const fetchEnterpriseAdminDeleteUserFromEnterprise = ( variables: EnterpriseAdminDeleteUserFromEnterpriseVariables, signal?: AbortSignal, ) => githubFetch< undefined, EnterpriseAdminDeleteUserFromEnterpriseError, undefined, {}, {}, EnterpriseAdminDeleteUserFromEnterprisePathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users/{scimUserId}', method: 'delete', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const useEnterpriseAdminDeleteUserFromEnterprise = ( options?: Omit< reactQuery.UseMutationOptions< undefined, EnterpriseAdminDeleteUserFromEnterpriseError, EnterpriseAdminDeleteUserFromEnterpriseVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, EnterpriseAdminDeleteUserFromEnterpriseError, EnterpriseAdminDeleteUserFromEnterpriseVariables >( (variables: EnterpriseAdminDeleteUserFromEnterpriseVariables) => fetchEnterpriseAdminDeleteUserFromEnterprise({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * scim_user_id parameter */ scimUserId: string; }; export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserError = Fetcher.ErrorWrapper; export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserVariables = { pathParams: EnterpriseAdminGetProvisioningInformationForEnterpriseUserPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const fetchEnterpriseAdminGetProvisioningInformationForEnterpriseUser = ( variables: EnterpriseAdminGetProvisioningInformationForEnterpriseUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseUser, EnterpriseAdminGetProvisioningInformationForEnterpriseUserError, undefined, {}, {}, EnterpriseAdminGetProvisioningInformationForEnterpriseUserPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users/{scimUserId}', method: 'get', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ export const useEnterpriseAdminGetProvisioningInformationForEnterpriseUser = < TData = Schemas.ScimEnterpriseUser, >( variables: EnterpriseAdminGetProvisioningInformationForEnterpriseUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ScimEnterpriseUser, EnterpriseAdminGetProvisioningInformationForEnterpriseUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ScimEnterpriseUser, EnterpriseAdminGetProvisioningInformationForEnterpriseUserError, TData >( queryKeyFn({ path: '/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}', operationId: 'enterpriseAdminGetProvisioningInformationForEnterpriseUser', variables, }), ({ signal }) => fetchEnterpriseAdminGetProvisioningInformationForEnterpriseUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type EnterpriseAdminUpdateAttributeForEnterpriseUserPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * scim_user_id parameter */ scimUserId: string; }; export type EnterpriseAdminUpdateAttributeForEnterpriseUserError = Fetcher.ErrorWrapper; export type EnterpriseAdminUpdateAttributeForEnterpriseUserRequestBody = { /** * Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ Operations: Record[]; /** * The SCIM schema URIs. */ schemas: string[]; }; export type EnterpriseAdminUpdateAttributeForEnterpriseUserVariables = { body: EnterpriseAdminUpdateAttributeForEnterpriseUserRequestBody; pathParams: EnterpriseAdminUpdateAttributeForEnterpriseUserPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). * * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. * * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated `:scim_user_id`. * * ``` * { * "Operations":[{ * "op":"replace", * "value":{ * "active":false * } * }] * } * ``` */ export const fetchEnterpriseAdminUpdateAttributeForEnterpriseUser = ( variables: EnterpriseAdminUpdateAttributeForEnterpriseUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseUser, EnterpriseAdminUpdateAttributeForEnterpriseUserError, EnterpriseAdminUpdateAttributeForEnterpriseUserRequestBody, {}, {}, EnterpriseAdminUpdateAttributeForEnterpriseUserPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users/{scimUserId}', method: 'patch', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). * * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. * * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated `:scim_user_id`. * * ``` * { * "Operations":[{ * "op":"replace", * "value":{ * "active":false * } * }] * } * ``` */ export const useEnterpriseAdminUpdateAttributeForEnterpriseUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseUser, EnterpriseAdminUpdateAttributeForEnterpriseUserError, EnterpriseAdminUpdateAttributeForEnterpriseUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseUser, EnterpriseAdminUpdateAttributeForEnterpriseUserError, EnterpriseAdminUpdateAttributeForEnterpriseUserVariables >( (variables: EnterpriseAdminUpdateAttributeForEnterpriseUserVariables) => fetchEnterpriseAdminUpdateAttributeForEnterpriseUser({ ...fetcherOptions, ...variables, }), options, ); }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserPathParams = { /** * The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ enterprise: string; /** * scim_user_id parameter */ scimUserId: string; }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserError = Fetcher.ErrorWrapper; export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserRequestBody = { /** * List of user emails. */ emails: { /** * Whether this email address is the primary address. */ primary: boolean; /** * The type of email address. */ type: string; /** * The email address. */ value: string; }[]; /** * List of SCIM group IDs the user is a member of. */ groups?: { value?: string; }[]; name: { /** * The last name of the user. */ familyName: string; /** * The first name of the user. */ givenName: string; }; /** * The SCIM schema URIs. */ schemas: string[]; /** * The username for the user. */ userName: string; }; export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserVariables = { body: EnterpriseAdminSetInformationForProvisionedEnterpriseUserRequestBody; pathParams: EnterpriseAdminSetInformationForProvisionedEnterpriseUserPathParams; } & GithubContext['fetcherOptions']; /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. * * You must at least provide the required values for the user: `userName`, `name`, and `emails`. * * **Warning:** Setting `active: false` removes the user from the enterprise, deletes the external identity, and deletes the associated `{scim_user_id}`. */ export const fetchEnterpriseAdminSetInformationForProvisionedEnterpriseUser = ( variables: EnterpriseAdminSetInformationForProvisionedEnterpriseUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ScimEnterpriseUser, EnterpriseAdminSetInformationForProvisionedEnterpriseUserError, EnterpriseAdminSetInformationForProvisionedEnterpriseUserRequestBody, {}, {}, EnterpriseAdminSetInformationForProvisionedEnterpriseUserPathParams >({ url: '/scim/v2/enterprises/{enterprise}/Users/{scimUserId}', method: 'put', ...variables, signal, }); /** * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. * * You must at least provide the required values for the user: `userName`, `name`, and `emails`. * * **Warning:** Setting `active: false` removes the user from the enterprise, deletes the external identity, and deletes the associated `{scim_user_id}`. */ export const useEnterpriseAdminSetInformationForProvisionedEnterpriseUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.ScimEnterpriseUser, EnterpriseAdminSetInformationForProvisionedEnterpriseUserError, EnterpriseAdminSetInformationForProvisionedEnterpriseUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.ScimEnterpriseUser, EnterpriseAdminSetInformationForProvisionedEnterpriseUserError, EnterpriseAdminSetInformationForProvisionedEnterpriseUserVariables >( ( variables: EnterpriseAdminSetInformationForProvisionedEnterpriseUserVariables, ) => fetchEnterpriseAdminSetInformationForProvisionedEnterpriseUser({ ...fetcherOptions, ...variables, }), options, ); }; export type ScimListProvisionedIdentitiesPathParams = { org: string; }; export type ScimListProvisionedIdentitiesQueryParams = { /** * Used for pagination: the index of the first result to return. */ startIndex?: number; /** * Used for pagination: the number of results to return. */ count?: number; /** * Filters results using the equals query parameter operator (`eq`). You can filter results that are equal to `id`, `userName`, `emails`, and `external_id`. For example, to search for an identity with the `userName` Octocat, you would use this query: * * `?filter=userName%20eq%20\"Octocat\"`. * * To filter results for the identity with the email `octocat@github.com`, you would use this query: * * `?filter=emails%20eq%20\"octocat@github.com\"`. */ filter?: string; }; export type ScimListProvisionedIdentitiesError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 400; payload: Responses.ScimBadRequest; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } >; export type ScimListProvisionedIdentitiesVariables = { pathParams: ScimListProvisionedIdentitiesPathParams; queryParams?: ScimListProvisionedIdentitiesQueryParams; } & GithubContext['fetcherOptions']; /** * Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the `filter` parameter, the resources for all matching provisions members are returned. * * When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: * - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. * * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: * * 1. The user is granted access by the IdP and is not a member of the GitHub organization. * * 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. * * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: * - If the user signs in, their GitHub account is linked to this entry. * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity `null` entry remains in place. */ export const fetchScimListProvisionedIdentities = ( variables: ScimListProvisionedIdentitiesVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimListProvisionedIdentitiesError, undefined, {}, ScimListProvisionedIdentitiesQueryParams, ScimListProvisionedIdentitiesPathParams >({ url: '/scim/v2/organizations/{org}/Users', method: 'get', ...variables, signal, }); /** * Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the `filter` parameter, the resources for all matching provisions members are returned. * * When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: * - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. * * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: * * 1. The user is granted access by the IdP and is not a member of the GitHub organization. * * 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. * * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: * - If the user signs in, their GitHub account is linked to this entry. * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity `null` entry remains in place. */ export const useScimListProvisionedIdentities = ( variables: ScimListProvisionedIdentitiesVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ScimListProvisionedIdentitiesError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ScimListProvisionedIdentitiesError, TData >( queryKeyFn({ path: '/scim/v2/organizations/{org}/Users', operationId: 'scimListProvisionedIdentities', variables, }), ({ signal }) => fetchScimListProvisionedIdentities( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ScimProvisionAndInviteUserPathParams = { org: string; }; export type ScimProvisionAndInviteUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 400; payload: Responses.ScimBadRequest; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } | { status: 409; payload: Responses.ScimConflict; } | { status: 500; payload: Responses.ScimInternalError; } >; export type ScimProvisionAndInviteUserRequestBody = { active?: boolean; /** * The name of the user, suitable for display to end-users * * @example Jon Doe */ displayName?: string; /** * user emails * * @example {"primary":true,"value":"someone@example.com"} * @example {"primary":false,"value":"another@example.com"} * @minItems 1 */ emails: { primary?: boolean; type?: string; value: string; }[]; externalId?: string; groups?: string[]; /** * @example {"familyName":"User","givenName":"Jane"} */ name: { familyName: string; formatted?: string; givenName: string; }; schemas?: string[]; /** * Configured by the admin. Could be an email, login, or username * * @example someone@example.com */ userName: string; }; export type ScimProvisionAndInviteUserVariables = { body: ScimProvisionAndInviteUserRequestBody; pathParams: ScimProvisionAndInviteUserPathParams; } & GithubContext['fetcherOptions']; /** * Provision organization membership for a user, and send an activation email to the email address. */ export const fetchScimProvisionAndInviteUser = ( variables: ScimProvisionAndInviteUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimProvisionAndInviteUserError, ScimProvisionAndInviteUserRequestBody, {}, {}, ScimProvisionAndInviteUserPathParams >({ url: '/scim/v2/organizations/{org}/Users', method: 'post', ...variables, signal, }); /** * Provision organization membership for a user, and send an activation email to the email address. */ export const useScimProvisionAndInviteUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ScimProvisionAndInviteUserError, ScimProvisionAndInviteUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ScimProvisionAndInviteUserError, ScimProvisionAndInviteUserVariables >( (variables: ScimProvisionAndInviteUserVariables) => fetchScimProvisionAndInviteUser({ ...fetcherOptions, ...variables }), options, ); }; export type ScimDeleteUserFromOrgPathParams = { org: string; /** * scim_user_id parameter */ scimUserId: string; }; export type ScimDeleteUserFromOrgError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } >; export type ScimDeleteUserFromOrgVariables = { pathParams: ScimDeleteUserFromOrgPathParams; } & GithubContext['fetcherOptions']; export const fetchScimDeleteUserFromOrg = ( variables: ScimDeleteUserFromOrgVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimDeleteUserFromOrgError, undefined, {}, {}, ScimDeleteUserFromOrgPathParams >({ url: '/scim/v2/organizations/{org}/Users/{scimUserId}', method: 'delete', ...variables, signal, }); export const useScimDeleteUserFromOrg = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ScimDeleteUserFromOrgError, ScimDeleteUserFromOrgVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ScimDeleteUserFromOrgError, ScimDeleteUserFromOrgVariables >( (variables: ScimDeleteUserFromOrgVariables) => fetchScimDeleteUserFromOrg({ ...fetcherOptions, ...variables }), options, ); }; export type ScimGetProvisioningInformationForUserPathParams = { org: string; /** * scim_user_id parameter */ scimUserId: string; }; export type ScimGetProvisioningInformationForUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } >; export type ScimGetProvisioningInformationForUserVariables = { pathParams: ScimGetProvisioningInformationForUserPathParams; } & GithubContext['fetcherOptions']; export const fetchScimGetProvisioningInformationForUser = ( variables: ScimGetProvisioningInformationForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimGetProvisioningInformationForUserError, undefined, {}, {}, ScimGetProvisioningInformationForUserPathParams >({ url: '/scim/v2/organizations/{org}/Users/{scimUserId}', method: 'get', ...variables, signal, }); export const useScimGetProvisioningInformationForUser = ( variables: ScimGetProvisioningInformationForUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ScimGetProvisioningInformationForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ScimGetProvisioningInformationForUserError, TData >( queryKeyFn({ path: '/scim/v2/organizations/{org}/Users/{scim_user_id}', operationId: 'scimGetProvisioningInformationForUser', variables, }), ({ signal }) => fetchScimGetProvisioningInformationForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ScimUpdateAttributeForUserPathParams = { org: string; /** * scim_user_id parameter */ scimUserId: string; }; export type ScimUpdateAttributeForUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 400; payload: Responses.ScimBadRequest; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } | { status: 429; payload: Schemas.BasicError; } >; export type ScimUpdateAttributeForUserRequestBody = { /** * Set of operations to be performed * * @example {"op":"replace","value":{"active":false}} * @minItems 1 */ Operations: { op: 'add' | 'remove' | 'replace'; path?: string; value?: | { active?: boolean | null; externalId?: string | null; familyName?: string | null; givenName?: string | null; userName?: string | null; } | { primary?: boolean; value?: string; }[] | string; }[]; schemas?: string[]; }; export type ScimUpdateAttributeForUserVariables = { body: ScimUpdateAttributeForUserRequestBody; pathParams: ScimUpdateAttributeForUserPathParams; } & GithubContext['fetcherOptions']; /** * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). * * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. * * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated `:scim_user_id`. * * ``` * { * "Operations":[{ * "op":"replace", * "value":{ * "active":false * } * }] * } * ``` */ export const fetchScimUpdateAttributeForUser = ( variables: ScimUpdateAttributeForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimUpdateAttributeForUserError, ScimUpdateAttributeForUserRequestBody, {}, {}, ScimUpdateAttributeForUserPathParams >({ url: '/scim/v2/organizations/{org}/Users/{scimUserId}', method: 'patch', ...variables, signal, }); /** * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). * * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. * * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated `:scim_user_id`. * * ``` * { * "Operations":[{ * "op":"replace", * "value":{ * "active":false * } * }] * } * ``` */ export const useScimUpdateAttributeForUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ScimUpdateAttributeForUserError, ScimUpdateAttributeForUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ScimUpdateAttributeForUserError, ScimUpdateAttributeForUserVariables >( (variables: ScimUpdateAttributeForUserVariables) => fetchScimUpdateAttributeForUser({ ...fetcherOptions, ...variables }), options, ); }; export type ScimSetInformationForProvisionedUserPathParams = { org: string; /** * scim_user_id parameter */ scimUserId: string; }; export type ScimSetInformationForProvisionedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.ScimForbidden; } | { status: 404; payload: Responses.ScimNotFound; } >; export type ScimSetInformationForProvisionedUserRequestBody = { active?: boolean; /** * The name of the user, suitable for display to end-users * * @example Jon Doe */ displayName?: string; /** * user emails * * @example {"primary":true,"value":"someone@example.com"} * @example {"primary":false,"value":"another@example.com"} * @minItems 1 */ emails: { primary?: boolean; type?: string; value: string; }[]; externalId?: string; groups?: string[]; /** * @example {"familyName":"User","givenName":"Jane"} */ name: { familyName: string; formatted?: string; givenName: string; }; schemas?: string[]; /** * Configured by the admin. Could be an email, login, or username * * @example someone@example.com */ userName: string; }; export type ScimSetInformationForProvisionedUserVariables = { body: ScimSetInformationForProvisionedUserRequestBody; pathParams: ScimSetInformationForProvisionedUserPathParams; } & GithubContext['fetcherOptions']; /** * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. * * You must at least provide the required values for the user: `userName`, `name`, and `emails`. * * **Warning:** Setting `active: false` removes the user from the organization, deletes the external identity, and deletes the associated `{scim_user_id}`. */ export const fetchScimSetInformationForProvisionedUser = ( variables: ScimSetInformationForProvisionedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ScimSetInformationForProvisionedUserError, ScimSetInformationForProvisionedUserRequestBody, {}, {}, ScimSetInformationForProvisionedUserPathParams >({ url: '/scim/v2/organizations/{org}/Users/{scimUserId}', method: 'put', ...variables, signal, }); /** * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. * * You must at least provide the required values for the user: `userName`, `name`, and `emails`. * * **Warning:** Setting `active: false` removes the user from the organization, deletes the external identity, and deletes the associated `{scim_user_id}`. */ export const useScimSetInformationForProvisionedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ScimSetInformationForProvisionedUserError, ScimSetInformationForProvisionedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ScimSetInformationForProvisionedUserError, ScimSetInformationForProvisionedUserVariables >( (variables: ScimSetInformationForProvisionedUserVariables) => fetchScimSetInformationForProvisionedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type SearchCodeQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ q: string; /** * Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: 'indexed'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type SearchCodeError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type SearchCodeResponse = { incomplete_results: boolean; items: Schemas.CodeSearchResultItem[]; total_count: number; }; export type SearchCodeVariables = { queryParams: SearchCodeQueryParams; } & GithubContext['fetcherOptions']; /** * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: * * `q=addClass+in:file+language:js+repo:jquery/jquery` * * This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository. * * #### Considerations for code search * * Due to the complexity of searching code, there are a few restrictions on how searches are performed: * * * Only the _default branch_ is considered. In most cases, this will be the `master` branch. * * Only files smaller than 384 KB are searchable. * * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing * language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. */ export const fetchSearchCode = ( variables: SearchCodeVariables, signal?: AbortSignal, ) => githubFetch< SearchCodeResponse, SearchCodeError, undefined, {}, SearchCodeQueryParams, {} >({ url: '/search/code', method: 'get', ...variables, signal }); /** * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: * * `q=addClass+in:file+language:js+repo:jquery/jquery` * * This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository. * * #### Considerations for code search * * Due to the complexity of searching code, there are a few restrictions on how searches are performed: * * * Only the _default branch_ is considered. In most cases, this will be the `master` branch. * * Only files smaller than 384 KB are searchable. * * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing * language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. */ export const useSearchCode = ( variables: SearchCodeVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/code', operationId: 'searchCode', variables }), ({ signal }) => fetchSearchCode({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SearchCommitsQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ q: string; /** * Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: 'author-date' | 'committer-date'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type SearchCommitsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type SearchCommitsResponse = { incomplete_results: boolean; items: Schemas.CommitSearchResultItem[]; total_count: number; }; export type SearchCommitsVariables = { queryParams: SearchCommitsQueryParams; } & GithubContext['fetcherOptions']; /** * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match * metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: * * `q=repo:octocat/Spoon-Knife+css` */ export const fetchSearchCommits = ( variables: SearchCommitsVariables, signal?: AbortSignal, ) => githubFetch< SearchCommitsResponse, SearchCommitsError, undefined, {}, SearchCommitsQueryParams, {} >({ url: '/search/commits', method: 'get', ...variables, signal }); /** * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match * metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: * * `q=repo:octocat/Spoon-Knife+css` */ export const useSearchCommits = ( variables: SearchCommitsVariables, options?: Omit< reactQuery.UseQueryOptions< SearchCommitsResponse, SearchCommitsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/commits', operationId: 'searchCommits', variables, }), ({ signal }) => fetchSearchCommits({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SearchIssuesAndPullRequestsQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ q: string; /** * Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: | 'comments' | 'reactions' | 'reactions-+1' | 'reactions--1' | 'reactions-smile' | 'reactions-thinking_face' | 'reactions-heart' | 'reactions-tada' | 'interactions' | 'created' | 'updated'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type SearchIssuesAndPullRequestsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type SearchIssuesAndPullRequestsResponse = { incomplete_results: boolean; items: Schemas.IssueSearchResultItem[]; total_count: number; }; export type SearchIssuesAndPullRequestsVariables = { queryParams: SearchIssuesAndPullRequestsQueryParams; } & GithubContext['fetcherOptions']; /** * Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted * search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. * * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` * * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. * * **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." */ export const fetchSearchIssuesAndPullRequests = ( variables: SearchIssuesAndPullRequestsVariables, signal?: AbortSignal, ) => githubFetch< SearchIssuesAndPullRequestsResponse, SearchIssuesAndPullRequestsError, undefined, {}, SearchIssuesAndPullRequestsQueryParams, {} >({ url: '/search/issues', method: 'get', ...variables, signal }); /** * Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted * search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. * * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` * * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. * * **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." */ export const useSearchIssuesAndPullRequests = < TData = SearchIssuesAndPullRequestsResponse, >( variables: SearchIssuesAndPullRequestsVariables, options?: Omit< reactQuery.UseQueryOptions< SearchIssuesAndPullRequestsResponse, SearchIssuesAndPullRequestsError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< SearchIssuesAndPullRequestsResponse, SearchIssuesAndPullRequestsError, TData >( queryKeyFn({ path: '/search/issues', operationId: 'searchIssuesAndPullRequests', variables, }), ({ signal }) => fetchSearchIssuesAndPullRequests( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type SearchLabelsQueryParams = { /** * The id of the repository. */ repository_id: number; /** * The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ q: string; /** * Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: 'created' | 'updated'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; }; export type SearchLabelsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type SearchLabelsResponse = { incomplete_results: boolean; items: Schemas.LabelSearchResultItem[]; total_count: number; }; export type SearchLabelsVariables = { queryParams: SearchLabelsQueryParams; } & GithubContext['fetcherOptions']; /** * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: * * `q=bug+defect+enhancement&repository_id=64778136` * * The labels that best match the query appear first in the search results. */ export const fetchSearchLabels = ( variables: SearchLabelsVariables, signal?: AbortSignal, ) => githubFetch< SearchLabelsResponse, SearchLabelsError, undefined, {}, SearchLabelsQueryParams, {} >({ url: '/search/labels', method: 'get', ...variables, signal }); /** * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: * * `q=bug+defect+enhancement&repository_id=64778136` * * The labels that best match the query appear first in the search results. */ export const useSearchLabels = ( variables: SearchLabelsVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/labels', operationId: 'searchLabels', variables, }), ({ signal }) => fetchSearchLabels({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SearchReposQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ q: string; /** * Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: 'stars' | 'forks' | 'help-wanted-issues' | 'updated'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type SearchReposError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type SearchReposResponse = { incomplete_results: boolean; items: Schemas.RepoSearchResultItem[]; total_count: number; }; export type SearchReposVariables = { queryParams: SearchReposQueryParams; } & GithubContext['fetcherOptions']; /** * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: * * `q=tetris+language:assembly&sort=stars&order=desc` * * This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. * * When you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this: * * `q=topic:ruby+topic:rails` */ export const fetchSearchRepos = ( variables: SearchReposVariables, signal?: AbortSignal, ) => githubFetch< SearchReposResponse, SearchReposError, undefined, {}, SearchReposQueryParams, {} >({ url: '/search/repositories', method: 'get', ...variables, signal }); /** * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: * * `q=tetris+language:assembly&sort=stars&order=desc` * * This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. * * When you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this: * * `q=topic:ruby+topic:rails` */ export const useSearchRepos = ( variables: SearchReposVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/repositories', operationId: 'searchRepos', variables, }), ({ signal }) => fetchSearchRepos({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SearchTopicsQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ q: string; }; export type SearchTopicsError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type SearchTopicsResponse = { incomplete_results: boolean; items: Schemas.TopicSearchResultItem[]; total_count: number; }; export type SearchTopicsVariables = { queryParams: SearchTopicsQueryParams; } & GithubContext['fetcherOptions']; /** * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. * * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: * * `q=ruby+is:featured` * * This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. */ export const fetchSearchTopics = ( variables: SearchTopicsVariables, signal?: AbortSignal, ) => githubFetch< SearchTopicsResponse, SearchTopicsError, undefined, {}, SearchTopicsQueryParams, {} >({ url: '/search/topics', method: 'get', ...variables, signal }); /** * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. * * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: * * `q=ruby+is:featured` * * This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. */ export const useSearchTopics = ( variables: SearchTopicsVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/topics', operationId: 'searchTopics', variables, }), ({ signal }) => fetchSearchTopics({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type SearchUsersQueryParams = { /** * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ q: string; /** * Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ sort?: 'followers' | 'repositories' | 'joined'; /** * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. * * @default desc */ order?: 'desc' | 'asc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type SearchUsersError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 422; payload: Responses.ValidationFailed; } | { status: 503; payload: Responses.ServiceUnavailable; } >; export type SearchUsersResponse = { incomplete_results: boolean; items: Schemas.UserSearchResultItem[]; total_count: number; }; export type SearchUsersVariables = { queryParams: SearchUsersQueryParams; } & GithubContext['fetcherOptions']; /** * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you're looking for a list of popular users, you might try this query: * * `q=tom+repos:%3E42+followers:%3E1000` * * This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers. */ export const fetchSearchUsers = ( variables: SearchUsersVariables, signal?: AbortSignal, ) => githubFetch< SearchUsersResponse, SearchUsersError, undefined, {}, SearchUsersQueryParams, {} >({ url: '/search/users', method: 'get', ...variables, signal }); /** * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you're looking for a list of popular users, you might try this query: * * `q=tom+repos:%3E42+followers:%3E1000` * * This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers. */ export const useSearchUsers = ( variables: SearchUsersVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/search/users', operationId: 'searchUsers', variables, }), ({ signal }) => fetchSearchUsers({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsDeleteLegacyPathParams = { teamId: number; }; export type TeamsDeleteLegacyError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsDeleteLegacyVariables = { pathParams: TeamsDeleteLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. * * To delete a team, the authenticated user must be an organization owner or team maintainer. * * If you are an organization owner, deleting a parent team will delete all of its child teams as well. */ export const fetchTeamsDeleteLegacy = ( variables: TeamsDeleteLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteLegacyError, undefined, {}, {}, TeamsDeleteLegacyPathParams >({ url: '/teams/{teamId}', method: 'delete', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. * * To delete a team, the authenticated user must be an organization owner or team maintainer. * * If you are an organization owner, deleting a parent team will delete all of its child teams as well. */ export const useTeamsDeleteLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteLegacyError, TeamsDeleteLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteLegacyError, TeamsDeleteLegacyVariables >( (variables: TeamsDeleteLegacyVariables) => fetchTeamsDeleteLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsGetLegacyPathParams = { teamId: number; }; export type TeamsGetLegacyError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type TeamsGetLegacyVariables = { pathParams: TeamsGetLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. */ export const fetchTeamsGetLegacy = ( variables: TeamsGetLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamFull, TeamsGetLegacyError, undefined, {}, {}, TeamsGetLegacyPathParams >({ url: '/teams/{teamId}', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. */ export const useTeamsGetLegacy = ( variables: TeamsGetLegacyVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/teams/{team_id}', operationId: 'teamsGetLegacy', variables, }), ({ signal }) => fetchTeamsGetLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateLegacyPathParams = { teamId: number; }; export type TeamsUpdateLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsUpdateLegacyRequestBody = { /** * The description of the team. */ description?: string; /** * The name of the team. */ name: string; /** * The ID of a team to set as the parent team. */ parent_team_id?: number | null; /** * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: * \* `pull` - team members can pull, but not push to or administer newly-added repositories. * \* `push` - team members can pull and push, but not administer newly-added repositories. * \* `admin` - team members can pull, push and administer newly-added repositories. * * @default pull */ permission?: 'pull' | 'push' | 'admin'; /** * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: * **For a non-nested team:** * \* `secret` - only visible to organization owners and members of this team. * \* `closed` - visible to all members of this organization. * **For a parent or child team:** * \* `closed` - visible to all members of this organization. */ privacy?: 'secret' | 'closed'; }; export type TeamsUpdateLegacyVariables = { body: TeamsUpdateLegacyRequestBody; pathParams: TeamsUpdateLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. * * To edit a team, the authenticated user must either be an organization owner or a team maintainer. * * **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. */ export const fetchTeamsUpdateLegacy = ( variables: TeamsUpdateLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamFull, TeamsUpdateLegacyError, TeamsUpdateLegacyRequestBody, {}, {}, TeamsUpdateLegacyPathParams >({ url: '/teams/{teamId}', method: 'patch', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. * * To edit a team, the authenticated user must either be an organization owner or a team maintainer. * * **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. */ export const useTeamsUpdateLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamFull, TeamsUpdateLegacyError, TeamsUpdateLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamFull, TeamsUpdateLegacyError, TeamsUpdateLegacyVariables >( (variables: TeamsUpdateLegacyVariables) => fetchTeamsUpdateLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsListDiscussionsLegacyPathParams = { teamId: number; }; export type TeamsListDiscussionsLegacyQueryParams = { /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListDiscussionsLegacyError = Fetcher.ErrorWrapper; export type TeamsListDiscussionsLegacyResponse = Schemas.TeamDiscussion[]; export type TeamsListDiscussionsLegacyVariables = { pathParams: TeamsListDiscussionsLegacyPathParams; queryParams?: TeamsListDiscussionsLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. * * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsListDiscussionsLegacy = ( variables: TeamsListDiscussionsLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListDiscussionsLegacyResponse, TeamsListDiscussionsLegacyError, undefined, {}, TeamsListDiscussionsLegacyQueryParams, TeamsListDiscussionsLegacyPathParams >({ url: '/teams/{teamId}/discussions', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. * * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsListDiscussionsLegacy = < TData = TeamsListDiscussionsLegacyResponse, >( variables: TeamsListDiscussionsLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListDiscussionsLegacyResponse, TeamsListDiscussionsLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListDiscussionsLegacyResponse, TeamsListDiscussionsLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions', operationId: 'teamsListDiscussionsLegacy', variables, }), ({ signal }) => fetchTeamsListDiscussionsLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsCreateDiscussionLegacyPathParams = { teamId: number; }; export type TeamsCreateDiscussionLegacyError = Fetcher.ErrorWrapper; export type TeamsCreateDiscussionLegacyRequestBody = { /** * The discussion post's body text. */ body: string; /** * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. * * @default false */ private?: boolean; /** * The discussion post's title. */ title: string; }; export type TeamsCreateDiscussionLegacyVariables = { body: TeamsCreateDiscussionLegacyRequestBody; pathParams: TeamsCreateDiscussionLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. * * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchTeamsCreateDiscussionLegacy = ( variables: TeamsCreateDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsCreateDiscussionLegacyError, TeamsCreateDiscussionLegacyRequestBody, {}, {}, TeamsCreateDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions', method: 'post', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. * * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const useTeamsCreateDiscussionLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussion, TeamsCreateDiscussionLegacyError, TeamsCreateDiscussionLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussion, TeamsCreateDiscussionLegacyError, TeamsCreateDiscussionLegacyVariables >( (variables: TeamsCreateDiscussionLegacyVariables) => fetchTeamsCreateDiscussionLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsDeleteDiscussionLegacyPathParams = { teamId: number; discussionNumber: number; }; export type TeamsDeleteDiscussionLegacyError = Fetcher.ErrorWrapper; export type TeamsDeleteDiscussionLegacyVariables = { pathParams: TeamsDeleteDiscussionLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. * * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsDeleteDiscussionLegacy = ( variables: TeamsDeleteDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteDiscussionLegacyError, undefined, {}, {}, TeamsDeleteDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. * * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsDeleteDiscussionLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteDiscussionLegacyError, TeamsDeleteDiscussionLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteDiscussionLegacyError, TeamsDeleteDiscussionLegacyVariables >( (variables: TeamsDeleteDiscussionLegacyVariables) => fetchTeamsDeleteDiscussionLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsGetDiscussionLegacyPathParams = { teamId: number; discussionNumber: number; }; export type TeamsGetDiscussionLegacyError = Fetcher.ErrorWrapper; export type TeamsGetDiscussionLegacyVariables = { pathParams: TeamsGetDiscussionLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. * * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsGetDiscussionLegacy = ( variables: TeamsGetDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsGetDiscussionLegacyError, undefined, {}, {}, TeamsGetDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. * * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsGetDiscussionLegacy = ( variables: TeamsGetDiscussionLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamDiscussion, TeamsGetDiscussionLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamDiscussion, TeamsGetDiscussionLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions/{discussion_number}', operationId: 'teamsGetDiscussionLegacy', variables, }), ({ signal }) => fetchTeamsGetDiscussionLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateDiscussionLegacyPathParams = { teamId: number; discussionNumber: number; }; export type TeamsUpdateDiscussionLegacyError = Fetcher.ErrorWrapper; export type TeamsUpdateDiscussionLegacyRequestBody = { /** * The discussion post's body text. */ body?: string; /** * The discussion post's title. */ title?: string; }; export type TeamsUpdateDiscussionLegacyVariables = { body?: TeamsUpdateDiscussionLegacyRequestBody; pathParams: TeamsUpdateDiscussionLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. * * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsUpdateDiscussionLegacy = ( variables: TeamsUpdateDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussion, TeamsUpdateDiscussionLegacyError, TeamsUpdateDiscussionLegacyRequestBody, {}, {}, TeamsUpdateDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}', method: 'patch', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. * * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsUpdateDiscussionLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussion, TeamsUpdateDiscussionLegacyError, TeamsUpdateDiscussionLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussion, TeamsUpdateDiscussionLegacyError, TeamsUpdateDiscussionLegacyVariables >( (variables: TeamsUpdateDiscussionLegacyVariables) => fetchTeamsUpdateDiscussionLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsListDiscussionCommentsLegacyPathParams = { teamId: number; discussionNumber: number; }; export type TeamsListDiscussionCommentsLegacyQueryParams = { /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListDiscussionCommentsLegacyError = Fetcher.ErrorWrapper; export type TeamsListDiscussionCommentsLegacyResponse = Schemas.TeamDiscussionComment[]; export type TeamsListDiscussionCommentsLegacyVariables = { pathParams: TeamsListDiscussionCommentsLegacyPathParams; queryParams?: TeamsListDiscussionCommentsLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. * * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsListDiscussionCommentsLegacy = ( variables: TeamsListDiscussionCommentsLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListDiscussionCommentsLegacyResponse, TeamsListDiscussionCommentsLegacyError, undefined, {}, TeamsListDiscussionCommentsLegacyQueryParams, TeamsListDiscussionCommentsLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. * * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsListDiscussionCommentsLegacy = < TData = TeamsListDiscussionCommentsLegacyResponse, >( variables: TeamsListDiscussionCommentsLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListDiscussionCommentsLegacyResponse, TeamsListDiscussionCommentsLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListDiscussionCommentsLegacyResponse, TeamsListDiscussionCommentsLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions/{discussion_number}/comments', operationId: 'teamsListDiscussionCommentsLegacy', variables, }), ({ signal }) => fetchTeamsListDiscussionCommentsLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsCreateDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; }; export type TeamsCreateDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type TeamsCreateDiscussionCommentLegacyRequestBody = { /** * The discussion comment's body text. */ body: string; }; export type TeamsCreateDiscussionCommentLegacyVariables = { body: TeamsCreateDiscussionCommentLegacyRequestBody; pathParams: TeamsCreateDiscussionCommentLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. * * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const fetchTeamsCreateDiscussionCommentLegacy = ( variables: TeamsCreateDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentLegacyError, TeamsCreateDiscussionCommentLegacyRequestBody, {}, {}, TeamsCreateDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments', method: 'post', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. * * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ export const useTeamsCreateDiscussionCommentLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentLegacyError, TeamsCreateDiscussionCommentLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussionComment, TeamsCreateDiscussionCommentLegacyError, TeamsCreateDiscussionCommentLegacyVariables >( (variables: TeamsCreateDiscussionCommentLegacyVariables) => fetchTeamsCreateDiscussionCommentLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsDeleteDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; commentNumber: number; }; export type TeamsDeleteDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type TeamsDeleteDiscussionCommentLegacyVariables = { pathParams: TeamsDeleteDiscussionCommentLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. * * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsDeleteDiscussionCommentLegacy = ( variables: TeamsDeleteDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsDeleteDiscussionCommentLegacyError, undefined, {}, {}, TeamsDeleteDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. * * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsDeleteDiscussionCommentLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsDeleteDiscussionCommentLegacyError, TeamsDeleteDiscussionCommentLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsDeleteDiscussionCommentLegacyError, TeamsDeleteDiscussionCommentLegacyVariables >( (variables: TeamsDeleteDiscussionCommentLegacyVariables) => fetchTeamsDeleteDiscussionCommentLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsGetDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; commentNumber: number; }; export type TeamsGetDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type TeamsGetDiscussionCommentLegacyVariables = { pathParams: TeamsGetDiscussionCommentLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. * * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsGetDiscussionCommentLegacy = ( variables: TeamsGetDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentLegacyError, undefined, {}, {}, TeamsGetDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. * * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsGetDiscussionCommentLegacy = < TData = Schemas.TeamDiscussionComment, >( variables: TeamsGetDiscussionCommentLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamDiscussionComment, TeamsGetDiscussionCommentLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}', operationId: 'teamsGetDiscussionCommentLegacy', variables, }), ({ signal }) => fetchTeamsGetDiscussionCommentLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsUpdateDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; commentNumber: number; }; export type TeamsUpdateDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type TeamsUpdateDiscussionCommentLegacyRequestBody = { /** * The discussion comment's body text. */ body: string; }; export type TeamsUpdateDiscussionCommentLegacyVariables = { body: TeamsUpdateDiscussionCommentLegacyRequestBody; pathParams: TeamsUpdateDiscussionCommentLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. * * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchTeamsUpdateDiscussionCommentLegacy = ( variables: TeamsUpdateDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentLegacyError, TeamsUpdateDiscussionCommentLegacyRequestBody, {}, {}, TeamsUpdateDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments/{commentNumber}', method: 'patch', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. * * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useTeamsUpdateDiscussionCommentLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentLegacyError, TeamsUpdateDiscussionCommentLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamDiscussionComment, TeamsUpdateDiscussionCommentLegacyError, TeamsUpdateDiscussionCommentLegacyVariables >( (variables: TeamsUpdateDiscussionCommentLegacyVariables) => fetchTeamsUpdateDiscussionCommentLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsListForTeamDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; commentNumber: number; }; export type ReactionsListForTeamDiscussionCommentLegacyQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForTeamDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type ReactionsListForTeamDiscussionCommentLegacyResponse = Schemas.Reaction[]; export type ReactionsListForTeamDiscussionCommentLegacyVariables = { pathParams: ReactionsListForTeamDiscussionCommentLegacyPathParams; queryParams?: ReactionsListForTeamDiscussionCommentLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. * * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchReactionsListForTeamDiscussionCommentLegacy = ( variables: ReactionsListForTeamDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForTeamDiscussionCommentLegacyResponse, ReactionsListForTeamDiscussionCommentLegacyError, undefined, {}, ReactionsListForTeamDiscussionCommentLegacyQueryParams, ReactionsListForTeamDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments/{commentNumber}/reactions', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. * * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useReactionsListForTeamDiscussionCommentLegacy = < TData = ReactionsListForTeamDiscussionCommentLegacyResponse, >( variables: ReactionsListForTeamDiscussionCommentLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForTeamDiscussionCommentLegacyResponse, ReactionsListForTeamDiscussionCommentLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForTeamDiscussionCommentLegacyResponse, ReactionsListForTeamDiscussionCommentLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions', operationId: 'reactionsListForTeamDiscussionCommentLegacy', variables, }), ({ signal }) => fetchReactionsListForTeamDiscussionCommentLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForTeamDiscussionCommentLegacyPathParams = { teamId: number; discussionNumber: number; commentNumber: number; }; export type ReactionsCreateForTeamDiscussionCommentLegacyError = Fetcher.ErrorWrapper; export type ReactionsCreateForTeamDiscussionCommentLegacyRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForTeamDiscussionCommentLegacyVariables = { body: ReactionsCreateForTeamDiscussionCommentLegacyRequestBody; pathParams: ReactionsCreateForTeamDiscussionCommentLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. * * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion comment. */ export const fetchReactionsCreateForTeamDiscussionCommentLegacy = ( variables: ReactionsCreateForTeamDiscussionCommentLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentLegacyError, ReactionsCreateForTeamDiscussionCommentLegacyRequestBody, {}, {}, ReactionsCreateForTeamDiscussionCommentLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/comments/{commentNumber}/reactions', method: 'post', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. * * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion comment. */ export const useReactionsCreateForTeamDiscussionCommentLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentLegacyError, ReactionsCreateForTeamDiscussionCommentLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForTeamDiscussionCommentLegacyError, ReactionsCreateForTeamDiscussionCommentLegacyVariables >( (variables: ReactionsCreateForTeamDiscussionCommentLegacyVariables) => fetchReactionsCreateForTeamDiscussionCommentLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type ReactionsListForTeamDiscussionLegacyPathParams = { teamId: number; discussionNumber: number; }; export type ReactionsListForTeamDiscussionLegacyQueryParams = { /** * Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ content?: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReactionsListForTeamDiscussionLegacyError = Fetcher.ErrorWrapper; export type ReactionsListForTeamDiscussionLegacyResponse = Schemas.Reaction[]; export type ReactionsListForTeamDiscussionLegacyVariables = { pathParams: ReactionsListForTeamDiscussionLegacyPathParams; queryParams?: ReactionsListForTeamDiscussionLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. * * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchReactionsListForTeamDiscussionLegacy = ( variables: ReactionsListForTeamDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< ReactionsListForTeamDiscussionLegacyResponse, ReactionsListForTeamDiscussionLegacyError, undefined, {}, ReactionsListForTeamDiscussionLegacyQueryParams, ReactionsListForTeamDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/reactions', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. * * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useReactionsListForTeamDiscussionLegacy = < TData = ReactionsListForTeamDiscussionLegacyResponse, >( variables: ReactionsListForTeamDiscussionLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< ReactionsListForTeamDiscussionLegacyResponse, ReactionsListForTeamDiscussionLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReactionsListForTeamDiscussionLegacyResponse, ReactionsListForTeamDiscussionLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/discussions/{discussion_number}/reactions', operationId: 'reactionsListForTeamDiscussionLegacy', variables, }), ({ signal }) => fetchReactionsListForTeamDiscussionLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReactionsCreateForTeamDiscussionLegacyPathParams = { teamId: number; discussionNumber: number; }; export type ReactionsCreateForTeamDiscussionLegacyError = Fetcher.ErrorWrapper; export type ReactionsCreateForTeamDiscussionLegacyRequestBody = { /** * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; }; export type ReactionsCreateForTeamDiscussionLegacyVariables = { body: ReactionsCreateForTeamDiscussionLegacyRequestBody; pathParams: ReactionsCreateForTeamDiscussionLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. * * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion. */ export const fetchReactionsCreateForTeamDiscussionLegacy = ( variables: ReactionsCreateForTeamDiscussionLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Reaction, ReactionsCreateForTeamDiscussionLegacyError, ReactionsCreateForTeamDiscussionLegacyRequestBody, {}, {}, ReactionsCreateForTeamDiscussionLegacyPathParams >({ url: '/teams/{teamId}/discussions/{discussionNumber}/reactions', method: 'post', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. * * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion. */ export const useReactionsCreateForTeamDiscussionLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Reaction, ReactionsCreateForTeamDiscussionLegacyError, ReactionsCreateForTeamDiscussionLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Reaction, ReactionsCreateForTeamDiscussionLegacyError, ReactionsCreateForTeamDiscussionLegacyVariables >( (variables: ReactionsCreateForTeamDiscussionLegacyVariables) => fetchReactionsCreateForTeamDiscussionLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListPendingInvitationsLegacyPathParams = { teamId: number; }; export type TeamsListPendingInvitationsLegacyQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListPendingInvitationsLegacyError = Fetcher.ErrorWrapper; export type TeamsListPendingInvitationsLegacyResponse = Schemas.OrganizationInvitation[]; export type TeamsListPendingInvitationsLegacyVariables = { pathParams: TeamsListPendingInvitationsLegacyPathParams; queryParams?: TeamsListPendingInvitationsLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. * * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ export const fetchTeamsListPendingInvitationsLegacy = ( variables: TeamsListPendingInvitationsLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListPendingInvitationsLegacyResponse, TeamsListPendingInvitationsLegacyError, undefined, {}, TeamsListPendingInvitationsLegacyQueryParams, TeamsListPendingInvitationsLegacyPathParams >({ url: '/teams/{teamId}/invitations', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. * * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ export const useTeamsListPendingInvitationsLegacy = < TData = TeamsListPendingInvitationsLegacyResponse, >( variables: TeamsListPendingInvitationsLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListPendingInvitationsLegacyResponse, TeamsListPendingInvitationsLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListPendingInvitationsLegacyResponse, TeamsListPendingInvitationsLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/invitations', operationId: 'teamsListPendingInvitationsLegacy', variables, }), ({ signal }) => fetchTeamsListPendingInvitationsLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsListMembersLegacyPathParams = { teamId: number; }; export type TeamsListMembersLegacyQueryParams = { /** * Filters members returned by their role in the team. Can be one of: * \* `member` - normal members of the team. * \* `maintainer` - team maintainers. * \* `all` - all members of the team. * * @default all */ role?: 'member' | 'maintainer' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListMembersLegacyError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type TeamsListMembersLegacyResponse = Schemas.SimpleUser[]; export type TeamsListMembersLegacyVariables = { pathParams: TeamsListMembersLegacyPathParams; queryParams?: TeamsListMembersLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. * * Team members will include the members of child teams. */ export const fetchTeamsListMembersLegacy = ( variables: TeamsListMembersLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListMembersLegacyResponse, TeamsListMembersLegacyError, undefined, {}, TeamsListMembersLegacyQueryParams, TeamsListMembersLegacyPathParams >({ url: '/teams/{teamId}/members', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. * * Team members will include the members of child teams. */ export const useTeamsListMembersLegacy = < TData = TeamsListMembersLegacyResponse, >( variables: TeamsListMembersLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListMembersLegacyResponse, TeamsListMembersLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListMembersLegacyResponse, TeamsListMembersLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/members', operationId: 'teamsListMembersLegacy', variables, }), ({ signal }) => fetchTeamsListMembersLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveMemberLegacyPathParams = { teamId: number; username: string; }; export type TeamsRemoveMemberLegacyError = Fetcher.ErrorWrapper; export type TeamsRemoveMemberLegacyVariables = { pathParams: TeamsRemoveMemberLegacyPathParams; } & GithubContext['fetcherOptions']; /** * The "Remove team member" endpoint (described below) is deprecated. * * We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ export const fetchTeamsRemoveMemberLegacy = ( variables: TeamsRemoveMemberLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveMemberLegacyError, undefined, {}, {}, TeamsRemoveMemberLegacyPathParams >({ url: '/teams/{teamId}/members/{username}', method: 'delete', ...variables, signal, }); /** * The "Remove team member" endpoint (described below) is deprecated. * * We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ export const useTeamsRemoveMemberLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveMemberLegacyError, TeamsRemoveMemberLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveMemberLegacyError, TeamsRemoveMemberLegacyVariables >( (variables: TeamsRemoveMemberLegacyVariables) => fetchTeamsRemoveMemberLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsGetMemberLegacyPathParams = { teamId: number; username: string; }; export type TeamsGetMemberLegacyError = Fetcher.ErrorWrapper; export type TeamsGetMemberLegacyVariables = { pathParams: TeamsGetMemberLegacyPathParams; } & GithubContext['fetcherOptions']; /** * The "Get team member" endpoint (described below) is deprecated. * * We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. * * To list members in a team, the team must be visible to the authenticated user. */ export const fetchTeamsGetMemberLegacy = ( variables: TeamsGetMemberLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsGetMemberLegacyError, undefined, {}, {}, TeamsGetMemberLegacyPathParams >({ url: '/teams/{teamId}/members/{username}', method: 'get', ...variables, signal, }); /** * The "Get team member" endpoint (described below) is deprecated. * * We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. * * To list members in a team, the team must be visible to the authenticated user. */ export const useTeamsGetMemberLegacy = ( variables: TeamsGetMemberLegacyVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/teams/{team_id}/members/{username}', operationId: 'teamsGetMemberLegacy', variables, }), ({ signal }) => fetchTeamsGetMemberLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsAddMemberLegacyPathParams = { teamId: number; username: string; }; export type TeamsAddMemberLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: { /** * @example "https://docs.github.com/rest" */ documentation_url?: string; errors?: { code?: string; field?: string; resource?: string; }[]; message?: string; }; } >; export type TeamsAddMemberLegacyVariables = { pathParams: TeamsAddMemberLegacyPathParams; } & GithubContext['fetcherOptions']; /** * The "Add team member" endpoint (described below) is deprecated. * * We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchTeamsAddMemberLegacy = ( variables: TeamsAddMemberLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsAddMemberLegacyError, undefined, {}, {}, TeamsAddMemberLegacyPathParams >({ url: '/teams/{teamId}/members/{username}', method: 'put', ...variables, signal, }); /** * The "Add team member" endpoint (described below) is deprecated. * * We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useTeamsAddMemberLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsAddMemberLegacyError, TeamsAddMemberLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsAddMemberLegacyError, TeamsAddMemberLegacyVariables >( (variables: TeamsAddMemberLegacyVariables) => fetchTeamsAddMemberLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsRemoveMembershipForUserLegacyPathParams = { teamId: number; username: string; }; export type TeamsRemoveMembershipForUserLegacyError = Fetcher.ErrorWrapper; export type TeamsRemoveMembershipForUserLegacyVariables = { pathParams: TeamsRemoveMembershipForUserLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ export const fetchTeamsRemoveMembershipForUserLegacy = ( variables: TeamsRemoveMembershipForUserLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveMembershipForUserLegacyError, undefined, {}, {}, TeamsRemoveMembershipForUserLegacyPathParams >({ url: '/teams/{teamId}/memberships/{username}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." */ export const useTeamsRemoveMembershipForUserLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveMembershipForUserLegacyError, TeamsRemoveMembershipForUserLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveMembershipForUserLegacyError, TeamsRemoveMembershipForUserLegacyVariables >( (variables: TeamsRemoveMembershipForUserLegacyVariables) => fetchTeamsRemoveMembershipForUserLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsGetMembershipForUserLegacyPathParams = { teamId: number; username: string; }; export type TeamsGetMembershipForUserLegacyError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type TeamsGetMembershipForUserLegacyVariables = { pathParams: TeamsGetMembershipForUserLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. * * Team members will include the members of child teams. * * To get a user's membership with a team, the team must be visible to the authenticated user. * * **Note:** The `role` for organization owners returns as `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). */ export const fetchTeamsGetMembershipForUserLegacy = ( variables: TeamsGetMembershipForUserLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamMembership, TeamsGetMembershipForUserLegacyError, undefined, {}, {}, TeamsGetMembershipForUserLegacyPathParams >({ url: '/teams/{teamId}/memberships/{username}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. * * Team members will include the members of child teams. * * To get a user's membership with a team, the team must be visible to the authenticated user. * * **Note:** The `role` for organization owners returns as `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). */ export const useTeamsGetMembershipForUserLegacy = < TData = Schemas.TeamMembership, >( variables: TeamsGetMembershipForUserLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamMembership, TeamsGetMembershipForUserLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamMembership, TeamsGetMembershipForUserLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/memberships/{username}', operationId: 'teamsGetMembershipForUserLegacy', variables, }), ({ signal }) => fetchTeamsGetMembershipForUserLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateMembershipForUserLegacyPathParams = { teamId: number; username: string; }; export type TeamsAddOrUpdateMembershipForUserLegacyError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: { /** * @example "https://help.github.com/articles/github-and-trade-controls" */ documentation_url?: string; errors?: { code?: string; field?: string; resource?: string; }[]; message?: string; }; } >; export type TeamsAddOrUpdateMembershipForUserLegacyRequestBody = { /** * The role that this user should have in the team. Can be one of: * \* `member` - a normal member of the team. * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. * * @default member */ role?: 'member' | 'maintainer'; }; export type TeamsAddOrUpdateMembershipForUserLegacyVariables = { body?: TeamsAddOrUpdateMembershipForUserLegacyRequestBody; pathParams: TeamsAddOrUpdateMembershipForUserLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. * * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. */ export const fetchTeamsAddOrUpdateMembershipForUserLegacy = ( variables: TeamsAddOrUpdateMembershipForUserLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserLegacyError, TeamsAddOrUpdateMembershipForUserLegacyRequestBody, {}, {}, TeamsAddOrUpdateMembershipForUserLegacyPathParams >({ url: '/teams/{teamId}/memberships/{username}', method: 'put', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. * * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. * * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. */ export const useTeamsAddOrUpdateMembershipForUserLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserLegacyError, TeamsAddOrUpdateMembershipForUserLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.TeamMembership, TeamsAddOrUpdateMembershipForUserLegacyError, TeamsAddOrUpdateMembershipForUserLegacyVariables >( (variables: TeamsAddOrUpdateMembershipForUserLegacyVariables) => fetchTeamsAddOrUpdateMembershipForUserLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListProjectsLegacyPathParams = { teamId: number; }; export type TeamsListProjectsLegacyQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListProjectsLegacyError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type TeamsListProjectsLegacyResponse = Schemas.TeamProject[]; export type TeamsListProjectsLegacyVariables = { pathParams: TeamsListProjectsLegacyPathParams; queryParams?: TeamsListProjectsLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. * * Lists the organization projects for a team. */ export const fetchTeamsListProjectsLegacy = ( variables: TeamsListProjectsLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListProjectsLegacyResponse, TeamsListProjectsLegacyError, undefined, {}, TeamsListProjectsLegacyQueryParams, TeamsListProjectsLegacyPathParams >({ url: '/teams/{teamId}/projects', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. * * Lists the organization projects for a team. */ export const useTeamsListProjectsLegacy = < TData = TeamsListProjectsLegacyResponse, >( variables: TeamsListProjectsLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListProjectsLegacyResponse, TeamsListProjectsLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListProjectsLegacyResponse, TeamsListProjectsLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/projects', operationId: 'teamsListProjectsLegacy', variables, }), ({ signal }) => fetchTeamsListProjectsLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveProjectLegacyPathParams = { teamId: number; projectId: number; }; export type TeamsRemoveProjectLegacyError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsRemoveProjectLegacyVariables = { pathParams: TeamsRemoveProjectLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. * * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. */ export const fetchTeamsRemoveProjectLegacy = ( variables: TeamsRemoveProjectLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveProjectLegacyError, undefined, {}, {}, TeamsRemoveProjectLegacyPathParams >({ url: '/teams/{teamId}/projects/{projectId}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. * * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. */ export const useTeamsRemoveProjectLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveProjectLegacyError, TeamsRemoveProjectLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveProjectLegacyError, TeamsRemoveProjectLegacyVariables >( (variables: TeamsRemoveProjectLegacyVariables) => fetchTeamsRemoveProjectLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsCheckPermissionsForProjectLegacyPathParams = { teamId: number; projectId: number; }; export type TeamsCheckPermissionsForProjectLegacyError = Fetcher.ErrorWrapper<{ status: 415; payload: Responses.PreviewHeaderMissing; }>; export type TeamsCheckPermissionsForProjectLegacyVariables = { pathParams: TeamsCheckPermissionsForProjectLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. * * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. */ export const fetchTeamsCheckPermissionsForProjectLegacy = ( variables: TeamsCheckPermissionsForProjectLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.TeamProject, TeamsCheckPermissionsForProjectLegacyError, undefined, {}, {}, TeamsCheckPermissionsForProjectLegacyPathParams >({ url: '/teams/{teamId}/projects/{projectId}', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. * * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. */ export const useTeamsCheckPermissionsForProjectLegacy = < TData = Schemas.TeamProject, >( variables: TeamsCheckPermissionsForProjectLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.TeamProject, TeamsCheckPermissionsForProjectLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.TeamProject, TeamsCheckPermissionsForProjectLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/projects/{project_id}', operationId: 'teamsCheckPermissionsForProjectLegacy', variables, }), ({ signal }) => fetchTeamsCheckPermissionsForProjectLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateProjectPermissionsLegacyPathParams = { teamId: number; projectId: number; }; export type TeamsAddOrUpdateProjectPermissionsLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: { documentation_url?: string; message?: string; }; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsAddOrUpdateProjectPermissionsLegacyRequestBody = { /** * The permission to grant to the team for this project. Can be one of: * \* `read` - team members can read, but not write to or administer this project. * \* `write` - team members can read and write, but not administer this project. * \* `admin` - team members can read, write and administer this project. * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ permission?: 'read' | 'write' | 'admin'; }; export type TeamsAddOrUpdateProjectPermissionsLegacyVariables = { body?: TeamsAddOrUpdateProjectPermissionsLegacyRequestBody; pathParams: TeamsAddOrUpdateProjectPermissionsLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. * * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. */ export const fetchTeamsAddOrUpdateProjectPermissionsLegacy = ( variables: TeamsAddOrUpdateProjectPermissionsLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsAddOrUpdateProjectPermissionsLegacyError, TeamsAddOrUpdateProjectPermissionsLegacyRequestBody, {}, {}, TeamsAddOrUpdateProjectPermissionsLegacyPathParams >({ url: '/teams/{teamId}/projects/{projectId}', method: 'put', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. * * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. */ export const useTeamsAddOrUpdateProjectPermissionsLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsAddOrUpdateProjectPermissionsLegacyError, TeamsAddOrUpdateProjectPermissionsLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsAddOrUpdateProjectPermissionsLegacyError, TeamsAddOrUpdateProjectPermissionsLegacyVariables >( (variables: TeamsAddOrUpdateProjectPermissionsLegacyVariables) => fetchTeamsAddOrUpdateProjectPermissionsLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListReposLegacyPathParams = { teamId: number; }; export type TeamsListReposLegacyQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListReposLegacyError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type TeamsListReposLegacyResponse = Schemas.MinimalRepository[]; export type TeamsListReposLegacyVariables = { pathParams: TeamsListReposLegacyPathParams; queryParams?: TeamsListReposLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. */ export const fetchTeamsListReposLegacy = ( variables: TeamsListReposLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListReposLegacyResponse, TeamsListReposLegacyError, undefined, {}, TeamsListReposLegacyQueryParams, TeamsListReposLegacyPathParams >({ url: '/teams/{teamId}/repos', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. */ export const useTeamsListReposLegacy = ( variables: TeamsListReposLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListReposLegacyResponse, TeamsListReposLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListReposLegacyResponse, TeamsListReposLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/repos', operationId: 'teamsListReposLegacy', variables, }), ({ signal }) => fetchTeamsListReposLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type TeamsRemoveRepoLegacyPathParams = { teamId: number; owner: string; repo: string; }; export type TeamsRemoveRepoLegacyError = Fetcher.ErrorWrapper; export type TeamsRemoveRepoLegacyVariables = { pathParams: TeamsRemoveRepoLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. * * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. */ export const fetchTeamsRemoveRepoLegacy = ( variables: TeamsRemoveRepoLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsRemoveRepoLegacyError, undefined, {}, {}, TeamsRemoveRepoLegacyPathParams >({ url: '/teams/{teamId}/repos/{owner}/{repo}', method: 'delete', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. * * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. */ export const useTeamsRemoveRepoLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsRemoveRepoLegacyError, TeamsRemoveRepoLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsRemoveRepoLegacyError, TeamsRemoveRepoLegacyVariables >( (variables: TeamsRemoveRepoLegacyVariables) => fetchTeamsRemoveRepoLegacy({ ...fetcherOptions, ...variables }), options, ); }; export type TeamsCheckPermissionsForRepoLegacyPathParams = { teamId: number; owner: string; repo: string; }; export type TeamsCheckPermissionsForRepoLegacyError = Fetcher.ErrorWrapper; export type TeamsCheckPermissionsForRepoLegacyVariables = { pathParams: TeamsCheckPermissionsForRepoLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Note**: Repositories inherited through a parent team will also be checked. * * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. * * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const fetchTeamsCheckPermissionsForRepoLegacy = ( variables: TeamsCheckPermissionsForRepoLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsCheckPermissionsForRepoLegacyError, undefined, {}, {}, TeamsCheckPermissionsForRepoLegacyPathParams >({ url: '/teams/{teamId}/repos/{owner}/{repo}', method: 'get', ...variables, signal, }); /** * **Note**: Repositories inherited through a parent team will also be checked. * * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. * * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const useTeamsCheckPermissionsForRepoLegacy = ( variables: TeamsCheckPermissionsForRepoLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, TeamsCheckPermissionsForRepoLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, TeamsCheckPermissionsForRepoLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/repos/{owner}/{repo}', operationId: 'teamsCheckPermissionsForRepoLegacy', variables, }), ({ signal }) => fetchTeamsCheckPermissionsForRepoLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsAddOrUpdateRepoPermissionsLegacyPathParams = { teamId: number; owner: string; repo: string; }; export type TeamsAddOrUpdateRepoPermissionsLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsAddOrUpdateRepoPermissionsLegacyRequestBody = { /** * The permission to grant the team on this repository. Can be one of: * \* `pull` - team members can pull, but not push to or administer this repository. * \* `push` - team members can pull and push, but not administer this repository. * \* `admin` - team members can pull, push and administer this repository. * * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. */ permission?: 'pull' | 'push' | 'admin'; }; export type TeamsAddOrUpdateRepoPermissionsLegacyVariables = { body?: TeamsAddOrUpdateRepoPermissionsLegacyRequestBody; pathParams: TeamsAddOrUpdateRepoPermissionsLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. * * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchTeamsAddOrUpdateRepoPermissionsLegacy = ( variables: TeamsAddOrUpdateRepoPermissionsLegacyVariables, signal?: AbortSignal, ) => githubFetch< undefined, TeamsAddOrUpdateRepoPermissionsLegacyError, TeamsAddOrUpdateRepoPermissionsLegacyRequestBody, {}, {}, TeamsAddOrUpdateRepoPermissionsLegacyPathParams >({ url: '/teams/{teamId}/repos/{owner}/{repo}', method: 'put', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. * * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. * * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useTeamsAddOrUpdateRepoPermissionsLegacy = ( options?: Omit< reactQuery.UseMutationOptions< undefined, TeamsAddOrUpdateRepoPermissionsLegacyError, TeamsAddOrUpdateRepoPermissionsLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, TeamsAddOrUpdateRepoPermissionsLegacyError, TeamsAddOrUpdateRepoPermissionsLegacyVariables >( (variables: TeamsAddOrUpdateRepoPermissionsLegacyVariables) => fetchTeamsAddOrUpdateRepoPermissionsLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListIdpGroupsForLegacyPathParams = { teamId: number; }; export type TeamsListIdpGroupsForLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type TeamsListIdpGroupsForLegacyVariables = { pathParams: TeamsListIdpGroupsForLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List IdP groups for a team`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups connected to a team on GitHub. */ export const fetchTeamsListIdpGroupsForLegacy = ( variables: TeamsListIdpGroupsForLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GroupMapping, TeamsListIdpGroupsForLegacyError, undefined, {}, {}, TeamsListIdpGroupsForLegacyPathParams >({ url: '/teams/{teamId}/team-sync/group-mappings', method: 'get', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List IdP groups for a team`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * List IdP groups connected to a team on GitHub. */ export const useTeamsListIdpGroupsForLegacy = ( variables: TeamsListIdpGroupsForLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GroupMapping, TeamsListIdpGroupsForLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.GroupMapping, TeamsListIdpGroupsForLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/team-sync/group-mappings', operationId: 'teamsListIdpGroupsForLegacy', variables, }), ({ signal }) => fetchTeamsListIdpGroupsForLegacy( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyPathParams = { teamId: number; }; export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyRequestBody = { /** * The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. */ groups: { /** * @example "moar cheese pleese" */ description?: string; /** * Description of the IdP group. */ group_description: string; /** * ID of the IdP group. */ group_id: string; /** * Name of the IdP group. */ group_name: string; /** * @example "caceab43fc9ffa20081c" */ id?: string; /** * @example "external-team-6c13e7288ef7" */ name?: string; }[]; /** * @example "I am not a timestamp" */ synced_at?: string; }; export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyVariables = { body: TeamsCreateOrUpdateIdpGroupConnectionsLegacyRequestBody; pathParams: TeamsCreateOrUpdateIdpGroupConnectionsLegacyPathParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create or update IdP group connections`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. */ export const fetchTeamsCreateOrUpdateIdpGroupConnectionsLegacy = ( variables: TeamsCreateOrUpdateIdpGroupConnectionsLegacyVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsLegacyError, TeamsCreateOrUpdateIdpGroupConnectionsLegacyRequestBody, {}, {}, TeamsCreateOrUpdateIdpGroupConnectionsLegacyPathParams >({ url: '/teams/{teamId}/team-sync/group-mappings', method: 'patch', ...variables, signal, }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create or update IdP group connections`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. * * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. */ export const useTeamsCreateOrUpdateIdpGroupConnectionsLegacy = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsLegacyError, TeamsCreateOrUpdateIdpGroupConnectionsLegacyVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GroupMapping, TeamsCreateOrUpdateIdpGroupConnectionsLegacyError, TeamsCreateOrUpdateIdpGroupConnectionsLegacyVariables >( (variables: TeamsCreateOrUpdateIdpGroupConnectionsLegacyVariables) => fetchTeamsCreateOrUpdateIdpGroupConnectionsLegacy({ ...fetcherOptions, ...variables, }), options, ); }; export type TeamsListChildLegacyPathParams = { teamId: number; }; export type TeamsListChildLegacyQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListChildLegacyError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type TeamsListChildLegacyResponse = Schemas.Team[]; export type TeamsListChildLegacyVariables = { pathParams: TeamsListChildLegacyPathParams; queryParams?: TeamsListChildLegacyQueryParams; } & GithubContext['fetcherOptions']; /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. */ export const fetchTeamsListChildLegacy = ( variables: TeamsListChildLegacyVariables, signal?: AbortSignal, ) => githubFetch< TeamsListChildLegacyResponse, TeamsListChildLegacyError, undefined, {}, TeamsListChildLegacyQueryParams, TeamsListChildLegacyPathParams >({ url: '/teams/{teamId}/teams', method: 'get', ...variables, signal }); /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. */ export const useTeamsListChildLegacy = ( variables: TeamsListChildLegacyVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListChildLegacyResponse, TeamsListChildLegacyError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListChildLegacyResponse, TeamsListChildLegacyError, TData >( queryKeyFn({ path: '/teams/{team_id}/teams', operationId: 'teamsListChildLegacy', variables, }), ({ signal }) => fetchTeamsListChildLegacy({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersGetAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type UsersGetAuthenticatedVariables = GithubContext['fetcherOptions']; /** * If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information. * * If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information. */ export const fetchUsersGetAuthenticated = ( variables: UsersGetAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PrivateUser | Schemas.PublicUser, UsersGetAuthenticatedError, undefined, {}, {}, {} >({ url: '/user', method: 'get', ...variables, signal }); /** * If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information. * * If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information. */ export const useUsersGetAuthenticated = < TData = Schemas.PrivateUser | Schemas.PublicUser, >( variables: UsersGetAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PrivateUser | Schemas.PublicUser, UsersGetAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PrivateUser | Schemas.PublicUser, UsersGetAuthenticatedError, TData >( queryKeyFn({ path: '/user', operationId: 'usersGetAuthenticated', variables, }), ({ signal }) => fetchUsersGetAuthenticated({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersUpdateAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersUpdateAuthenticatedRequestBody = { /** * The new short biography of the user. */ bio?: string; /** * The new blog URL of the user. * * @example blog.example.com */ blog?: string; /** * The new company of the user. * * @example Acme corporation */ company?: string; /** * The publicly visible email address of the user. * * @example omar@example.com */ email?: string; /** * The new hiring availability of the user. */ hireable?: boolean; /** * The new location of the user. * * @example Berlin, Germany */ location?: string; /** * The new name of the user. * * @example Omar Jahandar */ name?: string; /** * The new Twitter username of the user. * * @example therealomarj */ twitter_username?: string | null; }; export type UsersUpdateAuthenticatedVariables = { body?: UsersUpdateAuthenticatedRequestBody; } & GithubContext['fetcherOptions']; /** * **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. */ export const fetchUsersUpdateAuthenticated = ( variables: UsersUpdateAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PrivateUser, UsersUpdateAuthenticatedError, UsersUpdateAuthenticatedRequestBody, {}, {}, {} >({ url: '/user', method: 'patch', ...variables, signal }); /** * **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. */ export const useUsersUpdateAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.PrivateUser, UsersUpdateAuthenticatedError, UsersUpdateAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.PrivateUser, UsersUpdateAuthenticatedError, UsersUpdateAuthenticatedVariables >( (variables: UsersUpdateAuthenticatedVariables) => fetchUsersUpdateAuthenticated({ ...fetcherOptions, ...variables }), options, ); }; export type UsersListBlockedByAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type UsersListBlockedByAuthenticatedResponse = Schemas.SimpleUser[]; export type UsersListBlockedByAuthenticatedVariables = GithubContext['fetcherOptions']; /** * List the users you've blocked on your personal account. */ export const fetchUsersListBlockedByAuthenticated = ( variables: UsersListBlockedByAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListBlockedByAuthenticatedResponse, UsersListBlockedByAuthenticatedError, undefined, {}, {}, {} >({ url: '/user/blocks', method: 'get', ...variables, signal }); /** * List the users you've blocked on your personal account. */ export const useUsersListBlockedByAuthenticated = < TData = UsersListBlockedByAuthenticatedResponse, >( variables: UsersListBlockedByAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListBlockedByAuthenticatedResponse, UsersListBlockedByAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListBlockedByAuthenticatedResponse, UsersListBlockedByAuthenticatedError, TData >( queryKeyFn({ path: '/user/blocks', operationId: 'usersListBlockedByAuthenticated', variables, }), ({ signal }) => fetchUsersListBlockedByAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersUnblockPathParams = { username: string; }; export type UsersUnblockError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersUnblockVariables = { pathParams: UsersUnblockPathParams; } & GithubContext['fetcherOptions']; export const fetchUsersUnblock = ( variables: UsersUnblockVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersUnblockError, undefined, {}, {}, UsersUnblockPathParams >({ url: '/user/blocks/{username}', method: 'delete', ...variables, signal }); export const useUsersUnblock = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersUnblockError, UsersUnblockVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersUnblockError, UsersUnblockVariables >( (variables: UsersUnblockVariables) => fetchUsersUnblock({ ...fetcherOptions, ...variables }), options, ); }; export type UsersCheckBlockedPathParams = { username: string; }; export type UsersCheckBlockedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Schemas.BasicError; } >; export type UsersCheckBlockedVariables = { pathParams: UsersCheckBlockedPathParams; } & GithubContext['fetcherOptions']; export const fetchUsersCheckBlocked = ( variables: UsersCheckBlockedVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersCheckBlockedError, undefined, {}, {}, UsersCheckBlockedPathParams >({ url: '/user/blocks/{username}', method: 'get', ...variables, signal }); export const useUsersCheckBlocked = ( variables: UsersCheckBlockedVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/user/blocks/{username}', operationId: 'usersCheckBlocked', variables, }), ({ signal }) => fetchUsersCheckBlocked({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersBlockPathParams = { username: string; }; export type UsersBlockError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersBlockVariables = { pathParams: UsersBlockPathParams; } & GithubContext['fetcherOptions']; export const fetchUsersBlock = ( variables: UsersBlockVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersBlockError, undefined, {}, {}, UsersBlockPathParams >({ url: '/user/blocks/{username}', method: 'put', ...variables, signal }); export const useUsersBlock = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersBlockError, UsersBlockVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersBlockError, UsersBlockVariables >( (variables: UsersBlockVariables) => fetchUsersBlock({ ...fetcherOptions, ...variables }), options, ); }; export type UsersSetPrimaryEmailVisibilityForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersSetPrimaryEmailVisibilityForAuthenticatedResponse = Schemas.Email[]; export type UsersSetPrimaryEmailVisibilityForAuthenticatedRequestBody = { /** * An email address associated with the GitHub user account to manage. * * @example org@example.com */ email: string; /** * Denotes whether an email is publically visible. */ visibility: 'public' | 'private'; }; export type UsersSetPrimaryEmailVisibilityForAuthenticatedVariables = { body: UsersSetPrimaryEmailVisibilityForAuthenticatedRequestBody; } & GithubContext['fetcherOptions']; /** * Sets the visibility for your primary email addresses. */ export const fetchUsersSetPrimaryEmailVisibilityForAuthenticated = ( variables: UsersSetPrimaryEmailVisibilityForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersSetPrimaryEmailVisibilityForAuthenticatedResponse, UsersSetPrimaryEmailVisibilityForAuthenticatedError, UsersSetPrimaryEmailVisibilityForAuthenticatedRequestBody, {}, {}, {} >({ url: '/user/email/visibility', method: 'patch', ...variables, signal }); /** * Sets the visibility for your primary email addresses. */ export const useUsersSetPrimaryEmailVisibilityForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< UsersSetPrimaryEmailVisibilityForAuthenticatedResponse, UsersSetPrimaryEmailVisibilityForAuthenticatedError, UsersSetPrimaryEmailVisibilityForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< UsersSetPrimaryEmailVisibilityForAuthenticatedResponse, UsersSetPrimaryEmailVisibilityForAuthenticatedError, UsersSetPrimaryEmailVisibilityForAuthenticatedVariables >( (variables: UsersSetPrimaryEmailVisibilityForAuthenticatedVariables) => fetchUsersSetPrimaryEmailVisibilityForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersDeleteEmailForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersDeleteEmailForAuthenticatedVariables = { body?: | { /** * Email addresses associated with the GitHub user account. */ emails: string[]; } | string[] | string; } & GithubContext['fetcherOptions']; /** * This endpoint is accessible with the `user` scope. */ export const fetchUsersDeleteEmailForAuthenticated = ( variables: UsersDeleteEmailForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersDeleteEmailForAuthenticatedError, | { /** * Email addresses associated with the GitHub user account. */ emails: string[]; } | string[] | string, {}, {}, {} >({ url: '/user/emails', method: 'delete', ...variables, signal }); /** * This endpoint is accessible with the `user` scope. */ export const useUsersDeleteEmailForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersDeleteEmailForAuthenticatedError, UsersDeleteEmailForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersDeleteEmailForAuthenticatedError, UsersDeleteEmailForAuthenticatedVariables >( (variables: UsersDeleteEmailForAuthenticatedVariables) => fetchUsersDeleteEmailForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersListEmailsForAuthenticatedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListEmailsForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersListEmailsForAuthenticatedResponse = Schemas.Email[]; export type UsersListEmailsForAuthenticatedVariables = { queryParams?: UsersListEmailsForAuthenticatedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. */ export const fetchUsersListEmailsForAuthenticated = ( variables: UsersListEmailsForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListEmailsForAuthenticatedResponse, UsersListEmailsForAuthenticatedError, undefined, {}, UsersListEmailsForAuthenticatedQueryParams, {} >({ url: '/user/emails', method: 'get', ...variables, signal }); /** * Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. */ export const useUsersListEmailsForAuthenticated = < TData = UsersListEmailsForAuthenticatedResponse, >( variables: UsersListEmailsForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListEmailsForAuthenticatedResponse, UsersListEmailsForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListEmailsForAuthenticatedResponse, UsersListEmailsForAuthenticatedError, TData >( queryKeyFn({ path: '/user/emails', operationId: 'usersListEmailsForAuthenticated', variables, }), ({ signal }) => fetchUsersListEmailsForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersAddEmailForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersAddEmailForAuthenticatedResponse = Schemas.Email[]; export type UsersAddEmailForAuthenticatedVariables = { body?: | { /** * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. */ emails: string[]; } | string[] | string; } & GithubContext['fetcherOptions']; /** * This endpoint is accessible with the `user` scope. */ export const fetchUsersAddEmailForAuthenticated = ( variables: UsersAddEmailForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersAddEmailForAuthenticatedResponse, UsersAddEmailForAuthenticatedError, | { /** * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. */ emails: string[]; } | string[] | string, {}, {}, {} >({ url: '/user/emails', method: 'post', ...variables, signal }); /** * This endpoint is accessible with the `user` scope. */ export const useUsersAddEmailForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< UsersAddEmailForAuthenticatedResponse, UsersAddEmailForAuthenticatedError, UsersAddEmailForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< UsersAddEmailForAuthenticatedResponse, UsersAddEmailForAuthenticatedError, UsersAddEmailForAuthenticatedVariables >( (variables: UsersAddEmailForAuthenticatedVariables) => fetchUsersAddEmailForAuthenticated({ ...fetcherOptions, ...variables }), options, ); }; export type UsersListFollowersForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListFollowersForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type UsersListFollowersForAuthenticatedUserResponse = Schemas.SimpleUser[]; export type UsersListFollowersForAuthenticatedUserVariables = { queryParams?: UsersListFollowersForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people following the authenticated user. */ export const fetchUsersListFollowersForAuthenticatedUser = ( variables: UsersListFollowersForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< UsersListFollowersForAuthenticatedUserResponse, UsersListFollowersForAuthenticatedUserError, undefined, {}, UsersListFollowersForAuthenticatedUserQueryParams, {} >({ url: '/user/followers', method: 'get', ...variables, signal }); /** * Lists the people following the authenticated user. */ export const useUsersListFollowersForAuthenticatedUser = < TData = UsersListFollowersForAuthenticatedUserResponse, >( variables: UsersListFollowersForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListFollowersForAuthenticatedUserResponse, UsersListFollowersForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListFollowersForAuthenticatedUserResponse, UsersListFollowersForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/followers', operationId: 'usersListFollowersForAuthenticatedUser', variables, }), ({ signal }) => fetchUsersListFollowersForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersListFollowedByAuthenticatedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListFollowedByAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type UsersListFollowedByAuthenticatedResponse = Schemas.SimpleUser[]; export type UsersListFollowedByAuthenticatedVariables = { queryParams?: UsersListFollowedByAuthenticatedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people who the authenticated user follows. */ export const fetchUsersListFollowedByAuthenticated = ( variables: UsersListFollowedByAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListFollowedByAuthenticatedResponse, UsersListFollowedByAuthenticatedError, undefined, {}, UsersListFollowedByAuthenticatedQueryParams, {} >({ url: '/user/following', method: 'get', ...variables, signal }); /** * Lists the people who the authenticated user follows. */ export const useUsersListFollowedByAuthenticated = < TData = UsersListFollowedByAuthenticatedResponse, >( variables: UsersListFollowedByAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListFollowedByAuthenticatedResponse, UsersListFollowedByAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListFollowedByAuthenticatedResponse, UsersListFollowedByAuthenticatedError, TData >( queryKeyFn({ path: '/user/following', operationId: 'usersListFollowedByAuthenticated', variables, }), ({ signal }) => fetchUsersListFollowedByAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersUnfollowPathParams = { username: string; }; export type UsersUnfollowError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersUnfollowVariables = { pathParams: UsersUnfollowPathParams; } & GithubContext['fetcherOptions']; /** * Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ export const fetchUsersUnfollow = ( variables: UsersUnfollowVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersUnfollowError, undefined, {}, {}, UsersUnfollowPathParams >({ url: '/user/following/{username}', method: 'delete', ...variables, signal, }); /** * Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ export const useUsersUnfollow = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersUnfollowError, UsersUnfollowVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersUnfollowError, UsersUnfollowVariables >( (variables: UsersUnfollowVariables) => fetchUsersUnfollow({ ...fetcherOptions, ...variables }), options, ); }; export type UsersCheckPersonIsFollowedByAuthenticatedPathParams = { username: string; }; export type UsersCheckPersonIsFollowedByAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Schemas.BasicError; } >; export type UsersCheckPersonIsFollowedByAuthenticatedVariables = { pathParams: UsersCheckPersonIsFollowedByAuthenticatedPathParams; } & GithubContext['fetcherOptions']; export const fetchUsersCheckPersonIsFollowedByAuthenticated = ( variables: UsersCheckPersonIsFollowedByAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersCheckPersonIsFollowedByAuthenticatedError, undefined, {}, {}, UsersCheckPersonIsFollowedByAuthenticatedPathParams >({ url: '/user/following/{username}', method: 'get', ...variables, signal }); export const useUsersCheckPersonIsFollowedByAuthenticated = ( variables: UsersCheckPersonIsFollowedByAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, UsersCheckPersonIsFollowedByAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, UsersCheckPersonIsFollowedByAuthenticatedError, TData >( queryKeyFn({ path: '/user/following/{username}', operationId: 'usersCheckPersonIsFollowedByAuthenticated', variables, }), ({ signal }) => fetchUsersCheckPersonIsFollowedByAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersFollowPathParams = { username: string; }; export type UsersFollowError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersFollowVariables = { pathParams: UsersFollowPathParams; } & GithubContext['fetcherOptions']; /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ export const fetchUsersFollow = ( variables: UsersFollowVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersFollowError, undefined, {}, {}, UsersFollowPathParams >({ url: '/user/following/{username}', method: 'put', ...variables, signal }); /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ export const useUsersFollow = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersFollowError, UsersFollowVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersFollowError, UsersFollowVariables >( (variables: UsersFollowVariables) => fetchUsersFollow({ ...fetcherOptions, ...variables }), options, ); }; export type UsersListGpgKeysForAuthenticatedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListGpgKeysForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersListGpgKeysForAuthenticatedResponse = Schemas.GpgKey[]; export type UsersListGpgKeysForAuthenticatedVariables = { queryParams?: UsersListGpgKeysForAuthenticatedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersListGpgKeysForAuthenticated = ( variables: UsersListGpgKeysForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListGpgKeysForAuthenticatedResponse, UsersListGpgKeysForAuthenticatedError, undefined, {}, UsersListGpgKeysForAuthenticatedQueryParams, {} >({ url: '/user/gpg_keys', method: 'get', ...variables, signal }); /** * Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersListGpgKeysForAuthenticated = < TData = UsersListGpgKeysForAuthenticatedResponse, >( variables: UsersListGpgKeysForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListGpgKeysForAuthenticatedResponse, UsersListGpgKeysForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListGpgKeysForAuthenticatedResponse, UsersListGpgKeysForAuthenticatedError, TData >( queryKeyFn({ path: '/user/gpg_keys', operationId: 'usersListGpgKeysForAuthenticated', variables, }), ({ signal }) => fetchUsersListGpgKeysForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersCreateGpgKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersCreateGpgKeyForAuthenticatedRequestBody = { /** * A GPG key in ASCII-armored format. */ armored_public_key: string; }; export type UsersCreateGpgKeyForAuthenticatedVariables = { body: UsersCreateGpgKeyForAuthenticatedRequestBody; } & GithubContext['fetcherOptions']; /** * Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersCreateGpgKeyForAuthenticated = ( variables: UsersCreateGpgKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GpgKey, UsersCreateGpgKeyForAuthenticatedError, UsersCreateGpgKeyForAuthenticatedRequestBody, {}, {}, {} >({ url: '/user/gpg_keys', method: 'post', ...variables, signal }); /** * Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersCreateGpgKeyForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.GpgKey, UsersCreateGpgKeyForAuthenticatedError, UsersCreateGpgKeyForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.GpgKey, UsersCreateGpgKeyForAuthenticatedError, UsersCreateGpgKeyForAuthenticatedVariables >( (variables: UsersCreateGpgKeyForAuthenticatedVariables) => fetchUsersCreateGpgKeyForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersDeleteGpgKeyForAuthenticatedPathParams = { /** * gpg_key_id parameter */ gpgKeyId: number; }; export type UsersDeleteGpgKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersDeleteGpgKeyForAuthenticatedVariables = { pathParams: UsersDeleteGpgKeyForAuthenticatedPathParams; } & GithubContext['fetcherOptions']; /** * Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersDeleteGpgKeyForAuthenticated = ( variables: UsersDeleteGpgKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersDeleteGpgKeyForAuthenticatedError, undefined, {}, {}, UsersDeleteGpgKeyForAuthenticatedPathParams >({ url: '/user/gpg_keys/{gpgKeyId}', method: 'delete', ...variables, signal, }); /** * Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersDeleteGpgKeyForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersDeleteGpgKeyForAuthenticatedError, UsersDeleteGpgKeyForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersDeleteGpgKeyForAuthenticatedError, UsersDeleteGpgKeyForAuthenticatedVariables >( (variables: UsersDeleteGpgKeyForAuthenticatedVariables) => fetchUsersDeleteGpgKeyForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersGetGpgKeyForAuthenticatedPathParams = { /** * gpg_key_id parameter */ gpgKeyId: number; }; export type UsersGetGpgKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersGetGpgKeyForAuthenticatedVariables = { pathParams: UsersGetGpgKeyForAuthenticatedPathParams; } & GithubContext['fetcherOptions']; /** * View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersGetGpgKeyForAuthenticated = ( variables: UsersGetGpgKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.GpgKey, UsersGetGpgKeyForAuthenticatedError, undefined, {}, {}, UsersGetGpgKeyForAuthenticatedPathParams >({ url: '/user/gpg_keys/{gpgKeyId}', method: 'get', ...variables, signal }); /** * View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersGetGpgKeyForAuthenticated = ( variables: UsersGetGpgKeyForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.GpgKey, UsersGetGpgKeyForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.GpgKey, UsersGetGpgKeyForAuthenticatedError, TData >( queryKeyFn({ path: '/user/gpg_keys/{gpg_key_id}', operationId: 'usersGetGpgKeyForAuthenticated', variables, }), ({ signal }) => fetchUsersGetGpgKeyForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListInstallationsForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListInstallationsForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 415; payload: Responses.PreviewHeaderMissing; } >; export type AppsListInstallationsForAuthenticatedUserResponse = { installations: Schemas.Installation[]; total_count: number; }; export type AppsListInstallationsForAuthenticatedUserVariables = { queryParams?: AppsListInstallationsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You can find the permissions for the installation under the `permissions` key. */ export const fetchAppsListInstallationsForAuthenticatedUser = ( variables: AppsListInstallationsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< AppsListInstallationsForAuthenticatedUserResponse, AppsListInstallationsForAuthenticatedUserError, undefined, {}, AppsListInstallationsForAuthenticatedUserQueryParams, {} >({ url: '/user/installations', method: 'get', ...variables, signal }); /** * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You can find the permissions for the installation under the `permissions` key. */ export const useAppsListInstallationsForAuthenticatedUser = < TData = AppsListInstallationsForAuthenticatedUserResponse, >( variables: AppsListInstallationsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListInstallationsForAuthenticatedUserResponse, AppsListInstallationsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListInstallationsForAuthenticatedUserResponse, AppsListInstallationsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/installations', operationId: 'appsListInstallationsForAuthenticatedUser', variables, }), ({ signal }) => fetchAppsListInstallationsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListInstallationReposForAuthenticatedUserPathParams = { /** * installation_id parameter */ installationId: number; }; export type AppsListInstallationReposForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListInstallationReposForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type AppsListInstallationReposForAuthenticatedUserResponse = { repositories: Schemas.Repository[]; repository_selection?: string; total_count: number; }; export type AppsListInstallationReposForAuthenticatedUserVariables = { pathParams: AppsListInstallationReposForAuthenticatedUserPathParams; queryParams?: AppsListInstallationReposForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The access the user has to each repository is included in the hash under the `permissions` key. */ export const fetchAppsListInstallationReposForAuthenticatedUser = ( variables: AppsListInstallationReposForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< AppsListInstallationReposForAuthenticatedUserResponse, AppsListInstallationReposForAuthenticatedUserError, undefined, {}, AppsListInstallationReposForAuthenticatedUserQueryParams, AppsListInstallationReposForAuthenticatedUserPathParams >({ url: '/user/installations/{installationId}/repositories', method: 'get', ...variables, signal, }); /** * List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The access the user has to each repository is included in the hash under the `permissions` key. */ export const useAppsListInstallationReposForAuthenticatedUser = < TData = AppsListInstallationReposForAuthenticatedUserResponse, >( variables: AppsListInstallationReposForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListInstallationReposForAuthenticatedUserResponse, AppsListInstallationReposForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListInstallationReposForAuthenticatedUserResponse, AppsListInstallationReposForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/installations/{installation_id}/repositories', operationId: 'appsListInstallationReposForAuthenticatedUser', variables, }), ({ signal }) => fetchAppsListInstallationReposForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsRemoveRepoFromInstallationPathParams = { /** * installation_id parameter */ installationId: number; repositoryId: number; }; export type AppsRemoveRepoFromInstallationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type AppsRemoveRepoFromInstallationVariables = { pathParams: AppsRemoveRepoFromInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Remove a single repository from an installation. The authenticated user must have admin access to the repository. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ export const fetchAppsRemoveRepoFromInstallation = ( variables: AppsRemoveRepoFromInstallationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsRemoveRepoFromInstallationError, undefined, {}, {}, AppsRemoveRepoFromInstallationPathParams >({ url: '/user/installations/{installationId}/repositories/{repositoryId}', method: 'delete', ...variables, signal, }); /** * Remove a single repository from an installation. The authenticated user must have admin access to the repository. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ export const useAppsRemoveRepoFromInstallation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsRemoveRepoFromInstallationError, AppsRemoveRepoFromInstallationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsRemoveRepoFromInstallationError, AppsRemoveRepoFromInstallationVariables >( (variables: AppsRemoveRepoFromInstallationVariables) => fetchAppsRemoveRepoFromInstallation({ ...fetcherOptions, ...variables }), options, ); }; export type AppsAddRepoToInstallationPathParams = { /** * installation_id parameter */ installationId: number; repositoryId: number; }; export type AppsAddRepoToInstallationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type AppsAddRepoToInstallationVariables = { pathParams: AppsAddRepoToInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Add a single repository to an installation. The authenticated user must have admin access to the repository. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ export const fetchAppsAddRepoToInstallation = ( variables: AppsAddRepoToInstallationVariables, signal?: AbortSignal, ) => githubFetch< undefined, AppsAddRepoToInstallationError, undefined, {}, {}, AppsAddRepoToInstallationPathParams >({ url: '/user/installations/{installationId}/repositories/{repositoryId}', method: 'put', ...variables, signal, }); /** * Add a single repository to an installation. The authenticated user must have admin access to the repository. * * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ export const useAppsAddRepoToInstallation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, AppsAddRepoToInstallationError, AppsAddRepoToInstallationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, AppsAddRepoToInstallationError, AppsAddRepoToInstallationVariables >( (variables: AppsAddRepoToInstallationVariables) => fetchAppsAddRepoToInstallation({ ...fetcherOptions, ...variables }), options, ); }; export type InteractionsRemoveRestrictionsForAuthenticatedUserError = Fetcher.ErrorWrapper; export type InteractionsRemoveRestrictionsForAuthenticatedUserVariables = GithubContext['fetcherOptions']; /** * Removes any interaction restrictions from your public repositories. */ export const fetchInteractionsRemoveRestrictionsForAuthenticatedUser = ( variables: InteractionsRemoveRestrictionsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, InteractionsRemoveRestrictionsForAuthenticatedUserError, undefined, {}, {}, {} >({ url: '/user/interaction-limits', method: 'delete', ...variables, signal, }); /** * Removes any interaction restrictions from your public repositories. */ export const useInteractionsRemoveRestrictionsForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, InteractionsRemoveRestrictionsForAuthenticatedUserError, InteractionsRemoveRestrictionsForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, InteractionsRemoveRestrictionsForAuthenticatedUserError, InteractionsRemoveRestrictionsForAuthenticatedUserVariables >( (variables: InteractionsRemoveRestrictionsForAuthenticatedUserVariables) => fetchInteractionsRemoveRestrictionsForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type InteractionsGetRestrictionsForAuthenticatedUserError = Fetcher.ErrorWrapper; export type InteractionsGetRestrictionsForAuthenticatedUserVariables = GithubContext['fetcherOptions']; /** * Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. */ export const fetchInteractionsGetRestrictionsForAuthenticatedUser = ( variables: InteractionsGetRestrictionsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForAuthenticatedUserError, undefined, {}, {}, {} >({ url: '/user/interaction-limits', method: 'get', ...variables, signal }); /** * Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. */ export const useInteractionsGetRestrictionsForAuthenticatedUser = < TData = Schemas.InteractionLimitResponse, >( variables: InteractionsGetRestrictionsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.InteractionLimitResponse, InteractionsGetRestrictionsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/interaction-limits', operationId: 'interactionsGetRestrictionsForAuthenticatedUser', variables, }), ({ signal }) => fetchInteractionsGetRestrictionsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type InteractionsSetRestrictionsForAuthenticatedUserError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type InteractionsSetRestrictionsForAuthenticatedUserVariables = { body: Schemas.InteractionLimit; } & GithubContext['fetcherOptions']; /** * Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. */ export const fetchInteractionsSetRestrictionsForAuthenticatedUser = ( variables: InteractionsSetRestrictionsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForAuthenticatedUserError, Schemas.InteractionLimit, {}, {}, {} >({ url: '/user/interaction-limits', method: 'put', ...variables, signal }); /** * Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. */ export const useInteractionsSetRestrictionsForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForAuthenticatedUserError, InteractionsSetRestrictionsForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.InteractionLimitResponse, InteractionsSetRestrictionsForAuthenticatedUserError, InteractionsSetRestrictionsForAuthenticatedUserVariables >( (variables: InteractionsSetRestrictionsForAuthenticatedUserVariables) => fetchInteractionsSetRestrictionsForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type IssuesListForAuthenticatedUserQueryParams = { /** * Indicates which sorts of issues to return. Can be one of: * \* `assigned`: Issues assigned to you * \* `created`: Issues created by you * \* `mentioned`: Issues mentioning you * \* `subscribed`: Issues you're subscribed to updates for * \* `all`: All issues the authenticated user can see, regardless of participation or creation * * @default assigned */ filter?: | 'assigned' | 'created' | 'mentioned' | 'subscribed' | 'repos' | 'all'; /** * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * A list of comma separated label names. Example: `bug,ui,@high` */ labels?: string; /** * What to sort results by. Can be either `created`, `updated`, `comments`. * * @default created */ sort?: 'created' | 'updated' | 'comments'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type IssuesListForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 404; payload: Responses.NotFound; } >; export type IssuesListForAuthenticatedUserResponse = Schemas.Issue[]; export type IssuesListForAuthenticatedUserVariables = { queryParams?: IssuesListForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List issues across owned and member repositories assigned to the authenticated user. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const fetchIssuesListForAuthenticatedUser = ( variables: IssuesListForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< IssuesListForAuthenticatedUserResponse, IssuesListForAuthenticatedUserError, undefined, {}, IssuesListForAuthenticatedUserQueryParams, {} >({ url: '/user/issues', method: 'get', ...variables, signal }); /** * List issues across owned and member repositories assigned to the authenticated user. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ export const useIssuesListForAuthenticatedUser = < TData = IssuesListForAuthenticatedUserResponse, >( variables: IssuesListForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< IssuesListForAuthenticatedUserResponse, IssuesListForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< IssuesListForAuthenticatedUserResponse, IssuesListForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/issues', operationId: 'issuesListForAuthenticatedUser', variables, }), ({ signal }) => fetchIssuesListForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersListPublicSshKeysForAuthenticatedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListPublicSshKeysForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersListPublicSshKeysForAuthenticatedResponse = Schemas.Key[]; export type UsersListPublicSshKeysForAuthenticatedVariables = { queryParams?: UsersListPublicSshKeysForAuthenticatedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersListPublicSshKeysForAuthenticated = ( variables: UsersListPublicSshKeysForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListPublicSshKeysForAuthenticatedResponse, UsersListPublicSshKeysForAuthenticatedError, undefined, {}, UsersListPublicSshKeysForAuthenticatedQueryParams, {} >({ url: '/user/keys', method: 'get', ...variables, signal }); /** * Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersListPublicSshKeysForAuthenticated = < TData = UsersListPublicSshKeysForAuthenticatedResponse, >( variables: UsersListPublicSshKeysForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListPublicSshKeysForAuthenticatedResponse, UsersListPublicSshKeysForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListPublicSshKeysForAuthenticatedResponse, UsersListPublicSshKeysForAuthenticatedError, TData >( queryKeyFn({ path: '/user/keys', operationId: 'usersListPublicSshKeysForAuthenticated', variables, }), ({ signal }) => fetchUsersListPublicSshKeysForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersCreatePublicSshKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersCreatePublicSshKeyForAuthenticatedRequestBody = { /** * The public SSH key to add to your GitHub account. * * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) */ key: string; /** * A descriptive name for the new key. * * @example Personal MacBook Air */ title?: string; }; export type UsersCreatePublicSshKeyForAuthenticatedVariables = { body: UsersCreatePublicSshKeyForAuthenticatedRequestBody; } & GithubContext['fetcherOptions']; /** * Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersCreatePublicSshKeyForAuthenticated = ( variables: UsersCreatePublicSshKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Key, UsersCreatePublicSshKeyForAuthenticatedError, UsersCreatePublicSshKeyForAuthenticatedRequestBody, {}, {}, {} >({ url: '/user/keys', method: 'post', ...variables, signal }); /** * Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersCreatePublicSshKeyForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Key, UsersCreatePublicSshKeyForAuthenticatedError, UsersCreatePublicSshKeyForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Key, UsersCreatePublicSshKeyForAuthenticatedError, UsersCreatePublicSshKeyForAuthenticatedVariables >( (variables: UsersCreatePublicSshKeyForAuthenticatedVariables) => fetchUsersCreatePublicSshKeyForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersDeletePublicSshKeyForAuthenticatedPathParams = { /** * key_id parameter */ keyId: number; }; export type UsersDeletePublicSshKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersDeletePublicSshKeyForAuthenticatedVariables = { pathParams: UsersDeletePublicSshKeyForAuthenticatedPathParams; } & GithubContext['fetcherOptions']; /** * Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersDeletePublicSshKeyForAuthenticated = ( variables: UsersDeletePublicSshKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersDeletePublicSshKeyForAuthenticatedError, undefined, {}, {}, UsersDeletePublicSshKeyForAuthenticatedPathParams >({ url: '/user/keys/{keyId}', method: 'delete', ...variables, signal }); /** * Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersDeletePublicSshKeyForAuthenticated = ( options?: Omit< reactQuery.UseMutationOptions< undefined, UsersDeletePublicSshKeyForAuthenticatedError, UsersDeletePublicSshKeyForAuthenticatedVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, UsersDeletePublicSshKeyForAuthenticatedError, UsersDeletePublicSshKeyForAuthenticatedVariables >( (variables: UsersDeletePublicSshKeyForAuthenticatedVariables) => fetchUsersDeletePublicSshKeyForAuthenticated({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersGetPublicSshKeyForAuthenticatedPathParams = { /** * key_id parameter */ keyId: number; }; export type UsersGetPublicSshKeyForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersGetPublicSshKeyForAuthenticatedVariables = { pathParams: UsersGetPublicSshKeyForAuthenticatedPathParams; } & GithubContext['fetcherOptions']; /** * View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const fetchUsersGetPublicSshKeyForAuthenticated = ( variables: UsersGetPublicSshKeyForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Key, UsersGetPublicSshKeyForAuthenticatedError, undefined, {}, {}, UsersGetPublicSshKeyForAuthenticatedPathParams >({ url: '/user/keys/{keyId}', method: 'get', ...variables, signal }); /** * View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ export const useUsersGetPublicSshKeyForAuthenticated = ( variables: UsersGetPublicSshKeyForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Key, UsersGetPublicSshKeyForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Key, UsersGetPublicSshKeyForAuthenticatedError, TData >( queryKeyFn({ path: '/user/keys/{key_id}', operationId: 'usersGetPublicSshKeyForAuthenticated', variables, }), ({ signal }) => fetchUsersGetPublicSshKeyForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListSubscriptionsForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListSubscriptionsForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 404; payload: Responses.NotFound; } >; export type AppsListSubscriptionsForAuthenticatedUserResponse = Schemas.UserMarketplacePurchase[]; export type AppsListSubscriptionsForAuthenticatedUserVariables = { queryParams?: AppsListSubscriptionsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ export const fetchAppsListSubscriptionsForAuthenticatedUser = ( variables: AppsListSubscriptionsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< AppsListSubscriptionsForAuthenticatedUserResponse, AppsListSubscriptionsForAuthenticatedUserError, undefined, {}, AppsListSubscriptionsForAuthenticatedUserQueryParams, {} >({ url: '/user/marketplace_purchases', method: 'get', ...variables, signal, }); /** * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ export const useAppsListSubscriptionsForAuthenticatedUser = < TData = AppsListSubscriptionsForAuthenticatedUserResponse, >( variables: AppsListSubscriptionsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListSubscriptionsForAuthenticatedUserResponse, AppsListSubscriptionsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListSubscriptionsForAuthenticatedUserResponse, AppsListSubscriptionsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/marketplace_purchases', operationId: 'appsListSubscriptionsForAuthenticatedUser', variables, }), ({ signal }) => fetchAppsListSubscriptionsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type AppsListSubscriptionsForAuthenticatedUserStubbedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type AppsListSubscriptionsForAuthenticatedUserStubbedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } >; export type AppsListSubscriptionsForAuthenticatedUserStubbedResponse = Schemas.UserMarketplacePurchase[]; export type AppsListSubscriptionsForAuthenticatedUserStubbedVariables = { queryParams?: AppsListSubscriptionsForAuthenticatedUserStubbedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ export const fetchAppsListSubscriptionsForAuthenticatedUserStubbed = ( variables: AppsListSubscriptionsForAuthenticatedUserStubbedVariables, signal?: AbortSignal, ) => githubFetch< AppsListSubscriptionsForAuthenticatedUserStubbedResponse, AppsListSubscriptionsForAuthenticatedUserStubbedError, undefined, {}, AppsListSubscriptionsForAuthenticatedUserStubbedQueryParams, {} >({ url: '/user/marketplace_purchases/stubbed', method: 'get', ...variables, signal, }); /** * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ export const useAppsListSubscriptionsForAuthenticatedUserStubbed = < TData = AppsListSubscriptionsForAuthenticatedUserStubbedResponse, >( variables: AppsListSubscriptionsForAuthenticatedUserStubbedVariables, options?: Omit< reactQuery.UseQueryOptions< AppsListSubscriptionsForAuthenticatedUserStubbedResponse, AppsListSubscriptionsForAuthenticatedUserStubbedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< AppsListSubscriptionsForAuthenticatedUserStubbedResponse, AppsListSubscriptionsForAuthenticatedUserStubbedError, TData >( queryKeyFn({ path: '/user/marketplace_purchases/stubbed', operationId: 'appsListSubscriptionsForAuthenticatedUserStubbed', variables, }), ({ signal }) => fetchAppsListSubscriptionsForAuthenticatedUserStubbed( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListMembershipsForAuthenticatedUserQueryParams = { /** * Indicates the state of the memberships to return. Can be either `active` or `pending`. If not specified, the API returns both active and pending memberships. */ state?: 'active' | 'pending'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListMembershipsForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsListMembershipsForAuthenticatedUserResponse = Schemas.OrgMembership[]; export type OrgsListMembershipsForAuthenticatedUserVariables = { queryParams?: OrgsListMembershipsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; export const fetchOrgsListMembershipsForAuthenticatedUser = ( variables: OrgsListMembershipsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< OrgsListMembershipsForAuthenticatedUserResponse, OrgsListMembershipsForAuthenticatedUserError, undefined, {}, OrgsListMembershipsForAuthenticatedUserQueryParams, {} >({ url: '/user/memberships/orgs', method: 'get', ...variables, signal }); export const useOrgsListMembershipsForAuthenticatedUser = < TData = OrgsListMembershipsForAuthenticatedUserResponse, >( variables: OrgsListMembershipsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListMembershipsForAuthenticatedUserResponse, OrgsListMembershipsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListMembershipsForAuthenticatedUserResponse, OrgsListMembershipsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/memberships/orgs', operationId: 'orgsListMembershipsForAuthenticatedUser', variables, }), ({ signal }) => fetchOrgsListMembershipsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsGetMembershipForAuthenticatedUserPathParams = { org: string; }; export type OrgsGetMembershipForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type OrgsGetMembershipForAuthenticatedUserVariables = { pathParams: OrgsGetMembershipForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsGetMembershipForAuthenticatedUser = ( variables: OrgsGetMembershipForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgMembership, OrgsGetMembershipForAuthenticatedUserError, undefined, {}, {}, OrgsGetMembershipForAuthenticatedUserPathParams >({ url: '/user/memberships/orgs/{org}', method: 'get', ...variables, signal, }); export const useOrgsGetMembershipForAuthenticatedUser = < TData = Schemas.OrgMembership, >( variables: OrgsGetMembershipForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.OrgMembership, OrgsGetMembershipForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.OrgMembership, OrgsGetMembershipForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/memberships/orgs/{org}', operationId: 'orgsGetMembershipForAuthenticatedUser', variables, }), ({ signal }) => fetchOrgsGetMembershipForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsUpdateMembershipForAuthenticatedUserPathParams = { org: string; }; export type OrgsUpdateMembershipForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type OrgsUpdateMembershipForAuthenticatedUserRequestBody = { /** * The state that the membership should be in. Only `"active"` will be accepted. */ state: 'active'; }; export type OrgsUpdateMembershipForAuthenticatedUserVariables = { body: OrgsUpdateMembershipForAuthenticatedUserRequestBody; pathParams: OrgsUpdateMembershipForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchOrgsUpdateMembershipForAuthenticatedUser = ( variables: OrgsUpdateMembershipForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.OrgMembership, OrgsUpdateMembershipForAuthenticatedUserError, OrgsUpdateMembershipForAuthenticatedUserRequestBody, {}, {}, OrgsUpdateMembershipForAuthenticatedUserPathParams >({ url: '/user/memberships/orgs/{org}', method: 'patch', ...variables, signal, }); export const useOrgsUpdateMembershipForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.OrgMembership, OrgsUpdateMembershipForAuthenticatedUserError, OrgsUpdateMembershipForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.OrgMembership, OrgsUpdateMembershipForAuthenticatedUserError, OrgsUpdateMembershipForAuthenticatedUserVariables >( (variables: OrgsUpdateMembershipForAuthenticatedUserVariables) => fetchOrgsUpdateMembershipForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type MigrationsListForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type MigrationsListForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type MigrationsListForAuthenticatedUserResponse = Schemas.Migration[]; export type MigrationsListForAuthenticatedUserVariables = { queryParams?: MigrationsListForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all migrations a user has started. */ export const fetchMigrationsListForAuthenticatedUser = ( variables: MigrationsListForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< MigrationsListForAuthenticatedUserResponse, MigrationsListForAuthenticatedUserError, undefined, {}, MigrationsListForAuthenticatedUserQueryParams, {} >({ url: '/user/migrations', method: 'get', ...variables, signal }); /** * Lists all migrations a user has started. */ export const useMigrationsListForAuthenticatedUser = < TData = MigrationsListForAuthenticatedUserResponse, >( variables: MigrationsListForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsListForAuthenticatedUserResponse, MigrationsListForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsListForAuthenticatedUserResponse, MigrationsListForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/migrations', operationId: 'migrationsListForAuthenticatedUser', variables, }), ({ signal }) => fetchMigrationsListForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsStartForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type MigrationsStartForAuthenticatedUserRequestBody = { /** * Exclude attributes from the API response to improve performance * * @example repositories */ exclude?: 'repositories'[]; /** * Do not include attachments in the migration * * @example true */ exclude_attachments?: boolean; /** * Lock the repositories being migrated at the start of the migration * * @example true */ lock_repositories?: boolean; repositories: string[]; }; export type MigrationsStartForAuthenticatedUserVariables = { body: MigrationsStartForAuthenticatedUserRequestBody; } & GithubContext['fetcherOptions']; /** * Initiates the generation of a user migration archive. */ export const fetchMigrationsStartForAuthenticatedUser = ( variables: MigrationsStartForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Migration, MigrationsStartForAuthenticatedUserError, MigrationsStartForAuthenticatedUserRequestBody, {}, {}, {} >({ url: '/user/migrations', method: 'post', ...variables, signal }); /** * Initiates the generation of a user migration archive. */ export const useMigrationsStartForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Migration, MigrationsStartForAuthenticatedUserError, MigrationsStartForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Migration, MigrationsStartForAuthenticatedUserError, MigrationsStartForAuthenticatedUserVariables >( (variables: MigrationsStartForAuthenticatedUserVariables) => fetchMigrationsStartForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type MigrationsGetStatusForAuthenticatedUserPathParams = { /** * migration_id parameter */ migrationId: number; }; export type MigrationsGetStatusForAuthenticatedUserQueryParams = { exclude?: string[]; }; export type MigrationsGetStatusForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type MigrationsGetStatusForAuthenticatedUserVariables = { pathParams: MigrationsGetStatusForAuthenticatedUserPathParams; queryParams?: MigrationsGetStatusForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values: * * * `pending` - the migration hasn't started yet. * * `exporting` - the migration is in progress. * * `exported` - the migration finished successfully. * * `failed` - the migration failed. * * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). */ export const fetchMigrationsGetStatusForAuthenticatedUser = ( variables: MigrationsGetStatusForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Migration, MigrationsGetStatusForAuthenticatedUserError, undefined, {}, MigrationsGetStatusForAuthenticatedUserQueryParams, MigrationsGetStatusForAuthenticatedUserPathParams >({ url: '/user/migrations/{migrationId}', method: 'get', ...variables, signal, }); /** * Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values: * * * `pending` - the migration hasn't started yet. * * `exporting` - the migration is in progress. * * `exported` - the migration finished successfully. * * `failed` - the migration failed. * * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). */ export const useMigrationsGetStatusForAuthenticatedUser = < TData = Schemas.Migration, >( variables: MigrationsGetStatusForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Migration, MigrationsGetStatusForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Migration, MigrationsGetStatusForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/migrations/{migration_id}', operationId: 'migrationsGetStatusForAuthenticatedUser', variables, }), ({ signal }) => fetchMigrationsGetStatusForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsDeleteArchiveForAuthenticatedUserPathParams = { /** * migration_id parameter */ migrationId: number; }; export type MigrationsDeleteArchiveForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type MigrationsDeleteArchiveForAuthenticatedUserVariables = { pathParams: MigrationsDeleteArchiveForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ export const fetchMigrationsDeleteArchiveForAuthenticatedUser = ( variables: MigrationsDeleteArchiveForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsDeleteArchiveForAuthenticatedUserError, undefined, {}, {}, MigrationsDeleteArchiveForAuthenticatedUserPathParams >({ url: '/user/migrations/{migrationId}/archive', method: 'delete', ...variables, signal, }); /** * Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ export const useMigrationsDeleteArchiveForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MigrationsDeleteArchiveForAuthenticatedUserError, MigrationsDeleteArchiveForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MigrationsDeleteArchiveForAuthenticatedUserError, MigrationsDeleteArchiveForAuthenticatedUserVariables >( (variables: MigrationsDeleteArchiveForAuthenticatedUserVariables) => fetchMigrationsDeleteArchiveForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type MigrationsGetArchiveForAuthenticatedUserPathParams = { /** * migration_id parameter */ migrationId: number; }; export type MigrationsGetArchiveForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type MigrationsGetArchiveForAuthenticatedUserVariables = { pathParams: MigrationsGetArchiveForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * * * attachments * * bases * * commit\_comments * * issue\_comments * * issue\_events * * issues * * milestones * * organizations * * projects * * protected\_branches * * pull\_request\_reviews * * pull\_requests * * releases * * repositories * * review\_comments * * schema * * users * * The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. */ export const fetchMigrationsGetArchiveForAuthenticatedUser = ( variables: MigrationsGetArchiveForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsGetArchiveForAuthenticatedUserError, undefined, {}, {}, MigrationsGetArchiveForAuthenticatedUserPathParams >({ url: '/user/migrations/{migrationId}/archive', method: 'get', ...variables, signal, }); /** * Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * * * attachments * * bases * * commit\_comments * * issue\_comments * * issue\_events * * issues * * milestones * * organizations * * projects * * protected\_branches * * pull\_request\_reviews * * pull\_requests * * releases * * repositories * * review\_comments * * schema * * users * * The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. */ export const useMigrationsGetArchiveForAuthenticatedUser = ( variables: MigrationsGetArchiveForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, MigrationsGetArchiveForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, MigrationsGetArchiveForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/migrations/{migration_id}/archive', operationId: 'migrationsGetArchiveForAuthenticatedUser', variables, }), ({ signal }) => fetchMigrationsGetArchiveForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MigrationsUnlockRepoForAuthenticatedUserPathParams = { /** * migration_id parameter */ migrationId: number; /** * repo_name parameter */ repoName: string; }; export type MigrationsUnlockRepoForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type MigrationsUnlockRepoForAuthenticatedUserVariables = { pathParams: MigrationsUnlockRepoForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ export const fetchMigrationsUnlockRepoForAuthenticatedUser = ( variables: MigrationsUnlockRepoForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, MigrationsUnlockRepoForAuthenticatedUserError, undefined, {}, {}, MigrationsUnlockRepoForAuthenticatedUserPathParams >({ url: '/user/migrations/{migrationId}/repos/{repoName}/lock', method: 'delete', ...variables, signal, }); /** * Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ export const useMigrationsUnlockRepoForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, MigrationsUnlockRepoForAuthenticatedUserError, MigrationsUnlockRepoForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, MigrationsUnlockRepoForAuthenticatedUserError, MigrationsUnlockRepoForAuthenticatedUserVariables >( (variables: MigrationsUnlockRepoForAuthenticatedUserVariables) => fetchMigrationsUnlockRepoForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type MigrationsListReposForUserPathParams = { /** * migration_id parameter */ migrationId: number; }; export type MigrationsListReposForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type MigrationsListReposForUserError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type MigrationsListReposForUserResponse = Schemas.MinimalRepository[]; export type MigrationsListReposForUserVariables = { pathParams: MigrationsListReposForUserPathParams; queryParams?: MigrationsListReposForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all the repositories for this user migration. */ export const fetchMigrationsListReposForUser = ( variables: MigrationsListReposForUserVariables, signal?: AbortSignal, ) => githubFetch< MigrationsListReposForUserResponse, MigrationsListReposForUserError, undefined, {}, MigrationsListReposForUserQueryParams, MigrationsListReposForUserPathParams >({ url: '/user/migrations/{migrationId}/repositories', method: 'get', ...variables, signal, }); /** * Lists all the repositories for this user migration. */ export const useMigrationsListReposForUser = < TData = MigrationsListReposForUserResponse, >( variables: MigrationsListReposForUserVariables, options?: Omit< reactQuery.UseQueryOptions< MigrationsListReposForUserResponse, MigrationsListReposForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< MigrationsListReposForUserResponse, MigrationsListReposForUserError, TData >( queryKeyFn({ path: '/user/migrations/{migration_id}/repositories', operationId: 'migrationsListReposForUser', variables, }), ({ signal }) => fetchMigrationsListReposForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type OrgsListForAuthenticatedUserResponse = Schemas.OrganizationSimple[]; export type OrgsListForAuthenticatedUserVariables = { queryParams?: OrgsListForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List organizations for the authenticated user. * * **OAuth scope requirements** * * This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. */ export const fetchOrgsListForAuthenticatedUser = ( variables: OrgsListForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< OrgsListForAuthenticatedUserResponse, OrgsListForAuthenticatedUserError, undefined, {}, OrgsListForAuthenticatedUserQueryParams, {} >({ url: '/user/orgs', method: 'get', ...variables, signal }); /** * List organizations for the authenticated user. * * **OAuth scope requirements** * * This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. */ export const useOrgsListForAuthenticatedUser = < TData = OrgsListForAuthenticatedUserResponse, >( variables: OrgsListForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListForAuthenticatedUserResponse, OrgsListForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListForAuthenticatedUserResponse, OrgsListForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/orgs', operationId: 'orgsListForAuthenticatedUser', variables, }), ({ signal }) => fetchOrgsListForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesDeletePackageForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; }; export type PackagesDeletePackageForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesDeletePackageForAuthenticatedUserVariables = { pathParams: PackagesDeletePackageForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesDeletePackageForAuthenticatedUser = ( variables: PackagesDeletePackageForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesDeletePackageForAuthenticatedUserError, undefined, {}, {}, PackagesDeletePackageForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}', method: 'delete', ...variables, signal, }); /** * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesDeletePackageForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesDeletePackageForAuthenticatedUserError, PackagesDeletePackageForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesDeletePackageForAuthenticatedUserError, PackagesDeletePackageForAuthenticatedUserVariables >( (variables: PackagesDeletePackageForAuthenticatedUserVariables) => fetchPackagesDeletePackageForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type PackagesGetPackageForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; }; export type PackagesGetPackageForAuthenticatedUserError = Fetcher.ErrorWrapper; export type PackagesGetPackageForAuthenticatedUserVariables = { pathParams: PackagesGetPackageForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageForAuthenticatedUser = ( variables: PackagesGetPackageForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Package, PackagesGetPackageForAuthenticatedUserError, undefined, {}, {}, PackagesGetPackageForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}', method: 'get', ...variables, signal, }); /** * Gets a specific package for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageForAuthenticatedUser = < TData = Schemas.Package, >( variables: PackagesGetPackageForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Package, PackagesGetPackageForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Package, PackagesGetPackageForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/packages/{package_type}/{package_name}', operationId: 'packagesGetPackageForAuthenticatedUser', variables, }), ({ signal }) => fetchPackagesGetPackageForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesRestorePackageForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; }; export type PackagesRestorePackageForAuthenticatedUserQueryParams = { /** * package token */ token?: string; }; export type PackagesRestorePackageForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesRestorePackageForAuthenticatedUserVariables = { pathParams: PackagesRestorePackageForAuthenticatedUserPathParams; queryParams?: PackagesRestorePackageForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Restores a package owned by the authenticated user. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scope. If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesRestorePackageForAuthenticatedUser = ( variables: PackagesRestorePackageForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesRestorePackageForAuthenticatedUserError, undefined, {}, PackagesRestorePackageForAuthenticatedUserQueryParams, PackagesRestorePackageForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}/restore', method: 'post', ...variables, signal, }); /** * Restores a package owned by the authenticated user. * * You can restore a deleted package under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scope. If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesRestorePackageForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesRestorePackageForAuthenticatedUserError, PackagesRestorePackageForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesRestorePackageForAuthenticatedUserError, PackagesRestorePackageForAuthenticatedUserVariables >( (variables: PackagesRestorePackageForAuthenticatedUserVariables) => fetchPackagesRestorePackageForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: | 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; }; export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQueryParams = { /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * The state of the package, either active or deleted. * * @default active */ state?: 'active' | 'deleted'; }; export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse = Schemas.PackageVersion[]; export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserVariables = { pathParams: PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserPathParams; queryParams?: PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Returns all package versions for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser = ( variables: PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserError, undefined, {}, PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQueryParams, PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}/versions', method: 'get', ...variables, signal, }); /** * Returns all package versions for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser = < TData = PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse, >( variables: PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/packages/{package_type}/{package_name}/versions', operationId: 'packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser', variables, }), ({ signal }) => fetchPackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesDeletePackageVersionForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesDeletePackageVersionForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesDeletePackageVersionForAuthenticatedUserVariables = { pathParams: PackagesDeletePackageVersionForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesDeletePackageVersionForAuthenticatedUser = ( variables: PackagesDeletePackageVersionForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesDeletePackageVersionForAuthenticatedUserError, undefined, {}, {}, PackagesDeletePackageVersionForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}/versions/{packageVersionId}', method: 'delete', ...variables, signal, }); /** * Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. * * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesDeletePackageVersionForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesDeletePackageVersionForAuthenticatedUserError, PackagesDeletePackageVersionForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesDeletePackageVersionForAuthenticatedUserError, PackagesDeletePackageVersionForAuthenticatedUserVariables >( (variables: PackagesDeletePackageVersionForAuthenticatedUserVariables) => fetchPackagesDeletePackageVersionForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type PackagesGetPackageVersionForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesGetPackageVersionForAuthenticatedUserError = Fetcher.ErrorWrapper; export type PackagesGetPackageVersionForAuthenticatedUserVariables = { pathParams: PackagesGetPackageVersionForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package version for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageVersionForAuthenticatedUser = ( variables: PackagesGetPackageVersionForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackageVersion, PackagesGetPackageVersionForAuthenticatedUserError, undefined, {}, {}, PackagesGetPackageVersionForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}/versions/{packageVersionId}', method: 'get', ...variables, signal, }); /** * Gets a specific package version for a package owned by the authenticated user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageVersionForAuthenticatedUser = < TData = Schemas.PackageVersion, >( variables: PackagesGetPackageVersionForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackageVersion, PackagesGetPackageVersionForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackageVersion, PackagesGetPackageVersionForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/packages/{package_type}/{package_name}/versions/{package_version_id}', operationId: 'packagesGetPackageVersionForAuthenticatedUser', variables, }), ({ signal }) => fetchPackagesGetPackageVersionForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesRestorePackageVersionForAuthenticatedUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; /** * Unique identifier of the package version. */ packageVersionId: number; }; export type PackagesRestorePackageVersionForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesRestorePackageVersionForAuthenticatedUserVariables = { pathParams: PackagesRestorePackageVersionForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Restores a package version owned by the authenticated user. * * You can restore a deleted package version under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scope. If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesRestorePackageVersionForAuthenticatedUser = ( variables: PackagesRestorePackageVersionForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, PackagesRestorePackageVersionForAuthenticatedUserError, undefined, {}, {}, PackagesRestorePackageVersionForAuthenticatedUserPathParams >({ url: '/user/packages/{packageType}/{packageName}/versions/{packageVersionId}/restore', method: 'post', ...variables, signal, }); /** * Restores a package version owned by the authenticated user. * * You can restore a deleted package version under the following conditions: * - The package was deleted within the last 30 days. * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. * * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scope. If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesRestorePackageVersionForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, PackagesRestorePackageVersionForAuthenticatedUserError, PackagesRestorePackageVersionForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, PackagesRestorePackageVersionForAuthenticatedUserError, PackagesRestorePackageVersionForAuthenticatedUserVariables >( (variables: PackagesRestorePackageVersionForAuthenticatedUserVariables) => fetchPackagesRestorePackageVersionForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type ProjectsCreateForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailedSimple; } >; export type ProjectsCreateForAuthenticatedUserRequestBody = { /** * Body of the project * * @example This project represents the sprint of the first week in January */ body?: string | null; /** * Name of the project * * @example Week One Sprint */ name: string; }; export type ProjectsCreateForAuthenticatedUserVariables = { body: ProjectsCreateForAuthenticatedUserRequestBody; } & GithubContext['fetcherOptions']; export const fetchProjectsCreateForAuthenticatedUser = ( variables: ProjectsCreateForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Project, ProjectsCreateForAuthenticatedUserError, ProjectsCreateForAuthenticatedUserRequestBody, {}, {}, {} >({ url: '/user/projects', method: 'post', ...variables, signal }); export const useProjectsCreateForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Project, ProjectsCreateForAuthenticatedUserError, ProjectsCreateForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Project, ProjectsCreateForAuthenticatedUserError, ProjectsCreateForAuthenticatedUserVariables >( (variables: ProjectsCreateForAuthenticatedUserVariables) => fetchProjectsCreateForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type UsersListPublicEmailsForAuthenticatedQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListPublicEmailsForAuthenticatedError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type UsersListPublicEmailsForAuthenticatedResponse = Schemas.Email[]; export type UsersListPublicEmailsForAuthenticatedVariables = { queryParams?: UsersListPublicEmailsForAuthenticatedQueryParams; } & GithubContext['fetcherOptions']; /** * Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ export const fetchUsersListPublicEmailsForAuthenticated = ( variables: UsersListPublicEmailsForAuthenticatedVariables, signal?: AbortSignal, ) => githubFetch< UsersListPublicEmailsForAuthenticatedResponse, UsersListPublicEmailsForAuthenticatedError, undefined, {}, UsersListPublicEmailsForAuthenticatedQueryParams, {} >({ url: '/user/public_emails', method: 'get', ...variables, signal }); /** * Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ export const useUsersListPublicEmailsForAuthenticated = < TData = UsersListPublicEmailsForAuthenticatedResponse, >( variables: UsersListPublicEmailsForAuthenticatedVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListPublicEmailsForAuthenticatedResponse, UsersListPublicEmailsForAuthenticatedError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListPublicEmailsForAuthenticatedResponse, UsersListPublicEmailsForAuthenticatedError, TData >( queryKeyFn({ path: '/user/public_emails', operationId: 'usersListPublicEmailsForAuthenticated', variables, }), ({ signal }) => fetchUsersListPublicEmailsForAuthenticated( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListForAuthenticatedUserQueryParams = { /** * Can be one of `all`, `public`, or `private`. Note: For GitHub AE, can be one of `all`, `internal`, or `private`. * * @default all */ visibility?: 'all' | 'public' | 'private'; /** * Comma-separated list of values. Can include: * \* `owner`: Repositories that are owned by the authenticated user. * \* `collaborator`: Repositories that the user has been added to as a collaborator. * \* `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. * * @default owner,collaborator,organization_member */ affiliation?: string; /** * Can be one of `all`, `owner`, `public`, `private`, `member`. Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`, `member`. Default: `all` * * Will cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. * * @default all */ type?: 'all' | 'owner' | 'public' | 'private' | 'member'; /** * Can be one of `created`, `updated`, `pushed`, `full_name`. * * @default full_name */ sort?: 'created' | 'updated' | 'pushed' | 'full_name'; /** * Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ before?: string; }; export type ReposListForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposListForAuthenticatedUserResponse = Schemas.Repository[]; export type ReposListForAuthenticatedUserVariables = { queryParams?: ReposListForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. */ export const fetchReposListForAuthenticatedUser = ( variables: ReposListForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ReposListForAuthenticatedUserResponse, ReposListForAuthenticatedUserError, undefined, {}, ReposListForAuthenticatedUserQueryParams, {} >({ url: '/user/repos', method: 'get', ...variables, signal }); /** * Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. */ export const useReposListForAuthenticatedUser = < TData = ReposListForAuthenticatedUserResponse, >( variables: ReposListForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListForAuthenticatedUserResponse, ReposListForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListForAuthenticatedUserResponse, ReposListForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/repos', operationId: 'reposListForAuthenticatedUser', variables, }), ({ signal }) => fetchReposListForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposCreateForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 400; payload: Responses.BadRequest; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ReposCreateForAuthenticatedUserRequestBody = { /** * Whether to allow merge commits for pull requests. * * @default true * @example true */ allow_merge_commit?: boolean; /** * Whether to allow rebase merges for pull requests. * * @default true * @example true */ allow_rebase_merge?: boolean; /** * Whether to allow squash merges for pull requests. * * @default true * @example true */ allow_squash_merge?: boolean; /** * Whether the repository is initialized with a minimal README. * * @default false */ auto_init?: boolean; /** * Whether to delete head branches when pull requests are merged * * @default false * @example false */ delete_branch_on_merge?: boolean; /** * A short description of the repository. */ description?: string; /** * The desired language or platform to apply to the .gitignore. * * @example Haskell */ gitignore_template?: string; /** * Whether downloads are enabled. * * @default true * @example true */ has_downloads?: boolean; /** * Whether issues are enabled. * * @default true * @example true */ has_issues?: boolean; /** * Whether projects are enabled. * * @default true * @example true */ has_projects?: boolean; /** * Whether the wiki is enabled. * * @default true * @example true */ has_wiki?: boolean; /** * A URL with more information about the repository. */ homepage?: string; /** * Whether this repository acts as a template that can be used to generate new repositories. * * @default false * @example true */ is_template?: boolean; /** * The license keyword of the open source license for this repository. * * @example mit */ license_template?: string; /** * The name of the repository. * * @example Team Environment */ name: string; /** * Whether the repository is private. * * @default false */ private?: boolean; /** * The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ team_id?: number; }; export type ReposCreateForAuthenticatedUserVariables = { body: ReposCreateForAuthenticatedUserRequestBody; } & GithubContext['fetcherOptions']; /** * Creates a new repository for the authenticated user. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository. */ export const fetchReposCreateForAuthenticatedUser = ( variables: ReposCreateForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Repository, ReposCreateForAuthenticatedUserError, ReposCreateForAuthenticatedUserRequestBody, {}, {}, {} >({ url: '/user/repos', method: 'post', ...variables, signal }); /** * Creates a new repository for the authenticated user. * * **OAuth scope requirements** * * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository. */ export const useReposCreateForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< Schemas.Repository, ReposCreateForAuthenticatedUserError, ReposCreateForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< Schemas.Repository, ReposCreateForAuthenticatedUserError, ReposCreateForAuthenticatedUserVariables >( (variables: ReposCreateForAuthenticatedUserVariables) => fetchReposCreateForAuthenticatedUser({ ...fetcherOptions, ...variables }), options, ); }; export type ReposListInvitationsForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListInvitationsForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ReposListInvitationsForAuthenticatedUserResponse = Schemas.RepositoryInvitation[]; export type ReposListInvitationsForAuthenticatedUserVariables = { queryParams?: ReposListInvitationsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * When authenticating as a user, this endpoint will list all currently open repository invitations for that user. */ export const fetchReposListInvitationsForAuthenticatedUser = ( variables: ReposListInvitationsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ReposListInvitationsForAuthenticatedUserResponse, ReposListInvitationsForAuthenticatedUserError, undefined, {}, ReposListInvitationsForAuthenticatedUserQueryParams, {} >({ url: '/user/repository_invitations', method: 'get', ...variables, signal, }); /** * When authenticating as a user, this endpoint will list all currently open repository invitations for that user. */ export const useReposListInvitationsForAuthenticatedUser = < TData = ReposListInvitationsForAuthenticatedUserResponse, >( variables: ReposListInvitationsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListInvitationsForAuthenticatedUserResponse, ReposListInvitationsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListInvitationsForAuthenticatedUserResponse, ReposListInvitationsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/repository_invitations', operationId: 'reposListInvitationsForAuthenticatedUser', variables, }), ({ signal }) => fetchReposListInvitationsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposDeclineInvitationPathParams = { /** * invitation_id parameter */ invitationId: number; }; export type ReposDeclineInvitationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } >; export type ReposDeclineInvitationVariables = { pathParams: ReposDeclineInvitationPathParams; } & GithubContext['fetcherOptions']; export const fetchReposDeclineInvitation = ( variables: ReposDeclineInvitationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposDeclineInvitationError, undefined, {}, {}, ReposDeclineInvitationPathParams >({ url: '/user/repository_invitations/{invitationId}', method: 'delete', ...variables, signal, }); export const useReposDeclineInvitation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposDeclineInvitationError, ReposDeclineInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposDeclineInvitationError, ReposDeclineInvitationVariables >( (variables: ReposDeclineInvitationVariables) => fetchReposDeclineInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type ReposAcceptInvitationPathParams = { /** * invitation_id parameter */ invitationId: number; }; export type ReposAcceptInvitationError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } | { status: 409; payload: Responses.Conflict; } >; export type ReposAcceptInvitationVariables = { pathParams: ReposAcceptInvitationPathParams; } & GithubContext['fetcherOptions']; export const fetchReposAcceptInvitation = ( variables: ReposAcceptInvitationVariables, signal?: AbortSignal, ) => githubFetch< undefined, ReposAcceptInvitationError, undefined, {}, {}, ReposAcceptInvitationPathParams >({ url: '/user/repository_invitations/{invitationId}', method: 'patch', ...variables, signal, }); export const useReposAcceptInvitation = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ReposAcceptInvitationError, ReposAcceptInvitationVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ReposAcceptInvitationError, ReposAcceptInvitationVariables >( (variables: ReposAcceptInvitationVariables) => fetchReposAcceptInvitation({ ...fetcherOptions, ...variables }), options, ); }; export type ActivityListReposStarredByAuthenticatedUserQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListReposStarredByAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityListReposStarredByAuthenticatedUserResponse = Schemas.Repository[]; export type ActivityListReposStarredByAuthenticatedUserVariables = { queryParams?: ActivityListReposStarredByAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories the authenticated user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const fetchActivityListReposStarredByAuthenticatedUser = ( variables: ActivityListReposStarredByAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListReposStarredByAuthenticatedUserResponse, ActivityListReposStarredByAuthenticatedUserError, undefined, {}, ActivityListReposStarredByAuthenticatedUserQueryParams, {} >({ url: '/user/starred', method: 'get', ...variables, signal }); /** * Lists repositories the authenticated user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const useActivityListReposStarredByAuthenticatedUser = < TData = ActivityListReposStarredByAuthenticatedUserResponse, >( variables: ActivityListReposStarredByAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListReposStarredByAuthenticatedUserResponse, ActivityListReposStarredByAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListReposStarredByAuthenticatedUserResponse, ActivityListReposStarredByAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/starred', operationId: 'activityListReposStarredByAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListReposStarredByAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityUnstarRepoForAuthenticatedUserPathParams = { owner: string; repo: string; }; export type ActivityUnstarRepoForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ActivityUnstarRepoForAuthenticatedUserVariables = { pathParams: ActivityUnstarRepoForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchActivityUnstarRepoForAuthenticatedUser = ( variables: ActivityUnstarRepoForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityUnstarRepoForAuthenticatedUserError, undefined, {}, {}, ActivityUnstarRepoForAuthenticatedUserPathParams >({ url: '/user/starred/{owner}/{repo}', method: 'delete', ...variables, signal, }); export const useActivityUnstarRepoForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityUnstarRepoForAuthenticatedUserError, ActivityUnstarRepoForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityUnstarRepoForAuthenticatedUserError, ActivityUnstarRepoForAuthenticatedUserVariables >( (variables: ActivityUnstarRepoForAuthenticatedUserVariables) => fetchActivityUnstarRepoForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type ActivityCheckRepoIsStarredByAuthenticatedUserPathParams = { owner: string; repo: string; }; export type ActivityCheckRepoIsStarredByAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Schemas.BasicError; } >; export type ActivityCheckRepoIsStarredByAuthenticatedUserVariables = { pathParams: ActivityCheckRepoIsStarredByAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; export const fetchActivityCheckRepoIsStarredByAuthenticatedUser = ( variables: ActivityCheckRepoIsStarredByAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityCheckRepoIsStarredByAuthenticatedUserError, undefined, {}, {}, ActivityCheckRepoIsStarredByAuthenticatedUserPathParams >({ url: '/user/starred/{owner}/{repo}', method: 'get', ...variables, signal, }); export const useActivityCheckRepoIsStarredByAuthenticatedUser = < TData = undefined, >( variables: ActivityCheckRepoIsStarredByAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, ActivityCheckRepoIsStarredByAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< undefined, ActivityCheckRepoIsStarredByAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/starred/{owner}/{repo}', operationId: 'activityCheckRepoIsStarredByAuthenticatedUser', variables, }), ({ signal }) => fetchActivityCheckRepoIsStarredByAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityStarRepoForAuthenticatedUserPathParams = { owner: string; repo: string; }; export type ActivityStarRepoForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type ActivityStarRepoForAuthenticatedUserVariables = { pathParams: ActivityStarRepoForAuthenticatedUserPathParams; } & GithubContext['fetcherOptions']; /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const fetchActivityStarRepoForAuthenticatedUser = ( variables: ActivityStarRepoForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, ActivityStarRepoForAuthenticatedUserError, undefined, {}, {}, ActivityStarRepoForAuthenticatedUserPathParams >({ url: '/user/starred/{owner}/{repo}', method: 'put', ...variables, signal, }); /** * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ export const useActivityStarRepoForAuthenticatedUser = ( options?: Omit< reactQuery.UseMutationOptions< undefined, ActivityStarRepoForAuthenticatedUserError, ActivityStarRepoForAuthenticatedUserVariables >, 'mutationFn' >, ) => { const { fetcherOptions } = useGithubContext(); return reactQuery.useMutation< undefined, ActivityStarRepoForAuthenticatedUserError, ActivityStarRepoForAuthenticatedUserVariables >( (variables: ActivityStarRepoForAuthenticatedUserVariables) => fetchActivityStarRepoForAuthenticatedUser({ ...fetcherOptions, ...variables, }), options, ); }; export type ActivityListWatchedReposForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListWatchedReposForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } >; export type ActivityListWatchedReposForAuthenticatedUserResponse = Schemas.MinimalRepository[]; export type ActivityListWatchedReposForAuthenticatedUserVariables = { queryParams?: ActivityListWatchedReposForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories the authenticated user is watching. */ export const fetchActivityListWatchedReposForAuthenticatedUser = ( variables: ActivityListWatchedReposForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListWatchedReposForAuthenticatedUserResponse, ActivityListWatchedReposForAuthenticatedUserError, undefined, {}, ActivityListWatchedReposForAuthenticatedUserQueryParams, {} >({ url: '/user/subscriptions', method: 'get', ...variables, signal }); /** * Lists repositories the authenticated user is watching. */ export const useActivityListWatchedReposForAuthenticatedUser = < TData = ActivityListWatchedReposForAuthenticatedUserResponse, >( variables: ActivityListWatchedReposForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListWatchedReposForAuthenticatedUserResponse, ActivityListWatchedReposForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListWatchedReposForAuthenticatedUserResponse, ActivityListWatchedReposForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/subscriptions', operationId: 'activityListWatchedReposForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListWatchedReposForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type TeamsListForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type TeamsListForAuthenticatedUserError = Fetcher.ErrorWrapper< | { status: 304; payload: Responses.NotModified; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type TeamsListForAuthenticatedUserResponse = Schemas.TeamFull[]; export type TeamsListForAuthenticatedUserVariables = { queryParams?: TeamsListForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). */ export const fetchTeamsListForAuthenticatedUser = ( variables: TeamsListForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< TeamsListForAuthenticatedUserResponse, TeamsListForAuthenticatedUserError, undefined, {}, TeamsListForAuthenticatedUserQueryParams, {} >({ url: '/user/teams', method: 'get', ...variables, signal }); /** * List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). */ export const useTeamsListForAuthenticatedUser = < TData = TeamsListForAuthenticatedUserResponse, >( variables: TeamsListForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< TeamsListForAuthenticatedUserResponse, TeamsListForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< TeamsListForAuthenticatedUserResponse, TeamsListForAuthenticatedUserError, TData >( queryKeyFn({ path: '/user/teams', operationId: 'teamsListForAuthenticatedUser', variables, }), ({ signal }) => fetchTeamsListForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersListQueryParams = { /** * A user ID. Only return users with an ID greater than this ID. */ since?: number; /** * Results per page (max 100). * * @default 30 */ per_page?: number; }; export type UsersListError = Fetcher.ErrorWrapper<{ status: 304; payload: Responses.NotModified; }>; export type UsersListResponse = Schemas.SimpleUser[]; export type UsersListVariables = { queryParams?: UsersListQueryParams; } & GithubContext['fetcherOptions']; /** * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. * * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. */ export const fetchUsersList = ( variables: UsersListVariables, signal?: AbortSignal, ) => githubFetch< UsersListResponse, UsersListError, undefined, {}, UsersListQueryParams, {} >({ url: '/users', method: 'get', ...variables, signal }); /** * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. * * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. */ export const useUsersList = ( variables: UsersListVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/users', operationId: 'usersList', variables }), ({ signal }) => fetchUsersList({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersGetByUsernamePathParams = { username: string; }; export type UsersGetByUsernameError = Fetcher.ErrorWrapper<{ status: 404; payload: Responses.NotFound; }>; export type UsersGetByUsernameVariables = { pathParams: UsersGetByUsernamePathParams; } & GithubContext['fetcherOptions']; /** * Provides publicly available information about someone with a GitHub account. * * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" * * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). * * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". */ export const fetchUsersGetByUsername = ( variables: UsersGetByUsernameVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PrivateUser | Schemas.PublicUser, UsersGetByUsernameError, undefined, {}, {}, UsersGetByUsernamePathParams >({ url: '/users/{username}', method: 'get', ...variables, signal }); /** * Provides publicly available information about someone with a GitHub account. * * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" * * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). * * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". */ export const useUsersGetByUsername = < TData = Schemas.PrivateUser | Schemas.PublicUser, >( variables: UsersGetByUsernameVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PrivateUser | Schemas.PublicUser, UsersGetByUsernameError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PrivateUser | Schemas.PublicUser, UsersGetByUsernameError, TData >( queryKeyFn({ path: '/users/{username}', operationId: 'usersGetByUsername', variables, }), ({ signal }) => fetchUsersGetByUsername({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActivityListEventsForAuthenticatedUserPathParams = { username: string; }; export type ActivityListEventsForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListEventsForAuthenticatedUserError = Fetcher.ErrorWrapper; export type ActivityListEventsForAuthenticatedUserResponse = Schemas.Event[]; export type ActivityListEventsForAuthenticatedUserVariables = { pathParams: ActivityListEventsForAuthenticatedUserPathParams; queryParams?: ActivityListEventsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. */ export const fetchActivityListEventsForAuthenticatedUser = ( variables: ActivityListEventsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListEventsForAuthenticatedUserResponse, ActivityListEventsForAuthenticatedUserError, undefined, {}, ActivityListEventsForAuthenticatedUserQueryParams, ActivityListEventsForAuthenticatedUserPathParams >({ url: '/users/{username}/events', method: 'get', ...variables, signal }); /** * If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. */ export const useActivityListEventsForAuthenticatedUser = < TData = ActivityListEventsForAuthenticatedUserResponse, >( variables: ActivityListEventsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListEventsForAuthenticatedUserResponse, ActivityListEventsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListEventsForAuthenticatedUserResponse, ActivityListEventsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/users/{username}/events', operationId: 'activityListEventsForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListEventsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListOrgEventsForAuthenticatedUserPathParams = { username: string; org: string; }; export type ActivityListOrgEventsForAuthenticatedUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListOrgEventsForAuthenticatedUserError = Fetcher.ErrorWrapper; export type ActivityListOrgEventsForAuthenticatedUserResponse = Schemas.Event[]; export type ActivityListOrgEventsForAuthenticatedUserVariables = { pathParams: ActivityListOrgEventsForAuthenticatedUserPathParams; queryParams?: ActivityListOrgEventsForAuthenticatedUserQueryParams; } & GithubContext['fetcherOptions']; /** * This is the user's organization dashboard. You must be authenticated as the user to view this. */ export const fetchActivityListOrgEventsForAuthenticatedUser = ( variables: ActivityListOrgEventsForAuthenticatedUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListOrgEventsForAuthenticatedUserResponse, ActivityListOrgEventsForAuthenticatedUserError, undefined, {}, ActivityListOrgEventsForAuthenticatedUserQueryParams, ActivityListOrgEventsForAuthenticatedUserPathParams >({ url: '/users/{username}/events/orgs/{org}', method: 'get', ...variables, signal, }); /** * This is the user's organization dashboard. You must be authenticated as the user to view this. */ export const useActivityListOrgEventsForAuthenticatedUser = < TData = ActivityListOrgEventsForAuthenticatedUserResponse, >( variables: ActivityListOrgEventsForAuthenticatedUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListOrgEventsForAuthenticatedUserResponse, ActivityListOrgEventsForAuthenticatedUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListOrgEventsForAuthenticatedUserResponse, ActivityListOrgEventsForAuthenticatedUserError, TData >( queryKeyFn({ path: '/users/{username}/events/orgs/{org}', operationId: 'activityListOrgEventsForAuthenticatedUser', variables, }), ({ signal }) => fetchActivityListOrgEventsForAuthenticatedUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListPublicEventsForUserPathParams = { username: string; }; export type ActivityListPublicEventsForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListPublicEventsForUserError = Fetcher.ErrorWrapper; export type ActivityListPublicEventsForUserResponse = Schemas.Event[]; export type ActivityListPublicEventsForUserVariables = { pathParams: ActivityListPublicEventsForUserPathParams; queryParams?: ActivityListPublicEventsForUserQueryParams; } & GithubContext['fetcherOptions']; export const fetchActivityListPublicEventsForUser = ( variables: ActivityListPublicEventsForUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListPublicEventsForUserResponse, ActivityListPublicEventsForUserError, undefined, {}, ActivityListPublicEventsForUserQueryParams, ActivityListPublicEventsForUserPathParams >({ url: '/users/{username}/events/public', method: 'get', ...variables, signal, }); export const useActivityListPublicEventsForUser = < TData = ActivityListPublicEventsForUserResponse, >( variables: ActivityListPublicEventsForUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListPublicEventsForUserResponse, ActivityListPublicEventsForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListPublicEventsForUserResponse, ActivityListPublicEventsForUserError, TData >( queryKeyFn({ path: '/users/{username}/events/public', operationId: 'activityListPublicEventsForUser', variables, }), ({ signal }) => fetchActivityListPublicEventsForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersListFollowersForUserPathParams = { username: string; }; export type UsersListFollowersForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListFollowersForUserError = Fetcher.ErrorWrapper; export type UsersListFollowersForUserResponse = Schemas.SimpleUser[]; export type UsersListFollowersForUserVariables = { pathParams: UsersListFollowersForUserPathParams; queryParams?: UsersListFollowersForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people following the specified user. */ export const fetchUsersListFollowersForUser = ( variables: UsersListFollowersForUserVariables, signal?: AbortSignal, ) => githubFetch< UsersListFollowersForUserResponse, UsersListFollowersForUserError, undefined, {}, UsersListFollowersForUserQueryParams, UsersListFollowersForUserPathParams >({ url: '/users/{username}/followers', method: 'get', ...variables, signal, }); /** * Lists the people following the specified user. */ export const useUsersListFollowersForUser = < TData = UsersListFollowersForUserResponse, >( variables: UsersListFollowersForUserVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListFollowersForUserResponse, UsersListFollowersForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListFollowersForUserResponse, UsersListFollowersForUserError, TData >( queryKeyFn({ path: '/users/{username}/followers', operationId: 'usersListFollowersForUser', variables, }), ({ signal }) => fetchUsersListFollowersForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersListFollowingForUserPathParams = { username: string; }; export type UsersListFollowingForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListFollowingForUserError = Fetcher.ErrorWrapper; export type UsersListFollowingForUserResponse = Schemas.SimpleUser[]; export type UsersListFollowingForUserVariables = { pathParams: UsersListFollowingForUserPathParams; queryParams?: UsersListFollowingForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the people who the specified user follows. */ export const fetchUsersListFollowingForUser = ( variables: UsersListFollowingForUserVariables, signal?: AbortSignal, ) => githubFetch< UsersListFollowingForUserResponse, UsersListFollowingForUserError, undefined, {}, UsersListFollowingForUserQueryParams, UsersListFollowingForUserPathParams >({ url: '/users/{username}/following', method: 'get', ...variables, signal, }); /** * Lists the people who the specified user follows. */ export const useUsersListFollowingForUser = < TData = UsersListFollowingForUserResponse, >( variables: UsersListFollowingForUserVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListFollowingForUserResponse, UsersListFollowingForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListFollowingForUserResponse, UsersListFollowingForUserError, TData >( queryKeyFn({ path: '/users/{username}/following', operationId: 'usersListFollowingForUser', variables, }), ({ signal }) => fetchUsersListFollowingForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type UsersCheckFollowingForUserPathParams = { username: string; targetUser: string; }; export type UsersCheckFollowingForUserError = Fetcher.ErrorWrapper; export type UsersCheckFollowingForUserVariables = { pathParams: UsersCheckFollowingForUserPathParams; } & GithubContext['fetcherOptions']; export const fetchUsersCheckFollowingForUser = ( variables: UsersCheckFollowingForUserVariables, signal?: AbortSignal, ) => githubFetch< undefined, UsersCheckFollowingForUserError, undefined, {}, {}, UsersCheckFollowingForUserPathParams >({ url: '/users/{username}/following/{targetUser}', method: 'get', ...variables, signal, }); export const useUsersCheckFollowingForUser = ( variables: UsersCheckFollowingForUserVariables, options?: Omit< reactQuery.UseQueryOptions< undefined, UsersCheckFollowingForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/users/{username}/following/{target_user}', operationId: 'usersCheckFollowingForUser', variables, }), ({ signal }) => fetchUsersCheckFollowingForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type GistsListForUserPathParams = { username: string; }; export type GistsListForUserQueryParams = { /** * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type GistsListForUserError = Fetcher.ErrorWrapper<{ status: 422; payload: Responses.ValidationFailed; }>; export type GistsListForUserResponse = Schemas.BaseGist[]; export type GistsListForUserVariables = { pathParams: GistsListForUserPathParams; queryParams?: GistsListForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists public gists for the specified user: */ export const fetchGistsListForUser = ( variables: GistsListForUserVariables, signal?: AbortSignal, ) => githubFetch< GistsListForUserResponse, GistsListForUserError, undefined, {}, GistsListForUserQueryParams, GistsListForUserPathParams >({ url: '/users/{username}/gists', method: 'get', ...variables, signal }); /** * Lists public gists for the specified user: */ export const useGistsListForUser = ( variables: GistsListForUserVariables, options?: Omit< reactQuery.UseQueryOptions< GistsListForUserResponse, GistsListForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< GistsListForUserResponse, GistsListForUserError, TData >( queryKeyFn({ path: '/users/{username}/gists', operationId: 'gistsListForUser', variables, }), ({ signal }) => fetchGistsListForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersListGpgKeysForUserPathParams = { username: string; }; export type UsersListGpgKeysForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListGpgKeysForUserError = Fetcher.ErrorWrapper; export type UsersListGpgKeysForUserResponse = Schemas.GpgKey[]; export type UsersListGpgKeysForUserVariables = { pathParams: UsersListGpgKeysForUserPathParams; queryParams?: UsersListGpgKeysForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the GPG keys for a user. This information is accessible by anyone. */ export const fetchUsersListGpgKeysForUser = ( variables: UsersListGpgKeysForUserVariables, signal?: AbortSignal, ) => githubFetch< UsersListGpgKeysForUserResponse, UsersListGpgKeysForUserError, undefined, {}, UsersListGpgKeysForUserQueryParams, UsersListGpgKeysForUserPathParams >({ url: '/users/{username}/gpg_keys', method: 'get', ...variables, signal }); /** * Lists the GPG keys for a user. This information is accessible by anyone. */ export const useUsersListGpgKeysForUser = < TData = UsersListGpgKeysForUserResponse, >( variables: UsersListGpgKeysForUserVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListGpgKeysForUserResponse, UsersListGpgKeysForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListGpgKeysForUserResponse, UsersListGpgKeysForUserError, TData >( queryKeyFn({ path: '/users/{username}/gpg_keys', operationId: 'usersListGpgKeysForUser', variables, }), ({ signal }) => fetchUsersListGpgKeysForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersGetContextForUserPathParams = { username: string; }; export type UsersGetContextForUserQueryParams = { /** * Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. */ subject_type?: 'organization' | 'repository' | 'issue' | 'pull_request'; /** * Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. */ subject_id?: string; }; export type UsersGetContextForUserError = Fetcher.ErrorWrapper< | { status: 404; payload: Responses.NotFound; } | { status: 422; payload: Responses.ValidationFailed; } >; export type UsersGetContextForUserVariables = { pathParams: UsersGetContextForUserPathParams; queryParams?: UsersGetContextForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. * * The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this: * * ```shell * curl -u username:token * https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 * ``` */ export const fetchUsersGetContextForUser = ( variables: UsersGetContextForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Hovercard, UsersGetContextForUserError, undefined, {}, UsersGetContextForUserQueryParams, UsersGetContextForUserPathParams >({ url: '/users/{username}/hovercard', method: 'get', ...variables, signal, }); /** * Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. * * The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this: * * ```shell * curl -u username:token * https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 * ``` */ export const useUsersGetContextForUser = ( variables: UsersGetContextForUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Hovercard, UsersGetContextForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Hovercard, UsersGetContextForUserError, TData >( queryKeyFn({ path: '/users/{username}/hovercard', operationId: 'usersGetContextForUser', variables, }), ({ signal }) => fetchUsersGetContextForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type AppsGetUserInstallationPathParams = { username: string; }; export type AppsGetUserInstallationError = Fetcher.ErrorWrapper; export type AppsGetUserInstallationVariables = { pathParams: AppsGetUserInstallationPathParams; } & GithubContext['fetcherOptions']; /** * Enables an authenticated GitHub App to find the user’s installation information. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const fetchAppsGetUserInstallation = ( variables: AppsGetUserInstallationVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Installation, AppsGetUserInstallationError, undefined, {}, {}, AppsGetUserInstallationPathParams >({ url: '/users/{username}/installation', method: 'get', ...variables, signal, }); /** * Enables an authenticated GitHub App to find the user’s installation information. * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ export const useAppsGetUserInstallation = ( variables: AppsGetUserInstallationVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Installation, AppsGetUserInstallationError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Installation, AppsGetUserInstallationError, TData >( queryKeyFn({ path: '/users/{username}/installation', operationId: 'appsGetUserInstallation', variables, }), ({ signal }) => fetchAppsGetUserInstallation({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type UsersListPublicKeysForUserPathParams = { username: string; }; export type UsersListPublicKeysForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type UsersListPublicKeysForUserError = Fetcher.ErrorWrapper; export type UsersListPublicKeysForUserResponse = Schemas.KeySimple[]; export type UsersListPublicKeysForUserVariables = { pathParams: UsersListPublicKeysForUserPathParams; queryParams?: UsersListPublicKeysForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists the _verified_ public SSH keys for a user. This is accessible by anyone. */ export const fetchUsersListPublicKeysForUser = ( variables: UsersListPublicKeysForUserVariables, signal?: AbortSignal, ) => githubFetch< UsersListPublicKeysForUserResponse, UsersListPublicKeysForUserError, undefined, {}, UsersListPublicKeysForUserQueryParams, UsersListPublicKeysForUserPathParams >({ url: '/users/{username}/keys', method: 'get', ...variables, signal }); /** * Lists the _verified_ public SSH keys for a user. This is accessible by anyone. */ export const useUsersListPublicKeysForUser = < TData = UsersListPublicKeysForUserResponse, >( variables: UsersListPublicKeysForUserVariables, options?: Omit< reactQuery.UseQueryOptions< UsersListPublicKeysForUserResponse, UsersListPublicKeysForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< UsersListPublicKeysForUserResponse, UsersListPublicKeysForUserError, TData >( queryKeyFn({ path: '/users/{username}/keys', operationId: 'usersListPublicKeysForUser', variables, }), ({ signal }) => fetchUsersListPublicKeysForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type OrgsListForUserPathParams = { username: string; }; export type OrgsListForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type OrgsListForUserError = Fetcher.ErrorWrapper; export type OrgsListForUserResponse = Schemas.OrganizationSimple[]; export type OrgsListForUserVariables = { pathParams: OrgsListForUserPathParams; queryParams?: OrgsListForUserQueryParams; } & GithubContext['fetcherOptions']; /** * List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. * * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. */ export const fetchOrgsListForUser = ( variables: OrgsListForUserVariables, signal?: AbortSignal, ) => githubFetch< OrgsListForUserResponse, OrgsListForUserError, undefined, {}, OrgsListForUserQueryParams, OrgsListForUserPathParams >({ url: '/users/{username}/orgs', method: 'get', ...variables, signal }); /** * List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. * * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. */ export const useOrgsListForUser = ( variables: OrgsListForUserVariables, options?: Omit< reactQuery.UseQueryOptions< OrgsListForUserResponse, OrgsListForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< OrgsListForUserResponse, OrgsListForUserError, TData >( queryKeyFn({ path: '/users/{username}/orgs', operationId: 'orgsListForUser', variables, }), ({ signal }) => fetchOrgsListForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type PackagesGetPackageForUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; username: string; }; export type PackagesGetPackageForUserError = Fetcher.ErrorWrapper; export type PackagesGetPackageForUserVariables = { pathParams: PackagesGetPackageForUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package metadata for a public package owned by a user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageForUser = ( variables: PackagesGetPackageForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.Package, PackagesGetPackageForUserError, undefined, {}, {}, PackagesGetPackageForUserPathParams >({ url: '/users/{username}/packages/{packageType}/{packageName}', method: 'get', ...variables, signal, }); /** * Gets a specific package metadata for a public package owned by a user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageForUser = ( variables: PackagesGetPackageForUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.Package, PackagesGetPackageForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.Package, PackagesGetPackageForUserError, TData >( queryKeyFn({ path: '/users/{username}/packages/{package_type}/{package_name}', operationId: 'packagesGetPackageForUser', variables, }), ({ signal }) => fetchPackagesGetPackageForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesGetAllPackageVersionsForPackageOwnedByUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; username: string; }; export type PackagesGetAllPackageVersionsForPackageOwnedByUserError = Fetcher.ErrorWrapper< | { status: 401; payload: Responses.RequiresAuthentication; } | { status: 403; payload: Responses.Forbidden; } | { status: 404; payload: Responses.NotFound; } >; export type PackagesGetAllPackageVersionsForPackageOwnedByUserResponse = Schemas.PackageVersion[]; export type PackagesGetAllPackageVersionsForPackageOwnedByUserVariables = { pathParams: PackagesGetAllPackageVersionsForPackageOwnedByUserPathParams; } & GithubContext['fetcherOptions']; /** * Returns all package versions for a public package owned by a specified user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetAllPackageVersionsForPackageOwnedByUser = ( variables: PackagesGetAllPackageVersionsForPackageOwnedByUserVariables, signal?: AbortSignal, ) => githubFetch< PackagesGetAllPackageVersionsForPackageOwnedByUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByUserError, undefined, {}, {}, PackagesGetAllPackageVersionsForPackageOwnedByUserPathParams >({ url: '/users/{username}/packages/{packageType}/{packageName}/versions', method: 'get', ...variables, signal, }); /** * Returns all package versions for a public package owned by a specified user. * * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetAllPackageVersionsForPackageOwnedByUser = < TData = PackagesGetAllPackageVersionsForPackageOwnedByUserResponse, >( variables: PackagesGetAllPackageVersionsForPackageOwnedByUserVariables, options?: Omit< reactQuery.UseQueryOptions< PackagesGetAllPackageVersionsForPackageOwnedByUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< PackagesGetAllPackageVersionsForPackageOwnedByUserResponse, PackagesGetAllPackageVersionsForPackageOwnedByUserError, TData >( queryKeyFn({ path: '/users/{username}/packages/{package_type}/{package_name}/versions', operationId: 'packagesGetAllPackageVersionsForPackageOwnedByUser', variables, }), ({ signal }) => fetchPackagesGetAllPackageVersionsForPackageOwnedByUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type PackagesGetPackageVersionForUserPathParams = { /** * The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`. */ packageType: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * The name of the package. */ packageName: string; /** * Unique identifier of the package version. */ packageVersionId: number; username: string; }; export type PackagesGetPackageVersionForUserError = Fetcher.ErrorWrapper; export type PackagesGetPackageVersionForUserVariables = { pathParams: PackagesGetPackageVersionForUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets a specific package version for a public package owned by a specified user. * * At this time, to use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const fetchPackagesGetPackageVersionForUser = ( variables: PackagesGetPackageVersionForUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackageVersion, PackagesGetPackageVersionForUserError, undefined, {}, {}, PackagesGetPackageVersionForUserPathParams >({ url: '/users/{username}/packages/{packageType}/{packageName}/versions/{packageVersionId}', method: 'get', ...variables, signal, }); /** * Gets a specific package version for a public package owned by a specified user. * * At this time, to use this endpoint, you must authenticate using an access token with the `packages:read` scope. * If `package_type` is not `container`, your token must also include the `repo` scope. */ export const usePackagesGetPackageVersionForUser = < TData = Schemas.PackageVersion, >( variables: PackagesGetPackageVersionForUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackageVersion, PackagesGetPackageVersionForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackageVersion, PackagesGetPackageVersionForUserError, TData >( queryKeyFn({ path: '/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}', operationId: 'packagesGetPackageVersionForUser', variables, }), ({ signal }) => fetchPackagesGetPackageVersionForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ProjectsListForUserPathParams = { username: string; }; export type ProjectsListForUserQueryParams = { /** * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. * * @default open */ state?: 'open' | 'closed' | 'all'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ProjectsListForUserError = Fetcher.ErrorWrapper< | { status: 415; payload: Responses.PreviewHeaderMissing; } | { status: 422; payload: Responses.ValidationFailed; } >; export type ProjectsListForUserResponse = Schemas.Project[]; export type ProjectsListForUserVariables = { pathParams: ProjectsListForUserPathParams; queryParams?: ProjectsListForUserQueryParams; } & GithubContext['fetcherOptions']; export const fetchProjectsListForUser = ( variables: ProjectsListForUserVariables, signal?: AbortSignal, ) => githubFetch< ProjectsListForUserResponse, ProjectsListForUserError, undefined, {}, ProjectsListForUserQueryParams, ProjectsListForUserPathParams >({ url: '/users/{username}/projects', method: 'get', ...variables, signal }); export const useProjectsListForUser = ( variables: ProjectsListForUserVariables, options?: Omit< reactQuery.UseQueryOptions< ProjectsListForUserResponse, ProjectsListForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ProjectsListForUserResponse, ProjectsListForUserError, TData >( queryKeyFn({ path: '/users/{username}/projects', operationId: 'projectsListForUser', variables, }), ({ signal }) => fetchProjectsListForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type ActivityListReceivedEventsForUserPathParams = { username: string; }; export type ActivityListReceivedEventsForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListReceivedEventsForUserError = Fetcher.ErrorWrapper; export type ActivityListReceivedEventsForUserResponse = Schemas.Event[]; export type ActivityListReceivedEventsForUserVariables = { pathParams: ActivityListReceivedEventsForUserPathParams; queryParams?: ActivityListReceivedEventsForUserQueryParams; } & GithubContext['fetcherOptions']; /** * These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. */ export const fetchActivityListReceivedEventsForUser = ( variables: ActivityListReceivedEventsForUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListReceivedEventsForUserResponse, ActivityListReceivedEventsForUserError, undefined, {}, ActivityListReceivedEventsForUserQueryParams, ActivityListReceivedEventsForUserPathParams >({ url: '/users/{username}/received_events', method: 'get', ...variables, signal, }); /** * These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. */ export const useActivityListReceivedEventsForUser = < TData = ActivityListReceivedEventsForUserResponse, >( variables: ActivityListReceivedEventsForUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListReceivedEventsForUserResponse, ActivityListReceivedEventsForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListReceivedEventsForUserResponse, ActivityListReceivedEventsForUserError, TData >( queryKeyFn({ path: '/users/{username}/received_events', operationId: 'activityListReceivedEventsForUser', variables, }), ({ signal }) => fetchActivityListReceivedEventsForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListReceivedPublicEventsForUserPathParams = { username: string; }; export type ActivityListReceivedPublicEventsForUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListReceivedPublicEventsForUserError = Fetcher.ErrorWrapper; export type ActivityListReceivedPublicEventsForUserResponse = Schemas.Event[]; export type ActivityListReceivedPublicEventsForUserVariables = { pathParams: ActivityListReceivedPublicEventsForUserPathParams; queryParams?: ActivityListReceivedPublicEventsForUserQueryParams; } & GithubContext['fetcherOptions']; export const fetchActivityListReceivedPublicEventsForUser = ( variables: ActivityListReceivedPublicEventsForUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListReceivedPublicEventsForUserResponse, ActivityListReceivedPublicEventsForUserError, undefined, {}, ActivityListReceivedPublicEventsForUserQueryParams, ActivityListReceivedPublicEventsForUserPathParams >({ url: '/users/{username}/received_events/public', method: 'get', ...variables, signal, }); export const useActivityListReceivedPublicEventsForUser = < TData = ActivityListReceivedPublicEventsForUserResponse, >( variables: ActivityListReceivedPublicEventsForUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListReceivedPublicEventsForUserResponse, ActivityListReceivedPublicEventsForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListReceivedPublicEventsForUserResponse, ActivityListReceivedPublicEventsForUserError, TData >( queryKeyFn({ path: '/users/{username}/received_events/public', operationId: 'activityListReceivedPublicEventsForUser', variables, }), ({ signal }) => fetchActivityListReceivedPublicEventsForUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ReposListForUserPathParams = { username: string; }; export type ReposListForUserQueryParams = { /** * Can be one of `all`, `owner`, `member`. * * @default owner */ type?: 'all' | 'owner' | 'member'; /** * Can be one of `created`, `updated`, `pushed`, `full_name`. * * @default full_name */ sort?: 'created' | 'updated' | 'pushed' | 'full_name'; /** * Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ReposListForUserError = Fetcher.ErrorWrapper; export type ReposListForUserResponse = Schemas.MinimalRepository[]; export type ReposListForUserVariables = { pathParams: ReposListForUserPathParams; queryParams?: ReposListForUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ export const fetchReposListForUser = ( variables: ReposListForUserVariables, signal?: AbortSignal, ) => githubFetch< ReposListForUserResponse, ReposListForUserError, undefined, {}, ReposListForUserQueryParams, ReposListForUserPathParams >({ url: '/users/{username}/repos', method: 'get', ...variables, signal }); /** * Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ export const useReposListForUser = ( variables: ReposListForUserVariables, options?: Omit< reactQuery.UseQueryOptions< ReposListForUserResponse, ReposListForUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ReposListForUserResponse, ReposListForUserError, TData >( queryKeyFn({ path: '/users/{username}/repos', operationId: 'reposListForUser', variables, }), ({ signal }) => fetchReposListForUser({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type BillingGetGithubActionsBillingUserPathParams = { username: string; }; export type BillingGetGithubActionsBillingUserError = Fetcher.ErrorWrapper; export type BillingGetGithubActionsBillingUserVariables = { pathParams: BillingGetGithubActionsBillingUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `user` scope. */ export const fetchBillingGetGithubActionsBillingUser = ( variables: BillingGetGithubActionsBillingUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingUserError, undefined, {}, {}, BillingGetGithubActionsBillingUserPathParams >({ url: '/users/{username}/settings/billing/actions', method: 'get', ...variables, signal, }); /** * Gets the summary of the free and paid GitHub Actions minutes used. * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `user` scope. */ export const useBillingGetGithubActionsBillingUser = < TData = Schemas.ActionsBillingUsage, >( variables: BillingGetGithubActionsBillingUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.ActionsBillingUsage, BillingGetGithubActionsBillingUserError, TData >( queryKeyFn({ path: '/users/{username}/settings/billing/actions', operationId: 'billingGetGithubActionsBillingUser', variables, }), ({ signal }) => fetchBillingGetGithubActionsBillingUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetGithubPackagesBillingUserPathParams = { username: string; }; export type BillingGetGithubPackagesBillingUserError = Fetcher.ErrorWrapper; export type BillingGetGithubPackagesBillingUserVariables = { pathParams: BillingGetGithubPackagesBillingUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets the free and paid storage used for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ export const fetchBillingGetGithubPackagesBillingUser = ( variables: BillingGetGithubPackagesBillingUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingUserError, undefined, {}, {}, BillingGetGithubPackagesBillingUserPathParams >({ url: '/users/{username}/settings/billing/packages', method: 'get', ...variables, signal, }); /** * Gets the free and paid storage used for GitHub Packages in gigabytes. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ export const useBillingGetGithubPackagesBillingUser = < TData = Schemas.PackagesBillingUsage, >( variables: BillingGetGithubPackagesBillingUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.PackagesBillingUsage, BillingGetGithubPackagesBillingUserError, TData >( queryKeyFn({ path: '/users/{username}/settings/billing/packages', operationId: 'billingGetGithubPackagesBillingUser', variables, }), ({ signal }) => fetchBillingGetGithubPackagesBillingUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type BillingGetSharedStorageBillingUserPathParams = { username: string; }; export type BillingGetSharedStorageBillingUserError = Fetcher.ErrorWrapper; export type BillingGetSharedStorageBillingUserVariables = { pathParams: BillingGetSharedStorageBillingUserPathParams; } & GithubContext['fetcherOptions']; /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ export const fetchBillingGetSharedStorageBillingUser = ( variables: BillingGetSharedStorageBillingUserVariables, signal?: AbortSignal, ) => githubFetch< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingUserError, undefined, {}, {}, BillingGetSharedStorageBillingUserPathParams >({ url: '/users/{username}/settings/billing/shared-storage', method: 'get', ...variables, signal, }); /** * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ export const useBillingGetSharedStorageBillingUser = < TData = Schemas.CombinedBillingUsage, >( variables: BillingGetSharedStorageBillingUserVariables, options?: Omit< reactQuery.UseQueryOptions< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< Schemas.CombinedBillingUsage, BillingGetSharedStorageBillingUserError, TData >( queryKeyFn({ path: '/users/{username}/settings/billing/shared-storage', operationId: 'billingGetSharedStorageBillingUser', variables, }), ({ signal }) => fetchBillingGetSharedStorageBillingUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListReposStarredByUserPathParams = { username: string; }; export type ActivityListReposStarredByUserQueryParams = { /** * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). * * @default created */ sort?: 'created' | 'updated'; /** * One of `asc` (ascending) or `desc` (descending). * * @default desc */ direction?: 'asc' | 'desc'; /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListReposStarredByUserError = Fetcher.ErrorWrapper; export type ActivityListReposStarredByUserResponse = Schemas.Repository[]; export type ActivityListReposStarredByUserVariables = { pathParams: ActivityListReposStarredByUserPathParams; queryParams?: ActivityListReposStarredByUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories a user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const fetchActivityListReposStarredByUser = ( variables: ActivityListReposStarredByUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListReposStarredByUserResponse, ActivityListReposStarredByUserError, undefined, {}, ActivityListReposStarredByUserQueryParams, ActivityListReposStarredByUserPathParams >({ url: '/users/{username}/starred', method: 'get', ...variables, signal }); /** * Lists repositories a user has starred. * * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ export const useActivityListReposStarredByUser = < TData = ActivityListReposStarredByUserResponse, >( variables: ActivityListReposStarredByUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListReposStarredByUserResponse, ActivityListReposStarredByUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListReposStarredByUserResponse, ActivityListReposStarredByUserError, TData >( queryKeyFn({ path: '/users/{username}/starred', operationId: 'activityListReposStarredByUser', variables, }), ({ signal }) => fetchActivityListReposStarredByUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type ActivityListReposWatchedByUserPathParams = { username: string; }; export type ActivityListReposWatchedByUserQueryParams = { /** * Results per page (max 100). * * @default 30 */ per_page?: number; /** * Page number of the results to fetch. * * @default 1 */ page?: number; }; export type ActivityListReposWatchedByUserError = Fetcher.ErrorWrapper; export type ActivityListReposWatchedByUserResponse = Schemas.MinimalRepository[]; export type ActivityListReposWatchedByUserVariables = { pathParams: ActivityListReposWatchedByUserPathParams; queryParams?: ActivityListReposWatchedByUserQueryParams; } & GithubContext['fetcherOptions']; /** * Lists repositories a user is watching. */ export const fetchActivityListReposWatchedByUser = ( variables: ActivityListReposWatchedByUserVariables, signal?: AbortSignal, ) => githubFetch< ActivityListReposWatchedByUserResponse, ActivityListReposWatchedByUserError, undefined, {}, ActivityListReposWatchedByUserQueryParams, ActivityListReposWatchedByUserPathParams >({ url: '/users/{username}/subscriptions', method: 'get', ...variables, signal, }); /** * Lists repositories a user is watching. */ export const useActivityListReposWatchedByUser = < TData = ActivityListReposWatchedByUserResponse, >( variables: ActivityListReposWatchedByUserVariables, options?: Omit< reactQuery.UseQueryOptions< ActivityListReposWatchedByUserResponse, ActivityListReposWatchedByUserError, TData >, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery< ActivityListReposWatchedByUserResponse, ActivityListReposWatchedByUserError, TData >( queryKeyFn({ path: '/users/{username}/subscriptions', operationId: 'activityListReposWatchedByUser', variables, }), ({ signal }) => fetchActivityListReposWatchedByUser( { ...fetcherOptions, ...variables }, signal, ), { ...options, ...queryOptions, }, ); }; export type MetaGetZenError = Fetcher.ErrorWrapper; export type MetaGetZenVariables = GithubContext['fetcherOptions']; /** * Get a random sentence from the Zen of GitHub */ export const fetchMetaGetZen = ( variables: MetaGetZenVariables, signal?: AbortSignal, ) => githubFetch({ url: '/zen', method: 'get', ...variables, signal, }); /** * Get a random sentence from the Zen of GitHub */ export const useMetaGetZen = ( variables: MetaGetZenVariables, options?: Omit< reactQuery.UseQueryOptions, 'queryKey' | 'queryFn' >, ) => { const { fetcherOptions, queryOptions, queryKeyFn } = useGithubContext(options); return reactQuery.useQuery( queryKeyFn({ path: '/zen', operationId: 'metaGetZen', variables }), ({ signal }) => fetchMetaGetZen({ ...fetcherOptions, ...variables }, signal), { ...options, ...queryOptions, }, ); }; export type QueryOperation = | { path: '/'; operationId: 'metaRoot'; variables: MetaRootVariables; } | { path: '/app'; operationId: 'appsGetAuthenticated'; variables: AppsGetAuthenticatedVariables; } | { path: '/app/hook/config'; operationId: 'appsGetWebhookConfigForApp'; variables: AppsGetWebhookConfigForAppVariables; } | { path: '/app/installations'; operationId: 'appsListInstallations'; variables: AppsListInstallationsVariables; } | { path: '/app/installations/{installation_id}'; operationId: 'appsGetInstallation'; variables: AppsGetInstallationVariables; } | { path: '/applications/grants'; operationId: 'oauthAuthorizationsListGrants'; variables: OauthAuthorizationsListGrantsVariables; } | { path: '/applications/grants/{grant_id}'; operationId: 'oauthAuthorizationsGetGrant'; variables: OauthAuthorizationsGetGrantVariables; } | { path: '/applications/{client_id}/tokens/{access_token}'; operationId: 'appsCheckAuthorization'; variables: AppsCheckAuthorizationVariables; } | { path: '/apps/{app_slug}'; operationId: 'appsGetBySlug'; variables: AppsGetBySlugVariables; } | { path: '/authorizations'; operationId: 'oauthAuthorizationsListAuthorizations'; variables: OauthAuthorizationsListAuthorizationsVariables; } | { path: '/authorizations/{authorization_id}'; operationId: 'oauthAuthorizationsGetAuthorization'; variables: OauthAuthorizationsGetAuthorizationVariables; } | { path: '/codes_of_conduct'; operationId: 'codesOfConductGetAllCodesOfConduct'; variables: CodesOfConductGetAllCodesOfConductVariables; } | { path: '/codes_of_conduct/{key}'; operationId: 'codesOfConductGetConductCode'; variables: CodesOfConductGetConductCodeVariables; } | { path: '/emojis'; operationId: 'emojisGet'; variables: EmojisGetVariables; } | { path: '/enterprises/{enterprise}/actions/permissions'; operationId: 'enterpriseAdminGetGithubActionsPermissionsEnterprise'; variables: EnterpriseAdminGetGithubActionsPermissionsEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/permissions/organizations'; operationId: 'enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise'; variables: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/permissions/selected-actions'; operationId: 'enterpriseAdminGetAllowedActionsEnterprise'; variables: EnterpriseAdminGetAllowedActionsEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runner-groups'; operationId: 'enterpriseAdminListSelfHostedRunnerGroupsForEnterprise'; variables: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}'; operationId: 'enterpriseAdminGetSelfHostedRunnerGroupForEnterprise'; variables: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations'; operationId: 'enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise'; variables: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners'; operationId: 'enterpriseAdminListSelfHostedRunnersInGroupForEnterprise'; variables: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runners'; operationId: 'enterpriseAdminListSelfHostedRunnersForEnterprise'; variables: EnterpriseAdminListSelfHostedRunnersForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runners/downloads'; operationId: 'enterpriseAdminListRunnerApplicationsForEnterprise'; variables: EnterpriseAdminListRunnerApplicationsForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/actions/runners/{runner_id}'; operationId: 'enterpriseAdminGetSelfHostedRunnerForEnterprise'; variables: EnterpriseAdminGetSelfHostedRunnerForEnterpriseVariables; } | { path: '/enterprises/{enterprise}/audit-log'; operationId: 'auditLogGetAuditLog'; variables: AuditLogGetAuditLogVariables; } | { path: '/enterprises/{enterprise}/settings/billing/actions'; operationId: 'billingGetGithubActionsBillingGhe'; variables: BillingGetGithubActionsBillingGheVariables; } | { path: '/enterprises/{enterprise}/settings/billing/packages'; operationId: 'billingGetGithubPackagesBillingGhe'; variables: BillingGetGithubPackagesBillingGheVariables; } | { path: '/enterprises/{enterprise}/settings/billing/shared-storage'; operationId: 'billingGetSharedStorageBillingGhe'; variables: BillingGetSharedStorageBillingGheVariables; } | { path: '/events'; operationId: 'activityListPublicEvents'; variables: ActivityListPublicEventsVariables; } | { path: '/feeds'; operationId: 'activityGetFeeds'; variables: ActivityGetFeedsVariables; } | { path: '/gists'; operationId: 'gistsList'; variables: GistsListVariables; } | { path: '/gists/public'; operationId: 'gistsListPublic'; variables: GistsListPublicVariables; } | { path: '/gists/starred'; operationId: 'gistsListStarred'; variables: GistsListStarredVariables; } | { path: '/gists/{gist_id}'; operationId: 'gistsGet'; variables: GistsGetVariables; } | { path: '/gists/{gist_id}/comments'; operationId: 'gistsListComments'; variables: GistsListCommentsVariables; } | { path: '/gists/{gist_id}/comments/{comment_id}'; operationId: 'gistsGetComment'; variables: GistsGetCommentVariables; } | { path: '/gists/{gist_id}/commits'; operationId: 'gistsListCommits'; variables: GistsListCommitsVariables; } | { path: '/gists/{gist_id}/forks'; operationId: 'gistsListForks'; variables: GistsListForksVariables; } | { path: '/gists/{gist_id}/star'; operationId: 'gistsCheckIsStarred'; variables: GistsCheckIsStarredVariables; } | { path: '/gists/{gist_id}/{sha}'; operationId: 'gistsGetRevision'; variables: GistsGetRevisionVariables; } | { path: '/gitignore/templates'; operationId: 'gitignoreGetAllTemplates'; variables: GitignoreGetAllTemplatesVariables; } | { path: '/gitignore/templates/{name}'; operationId: 'gitignoreGetTemplate'; variables: GitignoreGetTemplateVariables; } | { path: '/installation/repositories'; operationId: 'appsListReposAccessibleToInstallation'; variables: AppsListReposAccessibleToInstallationVariables; } | { path: '/issues'; operationId: 'issuesList'; variables: IssuesListVariables; } | { path: '/licenses'; operationId: 'licensesGetAllCommonlyUsed'; variables: LicensesGetAllCommonlyUsedVariables; } | { path: '/licenses/{license}'; operationId: 'licensesGet'; variables: LicensesGetVariables; } | { path: '/marketplace_listing/accounts/{account_id}'; operationId: 'appsGetSubscriptionPlanForAccount'; variables: AppsGetSubscriptionPlanForAccountVariables; } | { path: '/marketplace_listing/plans'; operationId: 'appsListPlans'; variables: AppsListPlansVariables; } | { path: '/marketplace_listing/plans/{plan_id}/accounts'; operationId: 'appsListAccountsForPlan'; variables: AppsListAccountsForPlanVariables; } | { path: '/marketplace_listing/stubbed/accounts/{account_id}'; operationId: 'appsGetSubscriptionPlanForAccountStubbed'; variables: AppsGetSubscriptionPlanForAccountStubbedVariables; } | { path: '/marketplace_listing/stubbed/plans'; operationId: 'appsListPlansStubbed'; variables: AppsListPlansStubbedVariables; } | { path: '/marketplace_listing/stubbed/plans/{plan_id}/accounts'; operationId: 'appsListAccountsForPlanStubbed'; variables: AppsListAccountsForPlanStubbedVariables; } | { path: '/meta'; operationId: 'metaGet'; variables: MetaGetVariables; } | { path: '/networks/{owner}/{repo}/events'; operationId: 'activityListPublicEventsForRepoNetwork'; variables: ActivityListPublicEventsForRepoNetworkVariables; } | { path: '/notifications'; operationId: 'activityListNotificationsForAuthenticatedUser'; variables: ActivityListNotificationsForAuthenticatedUserVariables; } | { path: '/notifications/threads/{thread_id}'; operationId: 'activityGetThread'; variables: ActivityGetThreadVariables; } | { path: '/notifications/threads/{thread_id}/subscription'; operationId: 'activityGetThreadSubscriptionForAuthenticatedUser'; variables: ActivityGetThreadSubscriptionForAuthenticatedUserVariables; } | { path: '/octocat'; operationId: 'metaGetOctocat'; variables: MetaGetOctocatVariables; } | { path: '/organizations'; operationId: 'orgsList'; variables: OrgsListVariables; } | { path: '/orgs/{org}'; operationId: 'orgsGet'; variables: OrgsGetVariables; } | { path: '/orgs/{org}/actions/permissions'; operationId: 'actionsGetGithubActionsPermissionsOrganization'; variables: ActionsGetGithubActionsPermissionsOrganizationVariables; } | { path: '/orgs/{org}/actions/permissions/repositories'; operationId: 'actionsListSelectedRepositoriesEnabledGithubActionsOrganization'; variables: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationVariables; } | { path: '/orgs/{org}/actions/permissions/selected-actions'; operationId: 'actionsGetAllowedActionsOrganization'; variables: ActionsGetAllowedActionsOrganizationVariables; } | { path: '/orgs/{org}/actions/runner-groups'; operationId: 'actionsListSelfHostedRunnerGroupsForOrg'; variables: ActionsListSelfHostedRunnerGroupsForOrgVariables; } | { path: '/orgs/{org}/actions/runner-groups/{runner_group_id}'; operationId: 'actionsGetSelfHostedRunnerGroupForOrg'; variables: ActionsGetSelfHostedRunnerGroupForOrgVariables; } | { path: '/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories'; operationId: 'actionsListRepoAccessToSelfHostedRunnerGroupInOrg'; variables: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgVariables; } | { path: '/orgs/{org}/actions/runner-groups/{runner_group_id}/runners'; operationId: 'actionsListSelfHostedRunnersInGroupForOrg'; variables: ActionsListSelfHostedRunnersInGroupForOrgVariables; } | { path: '/orgs/{org}/actions/runners'; operationId: 'actionsListSelfHostedRunnersForOrg'; variables: ActionsListSelfHostedRunnersForOrgVariables; } | { path: '/orgs/{org}/actions/runners/downloads'; operationId: 'actionsListRunnerApplicationsForOrg'; variables: ActionsListRunnerApplicationsForOrgVariables; } | { path: '/orgs/{org}/actions/runners/{runner_id}'; operationId: 'actionsGetSelfHostedRunnerForOrg'; variables: ActionsGetSelfHostedRunnerForOrgVariables; } | { path: '/orgs/{org}/actions/secrets'; operationId: 'actionsListOrgSecrets'; variables: ActionsListOrgSecretsVariables; } | { path: '/orgs/{org}/actions/secrets/public-key'; operationId: 'actionsGetOrgPublicKey'; variables: ActionsGetOrgPublicKeyVariables; } | { path: '/orgs/{org}/actions/secrets/{secret_name}'; operationId: 'actionsGetOrgSecret'; variables: ActionsGetOrgSecretVariables; } | { path: '/orgs/{org}/actions/secrets/{secret_name}/repositories'; operationId: 'actionsListSelectedReposForOrgSecret'; variables: ActionsListSelectedReposForOrgSecretVariables; } | { path: '/orgs/{org}/audit-log'; operationId: 'orgsGetAuditLog'; variables: OrgsGetAuditLogVariables; } | { path: '/orgs/{org}/blocks'; operationId: 'orgsListBlockedUsers'; variables: OrgsListBlockedUsersVariables; } | { path: '/orgs/{org}/blocks/{username}'; operationId: 'orgsCheckBlockedUser'; variables: OrgsCheckBlockedUserVariables; } | { path: '/orgs/{org}/credential-authorizations'; operationId: 'orgsListSamlSsoAuthorizations'; variables: OrgsListSamlSsoAuthorizationsVariables; } | { path: '/orgs/{org}/events'; operationId: 'activityListPublicOrgEvents'; variables: ActivityListPublicOrgEventsVariables; } | { path: '/orgs/{org}/failed_invitations'; operationId: 'orgsListFailedInvitations'; variables: OrgsListFailedInvitationsVariables; } | { path: '/orgs/{org}/hooks'; operationId: 'orgsListWebhooks'; variables: OrgsListWebhooksVariables; } | { path: '/orgs/{org}/hooks/{hook_id}'; operationId: 'orgsGetWebhook'; variables: OrgsGetWebhookVariables; } | { path: '/orgs/{org}/hooks/{hook_id}/config'; operationId: 'orgsGetWebhookConfigForOrg'; variables: OrgsGetWebhookConfigForOrgVariables; } | { path: '/orgs/{org}/installation'; operationId: 'appsGetOrgInstallation'; variables: AppsGetOrgInstallationVariables; } | { path: '/orgs/{org}/installations'; operationId: 'orgsListAppInstallations'; variables: OrgsListAppInstallationsVariables; } | { path: '/orgs/{org}/interaction-limits'; operationId: 'interactionsGetRestrictionsForOrg'; variables: InteractionsGetRestrictionsForOrgVariables; } | { path: '/orgs/{org}/invitations'; operationId: 'orgsListPendingInvitations'; variables: OrgsListPendingInvitationsVariables; } | { path: '/orgs/{org}/invitations/{invitation_id}/teams'; operationId: 'orgsListInvitationTeams'; variables: OrgsListInvitationTeamsVariables; } | { path: '/orgs/{org}/issues'; operationId: 'issuesListForOrg'; variables: IssuesListForOrgVariables; } | { path: '/orgs/{org}/members'; operationId: 'orgsListMembers'; variables: OrgsListMembersVariables; } | { path: '/orgs/{org}/members/{username}'; operationId: 'orgsCheckMembershipForUser'; variables: OrgsCheckMembershipForUserVariables; } | { path: '/orgs/{org}/memberships/{username}'; operationId: 'orgsGetMembershipForUser'; variables: OrgsGetMembershipForUserVariables; } | { path: '/orgs/{org}/migrations'; operationId: 'migrationsListForOrg'; variables: MigrationsListForOrgVariables; } | { path: '/orgs/{org}/migrations/{migration_id}'; operationId: 'migrationsGetStatusForOrg'; variables: MigrationsGetStatusForOrgVariables; } | { path: '/orgs/{org}/migrations/{migration_id}/archive'; operationId: 'migrationsDownloadArchiveForOrg'; variables: MigrationsDownloadArchiveForOrgVariables; } | { path: '/orgs/{org}/migrations/{migration_id}/repositories'; operationId: 'migrationsListReposForOrg'; variables: MigrationsListReposForOrgVariables; } | { path: '/orgs/{org}/outside_collaborators'; operationId: 'orgsListOutsideCollaborators'; variables: OrgsListOutsideCollaboratorsVariables; } | { path: '/orgs/{org}/packages/{package_type}/{package_name}'; operationId: 'packagesGetPackageForOrganization'; variables: PackagesGetPackageForOrganizationVariables; } | { path: '/orgs/{org}/packages/{package_type}/{package_name}/versions'; operationId: 'packagesGetAllPackageVersionsForPackageOwnedByOrg'; variables: PackagesGetAllPackageVersionsForPackageOwnedByOrgVariables; } | { path: '/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}'; operationId: 'packagesGetPackageVersionForOrganization'; variables: PackagesGetPackageVersionForOrganizationVariables; } | { path: '/orgs/{org}/projects'; operationId: 'projectsListForOrg'; variables: ProjectsListForOrgVariables; } | { path: '/orgs/{org}/public_members'; operationId: 'orgsListPublicMembers'; variables: OrgsListPublicMembersVariables; } | { path: '/orgs/{org}/public_members/{username}'; operationId: 'orgsCheckPublicMembershipForUser'; variables: OrgsCheckPublicMembershipForUserVariables; } | { path: '/orgs/{org}/repos'; operationId: 'reposListForOrg'; variables: ReposListForOrgVariables; } | { path: '/orgs/{org}/settings/billing/actions'; operationId: 'billingGetGithubActionsBillingOrg'; variables: BillingGetGithubActionsBillingOrgVariables; } | { path: '/orgs/{org}/settings/billing/packages'; operationId: 'billingGetGithubPackagesBillingOrg'; variables: BillingGetGithubPackagesBillingOrgVariables; } | { path: '/orgs/{org}/settings/billing/shared-storage'; operationId: 'billingGetSharedStorageBillingOrg'; variables: BillingGetSharedStorageBillingOrgVariables; } | { path: '/orgs/{org}/team-sync/groups'; operationId: 'teamsListIdpGroupsForOrg'; variables: TeamsListIdpGroupsForOrgVariables; } | { path: '/orgs/{org}/teams'; operationId: 'teamsList'; variables: TeamsListVariables; } | { path: '/orgs/{org}/teams/{team_slug}'; operationId: 'teamsGetByName'; variables: TeamsGetByNameVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions'; operationId: 'teamsListDiscussionsInOrg'; variables: TeamsListDiscussionsInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}'; operationId: 'teamsGetDiscussionInOrg'; variables: TeamsGetDiscussionInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments'; operationId: 'teamsListDiscussionCommentsInOrg'; variables: TeamsListDiscussionCommentsInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}'; operationId: 'teamsGetDiscussionCommentInOrg'; variables: TeamsGetDiscussionCommentInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions'; operationId: 'reactionsListForTeamDiscussionCommentInOrg'; variables: ReactionsListForTeamDiscussionCommentInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions'; operationId: 'reactionsListForTeamDiscussionInOrg'; variables: ReactionsListForTeamDiscussionInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/invitations'; operationId: 'teamsListPendingInvitationsInOrg'; variables: TeamsListPendingInvitationsInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/members'; operationId: 'teamsListMembersInOrg'; variables: TeamsListMembersInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/memberships/{username}'; operationId: 'teamsGetMembershipForUserInOrg'; variables: TeamsGetMembershipForUserInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/projects'; operationId: 'teamsListProjectsInOrg'; variables: TeamsListProjectsInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/projects/{project_id}'; operationId: 'teamsCheckPermissionsForProjectInOrg'; variables: TeamsCheckPermissionsForProjectInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/repos'; operationId: 'teamsListReposInOrg'; variables: TeamsListReposInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}'; operationId: 'teamsCheckPermissionsForRepoInOrg'; variables: TeamsCheckPermissionsForRepoInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/team-sync/group-mappings'; operationId: 'teamsListIdpGroupsInOrg'; variables: TeamsListIdpGroupsInOrgVariables; } | { path: '/orgs/{org}/teams/{team_slug}/teams'; operationId: 'teamsListChildInOrg'; variables: TeamsListChildInOrgVariables; } | { path: '/projects/columns/cards/{card_id}'; operationId: 'projectsGetCard'; variables: ProjectsGetCardVariables; } | { path: '/projects/columns/{column_id}'; operationId: 'projectsGetColumn'; variables: ProjectsGetColumnVariables; } | { path: '/projects/columns/{column_id}/cards'; operationId: 'projectsListCards'; variables: ProjectsListCardsVariables; } | { path: '/projects/{project_id}'; operationId: 'projectsGet'; variables: ProjectsGetVariables; } | { path: '/projects/{project_id}/collaborators'; operationId: 'projectsListCollaborators'; variables: ProjectsListCollaboratorsVariables; } | { path: '/projects/{project_id}/collaborators/{username}/permission'; operationId: 'projectsGetPermissionForUser'; variables: ProjectsGetPermissionForUserVariables; } | { path: '/projects/{project_id}/columns'; operationId: 'projectsListColumns'; variables: ProjectsListColumnsVariables; } | { path: '/rate_limit'; operationId: 'rateLimitGet'; variables: RateLimitGetVariables; } | { path: '/repos/{owner}/{repo}'; operationId: 'reposGet'; variables: ReposGetVariables; } | { path: '/repos/{owner}/{repo}/actions/artifacts'; operationId: 'actionsListArtifactsForRepo'; variables: ActionsListArtifactsForRepoVariables; } | { path: '/repos/{owner}/{repo}/actions/artifacts/{artifact_id}'; operationId: 'actionsGetArtifact'; variables: ActionsGetArtifactVariables; } | { path: '/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}'; operationId: 'actionsDownloadArtifact'; variables: ActionsDownloadArtifactVariables; } | { path: '/repos/{owner}/{repo}/actions/jobs/{job_id}'; operationId: 'actionsGetJobForWorkflowRun'; variables: ActionsGetJobForWorkflowRunVariables; } | { path: '/repos/{owner}/{repo}/actions/jobs/{job_id}/logs'; operationId: 'actionsDownloadJobLogsForWorkflowRun'; variables: ActionsDownloadJobLogsForWorkflowRunVariables; } | { path: '/repos/{owner}/{repo}/actions/permissions'; operationId: 'actionsGetGithubActionsPermissionsRepository'; variables: ActionsGetGithubActionsPermissionsRepositoryVariables; } | { path: '/repos/{owner}/{repo}/actions/permissions/selected-actions'; operationId: 'actionsGetAllowedActionsRepository'; variables: ActionsGetAllowedActionsRepositoryVariables; } | { path: '/repos/{owner}/{repo}/actions/runners'; operationId: 'actionsListSelfHostedRunnersForRepo'; variables: ActionsListSelfHostedRunnersForRepoVariables; } | { path: '/repos/{owner}/{repo}/actions/runners/downloads'; operationId: 'actionsListRunnerApplicationsForRepo'; variables: ActionsListRunnerApplicationsForRepoVariables; } | { path: '/repos/{owner}/{repo}/actions/runners/{runner_id}'; operationId: 'actionsGetSelfHostedRunnerForRepo'; variables: ActionsGetSelfHostedRunnerForRepoVariables; } | { path: '/repos/{owner}/{repo}/actions/runs'; operationId: 'actionsListWorkflowRunsForRepo'; variables: ActionsListWorkflowRunsForRepoVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}'; operationId: 'actionsGetWorkflowRun'; variables: ActionsGetWorkflowRunVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/approvals'; operationId: 'actionsGetReviewsForRun'; variables: ActionsGetReviewsForRunVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts'; operationId: 'actionsListWorkflowRunArtifacts'; variables: ActionsListWorkflowRunArtifactsVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/jobs'; operationId: 'actionsListJobsForWorkflowRun'; variables: ActionsListJobsForWorkflowRunVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/logs'; operationId: 'actionsDownloadWorkflowRunLogs'; variables: ActionsDownloadWorkflowRunLogsVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments'; operationId: 'actionsGetPendingDeploymentsForRun'; variables: ActionsGetPendingDeploymentsForRunVariables; } | { path: '/repos/{owner}/{repo}/actions/runs/{run_id}/timing'; operationId: 'actionsGetWorkflowRunUsage'; variables: ActionsGetWorkflowRunUsageVariables; } | { path: '/repos/{owner}/{repo}/actions/secrets'; operationId: 'actionsListRepoSecrets'; variables: ActionsListRepoSecretsVariables; } | { path: '/repos/{owner}/{repo}/actions/secrets/public-key'; operationId: 'actionsGetRepoPublicKey'; variables: ActionsGetRepoPublicKeyVariables; } | { path: '/repos/{owner}/{repo}/actions/secrets/{secret_name}'; operationId: 'actionsGetRepoSecret'; variables: ActionsGetRepoSecretVariables; } | { path: '/repos/{owner}/{repo}/actions/workflows'; operationId: 'actionsListRepoWorkflows'; variables: ActionsListRepoWorkflowsVariables; } | { path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}'; operationId: 'actionsGetWorkflow'; variables: ActionsGetWorkflowVariables; } | { path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs'; operationId: 'actionsListWorkflowRuns'; variables: ActionsListWorkflowRunsVariables; } | { path: '/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing'; operationId: 'actionsGetWorkflowUsage'; variables: ActionsGetWorkflowUsageVariables; } | { path: '/repos/{owner}/{repo}/assignees'; operationId: 'issuesListAssignees'; variables: IssuesListAssigneesVariables; } | { path: '/repos/{owner}/{repo}/assignees/{assignee}'; operationId: 'issuesCheckUserCanBeAssigned'; variables: IssuesCheckUserCanBeAssignedVariables; } | { path: '/repos/{owner}/{repo}/branches'; operationId: 'reposListBranches'; variables: ReposListBranchesVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}'; operationId: 'reposGetBranch'; variables: ReposGetBranchVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection'; operationId: 'reposGetBranchProtection'; variables: ReposGetBranchProtectionVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins'; operationId: 'reposGetAdminBranchProtection'; variables: ReposGetAdminBranchProtectionVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews'; operationId: 'reposGetPullRequestReviewProtection'; variables: ReposGetPullRequestReviewProtectionVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures'; operationId: 'reposGetCommitSignatureProtection'; variables: ReposGetCommitSignatureProtectionVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks'; operationId: 'reposGetStatusChecksProtection'; variables: ReposGetStatusChecksProtectionVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts'; operationId: 'reposGetAllStatusCheckContexts'; variables: ReposGetAllStatusCheckContextsVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions'; operationId: 'reposGetAccessRestrictions'; variables: ReposGetAccessRestrictionsVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps'; operationId: 'reposGetAppsWithAccessToProtectedBranch'; variables: ReposGetAppsWithAccessToProtectedBranchVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams'; operationId: 'reposGetTeamsWithAccessToProtectedBranch'; variables: ReposGetTeamsWithAccessToProtectedBranchVariables; } | { path: '/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users'; operationId: 'reposGetUsersWithAccessToProtectedBranch'; variables: ReposGetUsersWithAccessToProtectedBranchVariables; } | { path: '/repos/{owner}/{repo}/check-runs/{check_run_id}'; operationId: 'checksGet'; variables: ChecksGetVariables; } | { path: '/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations'; operationId: 'checksListAnnotations'; variables: ChecksListAnnotationsVariables; } | { path: '/repos/{owner}/{repo}/check-suites/{check_suite_id}'; operationId: 'checksGetSuite'; variables: ChecksGetSuiteVariables; } | { path: '/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs'; operationId: 'checksListForSuite'; variables: ChecksListForSuiteVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/alerts'; operationId: 'codeScanningListAlertsForRepo'; variables: CodeScanningListAlertsForRepoVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}'; operationId: 'codeScanningGetAlert'; variables: CodeScanningGetAlertVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances'; operationId: 'codeScanningListAlertsInstances'; variables: CodeScanningListAlertsInstancesVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/analyses'; operationId: 'codeScanningListRecentAnalyses'; variables: CodeScanningListRecentAnalysesVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}'; operationId: 'codeScanningGetAnalysis'; variables: CodeScanningGetAnalysisVariables; } | { path: '/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}'; operationId: 'codeScanningGetSarif'; variables: CodeScanningGetSarifVariables; } | { path: '/repos/{owner}/{repo}/collaborators'; operationId: 'reposListCollaborators'; variables: ReposListCollaboratorsVariables; } | { path: '/repos/{owner}/{repo}/collaborators/{username}'; operationId: 'reposCheckCollaborator'; variables: ReposCheckCollaboratorVariables; } | { path: '/repos/{owner}/{repo}/collaborators/{username}/permission'; operationId: 'reposGetCollaboratorPermissionLevel'; variables: ReposGetCollaboratorPermissionLevelVariables; } | { path: '/repos/{owner}/{repo}/comments'; operationId: 'reposListCommitCommentsForRepo'; variables: ReposListCommitCommentsForRepoVariables; } | { path: '/repos/{owner}/{repo}/comments/{comment_id}'; operationId: 'reposGetCommitComment'; variables: ReposGetCommitCommentVariables; } | { path: '/repos/{owner}/{repo}/comments/{comment_id}/reactions'; operationId: 'reactionsListForCommitComment'; variables: ReactionsListForCommitCommentVariables; } | { path: '/repos/{owner}/{repo}/commits'; operationId: 'reposListCommits'; variables: ReposListCommitsVariables; } | { path: '/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head'; operationId: 'reposListBranchesForHeadCommit'; variables: ReposListBranchesForHeadCommitVariables; } | { path: '/repos/{owner}/{repo}/commits/{commit_sha}/comments'; operationId: 'reposListCommentsForCommit'; variables: ReposListCommentsForCommitVariables; } | { path: '/repos/{owner}/{repo}/commits/{commit_sha}/pulls'; operationId: 'reposListPullRequestsAssociatedWithCommit'; variables: ReposListPullRequestsAssociatedWithCommitVariables; } | { path: '/repos/{owner}/{repo}/commits/{ref}'; operationId: 'reposGetCommit'; variables: ReposGetCommitVariables; } | { path: '/repos/{owner}/{repo}/commits/{ref}/check-runs'; operationId: 'checksListForRef'; variables: ChecksListForRefVariables; } | { path: '/repos/{owner}/{repo}/commits/{ref}/check-suites'; operationId: 'checksListSuitesForRef'; variables: ChecksListSuitesForRefVariables; } | { path: '/repos/{owner}/{repo}/commits/{ref}/status'; operationId: 'reposGetCombinedStatusForRef'; variables: ReposGetCombinedStatusForRefVariables; } | { path: '/repos/{owner}/{repo}/commits/{ref}/statuses'; operationId: 'reposListCommitStatusesForRef'; variables: ReposListCommitStatusesForRefVariables; } | { path: '/repos/{owner}/{repo}/community/code_of_conduct'; operationId: 'codesOfConductGetForRepo'; variables: CodesOfConductGetForRepoVariables; } | { path: '/repos/{owner}/{repo}/community/profile'; operationId: 'reposGetCommunityProfileMetrics'; variables: ReposGetCommunityProfileMetricsVariables; } | { path: '/repos/{owner}/{repo}/compare/{base}...{head}'; operationId: 'reposCompareCommits'; variables: ReposCompareCommitsVariables; } | { path: '/repos/{owner}/{repo}/contents/{path}'; operationId: 'reposGetContent'; variables: ReposGetContentVariables; } | { path: '/repos/{owner}/{repo}/contributors'; operationId: 'reposListContributors'; variables: ReposListContributorsVariables; } | { path: '/repos/{owner}/{repo}/deployments'; operationId: 'reposListDeployments'; variables: ReposListDeploymentsVariables; } | { path: '/repos/{owner}/{repo}/deployments/{deployment_id}'; operationId: 'reposGetDeployment'; variables: ReposGetDeploymentVariables; } | { path: '/repos/{owner}/{repo}/deployments/{deployment_id}/statuses'; operationId: 'reposListDeploymentStatuses'; variables: ReposListDeploymentStatusesVariables; } | { path: '/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}'; operationId: 'reposGetDeploymentStatus'; variables: ReposGetDeploymentStatusVariables; } | { path: '/repos/{owner}/{repo}/environments'; operationId: 'reposGetAllEnvironments'; variables: ReposGetAllEnvironmentsVariables; } | { path: '/repos/{owner}/{repo}/environments/{environment_name}'; operationId: 'reposGetEnvironment'; variables: ReposGetEnvironmentVariables; } | { path: '/repos/{owner}/{repo}/events'; operationId: 'activityListRepoEvents'; variables: ActivityListRepoEventsVariables; } | { path: '/repos/{owner}/{repo}/forks'; operationId: 'reposListForks'; variables: ReposListForksVariables; } | { path: '/repos/{owner}/{repo}/git/blobs/{file_sha}'; operationId: 'gitGetBlob'; variables: GitGetBlobVariables; } | { path: '/repos/{owner}/{repo}/git/commits/{commit_sha}'; operationId: 'gitGetCommit'; variables: GitGetCommitVariables; } | { path: '/repos/{owner}/{repo}/git/matching-refs/{ref}'; operationId: 'gitListMatchingRefs'; variables: GitListMatchingRefsVariables; } | { path: '/repos/{owner}/{repo}/git/ref/{ref}'; operationId: 'gitGetRef'; variables: GitGetRefVariables; } | { path: '/repos/{owner}/{repo}/git/tags/{tag_sha}'; operationId: 'gitGetTag'; variables: GitGetTagVariables; } | { path: '/repos/{owner}/{repo}/git/trees/{tree_sha}'; operationId: 'gitGetTree'; variables: GitGetTreeVariables; } | { path: '/repos/{owner}/{repo}/hooks'; operationId: 'reposListWebhooks'; variables: ReposListWebhooksVariables; } | { path: '/repos/{owner}/{repo}/hooks/{hook_id}'; operationId: 'reposGetWebhook'; variables: ReposGetWebhookVariables; } | { path: '/repos/{owner}/{repo}/hooks/{hook_id}/config'; operationId: 'reposGetWebhookConfigForRepo'; variables: ReposGetWebhookConfigForRepoVariables; } | { path: '/repos/{owner}/{repo}/import'; operationId: 'migrationsGetImportStatus'; variables: MigrationsGetImportStatusVariables; } | { path: '/repos/{owner}/{repo}/import/authors'; operationId: 'migrationsGetCommitAuthors'; variables: MigrationsGetCommitAuthorsVariables; } | { path: '/repos/{owner}/{repo}/import/large_files'; operationId: 'migrationsGetLargeFiles'; variables: MigrationsGetLargeFilesVariables; } | { path: '/repos/{owner}/{repo}/installation'; operationId: 'appsGetRepoInstallation'; variables: AppsGetRepoInstallationVariables; } | { path: '/repos/{owner}/{repo}/interaction-limits'; operationId: 'interactionsGetRestrictionsForRepo'; variables: InteractionsGetRestrictionsForRepoVariables; } | { path: '/repos/{owner}/{repo}/invitations'; operationId: 'reposListInvitations'; variables: ReposListInvitationsVariables; } | { path: '/repos/{owner}/{repo}/issues'; operationId: 'issuesListForRepo'; variables: IssuesListForRepoVariables; } | { path: '/repos/{owner}/{repo}/issues/comments'; operationId: 'issuesListCommentsForRepo'; variables: IssuesListCommentsForRepoVariables; } | { path: '/repos/{owner}/{repo}/issues/comments/{comment_id}'; operationId: 'issuesGetComment'; variables: IssuesGetCommentVariables; } | { path: '/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions'; operationId: 'reactionsListForIssueComment'; variables: ReactionsListForIssueCommentVariables; } | { path: '/repos/{owner}/{repo}/issues/events'; operationId: 'issuesListEventsForRepo'; variables: IssuesListEventsForRepoVariables; } | { path: '/repos/{owner}/{repo}/issues/events/{event_id}'; operationId: 'issuesGetEvent'; variables: IssuesGetEventVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}'; operationId: 'issuesGet'; variables: IssuesGetVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}/comments'; operationId: 'issuesListComments'; variables: IssuesListCommentsVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}/events'; operationId: 'issuesListEvents'; variables: IssuesListEventsVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}/labels'; operationId: 'issuesListLabelsOnIssue'; variables: IssuesListLabelsOnIssueVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}/reactions'; operationId: 'reactionsListForIssue'; variables: ReactionsListForIssueVariables; } | { path: '/repos/{owner}/{repo}/issues/{issue_number}/timeline'; operationId: 'issuesListEventsForTimeline'; variables: IssuesListEventsForTimelineVariables; } | { path: '/repos/{owner}/{repo}/keys'; operationId: 'reposListDeployKeys'; variables: ReposListDeployKeysVariables; } | { path: '/repos/{owner}/{repo}/keys/{key_id}'; operationId: 'reposGetDeployKey'; variables: ReposGetDeployKeyVariables; } | { path: '/repos/{owner}/{repo}/labels'; operationId: 'issuesListLabelsForRepo'; variables: IssuesListLabelsForRepoVariables; } | { path: '/repos/{owner}/{repo}/labels/{name}'; operationId: 'issuesGetLabel'; variables: IssuesGetLabelVariables; } | { path: '/repos/{owner}/{repo}/languages'; operationId: 'reposListLanguages'; variables: ReposListLanguagesVariables; } | { path: '/repos/{owner}/{repo}/license'; operationId: 'licensesGetForRepo'; variables: LicensesGetForRepoVariables; } | { path: '/repos/{owner}/{repo}/milestones'; operationId: 'issuesListMilestones'; variables: IssuesListMilestonesVariables; } | { path: '/repos/{owner}/{repo}/milestones/{milestone_number}'; operationId: 'issuesGetMilestone'; variables: IssuesGetMilestoneVariables; } | { path: '/repos/{owner}/{repo}/milestones/{milestone_number}/labels'; operationId: 'issuesListLabelsForMilestone'; variables: IssuesListLabelsForMilestoneVariables; } | { path: '/repos/{owner}/{repo}/notifications'; operationId: 'activityListRepoNotificationsForAuthenticatedUser'; variables: ActivityListRepoNotificationsForAuthenticatedUserVariables; } | { path: '/repos/{owner}/{repo}/pages'; operationId: 'reposGetPages'; variables: ReposGetPagesVariables; } | { path: '/repos/{owner}/{repo}/pages/builds'; operationId: 'reposListPagesBuilds'; variables: ReposListPagesBuildsVariables; } | { path: '/repos/{owner}/{repo}/pages/builds/latest'; operationId: 'reposGetLatestPagesBuild'; variables: ReposGetLatestPagesBuildVariables; } | { path: '/repos/{owner}/{repo}/pages/builds/{build_id}'; operationId: 'reposGetPagesBuild'; variables: ReposGetPagesBuildVariables; } | { path: '/repos/{owner}/{repo}/projects'; operationId: 'projectsListForRepo'; variables: ProjectsListForRepoVariables; } | { path: '/repos/{owner}/{repo}/pulls'; operationId: 'pullsList'; variables: PullsListVariables; } | { path: '/repos/{owner}/{repo}/pulls/comments'; operationId: 'pullsListReviewCommentsForRepo'; variables: PullsListReviewCommentsForRepoVariables; } | { path: '/repos/{owner}/{repo}/pulls/comments/{comment_id}'; operationId: 'pullsGetReviewComment'; variables: PullsGetReviewCommentVariables; } | { path: '/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions'; operationId: 'reactionsListForPullRequestReviewComment'; variables: ReactionsListForPullRequestReviewCommentVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}'; operationId: 'pullsGet'; variables: PullsGetVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/comments'; operationId: 'pullsListReviewComments'; variables: PullsListReviewCommentsVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/commits'; operationId: 'pullsListCommits'; variables: PullsListCommitsVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/files'; operationId: 'pullsListFiles'; variables: PullsListFilesVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/merge'; operationId: 'pullsCheckIfMerged'; variables: PullsCheckIfMergedVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers'; operationId: 'pullsListRequestedReviewers'; variables: PullsListRequestedReviewersVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews'; operationId: 'pullsListReviews'; variables: PullsListReviewsVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}'; operationId: 'pullsGetReview'; variables: PullsGetReviewVariables; } | { path: '/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments'; operationId: 'pullsListCommentsForReview'; variables: PullsListCommentsForReviewVariables; } | { path: '/repos/{owner}/{repo}/readme'; operationId: 'reposGetReadme'; variables: ReposGetReadmeVariables; } | { path: '/repos/{owner}/{repo}/readme/{dir}'; operationId: 'reposGetReadmeFromAltPath'; variables: ReposGetReadmeFromAltPathVariables; } | { path: '/repos/{owner}/{repo}/releases'; operationId: 'reposListReleases'; variables: ReposListReleasesVariables; } | { path: '/repos/{owner}/{repo}/releases/assets/{asset_id}'; operationId: 'reposGetReleaseAsset'; variables: ReposGetReleaseAssetVariables; } | { path: '/repos/{owner}/{repo}/releases/latest'; operationId: 'reposGetLatestRelease'; variables: ReposGetLatestReleaseVariables; } | { path: '/repos/{owner}/{repo}/releases/tags/{tag}'; operationId: 'reposGetReleaseByTag'; variables: ReposGetReleaseByTagVariables; } | { path: '/repos/{owner}/{repo}/releases/{release_id}'; operationId: 'reposGetRelease'; variables: ReposGetReleaseVariables; } | { path: '/repos/{owner}/{repo}/releases/{release_id}/assets'; operationId: 'reposListReleaseAssets'; variables: ReposListReleaseAssetsVariables; } | { path: '/repos/{owner}/{repo}/secret-scanning/alerts'; operationId: 'secretScanningListAlertsForRepo'; variables: SecretScanningListAlertsForRepoVariables; } | { path: '/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}'; operationId: 'secretScanningGetAlert'; variables: SecretScanningGetAlertVariables; } | { path: '/repos/{owner}/{repo}/stargazers'; operationId: 'activityListStargazersForRepo'; variables: ActivityListStargazersForRepoVariables; } | { path: '/repos/{owner}/{repo}/stats/code_frequency'; operationId: 'reposGetCodeFrequencyStats'; variables: ReposGetCodeFrequencyStatsVariables; } | { path: '/repos/{owner}/{repo}/stats/commit_activity'; operationId: 'reposGetCommitActivityStats'; variables: ReposGetCommitActivityStatsVariables; } | { path: '/repos/{owner}/{repo}/stats/contributors'; operationId: 'reposGetContributorsStats'; variables: ReposGetContributorsStatsVariables; } | { path: '/repos/{owner}/{repo}/stats/participation'; operationId: 'reposGetParticipationStats'; variables: ReposGetParticipationStatsVariables; } | { path: '/repos/{owner}/{repo}/stats/punch_card'; operationId: 'reposGetPunchCardStats'; variables: ReposGetPunchCardStatsVariables; } | { path: '/repos/{owner}/{repo}/subscribers'; operationId: 'activityListWatchersForRepo'; variables: ActivityListWatchersForRepoVariables; } | { path: '/repos/{owner}/{repo}/subscription'; operationId: 'activityGetRepoSubscription'; variables: ActivityGetRepoSubscriptionVariables; } | { path: '/repos/{owner}/{repo}/tags'; operationId: 'reposListTags'; variables: ReposListTagsVariables; } | { path: '/repos/{owner}/{repo}/tarball/{ref}'; operationId: 'reposDownloadTarballArchive'; variables: ReposDownloadTarballArchiveVariables; } | { path: '/repos/{owner}/{repo}/teams'; operationId: 'reposListTeams'; variables: ReposListTeamsVariables; } | { path: '/repos/{owner}/{repo}/topics'; operationId: 'reposGetAllTopics'; variables: ReposGetAllTopicsVariables; } | { path: '/repos/{owner}/{repo}/traffic/clones'; operationId: 'reposGetClones'; variables: ReposGetClonesVariables; } | { path: '/repos/{owner}/{repo}/traffic/popular/paths'; operationId: 'reposGetTopPaths'; variables: ReposGetTopPathsVariables; } | { path: '/repos/{owner}/{repo}/traffic/popular/referrers'; operationId: 'reposGetTopReferrers'; variables: ReposGetTopReferrersVariables; } | { path: '/repos/{owner}/{repo}/traffic/views'; operationId: 'reposGetViews'; variables: ReposGetViewsVariables; } | { path: '/repos/{owner}/{repo}/vulnerability-alerts'; operationId: 'reposCheckVulnerabilityAlerts'; variables: ReposCheckVulnerabilityAlertsVariables; } | { path: '/repos/{owner}/{repo}/zipball/{ref}'; operationId: 'reposDownloadZipballArchive'; variables: ReposDownloadZipballArchiveVariables; } | { path: '/repositories'; operationId: 'reposListPublic'; variables: ReposListPublicVariables; } | { path: '/repositories/{repository_id}/environments/{environment_name}/secrets'; operationId: 'actionsListEnvironmentSecrets'; variables: ActionsListEnvironmentSecretsVariables; } | { path: '/repositories/{repository_id}/environments/{environment_name}/secrets/public-key'; operationId: 'actionsGetEnvironmentPublicKey'; variables: ActionsGetEnvironmentPublicKeyVariables; } | { path: '/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}'; operationId: 'actionsGetEnvironmentSecret'; variables: ActionsGetEnvironmentSecretVariables; } | { path: '/scim/v2/enterprises/{enterprise}/Groups'; operationId: 'enterpriseAdminListProvisionedGroupsEnterprise'; variables: EnterpriseAdminListProvisionedGroupsEnterpriseVariables; } | { path: '/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}'; operationId: 'enterpriseAdminGetProvisioningInformationForEnterpriseGroup'; variables: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupVariables; } | { path: '/scim/v2/enterprises/{enterprise}/Users'; operationId: 'enterpriseAdminListProvisionedIdentitiesEnterprise'; variables: EnterpriseAdminListProvisionedIdentitiesEnterpriseVariables; } | { path: '/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}'; operationId: 'enterpriseAdminGetProvisioningInformationForEnterpriseUser'; variables: EnterpriseAdminGetProvisioningInformationForEnterpriseUserVariables; } | { path: '/scim/v2/organizations/{org}/Users'; operationId: 'scimListProvisionedIdentities'; variables: ScimListProvisionedIdentitiesVariables; } | { path: '/scim/v2/organizations/{org}/Users/{scim_user_id}'; operationId: 'scimGetProvisioningInformationForUser'; variables: ScimGetProvisioningInformationForUserVariables; } | { path: '/search/code'; operationId: 'searchCode'; variables: SearchCodeVariables; } | { path: '/search/commits'; operationId: 'searchCommits'; variables: SearchCommitsVariables; } | { path: '/search/issues'; operationId: 'searchIssuesAndPullRequests'; variables: SearchIssuesAndPullRequestsVariables; } | { path: '/search/labels'; operationId: 'searchLabels'; variables: SearchLabelsVariables; } | { path: '/search/repositories'; operationId: 'searchRepos'; variables: SearchReposVariables; } | { path: '/search/topics'; operationId: 'searchTopics'; variables: SearchTopicsVariables; } | { path: '/search/users'; operationId: 'searchUsers'; variables: SearchUsersVariables; } | { path: '/teams/{team_id}'; operationId: 'teamsGetLegacy'; variables: TeamsGetLegacyVariables; } | { path: '/teams/{team_id}/discussions'; operationId: 'teamsListDiscussionsLegacy'; variables: TeamsListDiscussionsLegacyVariables; } | { path: '/teams/{team_id}/discussions/{discussion_number}'; operationId: 'teamsGetDiscussionLegacy'; variables: TeamsGetDiscussionLegacyVariables; } | { path: '/teams/{team_id}/discussions/{discussion_number}/comments'; operationId: 'teamsListDiscussionCommentsLegacy'; variables: TeamsListDiscussionCommentsLegacyVariables; } | { path: '/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}'; operationId: 'teamsGetDiscussionCommentLegacy'; variables: TeamsGetDiscussionCommentLegacyVariables; } | { path: '/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions'; operationId: 'reactionsListForTeamDiscussionCommentLegacy'; variables: ReactionsListForTeamDiscussionCommentLegacyVariables; } | { path: '/teams/{team_id}/discussions/{discussion_number}/reactions'; operationId: 'reactionsListForTeamDiscussionLegacy'; variables: ReactionsListForTeamDiscussionLegacyVariables; } | { path: '/teams/{team_id}/invitations'; operationId: 'teamsListPendingInvitationsLegacy'; variables: TeamsListPendingInvitationsLegacyVariables; } | { path: '/teams/{team_id}/members'; operationId: 'teamsListMembersLegacy'; variables: TeamsListMembersLegacyVariables; } | { path: '/teams/{team_id}/members/{username}'; operationId: 'teamsGetMemberLegacy'; variables: TeamsGetMemberLegacyVariables; } | { path: '/teams/{team_id}/memberships/{username}'; operationId: 'teamsGetMembershipForUserLegacy'; variables: TeamsGetMembershipForUserLegacyVariables; } | { path: '/teams/{team_id}/projects'; operationId: 'teamsListProjectsLegacy'; variables: TeamsListProjectsLegacyVariables; } | { path: '/teams/{team_id}/projects/{project_id}'; operationId: 'teamsCheckPermissionsForProjectLegacy'; variables: TeamsCheckPermissionsForProjectLegacyVariables; } | { path: '/teams/{team_id}/repos'; operationId: 'teamsListReposLegacy'; variables: TeamsListReposLegacyVariables; } | { path: '/teams/{team_id}/repos/{owner}/{repo}'; operationId: 'teamsCheckPermissionsForRepoLegacy'; variables: TeamsCheckPermissionsForRepoLegacyVariables; } | { path: '/teams/{team_id}/team-sync/group-mappings'; operationId: 'teamsListIdpGroupsForLegacy'; variables: TeamsListIdpGroupsForLegacyVariables; } | { path: '/teams/{team_id}/teams'; operationId: 'teamsListChildLegacy'; variables: TeamsListChildLegacyVariables; } | { path: '/user'; operationId: 'usersGetAuthenticated'; variables: UsersGetAuthenticatedVariables; } | { path: '/user/blocks'; operationId: 'usersListBlockedByAuthenticated'; variables: UsersListBlockedByAuthenticatedVariables; } | { path: '/user/blocks/{username}'; operationId: 'usersCheckBlocked'; variables: UsersCheckBlockedVariables; } | { path: '/user/emails'; operationId: 'usersListEmailsForAuthenticated'; variables: UsersListEmailsForAuthenticatedVariables; } | { path: '/user/followers'; operationId: 'usersListFollowersForAuthenticatedUser'; variables: UsersListFollowersForAuthenticatedUserVariables; } | { path: '/user/following'; operationId: 'usersListFollowedByAuthenticated'; variables: UsersListFollowedByAuthenticatedVariables; } | { path: '/user/following/{username}'; operationId: 'usersCheckPersonIsFollowedByAuthenticated'; variables: UsersCheckPersonIsFollowedByAuthenticatedVariables; } | { path: '/user/gpg_keys'; operationId: 'usersListGpgKeysForAuthenticated'; variables: UsersListGpgKeysForAuthenticatedVariables; } | { path: '/user/gpg_keys/{gpg_key_id}'; operationId: 'usersGetGpgKeyForAuthenticated'; variables: UsersGetGpgKeyForAuthenticatedVariables; } | { path: '/user/installations'; operationId: 'appsListInstallationsForAuthenticatedUser'; variables: AppsListInstallationsForAuthenticatedUserVariables; } | { path: '/user/installations/{installation_id}/repositories'; operationId: 'appsListInstallationReposForAuthenticatedUser'; variables: AppsListInstallationReposForAuthenticatedUserVariables; } | { path: '/user/interaction-limits'; operationId: 'interactionsGetRestrictionsForAuthenticatedUser'; variables: InteractionsGetRestrictionsForAuthenticatedUserVariables; } | { path: '/user/issues'; operationId: 'issuesListForAuthenticatedUser'; variables: IssuesListForAuthenticatedUserVariables; } | { path: '/user/keys'; operationId: 'usersListPublicSshKeysForAuthenticated'; variables: UsersListPublicSshKeysForAuthenticatedVariables; } | { path: '/user/keys/{key_id}'; operationId: 'usersGetPublicSshKeyForAuthenticated'; variables: UsersGetPublicSshKeyForAuthenticatedVariables; } | { path: '/user/marketplace_purchases'; operationId: 'appsListSubscriptionsForAuthenticatedUser'; variables: AppsListSubscriptionsForAuthenticatedUserVariables; } | { path: '/user/marketplace_purchases/stubbed'; operationId: 'appsListSubscriptionsForAuthenticatedUserStubbed'; variables: AppsListSubscriptionsForAuthenticatedUserStubbedVariables; } | { path: '/user/memberships/orgs'; operationId: 'orgsListMembershipsForAuthenticatedUser'; variables: OrgsListMembershipsForAuthenticatedUserVariables; } | { path: '/user/memberships/orgs/{org}'; operationId: 'orgsGetMembershipForAuthenticatedUser'; variables: OrgsGetMembershipForAuthenticatedUserVariables; } | { path: '/user/migrations'; operationId: 'migrationsListForAuthenticatedUser'; variables: MigrationsListForAuthenticatedUserVariables; } | { path: '/user/migrations/{migration_id}'; operationId: 'migrationsGetStatusForAuthenticatedUser'; variables: MigrationsGetStatusForAuthenticatedUserVariables; } | { path: '/user/migrations/{migration_id}/archive'; operationId: 'migrationsGetArchiveForAuthenticatedUser'; variables: MigrationsGetArchiveForAuthenticatedUserVariables; } | { path: '/user/migrations/{migration_id}/repositories'; operationId: 'migrationsListReposForUser'; variables: MigrationsListReposForUserVariables; } | { path: '/user/orgs'; operationId: 'orgsListForAuthenticatedUser'; variables: OrgsListForAuthenticatedUserVariables; } | { path: '/user/packages/{package_type}/{package_name}'; operationId: 'packagesGetPackageForAuthenticatedUser'; variables: PackagesGetPackageForAuthenticatedUserVariables; } | { path: '/user/packages/{package_type}/{package_name}/versions'; operationId: 'packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser'; variables: PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserVariables; } | { path: '/user/packages/{package_type}/{package_name}/versions/{package_version_id}'; operationId: 'packagesGetPackageVersionForAuthenticatedUser'; variables: PackagesGetPackageVersionForAuthenticatedUserVariables; } | { path: '/user/public_emails'; operationId: 'usersListPublicEmailsForAuthenticated'; variables: UsersListPublicEmailsForAuthenticatedVariables; } | { path: '/user/repos'; operationId: 'reposListForAuthenticatedUser'; variables: ReposListForAuthenticatedUserVariables; } | { path: '/user/repository_invitations'; operationId: 'reposListInvitationsForAuthenticatedUser'; variables: ReposListInvitationsForAuthenticatedUserVariables; } | { path: '/user/starred'; operationId: 'activityListReposStarredByAuthenticatedUser'; variables: ActivityListReposStarredByAuthenticatedUserVariables; } | { path: '/user/starred/{owner}/{repo}'; operationId: 'activityCheckRepoIsStarredByAuthenticatedUser'; variables: ActivityCheckRepoIsStarredByAuthenticatedUserVariables; } | { path: '/user/subscriptions'; operationId: 'activityListWatchedReposForAuthenticatedUser'; variables: ActivityListWatchedReposForAuthenticatedUserVariables; } | { path: '/user/teams'; operationId: 'teamsListForAuthenticatedUser'; variables: TeamsListForAuthenticatedUserVariables; } | { path: '/users'; operationId: 'usersList'; variables: UsersListVariables; } | { path: '/users/{username}'; operationId: 'usersGetByUsername'; variables: UsersGetByUsernameVariables; } | { path: '/users/{username}/events'; operationId: 'activityListEventsForAuthenticatedUser'; variables: ActivityListEventsForAuthenticatedUserVariables; } | { path: '/users/{username}/events/orgs/{org}'; operationId: 'activityListOrgEventsForAuthenticatedUser'; variables: ActivityListOrgEventsForAuthenticatedUserVariables; } | { path: '/users/{username}/events/public'; operationId: 'activityListPublicEventsForUser'; variables: ActivityListPublicEventsForUserVariables; } | { path: '/users/{username}/followers'; operationId: 'usersListFollowersForUser'; variables: UsersListFollowersForUserVariables; } | { path: '/users/{username}/following'; operationId: 'usersListFollowingForUser'; variables: UsersListFollowingForUserVariables; } | { path: '/users/{username}/following/{target_user}'; operationId: 'usersCheckFollowingForUser'; variables: UsersCheckFollowingForUserVariables; } | { path: '/users/{username}/gists'; operationId: 'gistsListForUser'; variables: GistsListForUserVariables; } | { path: '/users/{username}/gpg_keys'; operationId: 'usersListGpgKeysForUser'; variables: UsersListGpgKeysForUserVariables; } | { path: '/users/{username}/hovercard'; operationId: 'usersGetContextForUser'; variables: UsersGetContextForUserVariables; } | { path: '/users/{username}/installation'; operationId: 'appsGetUserInstallation'; variables: AppsGetUserInstallationVariables; } | { path: '/users/{username}/keys'; operationId: 'usersListPublicKeysForUser'; variables: UsersListPublicKeysForUserVariables; } | { path: '/users/{username}/orgs'; operationId: 'orgsListForUser'; variables: OrgsListForUserVariables; } | { path: '/users/{username}/packages/{package_type}/{package_name}'; operationId: 'packagesGetPackageForUser'; variables: PackagesGetPackageForUserVariables; } | { path: '/users/{username}/packages/{package_type}/{package_name}/versions'; operationId: 'packagesGetAllPackageVersionsForPackageOwnedByUser'; variables: PackagesGetAllPackageVersionsForPackageOwnedByUserVariables; } | { path: '/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}'; operationId: 'packagesGetPackageVersionForUser'; variables: PackagesGetPackageVersionForUserVariables; } | { path: '/users/{username}/projects'; operationId: 'projectsListForUser'; variables: ProjectsListForUserVariables; } | { path: '/users/{username}/received_events'; operationId: 'activityListReceivedEventsForUser'; variables: ActivityListReceivedEventsForUserVariables; } | { path: '/users/{username}/received_events/public'; operationId: 'activityListReceivedPublicEventsForUser'; variables: ActivityListReceivedPublicEventsForUserVariables; } | { path: '/users/{username}/repos'; operationId: 'reposListForUser'; variables: ReposListForUserVariables; } | { path: '/users/{username}/settings/billing/actions'; operationId: 'billingGetGithubActionsBillingUser'; variables: BillingGetGithubActionsBillingUserVariables; } | { path: '/users/{username}/settings/billing/packages'; operationId: 'billingGetGithubPackagesBillingUser'; variables: BillingGetGithubPackagesBillingUserVariables; } | { path: '/users/{username}/settings/billing/shared-storage'; operationId: 'billingGetSharedStorageBillingUser'; variables: BillingGetSharedStorageBillingUserVariables; } | { path: '/users/{username}/starred'; operationId: 'activityListReposStarredByUser'; variables: ActivityListReposStarredByUserVariables; } | { path: '/users/{username}/subscriptions'; operationId: 'activityListReposWatchedByUser'; variables: ActivityListReposWatchedByUserVariables; } | { path: '/zen'; operationId: 'metaGetZen'; variables: MetaGetZenVariables; }; ================================================ FILE: src/github/githubContext.ts ================================================ import type { QueryKey, UseQueryOptions } from '@tanstack/react-query'; import { QueryOperation } from './githubComponents'; export type GithubContext = { fetcherOptions: { /** * Headers to inject in the fetcher */ headers?: {}; /** * Query params to inject in the fetcher */ queryParams?: {}; }; queryOptions: { /** * Set this to `false` to disable automatic refetching when the query mounts or changes query keys. * Defaults to `true`. */ enabled?: boolean; }; /** * Query key manager. */ queryKeyFn: (operation: QueryOperation) => QueryKey; }; /** * Context injected into every react-query hook wrappers * * @param queryOptions options from the useQuery wrapper */ export function useGithubContext< TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, >( _queryOptions?: Omit< UseQueryOptions, 'queryKey' | 'queryFn' >, ): GithubContext { return { fetcherOptions: {}, queryOptions: {}, queryKeyFn, }; } export const queryKeyFn = (operation: QueryOperation) => { const queryKey: unknown[] = hasPathParams(operation) ? operation.path .split('/') .filter(Boolean) .map((i) => resolvePathParam(i, operation.variables.pathParams)) : operation.path.split('/').filter(Boolean); if (hasQueryParams(operation)) { queryKey.push(operation.variables.queryParams); } if (hasBody(operation)) { queryKey.push(operation.variables.body); } return queryKey; }; // Helpers const resolvePathParam = (key: string, pathParams: Record) => { if (key.startsWith('{') && key.endsWith('}')) { return pathParams[key.slice(1, -1)]; } return key; }; const hasPathParams = ( operation: QueryOperation, ): operation is QueryOperation & { variables: { pathParams: Record }; } => { return Boolean((operation.variables as any).pathParams); }; const hasBody = ( operation: QueryOperation, ): operation is QueryOperation & { variables: { body: Record }; } => { return Boolean((operation.variables as any).body); }; const hasQueryParams = ( operation: QueryOperation, ): operation is QueryOperation & { variables: { queryParams: Record }; } => { return Boolean((operation.variables as any).queryParams); }; ================================================ FILE: src/github/githubFetcher.ts ================================================ import Taro from '@tarojs/taro'; import { GithubContext } from './githubContext'; const baseUrl = 'https://api.github.com'; export type ErrorWrapper = | TError | { status: 'unknown'; payload: string }; export type GithubFetcherOptions = { url: string; method: string; body?: TBody; headers?: THeaders; queryParams?: TQueryParams; pathParams?: TPathParams; signal?: AbortSignal; } & GithubContext['fetcherOptions']; let token = Taro.getStorageSync('authorization'); export async function githubFetch< TData, TError, TBody extends {} | FormData | undefined | null, THeaders extends {}, TQueryParams extends {}, TPathParams extends {}, >({ url, method, body, headers, pathParams, queryParams, }: GithubFetcherOptions< TBody, THeaders, TQueryParams, TPathParams >): Promise { try { const requestHeaders: TaroGeneral.IAnyObject = { Authorization: token || (token = Taro.getStorageSync('authorization')), ...headers, }; const { data, errMsg, header, statusCode } = await Taro.request({ url: `${baseUrl}${resolveUrl(url, queryParams, pathParams)}`, data: body, method: method.toUpperCase() as any, header: requestHeaders, }); if ((statusCode >= 200 && statusCode < 300) || statusCode === 404) { return data; } if (statusCode === 401) { Taro.setStorageSync('username', ''); Taro.setStorageSync('authorization', ''); throw new Error('Token 无效或未登录!'); } if (statusCode === 403) { throw new Error('接口请求限流,请登录或稍后尝试!'); } throw new Error(errMsg); } catch (err) { console.log('err: ', err); Taro.showToast({ title: err.message || '请求失败,请稍后尝试~', icon: 'none', duration: 3000, mask: true, }); throw err; } finally { Taro.stopPullDownRefresh(); } } const resolveUrl = ( url: string, queryParams: Record = {}, pathParams: Record = {}, ) => { let query = new URLSearchParams(queryParams).toString(); if (query) query = `?${query}`; return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)]) + query; }; ================================================ FILE: src/github/githubParameters.ts ================================================ /** * Generated by @openapi-codegen * * @version 1.1.4 */ import type * as Schemas from './githubSchemas'; export type AccessToken = string; export type AccountId = number; export type Actor = string; export type AlertNumber = Schemas.AlertNumber; /** * @default false */ export type All = boolean; export type AppSlug = string; export type ArtifactId = number; export type AssetId = number; export type AuditLogAfter = string; export type AuditLogBefore = string; export type AuditLogInclude = 'web' | 'git' | 'all'; export type AuditLogOrder = 'desc' | 'asc'; export type AuditLogPhrase = string; export type AuthorizationId = number; export type Before = string; export type Branch = string; export type CardId = number; export type CheckName = string; export type CheckRunId = number; export type CheckSuiteId = number; export type ClientId = string; export type ColumnId = number; export type CommentNumber = number; export type CommentId = number; export type CommitSha = string; export type Count = number; export type DeploymentId = number; /** * @default desc */ export type Direction = 'asc' | 'desc'; export type DiscussionNumber = number; export type Enterprise = string; export type EnvironmentName = string; export type Event = string; export type GistId = string; export type GitRef = Schemas.CodeScanningRef; export type GpgKeyId = number; export type GrantId = number; export type HookId = number; export type InstallationId = number; export type InvitationId = number; export type IssueNumber = number; export type JobId = number; export type KeyId = number; export type Labels = string; export type MigrationId = number; export type MilestoneNumber = number; /** * @default desc */ export type Order = 'desc' | 'asc'; export type Org = string; export type OrgId = number; export type Owner = string; export type PackageName = string; export type PackageType = | 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; export type PackageVersionId = number; /** * @default 1 */ export type Page = number; /** * @default false */ export type Participating = boolean; /** * @default day */ export type Per = '' | 'day' | 'week'; /** * @default 30 */ export type PerPage = number; export type PlanId = number; export type ProjectId = number; export type PullNumber = number; export type ReactionId = number; export type ReleaseId = number; export type Repo = string; export type RepoName = string; export type RepositoryId = number; export type ReviewId = number; export type RunId = number; export type RunnerGroupId = number; export type RunnerId = number; export type ScimGroupId = string; export type ScimUserId = string; export type SecretName = string; export type Since = string; export type SinceOrg = number; export type SinceRepo = number; export type SinceUser = number; /** * @default created */ export type Sort = 'created' | 'updated'; export type StartIndex = number; export type Status = 'queued' | 'in_progress' | 'completed'; export type TeamId = number; export type TeamSlug = string; export type ThreadId = number; export type ToolGuid = Schemas.CodeScanningAnalysisToolGuid; export type ToolName = Schemas.CodeScanningAnalysisToolName; export type Username = string; export type WorkflowId = number | string; export type WorkflowRunBranch = string; export type WorkflowRunStatus = | 'completed' | 'action_required' | 'cancelled' | 'failure' | 'neutral' | 'skipped' | 'stale' | 'success' | 'timed_out' | 'in_progress' | 'queued' | 'requested' | 'waiting'; ================================================ FILE: src/github/githubResponses.ts ================================================ /** * Generated by @openapi-codegen * * @version 1.1.4 */ import type * as Schemas from './githubSchemas'; export type BadRequest = Schemas.BasicError; export type CodeScanningForbiddenRead = Schemas.BasicError; export type CodeScanningForbiddenWrite = Schemas.BasicError; export type Conflict = Schemas.BasicError; export type Forbidden = Schemas.BasicError; export type ForbiddenGist = { block?: { created_at?: string; html_url?: string | null; reason?: string; }; documentation_url?: string; message?: string; }; export type Found = void; export type Gone = Schemas.BasicError; export type InternalError = Schemas.BasicError; export type MovedPermanently = void; export type NotFound = Schemas.BasicError; export type NotModified = void; export type PreviewHeaderMissing = { documentation_url: string; message: string; }; export type RequiresAuthentication = Schemas.BasicError; export type ScimBadRequest = Schemas.ScimError; export type ScimConflict = Schemas.ScimError; export type ScimForbidden = Schemas.ScimError; export type ScimInternalError = Schemas.ScimError; export type ScimNotFound = Schemas.ScimError; export type ServiceUnavailable = { code?: string; documentation_url?: string; message?: string; }; export type ValidationFailed = Schemas.ValidationError; export type ValidationFailedSimple = Schemas.ValidationErrorSimple; ================================================ FILE: src/github/githubSchemas.ts ================================================ /** * Generated by @openapi-codegen * * @version 1.1.4 */ export type ActionsBillingUsage = { /** * The amount of free GitHub Actions minutes available. */ included_minutes: number; minutes_used_breakdown: { /** * Total minutes used on macOS runner machines. */ MACOS?: number; /** * Total minutes used on Ubuntu runner machines. */ UBUNTU?: number; /** * Total minutes used on Windows runner machines. */ WINDOWS?: number; }; /** * The sum of the free and paid GitHub Actions minutes used. */ total_minutes_used: number; /** * The total paid GitHub Actions minutes used. */ total_paid_minutes_used: number; }; /** * Whether GitHub Actions is enabled on the repository. */ export type ActionsEnabled = boolean; export type ActionsEnterprisePermissions = { allowed_actions: AllowedActions; enabled_organizations: EnabledOrganizations; selected_actions_url?: SelectedActionsUrl; /** * The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`. */ selected_organizations_url?: string; }; export type ActionsOrganizationPermissions = { allowed_actions: AllowedActions; enabled_repositories: EnabledRepositories; selected_actions_url?: SelectedActionsUrl; /** * The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. */ selected_repositories_url?: string; }; /** * The public key used for setting Actions Secrets. */ export type ActionsPublicKey = { /** * @example "2011-01-26T19:01:12.000Z" */ created_at?: string; /** * @example 2 */ id?: number; /** * The Base64 encoded public key. * * @example hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs= */ key: string; /** * The identifier for the key. * * @example 1234567 */ key_id: string; /** * @example ssh-rsa AAAAB3NzaC1yc2EAAA */ title?: string; /** * @example https://api.github.com/user/keys/2 */ url?: string; }; export type ActionsRepositoryPermissions = { allowed_actions: AllowedActions; enabled: ActionsEnabled; selected_actions_url?: SelectedActionsUrl; }; /** * Set secrets for GitHub Actions. */ export type ActionsSecret = { /** * @format date-time */ created_at: string; /** * The name of the secret. * * @example SECRET_TOKEN */ name: string; /** * @format date-time */ updated_at: string; }; /** * Actor */ export type Actor = { /** * @format uri */ avatar_url: string; display_login?: string; gravatar_id: string | null; id: number; login: string; /** * @format uri */ url: string; }; /** * The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. * * @format date-time */ export type AlertCreatedAt = string; /** * The GitHub URL of the alert resource. * * @format uri */ export type AlertHtmlUrl = string; /** * The REST API URL for fetching the list of instances for an alert. * * @format uri */ export type AlertInstancesUrl = string; /** * The security alert number. */ export type AlertNumber = number; /** * The REST API URL of the alert resource. * * @format uri */ export type AlertUrl = string; /** * The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`. */ export type AllowedActions = 'all' | 'local_only' | 'selected'; /** * Api Overview */ export type ApiOverview = { /** * @example 13.64.0.0/16 * @example 13.65.0.0/16 */ actions?: string[]; /** * @example 127.0.0.1/32 */ api?: string[]; /** * @example 127.0.0.1/32 */ git?: string[]; /** * @example 127.0.0.1/32 */ hooks?: string[]; /** * @example 54.158.161.132 * @example 54.226.70.38 */ importer?: string[]; /** * @example 192.30.252.153/32 * @example 192.30.252.154/32 */ pages?: string[]; ssh_key_fingerprints?: { SHA256_DSA?: string; SHA256_RSA?: string; }; /** * @example true */ verifiable_password_authentication: boolean; /** * @example 127.0.0.1/32 */ web?: string[]; }; /** * The permissions granted to the user-to-server access token. * * @example {"contents":"read","deployments":"write","issues":"read","single_file":"read"} */ export type AppPermissions = { /** * The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: `read` or `write`. */ actions?: 'read' | 'write'; /** * The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: `read` or `write`. */ administration?: 'read' | 'write'; /** * The level of permission to grant the access token for checks on code. Can be one of: `read` or `write`. */ checks?: 'read' | 'write'; /** * The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: `read` or `write`. */ content_references?: 'read' | 'write'; /** * The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: `read` or `write`. */ contents?: 'read' | 'write'; /** * The level of permission to grant the access token for deployments and deployment statuses. Can be one of: `read` or `write`. */ deployments?: 'read' | 'write'; /** * The level of permission to grant the access token for managing repository environments. Can be one of: `read` or `write`. */ environments?: 'read' | 'write'; /** * The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: `read` or `write`. */ issues?: 'read' | 'write'; /** * The level of permission to grant the access token for organization teams and members. Can be one of: `read` or `write`. */ members?: 'read' | 'write'; /** * The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: `read` or `write`. */ metadata?: 'read' | 'write'; /** * The level of permission to grant the access token to manage access to an organization. Can be one of: `read` or `write`. */ organization_administration?: 'read' | 'write'; /** * The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: `read` or `write`. */ organization_hooks?: 'read' | 'write'; /** * The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`. */ organization_plan?: 'read'; /** * The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. */ organization_projects?: 'read' | 'write' | 'admin'; /** * The level of permission to grant the access token to manage organization secrets. Can be one of: `read` or `write`. */ organization_secrets?: 'read' | 'write'; /** * The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: `read` or `write`. */ organization_self_hosted_runners?: 'read' | 'write'; /** * The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: `read` or `write`. */ organization_user_blocking?: 'read' | 'write'; /** * The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: `read` or `write`. */ packages?: 'read' | 'write'; /** * The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`. */ pages?: 'read' | 'write'; /** * The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: `read` or `write`. */ pull_requests?: 'read' | 'write'; /** * The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: `read` or `write`. */ repository_hooks?: 'read' | 'write'; /** * The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. */ repository_projects?: 'read' | 'write' | 'admin'; /** * The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: `read` or `write`. */ secret_scanning_alerts?: 'read' | 'write'; /** * The level of permission to grant the access token to manage repository secrets. Can be one of: `read` or `write`. */ secrets?: 'read' | 'write'; /** * The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: `read` or `write`. */ security_events?: 'read' | 'write'; /** * The level of permission to grant the access token to manage just a single file. Can be one of: `read` or `write`. */ single_file?: 'read' | 'write'; /** * The level of permission to grant the access token for commit statuses. Can be one of: `read` or `write`. */ statuses?: 'read' | 'write'; /** * The level of permission to grant the access token to manage team discussions and related comments. Can be one of: `read` or `write`. */ team_discussions?: 'read' | 'write'; /** * The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: `read`. */ vulnerability_alerts?: 'read'; /** * The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`. */ workflows?: 'write'; }; /** * The authorization associated with an OAuth Access. */ export type ApplicationGrant = { app: { client_id: string; name: string; /** * @format uri */ url: string; }; /** * @example "2011-09-06T17:26:27.000Z" * @format date-time */ created_at: string; /** * @example 1 */ id: number; /** * @example public_repo */ scopes: string[]; /** * @example "2011-09-06T20:39:23.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/applications/grants/1 * @format uri */ url: string; /** * Simple User */ user?: SimpleUser; }; /** * An artifact */ export type Artifact = { /** * @example https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip */ archive_download_url: string; /** * @format date-time */ created_at: string | null; /** * Whether or not the artifact has expired. */ expired: boolean; /** * @format date-time */ expires_at: string; /** * @example 5 */ id: number; /** * The name of the artifact. * * @example AdventureWorks.Framework */ name: string; /** * @example MDEwOkNoZWNrU3VpdGU1 */ node_id: string; /** * The size in bytes of the artifact. * * @example 12345 */ size_in_bytes: number; /** * @format date-time */ updated_at: string | null; /** * @example https://api.github.com/repos/github/hello-world/actions/artifacts/5 */ url: string; }; export type AuditLogEvent = { /** * The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ ['@timestamp']?: number; /** * The name of the action that was performed, for example `user.login` or `repo.create`. */ action?: string; active?: boolean; active_was?: boolean; /** * The actor who performed the action. */ actor?: string; /** * The username of the account being blocked. */ blocked_user?: string; business?: string; config?: any[]; config_was?: any[]; content_type?: string; /** * The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ created_at?: number; deploy_key_fingerprint?: string; emoji?: string; events?: any[]; events_were?: any[]; explanation?: string; fingerprint?: string; hook_id?: number; limited_availability?: boolean; message?: string; name?: string; old_user?: string; openssh_public_key?: string; org?: string; previous_visibility?: string; read_only?: boolean; /** * The name of the repository. */ repo?: string; /** * The name of the repository. */ repository?: string; repository_public?: boolean; target_login?: string; team?: string; /** * The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ transport_protocol?: number; /** * A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ transport_protocol_name?: string; /** * The user that was affected by the action performed (if available). */ user?: string; /** * The repository visibility, for example `public` or `private`. */ visibility?: string; }; /** * Authentication Token */ export type AuthenticationToken = { /** * The time this token expires * * @example "2016-07-11T22:14:10.000Z" * @format date-time */ expires_at: string; /** * @example {"deployments":"write","issues":"read"} */ permissions?: Record; /** * The repositories this token has access to */ repositories?: Repository[]; /** * Describe whether all repositories have been selected or there's a selection involved */ repository_selection?: 'all' | 'selected'; /** * @example config.yaml */ single_file?: string | null; /** * The token used for authentication * * @example v1.1f699f1069f60xxx */ token: string; }; /** * How the author is associated with the repository. * * @example OWNER */ export type AuthorAssociation = | 'COLLABORATOR' | 'CONTRIBUTOR' | 'FIRST_TIMER' | 'FIRST_TIME_CONTRIBUTOR' | 'MANNEQUIN' | 'MEMBER' | 'NONE' | 'OWNER'; /** * The authorization for an OAuth app, GitHub App, or a Personal Access Token. */ export type Authorization = { app: { client_id: string; name: string; /** * @format uri */ url: string; }; /** * @format date-time */ created_at: string; fingerprint: string | null; hashed_token: string | null; id: number; installation?: ScopedInstallation; note: string | null; /** * @format uri */ note_url: string | null; /** * A list of scopes that this authorization is in. */ scopes: string[] | null; token: string; token_last_eight: string | null; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; /** * Simple User */ user?: SimpleUser; }; /** * The status of auto merging a pull request. */ export type AutoMerge = { /** * Commit message for the merge commit. */ commit_message: string; /** * Title for the merge commit message. */ commit_title: string; enabled_by: SimpleUser; /** * The merge method to use. */ merge_method: 'merge' | 'squash' | 'rebase'; } | null; /** * Base Gist */ export type BaseGist = { comments: number; /** * @format uri */ comments_url: string; /** * @format uri */ commits_url: string; /** * @format date-time */ created_at: string; description: string | null; files: { [key: string]: { filename?: string; language?: string; raw_url?: string; size?: number; type?: string; }; }; forks?: any[]; /** * @format uri */ forks_url: string; /** * @format uri */ git_pull_url: string; /** * @format uri */ git_push_url: string; history?: any[]; /** * @format uri */ html_url: string; id: string; node_id: string; /** * Simple User */ owner?: SimpleUser; public: boolean; truncated?: boolean; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Basic Error */ export type BasicError = { documentation_url?: string; message?: string; }; /** * Blob */ export type Blob = { content: string; encoding: string; highlighted_content?: string; node_id: string; sha: string; size: number | null; /** * @format uri */ url: string; }; /** * Branch Protection */ export type BranchProtection = { allow_deletions?: { enabled?: boolean; }; allow_force_pushes?: { enabled?: boolean; }; enabled: boolean; enforce_admins?: ProtectedBranchAdminEnforced; /** * @example "branch/with/protection" */ name?: string; /** * @example "https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection" */ protection_url?: string; required_linear_history?: { enabled?: boolean; }; required_pull_request_reviews?: ProtectedBranchPullRequestReview; required_status_checks: { contexts: string[]; contexts_url?: string; enforcement_level: string; url?: string; }; restrictions?: BranchRestrictionPolicy; url?: string; }; /** * Branch Restriction Policy */ export type BranchRestrictionPolicy = { apps: { created_at?: string; description?: string; events?: string[]; external_url?: string; html_url?: string; id?: number; name?: string; node_id?: string; owner?: { avatar_url?: string; description?: string; events_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers" */ followers_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}" */ following_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}" */ gists_url?: string; /** * @example "" */ gravatar_id?: string; hooks_url?: string; /** * @example "https://github.com/testorg-ea8ec76d71c3af4b" */ html_url?: string; id?: number; issues_url?: string; login?: string; members_url?: string; node_id?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs" */ organizations_url?: string; public_members_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events" */ received_events_url?: string; repos_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}" */ starred_url?: string; /** * @example "https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions" */ subscriptions_url?: string; /** * @example "Organization" */ type?: string; url?: string; }; permissions?: { contents?: string; issues?: string; metadata?: string; single_file?: string; }; slug?: string; updated_at?: string; }[]; /** * @format uri */ apps_url: string; teams: { description?: string | null; html_url?: string; id?: number; members_url?: string; name?: string; node_id?: string; parent?: string | null; permission?: string; privacy?: string; repositories_url?: string; slug?: string; url?: string; }[]; /** * @format uri */ teams_url: string; /** * @format uri */ url: string; users: { avatar_url?: string; events_url?: string; followers_url?: string; following_url?: string; gists_url?: string; gravatar_id?: string; html_url?: string; id?: number; login?: string; node_id?: string; organizations_url?: string; received_events_url?: string; repos_url?: string; site_admin?: boolean; starred_url?: string; subscriptions_url?: string; type?: string; url?: string; }[]; /** * @format uri */ users_url: string; }; /** * Branch Short */ export type BranchShort = { commit: { sha: string; url: string; }; name: string; protected: boolean; }; /** * Branch With Protection */ export type BranchWithProtection = { _links: { html: string; /** * @format uri */ self: string; }; commit: Commit; name: string; /** * @example "mas*" */ pattern?: string; protected: boolean; protection: BranchProtection; /** * @format uri */ protection_url: string; /** * @example 1 */ required_approving_review_count?: number; }; /** * Check Annotation */ export type CheckAnnotation = { /** * @example warning */ annotation_level: string | null; blob_href: string; /** * @example 10 */ end_column: number | null; /** * @example 2 */ end_line: number; /** * @example Check your spelling for 'banaas'. */ message: string | null; /** * @example README.md */ path: string; /** * @example Do you mean 'bananas' or 'banana'? */ raw_details: string | null; /** * @example 5 */ start_column: number | null; /** * @example 2 */ start_line: number; /** * @example Spell Checker */ title: string | null; }; /** * A check performed on the code of a given code change */ export type CheckRun = { /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ app: Integration; check_suite: { id: number; } | null; /** * @example "2018-05-04T01:14:52.000Z" * @format date-time */ completed_at: string | null; /** * @example neutral */ conclusion: | 'success' | 'failure' | 'neutral' | 'cancelled' | 'skipped' | 'timed_out' | 'action_required'; deployment?: DeploymentSimple; /** * @example https://example.com */ details_url: string | null; /** * @example 42 */ external_id: string | null; /** * The SHA of the commit that is being checked. * * @example 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d */ head_sha: string; /** * @example https://github.com/github/hello-world/runs/4 */ html_url: string | null; /** * The id of the check. * * @example 21 */ id: number; /** * The name of the check. * * @example test-coverage */ name: string; /** * @example MDg6Q2hlY2tSdW40 */ node_id: string; output: { annotations_count: number; /** * @format uri */ annotations_url: string; summary: string | null; text: string | null; title: string | null; }; pull_requests: PullRequestMinimal[]; /** * @example "2018-05-04T01:14:52.000Z" * @format date-time */ started_at: string | null; /** * The phase of the lifecycle that the check is currently in. * * @example queued */ status: 'queued' | 'in_progress' | 'completed'; /** * @example https://api.github.com/repos/github/hello-world/check-runs/4 */ url: string; }; /** * A suite of checks performed on the code of a given code change */ export type CheckSuite = { /** * @example d6fde92930d4715a2b49857d24b940956b26d2d3 */ after: string | null; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ app: Integration; /** * @example 146e867f55c26428e5f9fade55a9bbf5e95a7912 */ before: string | null; check_runs_url: string; /** * @example neutral */ conclusion: | 'success' | 'failure' | 'neutral' | 'cancelled' | 'skipped' | 'timed_out' | 'action_required'; /** * @format date-time */ created_at: string | null; /** * @example master */ head_branch: string | null; head_commit: SimpleCommit; /** * The SHA of the head commit that is being checked. * * @example 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d */ head_sha: string; /** * @example 5 */ id: number; latest_check_runs_count: number; /** * @example MDEwOkNoZWNrU3VpdGU1 */ node_id: string; pull_requests: PullRequestMinimal[] | null; repository: MinimalRepository; /** * @example completed */ status: 'queued' | 'in_progress' | 'completed'; /** * @format date-time */ updated_at: string | null; /** * @example https://api.github.com/repos/github/hello-world/check-suites/5 */ url: string | null; }; /** * Check suite configuration preferences for a repository. */ export type CheckSuitePreference = { preferences: { auto_trigger_checks?: { app_id: number; setting: boolean; }[]; }; repository: Repository; }; /** * Clone Traffic */ export type CloneTraffic = { clones: Traffic[]; /** * @example 173 */ count: number; /** * @example 128 */ uniques: number; }; /** * Code Frequency Stat */ export type CodeFrequencyStat = number[]; /** * Code Of Conduct */ export type CodeOfConduct = { /** * @example # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ */ body?: string; /** * @format uri */ html_url: string | null; /** * @example contributor_covenant */ key: string; /** * @example Contributor Covenant */ name: string; /** * @example https://api.github.com/codes_of_conduct/contributor_covenant * @format uri */ url: string; }; /** * Code of Conduct Simple */ export type CodeOfConductSimple = { /** * @example https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md * @format uri */ html_url: string | null; /** * @example citizen_code_of_conduct */ key: string; /** * @example Citizen Code of Conduct */ name: string; /** * @example https://api.github.com/repos/github/docs/community/code_of_conduct * @format uri */ url: string; }; export type CodeScanningAlert = { created_at: AlertCreatedAt; dismissed_at: CodeScanningAlertDismissedAt; dismissed_by: SimpleUser; dismissed_reason: CodeScanningAlertDismissedReason; html_url: AlertHtmlUrl; instances_url: AlertInstancesUrl; most_recent_instance: CodeScanningAlertInstance; number: AlertNumber; rule: CodeScanningAlertRule; state: CodeScanningAlertState; tool: CodeScanningAnalysisTool; url: AlertUrl; }; /** * A classification of the file. For example to identify it as generated. */ export type CodeScanningAlertClassification = | 'source' | 'generated' | 'test' | 'library'; /** * The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. * * @format date-time */ export type CodeScanningAlertDismissedAt = string | null; /** * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. */ export type CodeScanningAlertDismissedReason = | ('false positive' | "won't fix" | 'used in tests') | any | null; /** * Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ export type CodeScanningAlertEnvironment = string; export type CodeScanningAlertInstance = { analysis_key?: CodeScanningAnalysisAnalysisKey; /** * Classifications that have been applied to the file that triggered the alert. * For example identifying it as documentation, or a generated file. */ classifications?: CodeScanningAlertClassification[]; commit_sha?: string; environment?: CodeScanningAlertEnvironment; html_url?: string; location?: CodeScanningAlertLocation; message?: { text?: string; }; ref?: CodeScanningRef; state?: CodeScanningAlertState; }; export type CodeScanningAlertItems = { created_at: AlertCreatedAt; dismissed_at: CodeScanningAlertDismissedAt; dismissed_by: SimpleUser; dismissed_reason: CodeScanningAlertDismissedReason; html_url: AlertHtmlUrl; instances_url: AlertInstancesUrl; most_recent_instance: CodeScanningAlertInstance; number: AlertNumber; rule: CodeScanningAlertRuleSummary; state: CodeScanningAlertState; tool: CodeScanningAnalysisTool; url: AlertUrl; }; /** * Describe a region within a file for the alert. */ export type CodeScanningAlertLocation = { end_column?: number; end_line?: number; path?: string; start_column?: number; start_line?: number; }; export type CodeScanningAlertRule = { /** * A short description of the rule used to detect the alert. */ description?: string; /** * description of the rule used to detect the alert. */ full_description?: string; /** * Detailed documentation for the rule as GitHub Flavored Markdown. */ help?: string; /** * A unique identifier for the rule used to detect the alert. */ id?: string | null; /** * The name of the rule used to detect the alert. */ name?: string; /** * The severity of the alert. */ severity?: 'none' | 'note' | 'warning' | 'error'; /** * A set of tags applicable for the rule. */ tags?: string[]; }; export type CodeScanningAlertRuleSummary = { /** * A short description of the rule used to detect the alert. */ description?: string; /** * A unique identifier for the rule used to detect the alert. */ id?: string | null; /** * The name of the rule used to detect the alert. */ name?: string; /** * The severity of the alert. */ severity?: 'none' | 'note' | 'warning' | 'error'; }; /** * Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. */ export type CodeScanningAlertSetState = 'open' | 'dismissed'; /** * State of a code scanning alert. */ export type CodeScanningAlertState = 'open' | 'closed' | 'dismissed' | 'fixed'; export type CodeScanningAnalysis = { analysis_key: CodeScanningAnalysisAnalysisKey; commit_sha: CodeScanningAnalysisCommitSha; created_at: CodeScanningAnalysisCreatedAt; deletable: boolean; environment: CodeScanningAnalysisEnvironment; /** * @example error reading field xyz */ error: string; /** * Unique identifier for this analysis. */ id: number; ref: CodeScanningRef; /** * The total number of results in the analysis. */ results_count: number; /** * The total number of rules used in the analysis. */ rules_count: number; sarif_id: CodeScanningAnalysisSarifId; tool: CodeScanningAnalysisTool; url: CodeScanningAnalysisUrl; }; /** * Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ export type CodeScanningAnalysisAnalysisKey = string; /** * The SHA of the commit to which the analysis you are uploading relates. * * @maxLength 40 * @minLength 40 * @pattern ^[0-9a-fA-F]+$ */ export type CodeScanningAnalysisCommitSha = string; /** * The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. * * @format date-time */ export type CodeScanningAnalysisCreatedAt = string; /** * Successful deletion of a code scanning analysis */ export type CodeScanningAnalysisDeletion = { /** * Next deletable analysis in chain, with last analysis deletion confirmation * * @format uri */ confirm_delete_url: string | null; /** * Next deletable analysis in chain, without last analysis deletion confirmation * * @format uri */ next_analysis_url: string | null; }; /** * Identifies the variable values associated with the environment in which this analysis was performed. */ export type CodeScanningAnalysisEnvironment = string; /** * A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning)." */ export type CodeScanningAnalysisSarifFile = string; /** * An identifier for the upload. * * @example 6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53 */ export type CodeScanningAnalysisSarifId = string; export type CodeScanningAnalysisTool = { guid?: CodeScanningAnalysisToolGuid; name?: CodeScanningAnalysisToolName; version?: CodeScanningAnalysisToolVersion; }; /** * The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. */ export type CodeScanningAnalysisToolGuid = string | null; /** * The name of the tool used to generate the code scanning analysis. */ export type CodeScanningAnalysisToolName = string; /** * The version of the tool used to generate the code scanning analysis. */ export type CodeScanningAnalysisToolVersion = string | null; /** * The REST API URL of the analysis resource. * * @format uri */ export type CodeScanningAnalysisUrl = string; /** * The full Git reference, formatted as `refs/heads/`, * `refs/pull//merge`, or `refs/pull//head`. */ export type CodeScanningRef = string; export type CodeScanningSarifsReceipt = { id?: CodeScanningAnalysisSarifId; /** * The REST API URL for checking the status of the upload. * * @format uri */ url?: string; }; export type CodeScanningSarifsStatus = { /** * The REST API URL for getting the analyses associated with the upload. * * @format uri */ analyses_url?: string | null; /** * `pending` files have not yet been processed, while `complete` means all results in the SARIF have been stored. */ processing_status?: 'pending' | 'complete'; }; /** * Code Search Result Item */ export type CodeSearchResultItem = { file_size?: number; /** * @format uri */ git_url: string; /** * @format uri */ html_url: string; language?: string | null; /** * @format date-time */ last_modified_at?: string; /** * @example 73..77 * @example 77..78 */ line_numbers?: string[]; name: string; path: string; repository: MinimalRepository; score: number; sha: string; text_matches?: SearchResultTextMatches; /** * @format uri */ url: string; }; /** * Collaborator */ export type Collaborator = { /** * @example https://github.com/images/error/octocat_happy.gif * @format uri */ avatar_url: string; /** * @example https://api.github.com/users/octocat/events{/privacy} */ events_url: string; /** * @example https://api.github.com/users/octocat/followers * @format uri */ followers_url: string; /** * @example https://api.github.com/users/octocat/following{/other_user} */ following_url: string; /** * @example https://api.github.com/users/octocat/gists{/gist_id} */ gists_url: string; /** * @example 41d064eb2195891e12d0413f63227ea7 */ gravatar_id: string | null; /** * @example https://github.com/octocat * @format uri */ html_url: string; /** * @example 1 */ id: number; /** * @example octocat */ login: string; /** * @example MDQ6VXNlcjE= */ node_id: string; /** * @example https://api.github.com/users/octocat/orgs * @format uri */ organizations_url: string; permissions?: { admin: boolean; pull: boolean; push: boolean; }; /** * @example https://api.github.com/users/octocat/received_events * @format uri */ received_events_url: string; /** * @example https://api.github.com/users/octocat/repos * @format uri */ repos_url: string; site_admin: boolean; /** * @example https://api.github.com/users/octocat/starred{/owner}{/repo} */ starred_url: string; /** * @example https://api.github.com/users/octocat/subscriptions * @format uri */ subscriptions_url: string; /** * @example User */ type: string; /** * @example https://api.github.com/users/octocat * @format uri */ url: string; }; export type CombinedBillingUsage = { /** * Numbers of days left in billing cycle. */ days_left_in_billing_cycle: number; /** * Estimated storage space (GB) used in billing cycle. */ estimated_paid_storage_for_month: number; /** * Estimated sum of free and paid storage space (GB) used in billing cycle. */ estimated_storage_for_month: number; }; /** * Combined Commit Status */ export type CombinedCommitStatus = { /** * @format uri */ commit_url: string; repository: MinimalRepository; sha: string; state: string; statuses: SimpleCommitStatus[]; total_count: number; /** * @format uri */ url: string; }; /** * Commit */ export type Commit = { /** * Simple User */ author: SimpleUser; /** * @example https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments * @format uri */ comments_url: string; commit: { /** * Metaproperties for Git author/committer information. */ author: GitUser; /** * @example 0 */ comment_count: number; /** * Metaproperties for Git author/committer information. */ committer: GitUser; /** * @example Fix all the bugs */ message: string; tree: { /** * @example 827efc6d56897b048c772eb4087f854f46256132 */ sha: string; /** * @example https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132 * @format uri */ url: string; }; /** * @example https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ url: string; verification?: Verification; }; /** * Simple User */ committer: SimpleUser; files?: { additions?: number; blob_url?: string; changes?: number; /** * @example "https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573" */ contents_url?: string; deletions?: number; filename?: string; patch?: string; /** * @example "subdir/before_name.txt" */ previous_filename?: string; raw_url?: string; /** * @example "1e8e60ce9733d5283f7836fa602b6365a66b2567" */ sha?: string; status?: string; }[]; /** * @example https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ html_url: string; /** * @example MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ== */ node_id: string; parents: { /** * @example https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd * @format uri */ html_url?: string; /** * @example 7638417db6d59f3c431d3e1f261cc637155684cd */ sha: string; /** * @example https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd * @format uri */ url: string; }[]; /** * @example 6dcb09b5b57875f334f61aebed695e2e4193db5e */ sha: string; stats?: { additions?: number; deletions?: number; total?: number; }; /** * @example https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ url: string; }; /** * Commit Activity */ export type CommitActivity = { /** * @example 0 * @example 3 * @example 26 * @example 20 * @example 39 * @example 1 * @example 0 */ days: number[]; /** * @example 89 */ total: number; /** * @example 1336280400 */ week: number; }; /** * Commit Comment */ export type CommitComment = { author_association: AuthorAssociation; body: string; commit_id: string; /** * @format date-time */ created_at: string; /** * @format uri */ html_url: string; id: number; line: number | null; node_id: string; path: string | null; position: number | null; reactions?: ReactionRollup; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Commit Comparison */ export type CommitComparison = { /** * @example 4 */ ahead_by: number; base_commit: Commit; /** * @example 5 */ behind_by: number; commits: Commit[]; /** * @example https://github.com/octocat/Hello-World/compare/master...topic.diff * @format uri */ diff_url: string; files: DiffEntry[]; /** * @example https://github.com/octocat/Hello-World/compare/master...topic * @format uri */ html_url: string; merge_base_commit: Commit; /** * @example https://github.com/octocat/Hello-World/compare/master...topic.patch * @format uri */ patch_url: string; /** * @example https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17 * @format uri */ permalink_url: string; /** * @example ahead */ status: 'diverged' | 'ahead' | 'behind' | 'identical'; /** * @example 6 */ total_commits: number; /** * @example https://api.github.com/repos/octocat/Hello-World/compare/master...topic * @format uri */ url: string; }; /** * Commit Search Result Item */ export type CommitSearchResultItem = { /** * Simple User */ author: SimpleUser; /** * @format uri */ comments_url: string; commit: { author: { /** * @format date-time */ date: string; email: string; name: string; }; comment_count: number; /** * Metaproperties for Git author/committer information. */ committer: GitUser; message: string; tree: { sha: string; /** * @format uri */ url: string; }; /** * @format uri */ url: string; verification?: Verification; }; /** * Metaproperties for Git author/committer information. */ committer: GitUser; /** * @format uri */ html_url: string; node_id: string; parents: { html_url?: string; sha?: string; url?: string; }[]; repository: MinimalRepository; score: number; sha: string; text_matches?: SearchResultTextMatches; /** * @format uri */ url: string; }; export type CommunityHealthFile = { /** * @format uri */ html_url: string; /** * @format uri */ url: string; }; /** * Community Profile */ export type CommunityProfile = { /** * @example true */ content_reports_enabled?: boolean; /** * @example My first repository on GitHub! */ description: string | null; /** * @example example.com */ documentation: string | null; files: { /** * Code of Conduct Simple */ code_of_conduct: CodeOfConductSimple; contributing: CommunityHealthFile; issue_template: CommunityHealthFile; /** * License Simple */ license: LicenseSimple; pull_request_template: CommunityHealthFile; readme: CommunityHealthFile; }; /** * @example 100 */ health_percentage: number; /** * @example "2017-02-28T19:09:29.000Z" * @format date-time */ updated_at: string | null; }; /** * A list of directory items */ export type ContentDirectory = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; content?: string; /** * @format uri */ download_url: string | null; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; type: string; /** * @format uri */ url: string; }[]; /** * Content File */ export type ContentFile = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; content: string; /** * @format uri */ download_url: string | null; encoding: string; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; /** * @example "git://example.com/defunkt/dotjs.git" */ submodule_git_url?: string; /** * @example "actual/actual.md" */ target?: string; type: string; /** * @format uri */ url: string; }; /** * Content Reference attachments allow you to provide context around URLs posted in comments */ export type ContentReferenceAttachment = { /** * The body of the attachment * * @example Body of the attachment * @maxLength 262144 */ body: string; /** * The ID of the attachment * * @example 21 */ id: number; /** * The node_id of the content attachment * * @example MDE3OkNvbnRlbnRBdHRhY2htZW50MjE= */ node_id?: string; /** * The title of the attachment * * @example Title of the attachment * @maxLength 1024 */ title: string; }; /** * An object describing a symlink */ export type ContentSubmodule = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; /** * @format uri */ download_url: string | null; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; /** * @format uri */ submodule_git_url: string; type: string; /** * @format uri */ url: string; }; /** * An object describing a symlink */ export type ContentSymlink = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; /** * @format uri */ download_url: string | null; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; target: string; type: string; /** * @format uri */ url: string; }; /** * Content Traffic */ export type ContentTraffic = { /** * @example 3542 */ count: number; /** * @example /github/hubot */ path: string; /** * @example github/hubot: A customizable life embetterment robot. */ title: string; /** * @example 2225 */ uniques: number; }; /** * Content Tree */ export type ContentTree = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; /** * @format uri */ download_url: string | null; entries?: { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; content?: string; /** * @format uri */ download_url: string | null; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; type: string; /** * @format uri */ url: string; }[]; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; name: string; path: string; sha: string; size: number; type: string; /** * @format uri */ url: string; }; /** * Contributor */ export type Contributor = { /** * @format uri */ avatar_url?: string; contributions: number; email?: string; events_url?: string; /** * @format uri */ followers_url?: string; following_url?: string; gists_url?: string; gravatar_id?: string | null; /** * @format uri */ html_url?: string; id?: number; login?: string; name?: string; node_id?: string; /** * @format uri */ organizations_url?: string; /** * @format uri */ received_events_url?: string; /** * @format uri */ repos_url?: string; site_admin?: boolean; starred_url?: string; /** * @format uri */ subscriptions_url?: string; type: string; /** * @format uri */ url?: string; }; /** * Contributor Activity */ export type ContributorActivity = { /** * Simple User */ author: SimpleUser; /** * @example 135 */ total: number; /** * @example {"a":6898,"c":10,"d":77,"w":"1367712000"} */ weeks: { a?: number; c?: number; d?: number; w?: string; }[]; }; /** * Credential Authorization */ export type CredentialAuthorization = { /** * @example 12345678 */ authorized_credential_id?: number | null; /** * The note given to the token. This will only be present when the credential is a token. * * @example my token */ authorized_credential_note?: string | null; /** * The title given to the ssh key. This will only be present when the credential is an ssh key. * * @example my ssh key */ authorized_credential_title?: string | null; /** * Date when the credential was last accessed. May be null if it was never accessed * * @example "2011-01-26T19:06:43.000Z" * @format date-time */ credential_accessed_at?: string | null; /** * Date when the credential was authorized for use. * * @example "2011-01-26T19:06:43.000Z" * @format date-time */ credential_authorized_at: string; /** * Unique identifier for the credential. * * @example 1 */ credential_id: number; /** * Human-readable description of the credential type. * * @example SSH Key */ credential_type: string; /** * Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. * * @example jklmnop12345678 */ fingerprint?: string; /** * User login that owns the underlying credential. * * @example monalisa */ login: string; /** * List of oauth scopes the token has been granted. * * @example user * @example repo */ scopes?: string[]; /** * Last eight characters of the credential. Only included in responses with credential_type of personal access token. * * @example 12345678 */ token_last_eight?: string; }; /** * An SSH key granting access to a single repository. */ export type DeployKey = { created_at: string; id: number; key: string; read_only: boolean; title: string; url: string; verified: boolean; }; /** * A request for a specific ref(branch,sha,tag) to be deployed */ export type Deployment = { /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ created_at: string; /** * Simple User */ creator: SimpleUser; /** * @example Deploy request from hubot */ description: string | null; /** * Name for the target deployment environment. * * @example production */ environment: string; /** * Unique identifier of the deployment * * @example 42 */ id: number; /** * @example MDEwOkRlcGxveW1lbnQx */ node_id: string; /** * @example staging */ original_environment?: string; payload: {}; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; /** * Specifies if the given environment is one that end-users directly interact with. Default: false. * * @example true */ production_environment?: boolean; /** * The ref to deploy. This can be a branch, tag, or sha. * * @example topic-branch */ ref: string; /** * @example https://api.github.com/repos/octocat/example * @format uri */ repository_url: string; /** * @example a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d */ sha: string; /** * @example https://api.github.com/repos/octocat/example/deployments/1/statuses * @format uri */ statuses_url: string; /** * Parameter to specify a task to execute * * @example deploy */ task: string; /** * Specifies if the given environment is will no longer exist at some point in the future. Default: false. * * @example true */ transient_environment?: boolean; /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/example/deployments/1 * @format uri */ url: string; }; /** * The type of reviewer. Must be one of: `User` or `Team` * * @example User */ export type DeploymentReviewerType = 'User' | 'Team'; /** * A deployment created as the result of an Actions check run from a workflow that references an environment */ export type DeploymentSimple = { /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ created_at: string; /** * @example Deploy request from hubot */ description: string | null; /** * Name for the target deployment environment. * * @example production */ environment: string; /** * Unique identifier of the deployment * * @example 42 */ id: number; /** * @example MDEwOkRlcGxveW1lbnQx */ node_id: string; /** * @example staging */ original_environment?: string; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; /** * Specifies if the given environment is one that end-users directly interact with. Default: false. * * @example true */ production_environment?: boolean; /** * @example https://api.github.com/repos/octocat/example * @format uri */ repository_url: string; /** * @example https://api.github.com/repos/octocat/example/deployments/1/statuses * @format uri */ statuses_url: string; /** * Parameter to specify a task to execute * * @example deploy */ task: string; /** * Specifies if the given environment is will no longer exist at some point in the future. Default: false. * * @example true */ transient_environment?: boolean; /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/example/deployments/1 * @format uri */ url: string; }; /** * The status of a deployment. */ export type DeploymentStatus = { /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ created_at: string; /** * Simple User */ creator: SimpleUser; /** * @example https://api.github.com/repos/octocat/example/deployments/42 * @format uri */ deployment_url: string; /** * A short description of the status. * * @default * @example Deployment finished successfully. * @maxLength 140 */ description: string; /** * The environment of the deployment that the status is for. * * @default * @example production */ environment?: string; /** * The URL for accessing your environment. * * @default * @example https://staging.example.com/ * @format uri */ environment_url?: string; /** * @example 1 */ id: number; /** * The URL to associate with this status. * * @default * @example https://example.com/deployment/42/output * @format uri */ log_url?: string; /** * @example MDE2OkRlcGxveW1lbnRTdGF0dXMx */ node_id: string; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; /** * @example https://api.github.com/repos/octocat/example * @format uri */ repository_url: string; /** * The state of the status. * * @example success */ state: | 'error' | 'failure' | 'inactive' | 'pending' | 'success' | 'queued' | 'in_progress'; /** * Deprecated: the URL to associate with this status. * * @default * @example https://example.com/deployment/42/output * @format uri */ target_url: string; /** * @example "2012-07-20T01:19:13.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/example/deployments/42/statuses/1 * @format uri */ url: string; }; /** * The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. */ export type DeploymentBranchPolicy = { /** * Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. */ custom_branch_policies: boolean; /** * Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. */ protected_branches: boolean; } | null; /** * Diff Entry */ export type DiffEntry = { /** * @example 103 */ additions: number; /** * @example https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt * @format uri */ blob_url: string; /** * @example 124 */ changes: number; /** * @example https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ contents_url: string; /** * @example 21 */ deletions: number; /** * @example file1.txt */ filename: string; /** * @example @@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test */ patch?: string; /** * @example file.txt */ previous_filename?: string; /** * @example https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt * @format uri */ raw_url: string; /** * @example bbcd538c8e72b8c175046e27cc8f907076331401 */ sha: string; /** * @example added */ status: string; }; /** * Email */ export type Email = { /** * @example octocat@github.com * @format email */ email: string; /** * @example true */ primary: boolean; /** * @example true */ verified: boolean; /** * @example public */ visibility: string | null; }; /** * The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ export type EnabledOrganizations = 'all' | 'none' | 'selected'; /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ export type EnabledRepositories = 'all' | 'none' | 'selected'; /** * An enterprise account */ export type Enterprise = { /** * @format uri */ avatar_url: string; /** * @example "2019-01-26T19:01:12.000Z" * @format date-time */ created_at: string | null; /** * A short description of the enterprise. */ description?: string | null; /** * @example https://github.com/enterprises/octo-business * @format uri */ html_url: string; /** * Unique identifier of the enterprise * * @example 42 */ id: number; /** * The name of the enterprise. * * @example Octo Business */ name: string; /** * @example MDEwOlJlcG9zaXRvcnkxMjk2MjY5 */ node_id: string; /** * The slug url identifier for the enterprise. * * @example octo-business */ slug: string; /** * @example "2019-01-26T19:14:43.000Z" * @format date-time */ updated_at: string | null; /** * The enterprise's website URL. * * @format uri */ website_url?: string | null; }; /** * Details of a deployment environment */ export type Environment = { /** * The time that the environment was created, in ISO 8601 format. * * @example "2020-11-23T22:00:40.000Z" * @format date-time */ created_at: string; deployment_branch_policy?: DeploymentBranchPolicy; /** * @example https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging */ html_url: string; /** * The id of the environment. * * @example 56780428 */ id: number; /** * The name of the environment. * * @example staging */ name: string; /** * @example MDExOkVudmlyb25tZW50NTY3ODA0Mjg= */ node_id: string; protection_rules?: ( | { /** * @example 3515 */ id: number; /** * @example MDQ6R2F0ZTM1MTU= */ node_id: string; /** * @example wait_timer */ type: string; wait_timer?: WaitTimer; } | { /** * @example 3755 */ id: number; /** * @example MDQ6R2F0ZTM3NTU= */ node_id: string; /** * The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ reviewers?: { reviewer?: SimpleUser | TeamSimple; type?: DeploymentReviewerType; }[]; /** * @example required_reviewers */ type: string; } | { /** * @example 3515 */ id: number; /** * @example MDQ6R2F0ZTM1MTU= */ node_id: string; /** * @example branch_policy */ type: string; } )[]; /** * The time that the environment was last updated, in ISO 8601 format. * * @example "2020-11-23T22:00:40.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/github/hello-world/environments/staging */ url: string; }; /** * An entry in the reviews log for environment deployments */ export type EnvironmentApprovals = { /** * The comment submitted with the deployment review * * @example Ship it! */ comment: string; /** * The list of environments that were approved or rejected */ environments: { /** * The time that the environment was created, in ISO 8601 format. * * @example "2020-11-23T22:00:40.000Z" * @format date-time */ created_at?: string; /** * @example https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging */ html_url?: string; /** * The id of the environment. * * @example 56780428 */ id?: number; /** * The name of the environment. * * @example staging */ name?: string; /** * @example MDExOkVudmlyb25tZW50NTY3ODA0Mjg= */ node_id?: string; /** * The time that the environment was last updated, in ISO 8601 format. * * @example "2020-11-23T22:00:40.000Z" * @format date-time */ updated_at?: string; /** * @example https://api.github.com/repos/github/hello-world/environments/staging */ url?: string; }[]; /** * Whether deployment to the environment(s) was approved or rejected * * @example approved */ state: 'approved' | 'rejected'; user: SimpleUser; }; /** * Event */ export type Event = { actor: Actor; /** * @format date-time */ created_at: string | null; id: string; org?: Actor; payload: { action: string; comment?: IssueComment; issue?: IssueSimple; pages?: { action?: string; html_url?: string; page_name?: string; sha?: string; summary?: string | null; title?: string; }[]; }; public: boolean; repo: { id: number; name: string; /** * @format uri */ url: string; }; type: string | null; }; /** * Feed */ export type Feed = { _links: { current_user?: LinkWithType; current_user_actor?: LinkWithType; current_user_organization?: LinkWithType; current_user_organizations?: LinkWithType[]; current_user_public?: LinkWithType; security_advisories?: LinkWithType; timeline: LinkWithType; user: LinkWithType; }; /** * @example https://github.com/octocat.private.actor?token=abc123 */ current_user_actor_url?: string; /** * @example https://github.com/octocat-org */ current_user_organization_url?: string; /** * @example https://github.com/organizations/github/octocat.private.atom?token=abc123 */ current_user_organization_urls?: string[]; /** * @example https://github.com/octocat */ current_user_public_url?: string; /** * @example https://github.com/octocat.private?token=abc123 */ current_user_url?: string; /** * @example https://github.com/security-advisories */ security_advisories_url?: string; /** * @example https://github.com/timeline */ timeline_url: string; /** * @example https://github.com/{user} */ user_url: string; }; /** * File Commit */ export type FileCommit = { commit: { author?: { date?: string; email?: string; name?: string; }; committer?: { date?: string; email?: string; name?: string; }; html_url?: string; message?: string; node_id?: string; parents?: { html_url?: string; sha?: string; url?: string; }[]; sha?: string; tree?: { sha?: string; url?: string; }; url?: string; verification?: { payload?: string | null; reason?: string; signature?: string | null; verified?: boolean; }; }; content: { _links?: { git?: string; html?: string; self?: string; }; download_url?: string; git_url?: string; html_url?: string; name?: string; path?: string; sha?: string; size?: number; type?: string; url?: string; } | null; }; /** * Full Repository */ export type FullRepository = { /** * @example true */ allow_merge_commit?: boolean; /** * @example true */ allow_rebase_merge?: boolean; /** * @example true */ allow_squash_merge?: boolean; /** * Whether anonymous git access is allowed. * * @default true */ anonymous_access_enabled?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} */ archive_url: string; archived: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/assignees{/user} */ assignees_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} */ blobs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/branches{/branch} */ branches_url: string; /** * @example https://github.com/octocat/Hello-World.git */ clone_url: string; code_of_conduct?: CodeOfConductSimple; /** * @example http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} */ collaborators_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/comments{/number} */ comments_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/commits{/sha} */ commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} */ compare_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contents/{+path} */ contents_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contributors * @format uri */ contributors_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at: string; /** * @example master */ default_branch: string; /** * @example false */ delete_branch_on_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/deployments * @format uri */ deployments_url: string; /** * @example This your first repo! */ description: string | null; /** * Returns whether or not this repository disabled. */ disabled: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/downloads * @format uri */ downloads_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/events * @format uri */ events_url: string; fork: boolean; forks: number; /** * @example 9 */ forks_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/forks * @format uri */ forks_url: string; /** * @example octocat/Hello-World */ full_name: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/commits{/sha} */ git_commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/refs{/sha} */ git_refs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/tags{/sha} */ git_tags_url: string; /** * @example git:github.com/octocat/Hello-World.git */ git_url: string; /** * @example true */ has_downloads: boolean; /** * @example true */ has_issues: boolean; has_pages: boolean; /** * @example true */ has_projects: boolean; /** * @example true */ has_wiki: boolean; /** * @example https://github.com * @format uri */ homepage: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/hooks * @format uri */ hooks_url: string; /** * @example https://github.com/octocat/Hello-World * @format uri */ html_url: string; /** * @example 1296269 */ id: number; /** * @example true */ is_template?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/comments{/number} */ issue_comment_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/events{/number} */ issue_events_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues{/number} */ issues_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/keys{/key_id} */ keys_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/labels{/name} */ labels_url: string; language: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/languages * @format uri */ languages_url: string; /** * License Simple */ license: LicenseSimple; master_branch?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/merges * @format uri */ merges_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/milestones{/number} */ milestones_url: string; /** * @example git:git.example.com/octocat/Hello-World * @format uri */ mirror_url: string | null; /** * @example Hello-World */ name: string; /** * @example 0 */ network_count: number; /** * @example MDEwOlJlcG9zaXRvcnkxMjk2MjY5 */ node_id: string; /** * @example http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} */ notifications_url: string; open_issues: number; /** * @example 0 */ open_issues_count: number; /** * Simple User */ organization?: SimpleUser; /** * Simple User */ owner: SimpleUser; parent?: Repository; permissions?: { admin: boolean; pull: boolean; push: boolean; }; private: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/pulls{/number} */ pulls_url: string; /** * @example "2011-01-26T19:06:43.000Z" * @format date-time */ pushed_at: string; /** * @example http://api.github.com/repos/octocat/Hello-World/releases{/id} */ releases_url: string; /** * @example 108 */ size: number; source?: Repository; /** * @example git@github.com:octocat/Hello-World.git */ ssh_url: string; /** * @example 80 */ stargazers_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/stargazers * @format uri */ stargazers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/statuses/{sha} */ statuses_url: string; /** * @example 42 */ subscribers_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/subscribers * @format uri */ subscribers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/subscription * @format uri */ subscription_url: string; /** * @example https://svn.github.com/octocat/Hello-World * @format uri */ svn_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/tags * @format uri */ tags_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/teams * @format uri */ teams_url: string; temp_clone_token?: string | null; /** * A git repository */ template_repository?: Repository; /** * @example octocat * @example atom * @example electron * @example API */ topics?: string[]; /** * @example http://api.github.com/repos/octocat/Hello-World/git/trees{/sha} */ trees_url: string; /** * @example "2011-01-26T19:14:43.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World * @format uri */ url: string; /** * The repository visibility: public, private, or internal. * * @example public */ visibility?: string; watchers: number; /** * @example 80 */ watchers_count: number; }; /** * A comment made to a gist. */ export type GistComment = { author_association: AuthorAssociation; /** * The comment text. * * @example Body of the attachment * @maxLength 65535 */ body: string; /** * @example "2011-04-18T23:23:56.000Z" * @format date-time */ created_at: string; /** * @example 1 */ id: number; /** * @example MDExOkdpc3RDb21tZW50MQ== */ node_id: string; /** * @example "2011-04-18T23:23:56.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/gists/a6db0bec360bb87e9418/comments/1 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Gist Commit */ export type GistCommit = { change_status: { additions?: number; deletions?: number; total?: number; }; /** * @example "2010-04-14T02:15:15.000Z" * @format date-time */ committed_at: string; /** * @example https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f * @format uri */ url: string; /** * Simple User */ user: SimpleUser; /** * @example 57a7f021a713b1c5a6a199b54cc514735d2d462f */ version: string; }; /** * Gist Simple */ export type GistSimple = { comments?: number; comments_url?: string; commits_url?: string; created_at?: string; description?: string | null; files?: { [key: string]: { content?: string; filename?: string; language?: string; raw_url?: string; size?: number; truncated?: boolean; type?: string; } | null; }; forks_url?: string; git_pull_url?: string; git_push_url?: string; html_url?: string; id?: string; node_id?: string; owner?: SimpleUser; public?: boolean; truncated?: boolean; updated_at?: string; url?: string; user?: string | null; }; /** * Low-level Git commit operations within a repository */ export type GitCommit = { /** * Identifying information for the git-user */ author: { /** * Timestamp of the commit * * @example "2014-08-08T20:02:04.000Z" * @format date-time */ date: string; /** * Git email address of the user * * @example monalisa.octocat@example.com */ email: string; /** * Name of the git user * * @example Monalisa Octocat */ name: string; }; /** * Identifying information for the git-user */ committer: { /** * Timestamp of the commit * * @example "2014-08-08T20:02:04.000Z" * @format date-time */ date: string; /** * Git email address of the user * * @example monalisa.octocat@example.com */ email: string; /** * Name of the git user * * @example Monalisa Octocat */ name: string; }; /** * @format uri */ html_url: string; /** * Message describing the purpose of the commit * * @example Fix #42 */ message: string; node_id: string; parents: { /** * @format uri */ html_url: string; /** * SHA for the commit * * @example 7638417db6d59f3c431d3e1f261cc637155684cd */ sha: string; /** * @format uri */ url: string; }[]; /** * SHA for the commit * * @example 7638417db6d59f3c431d3e1f261cc637155684cd */ sha: string; tree: { /** * SHA for the commit * * @example 7638417db6d59f3c431d3e1f261cc637155684cd */ sha: string; /** * @format uri */ url: string; }; /** * @format uri */ url: string; verification: { payload: string | null; reason: string; signature: string | null; verified: boolean; }; }; /** * Git references within a repository */ export type GitRef = { node_id: string; object: { /** * SHA for the reference * * @example 7638417db6d59f3c431d3e1f261cc637155684cd * @maxLength 40 * @minLength 40 */ sha: string; type: string; /** * @format uri */ url: string; }; ref: string; /** * @format uri */ url: string; }; /** * Metadata for a Git tag */ export type GitTag = { /** * Message describing the purpose of the tag * * @example Initial public release */ message: string; /** * @example MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw== */ node_id: string; object: { sha: string; type: string; /** * @format uri */ url: string; }; /** * @example 940bd336248efae0f9ee5bc7b2d5c985887b16ac */ sha: string; /** * Name of the tag * * @example v0.0.1 */ tag: string; tagger: { date: string; email: string; name: string; }; /** * URL for the tag * * @example https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac * @format uri */ url: string; verification?: Verification; }; /** * The hierarchy between files in a Git repository. */ export type GitTree = { sha: string; /** * Objects specifying a tree structure * * @example {"mode":"100644","path":"file.rb","properties":{"mode":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"size":{"type":"integer"},"type":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"],"sha":"44b4fc6d56897b048c772eb4087f854f46256132","size":30,"type":"blob","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132"} */ tree: { /** * @example 040000 */ mode?: string; /** * @example test/file.rb */ path?: string; /** * @example 23f6827669e43831def8a7ad935069c8bd418261 */ sha?: string; /** * @example 12 */ size?: number; /** * @example tree */ type?: string; /** * @example https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261 */ url?: string; }[]; truncated: boolean; /** * @format uri */ url: string; }; /** * Metaproperties for Git author/committer information. */ export type GitUser = { /** * @example "2007-10-29T02:42:39.000-07:00" */ date?: string; /** * @example "chris@ozmm.org" */ email?: string; /** * @example "Chris Wanstrath" */ name?: string; }; /** * Gitignore Template */ export type GitignoreTemplate = { /** * @example C */ name: string; /** * @example # Object files *.o # Libraries *.lib *.a # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app */ source: string; }; /** * A unique encryption key */ export type GpgKey = { /** * @example true */ can_certify: boolean; can_encrypt_comms: boolean; can_encrypt_storage: boolean; /** * @example true */ can_sign: boolean; /** * @example "2016-03-24T17:31:04.000Z" * @format date-time */ created_at: string; /** * @example {"email":"mastahyeti@users.noreply.github.com","verified":true} */ emails: { email?: string; verified?: boolean; }[]; /** * @format date-time */ expires_at: string | null; /** * @example 3 */ id: number; /** * @example 3262EFF25BA0D270 */ key_id: string; primary_key_id: number | null; /** * @example xsBNBFayYZ... */ public_key: string; raw_key: string | null; /** * @example {"can_certify":false,"can_encrypt_comms":true,"can_encrypt_storage":true,"can_sign":false,"created_at":"2016-03-24T17:31:04.000Z","emails":[],"expires_at":null,"id":4,"key_id":"4A595D4C72EE49C7","primary_key_id":3,"public_key":"zsBNBFayYZ...","subkeys":[]} */ subkeys: { can_certify?: boolean; can_encrypt_comms?: boolean; can_encrypt_storage?: boolean; can_sign?: boolean; created_at?: string; emails?: any[]; expires_at?: string | null; id?: number; key_id?: string; primary_key_id?: number; public_key?: string; raw_key?: string | null; subkeys?: any[]; }[]; }; /** * External Groups to be mapped to a team for membership */ export type GroupMapping = { /** * Array of groups to be mapped to this team * * @example {"group_description":"A group of Developers working on AzureAD SAML SSO","group_id":"111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa","group_name":"saml-azuread-test"} * @example {"group_description":"Another group of Developers working on AzureAD SAML SSO","group_id":"2bb2bb2b-bb22-22bb-2bb2-bb2bbb2bb2b2","group_name":"saml-azuread-test2"} */ groups?: { /** * a description of the group * * @example A group of Developers working on AzureAD SAML SSO */ group_description: string; /** * The ID of the group * * @example 111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa */ group_id: string; /** * The name of the group * * @example saml-azuread-test */ group_name: string; /** * synchronization status for this group mapping * * @example unsynced */ status?: string; /** * the time of the last sync for this group-mapping * * @example 2019-06-03 22:27:15:000 -700 */ synced_at?: string; }[]; }; /** * Webhooks for repositories. */ export type Hook = { /** * Determines whether the hook is actually triggered on pushes. * * @example true */ active: boolean; config: { content_type?: WebhookConfigContentType; /** * @example "sha256" */ digest?: string; /** * @example "foo@bar.com" */ email?: string; insecure_ssl?: WebhookConfigInsecureSsl; /** * @example "foo" */ password?: string; /** * @example "roomer" */ room?: string; secret?: WebhookConfigSecret; /** * @example "foo" */ subdomain?: string; /** * @example "abc" */ token?: string; url?: WebhookConfigUrl; }; /** * @example "2011-09-06T17:26:27.000Z" * @format date-time */ created_at: string; /** * Determines what events the hook is triggered for. Default: ['push']. * * @example push * @example pull_request */ events: string[]; /** * Unique identifier of the webhook. * * @example 42 */ id: number; last_response: HookResponse; /** * The name of a valid service, use 'web' for a webhook. * * @example web */ name: string; /** * @example https://api.github.com/repos/octocat/Hello-World/hooks/1/pings * @format uri */ ping_url: string; /** * @example https://api.github.com/repos/octocat/Hello-World/hooks/1/test * @format uri */ test_url: string; type: string; /** * @example "2011-09-06T20:39:23.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/hooks/1 * @format uri */ url: string; }; export type HookResponse = { code: number | null; message: string | null; status: string | null; }; /** * Hovercard */ export type Hovercard = { contexts: { message: string; octicon: string; }[]; }; /** * A repository import from an external source. */ export type Import = { authors_count?: number | null; /** * @format uri */ authors_url: string; commit_count?: number | null; error_message?: string | null; failed_step?: string | null; has_large_files?: boolean; /** * @format uri */ html_url: string; import_percent?: number | null; large_files_count?: number; large_files_size?: number; message?: string; project_choices?: { human_name?: string; tfvc_project?: string; vcs?: string; }[]; push_percent?: number | null; /** * @format uri */ repository_url: string; status: | 'auth' | 'error' | 'none' | 'detecting' | 'choose' | 'auth_failed' | 'importing' | 'mapping' | 'waiting_to_push' | 'pushing' | 'complete' | 'setup' | 'unknown' | 'detection_found_multiple' | 'detection_found_nothing' | 'detection_needs_auth'; status_text?: string | null; svc_root?: string; svn_root?: string; tfvc_project?: string; /** * @format uri */ url: string; use_lfs?: string; vcs: string | null; /** * The URL of the originating repository. */ vcs_url: string; }; /** * Installation */ export type Installation = { /** * @example https://api.github.com/installations/1/access_tokens * @format uri */ access_tokens_url: string; account: SimpleUser | Enterprise | null; /** * @example 1 */ app_id: number; /** * @example github-actions */ app_slug: string; /** * @example "test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com" */ contact_email?: string | null; /** * @format date-time */ created_at: string; events: string[]; /** * @example true */ has_multiple_single_files?: boolean; /** * @example https://github.com/organizations/github/settings/installations/1 * @format uri */ html_url: string; /** * The ID of the installation. * * @example 1 */ id: number; /** * @example {"deployments":"write","issues":"read"} */ permissions: { checks?: string; contents?: string; deployments?: string; /** * @example "read" */ issues?: string; metadata?: string; /** * @example "read" */ organization_administration?: string; pull_requests?: string; statuses?: string; }; /** * @example https://api.github.com/installation/repositories * @format uri */ repositories_url: string; /** * Describe whether all repositories have been selected or there's a selection involved */ repository_selection: 'all' | 'selected'; /** * @example config.yaml */ single_file_name: string | null; /** * @example config.yml * @example .github/issue_TEMPLATE.md */ single_file_paths?: string[]; /** * @format date-time */ suspended_at?: string | null; /** * Simple User */ suspended_by?: SimpleUser; /** * The ID of the user or organization this token is being scoped to. */ target_id: number; /** * @example Organization */ target_type: string; /** * @format date-time */ updated_at: string; }; /** * Authentication token for a GitHub App installed on a user or org. */ export type InstallationToken = { expires_at: string; /** * @example true */ has_multiple_single_files?: boolean; permissions?: { contents?: string; issues?: string; /** * @example read */ metadata?: string; /** * @example read */ single_file?: string; }; repositories?: Repository[]; repository_selection?: 'all' | 'selected'; /** * @example README.md */ single_file?: string; /** * @example config.yml * @example .github/issue_TEMPLATE.md */ single_file_paths?: string[]; token: string; }; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ export type Integration = { /** * @example "Iv1.25b5d1e65ffc4022" */ client_id?: string; /** * @example "1d4b2097ac622ba702d19de498f005747a8b21d3" */ client_secret?: string; /** * @example "2017-07-08T20:18:44.000Z" * @format date-time */ created_at: string; /** * @example The description of the app. */ description: string | null; /** * The list of events for the GitHub app * * @example label * @example deployment */ events: string[]; /** * @example https://example.com * @format uri */ external_url: string; /** * @example https://github.com/apps/super-ci * @format uri */ html_url: string; /** * Unique identifier of the GitHub app * * @example 37 */ id: number; /** * The number of installations associated with the GitHub app * * @example 5 */ installations_count?: number; /** * The name of the GitHub app * * @example Probot Owners */ name: string; /** * @example MDExOkludGVncmF0aW9uMQ== */ node_id: string; /** * Simple User */ owner: SimpleUser; /** * @example "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\n-----END RSA PRIVATE KEY-----\n" */ pem?: string; /** * The set of permissions for the GitHub app * * @example {"deployments":"write","issues":"read"} */ permissions: { checks?: string; contents?: string; deployments?: string; issues?: string; metadata?: string; } & { [key: string]: string; }; /** * The slug name of the GitHub app * * @example probot-owners */ slug?: string; /** * @example "2017-07-08T20:18:44.000Z" * @format date-time */ updated_at: string; /** * @example "6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b" */ webhook_secret?: string; } & { [key: string]: any; }; /** * The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`. * * @example one_month */ export type InteractionExpiry = | 'one_day' | 'three_days' | 'one_week' | 'one_month' | 'six_months'; /** * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. * * @example collaborators_only */ export type InteractionGroup = | 'existing_users' | 'contributors_only' | 'collaborators_only'; /** * Limit interactions to a specific type of user for a specified duration */ export type InteractionLimit = { expiry?: InteractionExpiry; limit: InteractionGroup; }; /** * Interaction limit settings. */ export type InteractionLimitResponse = { /** * @example "2018-08-17T04:18:39.000Z" * @format date-time */ expires_at: string; limit: InteractionGroup; /** * @example repository */ origin: string; }; /** * Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. */ export type Issue = { active_lock_reason?: string | null; /** * Simple User */ assignee: SimpleUser; assignees?: SimpleUser[] | null; author_association: AuthorAssociation; /** * Contents of the issue * * @example It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug? */ body?: string; body_html?: string; body_text?: string; /** * @format date-time */ closed_at: string | null; /** * Simple User */ closed_by?: SimpleUser; comments: number; /** * @format uri */ comments_url: string; /** * @format date-time */ created_at: string; /** * @format uri */ events_url: string; /** * @format uri */ html_url: string; id: number; /** * Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository * * @example bug * @example registration */ labels: ( | string | { color?: string | null; ['default']?: boolean; description?: string | null; id?: number; name?: string; node_id?: string; /** * @format uri */ url?: string; } )[]; labels_url: string; locked: boolean; /** * A collection of related issues and pull requests. */ milestone: Milestone; node_id: string; /** * Number uniquely identifying the issue within its repository * * @example 42 */ number: number; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; pull_request?: { /** * @format uri */ diff_url: string | null; /** * @format uri */ html_url: string | null; /** * @format date-time */ merged_at?: string | null; /** * @format uri */ patch_url: string | null; /** * @format uri */ url: string | null; }; reactions?: ReactionRollup; repository?: Repository; /** * @format uri */ repository_url: string; /** * State of the issue; either 'open' or 'closed' * * @example open */ state: string; /** * @format uri */ timeline_url?: string; /** * Title of the issue * * @example Widget creation fails in Safari on OS X 10.8 */ title: string; /** * @format date-time */ updated_at: string; /** * URL for the issue * * @example https://api.github.com/repositories/42/issues/1 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Comments provide a way for people to collaborate on an issue. */ export type IssueComment = { author_association: AuthorAssociation; /** * Contents of the issue comment * * @example What version of Safari were you using when you observed this bug? */ body?: string; body_html?: string; body_text?: string; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ created_at: string; /** * @format uri */ html_url: string; /** * Unique identifier of the issue comment * * @example 42 */ id: number; /** * @format uri */ issue_url: string; node_id: string; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; reactions?: ReactionRollup; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ updated_at: string; /** * URL for the issue comment * * @example https://api.github.com/repositories/42/issues/comments/1 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Issue Event */ export type IssueEvent = { /** * Simple User */ actor: SimpleUser; /** * Simple User */ assignee?: SimpleUser; /** * Simple User */ assigner?: SimpleUser; author_association?: AuthorAssociation; /** * @example 6dcb09b5b57875f334f61aebed695e2e4193db5e */ commit_id: string | null; /** * @example https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e */ commit_url: string | null; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ created_at: string; dismissed_review?: IssueEventDismissedReview; /** * @example closed */ event: string; /** * @example 1 */ id: number; issue?: IssueSimple; label?: IssueEventLabel; lock_reason?: string | null; milestone?: IssueEventMilestone; /** * @example MDEwOklzc3VlRXZlbnQx */ node_id: string; project_card?: IssueEventProjectCard; rename?: IssueEventRename; /** * Simple User */ requested_reviewer?: SimpleUser; requested_team?: Team; /** * Simple User */ review_requester?: SimpleUser; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/events/1 * @format uri */ url: string; }; export type IssueEventDismissedReview = { dismissal_commit_id?: string | null; dismissal_message: string | null; review_id: number; state: string; }; /** * Issue Event for Issue */ export type IssueEventForIssue = { actor?: SimpleUser; author_association?: AuthorAssociation; /** * @example ":+1:" */ body?: string; /** * @example "

    Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam.

    " */ body_html?: string; /** * @example "Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam." */ body_text?: string; commit_id?: string | null; commit_url?: string | null; created_at?: string; event?: string; /** * @example "https://github.com/owner-3906e11a33a3d55ba449d63f/BBB_Private_Repo/commit/480d4f47447129f015cb327536c522ca683939a1" */ html_url?: string; id?: number; /** * @example "https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/issues/1" */ issue_url?: string; /** * @example "off-topic" */ lock_reason?: string; /** * @example "add a bunch of files" */ message?: string; node_id?: string; /** * @example "https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/pulls/2" */ pull_request_url?: string; /** * @example "480d4f47447129f015cb327536c522ca683939a1" */ sha?: string; /** * @example "commented" */ state?: string; /** * @example "2020-07-09T00:17:51Z" */ submitted_at?: string; /** * @example "2020-07-09T00:17:36Z" */ updated_at?: string; url?: string; }; /** * Issue Event Label */ export type IssueEventLabel = { color: string | null; name: string | null; }; /** * Issue Event Milestone */ export type IssueEventMilestone = { title: string; }; /** * Issue Event Project Card */ export type IssueEventProjectCard = { column_name: string; id: number; previous_column_name?: string; project_id: number; /** * @format uri */ project_url: string; /** * @format uri */ url: string; }; /** * Issue Event Rename */ export type IssueEventRename = { from: string; to: string; }; /** * Issue Search Result Item */ export type IssueSearchResultItem = { active_lock_reason?: string | null; /** * Simple User */ assignee: SimpleUser; assignees?: SimpleUser[] | null; author_association: AuthorAssociation; body?: string; body_html?: string; body_text?: string; /** * @format date-time */ closed_at: string | null; comments: number; /** * @format uri */ comments_url: string; /** * @format date-time */ created_at: string; draft?: boolean; /** * @format uri */ events_url: string; /** * @format uri */ html_url: string; id: number; labels: { color?: string; ['default']?: boolean; description?: string | null; id?: number; name?: string; node_id?: string; url?: string; }[]; labels_url: string; locked: boolean; /** * A collection of related issues and pull requests. */ milestone: Milestone; node_id: string; number: number; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; pull_request?: { /** * @format uri */ diff_url: string | null; /** * @format uri */ html_url: string | null; /** * @format date-time */ merged_at?: string | null; /** * @format uri */ patch_url: string | null; /** * @format uri */ url: string | null; }; repository?: Repository; /** * @format uri */ repository_url: string; score: number; state: string; text_matches?: SearchResultTextMatches; /** * @format uri */ timeline_url?: string; title: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Issue Simple */ export type IssueSimple = { /** * @example too heated */ active_lock_reason?: string | null; /** * Simple User */ assignee: SimpleUser; assignees?: SimpleUser[] | null; author_association: AuthorAssociation; /** * @example I'm having a problem with this. */ body?: string; body_html?: string; body_text?: string; /** * @format date-time */ closed_at: string | null; /** * @example 0 */ comments: number; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347/comments * @format uri */ comments_url: string; /** * @example "2011-04-22T13:33:48.000Z" * @format date-time */ created_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347/events * @format uri */ events_url: string; /** * @example https://github.com/octocat/Hello-World/issues/1347 * @format uri */ html_url: string; /** * @example 1 */ id: number; labels: Label[]; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name} */ labels_url: string; /** * @example true */ locked: boolean; /** * A collection of related issues and pull requests. */ milestone: Milestone; /** * @example MDU6SXNzdWUx */ node_id: string; /** * @example 1347 */ number: number; /** * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ performed_via_github_app?: Integration; pull_request?: { /** * @format uri */ diff_url: string | null; /** * @format uri */ html_url: string | null; /** * @format date-time */ merged_at?: string | null; /** * @format uri */ patch_url: string | null; /** * @format uri */ url: string | null; }; repository?: Repository; /** * @example https://api.github.com/repos/octocat/Hello-World * @format uri */ repository_url: string; /** * @example open */ state: string; /** * @format uri */ timeline_url?: string; /** * @example Found a bug */ title: string; /** * @example "2011-04-22T13:33:48.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Information of a job execution in a workflow run */ export type Job = { /** * @example https://api.github.com/repos/github/hello-world/check-runs/4 */ check_run_url: string; /** * The time that the job finished, in ISO 8601 format. * * @example "2019-08-08T15:00:00.000Z" * @format date-time */ completed_at: string | null; /** * The outcome of the job. * * @example success */ conclusion: string | null; /** * The SHA of the commit that is being run. * * @example 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d */ head_sha: string; /** * @example https://github.com/github/hello-world/runs/4 */ html_url: string | null; /** * The id of the job. * * @example 21 */ id: number; /** * The name of the job. * * @example test-coverage */ name: string; /** * @example MDg6Q2hlY2tSdW40 */ node_id: string; /** * The id of the associated workflow run. * * @example 5 */ run_id: number; /** * @example https://api.github.com/repos/github/hello-world/actions/runs/5 */ run_url: string; /** * The time that the job started, in ISO 8601 format. * * @example "2019-08-08T15:00:00.000Z" * @format date-time */ started_at: string; /** * The phase of the lifecycle that the job is currently in. * * @example queued */ status: 'queued' | 'in_progress' | 'completed'; /** * Steps in this job. */ steps?: { /** * The time that the job finished, in ISO 8601 format. * * @example "2019-08-08T15:00:00.000Z" * @format date-time */ completed_at?: string | null; /** * The outcome of the job. * * @example success */ conclusion: string | null; /** * The name of the job. * * @example test-coverage */ name: string; /** * @example 1 */ number: number; /** * The time that the step started, in ISO 8601 format. * * @example "2019-08-08T15:00:00.000Z" * @format date-time */ started_at?: string | null; /** * The phase of the lifecycle that the job is currently in. * * @example queued */ status: 'queued' | 'in_progress' | 'completed'; }[]; /** * @example https://api.github.com/repos/github/hello-world/actions/jobs/21 */ url: string; }; /** * Key */ export type Key = { /** * @format date-time */ created_at: string; id: number; key: string; key_id: string; read_only: boolean; title: string; url: string; verified: boolean; }; /** * Key Simple */ export type KeySimple = { id: number; key: string; }; /** * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). */ export type Label = { /** * 6-character hex code, without the leading #, identifying the color * * @example FFFFFF */ color: string; /** * @example true */ ['default']: boolean; /** * @example Something isn't working */ description: string | null; /** * @example 208045946 */ id: number; /** * The name of the label. * * @example bug */ name: string; /** * @example MDU6TGFiZWwyMDgwNDU5NDY= */ node_id: string; /** * URL for the label * * @example https://api.github.com/repositories/42/labels/bug * @format uri */ url: string; }; /** * Label Search Result Item */ export type LabelSearchResultItem = { color: string; ['default']: boolean; description: string | null; id: number; name: string; node_id: string; score: number; text_matches?: SearchResultTextMatches; /** * @format uri */ url: string; }; /** * Language */ export type Language = { [key: string]: number; }; /** * License */ export type License = { /** * @example The MIT License (MIT) Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ body: string; /** * @example include-copyright */ conditions: string[]; /** * @example A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty. */ description: string; /** * @example true */ featured: boolean; /** * @example http://choosealicense.com/licenses/mit/ * @format uri */ html_url: string; /** * @example Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders. */ implementation: string; /** * @example mit */ key: string; /** * @example no-liability */ limitations: string[]; /** * @example MIT License */ name: string; /** * @example MDc6TGljZW5zZW1pdA== */ node_id: string; /** * @example commercial-use * @example modifications * @example distribution * @example sublicense * @example private-use */ permissions: string[]; /** * @example MIT */ spdx_id: string | null; /** * @example https://api.github.com/licenses/mit * @format uri */ url: string | null; }; /** * License Content */ export type LicenseContent = { _links: { /** * @format uri */ git: string | null; /** * @format uri */ html: string | null; /** * @format uri */ self: string; }; content: string; /** * @format uri */ download_url: string | null; encoding: string; /** * @format uri */ git_url: string | null; /** * @format uri */ html_url: string | null; /** * License Simple */ license: LicenseSimple; name: string; path: string; sha: string; size: number; type: string; /** * @format uri */ url: string; }; /** * License Simple */ export type LicenseSimple = { /** * @format uri */ html_url?: string; /** * @example mit */ key: string; /** * @example MIT License */ name: string; /** * @example MDc6TGljZW5zZW1pdA== */ node_id: string; /** * @example MIT */ spdx_id: string | null; /** * @example https://api.github.com/licenses/mit * @format uri */ url: string | null; }; /** * Hypermedia Link */ export type Link = { href: string; }; /** * Hypermedia Link with Type */ export type LinkWithType = { href: string; type: string; }; export type MarketplaceAccount = { /** * @format email */ email?: string | null; id: number; login: string; node_id?: string; /** * @format email */ organization_billing_email?: string | null; type: string; /** * @format uri */ url: string; }; /** * Marketplace Listing Plan */ export type MarketplaceListingPlan = { /** * @example https://api.github.com/marketplace_listing/plans/1313/accounts * @format uri */ accounts_url: string; /** * @example Up to 25 private repositories * @example 11 concurrent builds */ bullets: string[]; /** * @example A professional-grade CI solution */ description: string; /** * @example true */ has_free_trial: boolean; /** * @example 1313 */ id: number; /** * @example 1099 */ monthly_price_in_cents: number; /** * @example Pro */ name: string; /** * @example 3 */ number: number; /** * @example flat-rate */ price_model: string; /** * @example published */ state: string; unit_name: string | null; /** * @example https://api.github.com/marketplace_listing/plans/1313 * @format uri */ url: string; /** * @example 11870 */ yearly_price_in_cents: number; }; /** * Marketplace Purchase */ export type MarketplacePurchase = { id: number; login: string; marketplace_pending_change?: { effective_date?: string; id?: number; is_installed?: boolean; plan?: MarketplaceListingPlan; unit_count?: number | null; } | null; marketplace_purchase: { billing_cycle?: string; free_trial_ends_on?: string | null; is_installed?: boolean; next_billing_date?: string | null; on_free_trial?: boolean; plan?: MarketplaceListingPlan; unit_count?: number | null; updated_at?: string; }; organization_billing_email?: string; type: string; url: string; }; /** * A migration. */ export type Migration = { /** * @format uri */ archive_url?: string; /** * @example "2015-07-06T22:33:38.000Z" * @format date-time */ created_at: string; exclude?: any[]; exclude_attachments: boolean; /** * @example 0b989ba4-242f-11e5-81e1-c7b6966d2516 */ guid: string; /** * @example 79 */ id: number; /** * @example true */ lock_repositories: boolean; node_id: string; /** * Simple User */ owner: SimpleUser; repositories: Repository[]; /** * @example pending */ state: string; /** * @example "2015-07-06T22:33:38.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/orgs/octo-org/migrations/79 * @format uri */ url: string; }; /** * A collection of related issues and pull requests. */ export type Milestone = { /** * @example "2013-02-12T13:22:01.000Z" * @format date-time */ closed_at: string | null; /** * @example 8 */ closed_issues: number; /** * @example "2011-04-10T20:09:31.000Z" * @format date-time */ created_at: string; /** * Simple User */ creator: SimpleUser; /** * @example Tracking milestone for version 1.0 */ description: string | null; /** * @example "2012-10-09T23:39:01.000Z" * @format date-time */ due_on: string | null; /** * @example https://github.com/octocat/Hello-World/milestones/v1.0 * @format uri */ html_url: string; /** * @example 1002604 */ id: number; /** * @example https://api.github.com/repos/octocat/Hello-World/milestones/1/labels * @format uri */ labels_url: string; /** * @example MDk6TWlsZXN0b25lMTAwMjYwNA== */ node_id: string; /** * The number of the milestone. * * @example 42 */ number: number; /** * @example 4 */ open_issues: number; /** * The state of the milestone. * * @default open * @example open */ state: 'open' | 'closed'; /** * The title of the milestone. * * @example v1.0 */ title: string; /** * @example "2014-03-03T18:58:10.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/milestones/1 * @format uri */ url: string; }; /** * Minimal Repository */ export type MinimalRepository = { /** * @example http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} */ archive_url: string; archived?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/assignees{/user} */ assignees_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} */ blobs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/branches{/branch} */ branches_url: string; clone_url?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} */ collaborators_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/comments{/number} */ comments_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/commits{/sha} */ commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} */ compare_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contents/{+path} */ contents_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contributors * @format uri */ contributors_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at?: string | null; default_branch?: string; delete_branch_on_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/deployments * @format uri */ deployments_url: string; /** * @example This your first repo! */ description: string | null; disabled?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/downloads * @format uri */ downloads_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/events * @format uri */ events_url: string; fork: boolean; /** * @example 0 */ forks?: number; forks_count?: number; /** * @example http://api.github.com/repos/octocat/Hello-World/forks * @format uri */ forks_url: string; /** * @example octocat/Hello-World */ full_name: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/commits{/sha} */ git_commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/refs{/sha} */ git_refs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/tags{/sha} */ git_tags_url: string; git_url?: string; has_downloads?: boolean; has_issues?: boolean; has_pages?: boolean; has_projects?: boolean; has_wiki?: boolean; homepage?: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/hooks * @format uri */ hooks_url: string; /** * @example https://github.com/octocat/Hello-World * @format uri */ html_url: string; /** * @example 1296269 */ id: number; is_template?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/comments{/number} */ issue_comment_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/events{/number} */ issue_events_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues{/number} */ issues_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/keys{/key_id} */ keys_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/labels{/name} */ labels_url: string; language?: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/languages * @format uri */ languages_url: string; license?: { key?: string; name?: string; node_id?: string; spdx_id?: string; url?: string; } | null; /** * @example http://api.github.com/repos/octocat/Hello-World/merges * @format uri */ merges_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/milestones{/number} */ milestones_url: string; mirror_url?: string | null; /** * @example Hello-World */ name: string; network_count?: number; /** * @example MDEwOlJlcG9zaXRvcnkxMjk2MjY5 */ node_id: string; /** * @example http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} */ notifications_url: string; /** * @example 0 */ open_issues?: number; open_issues_count?: number; /** * Simple User */ owner: SimpleUser; permissions?: { admin?: boolean; pull?: boolean; push?: boolean; }; private: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/pulls{/number} */ pulls_url: string; /** * @example "2011-01-26T19:06:43.000Z" * @format date-time */ pushed_at?: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/releases{/id} */ releases_url: string; size?: number; ssh_url?: string; stargazers_count?: number; /** * @example http://api.github.com/repos/octocat/Hello-World/stargazers * @format uri */ stargazers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/statuses/{sha} */ statuses_url: string; subscribers_count?: number; /** * @example http://api.github.com/repos/octocat/Hello-World/subscribers * @format uri */ subscribers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/subscription * @format uri */ subscription_url: string; svn_url?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/tags * @format uri */ tags_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/teams * @format uri */ teams_url: string; temp_clone_token?: string; /** * A git repository */ template_repository?: Repository; topics?: string[]; /** * @example http://api.github.com/repos/octocat/Hello-World/git/trees{/sha} */ trees_url: string; /** * @example "2011-01-26T19:14:43.000Z" * @format date-time */ updated_at?: string | null; /** * @example https://api.github.com/repos/octocat/Hello-World * @format uri */ url: string; visibility?: string; /** * @example 0 */ watchers?: number; watchers_count?: number; }; /** * Org Hook */ export type OrgHook = { /** * @example true */ active: boolean; config: { /** * @example "form" */ content_type?: string; /** * @example "0" */ insecure_ssl?: string; /** * @example "********" */ secret?: string; /** * @example "http://example.com/2" */ url?: string; }; /** * @example "2011-09-06T17:26:27.000Z" * @format date-time */ created_at: string; /** * @example push * @example pull_request */ events: string[]; /** * @example 1 */ id: number; /** * @example web */ name: string; /** * @example https://api.github.com/orgs/octocat/hooks/1/pings * @format uri */ ping_url: string; type: string; /** * @example "2011-09-06T20:39:23.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/orgs/octocat/hooks/1 * @format uri */ url: string; }; /** * Org Membership */ export type OrgMembership = { organization: OrganizationSimple; /** * @example https://api.github.com/orgs/octocat * @format uri */ organization_url: string; permissions?: { can_create_repository: boolean; }; /** * @example admin */ role: string; /** * @example active */ state: string; /** * @example https://api.github.com/orgs/octocat/memberships/defunkt * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Secrets for GitHub Actions for an organization. */ export type OrganizationActionsSecret = { /** * @format date-time */ created_at: string; /** * The name of the secret. * * @example SECRET_TOKEN */ name: string; /** * @example https://api.github.com/organizations/org/secrets/my_secret/repositories * @format uri */ selected_repositories_url?: string; /** * @format date-time */ updated_at: string; /** * Visibility of a secret */ visibility: 'all' | 'private' | 'selected'; }; /** * Organization Full */ export type OrganizationFull = { /** * @example https://github.com/images/error/octocat_happy.gif */ avatar_url: string; /** * @example org@example.com * @format email */ billing_email?: string | null; /** * @example https://github.com/blog * @format uri */ blog?: string; /** * @example 8 */ collaborators?: number | null; /** * @example GitHub */ company?: string; /** * @example "2008-01-14T04:33:35.000Z" * @format date-time */ created_at: string; default_repository_permission?: string | null; /** * @example A great organization */ description: string | null; /** * @example 10000 */ disk_usage?: number | null; /** * @example octocat@github.com * @format email */ email?: string; /** * @example https://api.github.com/orgs/github/events * @format uri */ events_url: string; /** * @example 20 */ followers: number; /** * @example 0 */ following: number; /** * @example true */ has_organization_projects: boolean; /** * @example true */ has_repository_projects: boolean; /** * @example https://api.github.com/orgs/github/hooks */ hooks_url: string; /** * @example https://github.com/octocat * @format uri */ html_url: string; /** * @example 1 */ id: number; /** * @example true */ is_verified?: boolean; /** * @example https://api.github.com/orgs/github/issues */ issues_url: string; /** * @example San Francisco */ location?: string; /** * @example github */ login: string; /** * @example all */ members_allowed_repository_creation_type?: string; /** * @example true */ members_can_create_internal_repositories?: boolean; /** * @example true */ members_can_create_pages?: boolean; /** * @example true */ members_can_create_private_repositories?: boolean; /** * @example true */ members_can_create_public_repositories?: boolean; /** * @example true */ members_can_create_repositories?: boolean | null; /** * @example https://api.github.com/orgs/github/members{/member} */ members_url: string; /** * @example github */ name?: string; /** * @example MDEyOk9yZ2FuaXphdGlvbjE= */ node_id: string; /** * @example 100 */ owned_private_repos?: number; plan?: { filled_seats?: number; name: string; private_repos: number; seats?: number; space: number; }; /** * @example 81 */ private_gists?: number | null; /** * @example 1 */ public_gists: number; /** * @example https://api.github.com/orgs/github/public_members{/member} */ public_members_url: string; /** * @example 2 */ public_repos: number; /** * @example https://api.github.com/orgs/github/repos * @format uri */ repos_url: string; /** * @example 100 */ total_private_repos?: number; /** * @example github */ twitter_username?: string | null; /** * @example true */ two_factor_requirement_enabled?: boolean | null; /** * @example Organization */ type: string; /** * @format date-time */ updated_at: string; /** * @example https://api.github.com/orgs/github * @format uri */ url: string; }; /** * Organization Invitation */ export type OrganizationInvitation = { created_at: string; email: string | null; failed_at?: string; failed_reason?: string; id: number; invitation_team_url: string; /** * @example "https://api.github.com/organizations/16/invitations/1/teams" */ invitation_teams_url?: string; inviter: SimpleUser; login: string | null; /** * @example "MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x" */ node_id: string; role: string; team_count: number; }; /** * Organization Simple */ export type OrganizationSimple = { /** * @example https://github.com/images/error/octocat_happy.gif */ avatar_url: string; /** * @example A great organization */ description: string | null; /** * @example https://api.github.com/orgs/github/events * @format uri */ events_url: string; /** * @example https://api.github.com/orgs/github/hooks */ hooks_url: string; /** * @example 1 */ id: number; /** * @example https://api.github.com/orgs/github/issues */ issues_url: string; /** * @example github */ login: string; /** * @example https://api.github.com/orgs/github/members{/member} */ members_url: string; /** * @example MDEyOk9yZ2FuaXphdGlvbjE= */ node_id: string; /** * @example https://api.github.com/orgs/github/public_members{/member} */ public_members_url: string; /** * @example https://api.github.com/orgs/github/repos * @format uri */ repos_url: string; /** * @example https://api.github.com/orgs/github * @format uri */ url: string; }; /** * A software package */ export type Package = { /** * @format date-time */ created_at: string; /** * @example https://github.com/orgs/github/packages/container/package/super-linter */ html_url: string; /** * Unique identifier of the package. * * @example 1 */ id: number; /** * The name of the package. * * @example super-linter */ name: string; /** * Simple User */ owner?: SimpleUser; /** * @example docker */ package_type: 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; /** * Minimal Repository */ repository?: MinimalRepository; /** * @format date-time */ updated_at: string; /** * @example https://api.github.com/orgs/github/packages/container/super-linter */ url: string; /** * The number of versions of the package. * * @example 1 */ version_count: number; /** * @example private */ visibility: 'private' | 'public'; }; /** * A version of a software package */ export type PackageVersion = { /** * @example "2011-04-10T20:09:31.000Z" * @format date-time */ created_at: string; /** * @example "2014-03-03T18:58:10.000Z" * @format date-time */ deleted_at?: string; description?: string; /** * @example https://github.com/orgs/github/packages/container/super-linter/786068 */ html_url?: string; /** * Unique identifier of the package version. * * @example 1 */ id: number; /** * @example MIT */ license?: string; metadata?: { container?: { tags: any[]; }; docker?: { tag?: any[]; }; /** * @example docker */ package_type: | 'npm' | 'maven' | 'rubygems' | 'docker' | 'nuget' | 'container'; }; /** * The name of the package version. * * @example latest */ name: string; /** * @example https://github.com/orgs/github/packages/container/package/super-linter */ package_html_url: string; /** * @example "2014-03-03T18:58:10.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/orgs/github/packages/container/super-linter/versions/786068 */ url: string; }; export type PackagesBillingUsage = { /** * Free storage space (GB) for GitHub Packages. */ included_gigabytes_bandwidth: number; /** * Sum of the free and paid storage space (GB) for GitHuub Packages. */ total_gigabytes_bandwidth_used: number; /** * Total paid storage space (GB) for GitHuub Packages. */ total_paid_gigabytes_bandwidth_used: number; }; /** * The configuration for GitHub Pages for a repository. */ export type Page = { /** * The Pages site's custom domain * * @example example.com */ cname: string | null; /** * Whether the Page has a custom 404 page. * * @default false * @example false */ custom_404: boolean; /** * The web address the Page can be accessed from. * * @example https://example.com * @format uri */ html_url?: string; /** * Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. * * @example true */ public: boolean; source?: PagesSourceHash; /** * The status of the most recent build of the Page. * * @example built */ status: 'built' | 'building' | 'errored'; /** * The API address for accessing this Page resource. * * @example https://api.github.com/repos/github/hello-world/pages * @format uri */ url: string; }; /** * Page Build */ export type PageBuild = { commit: string; /** * @format date-time */ created_at: string; duration: number; error: { message: string | null; }; /** * Simple User */ pusher: SimpleUser; status: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; }; /** * Page Build Status */ export type PageBuildStatus = { /** * @example queued */ status: string; /** * @example https://api.github.com/repos/github/hello-world/pages/builds/latest * @format uri */ url: string; }; export type PagesSourceHash = { branch: string; path: string; }; export type ParticipationStats = { all: number[]; owner: number[]; }; /** * Details of a deployment that is waiting for protection rules to pass */ export type PendingDeployment = { /** * Whether the currently authenticated user can approve the deployment * * @example true */ current_user_can_approve: boolean; environment: { /** * @example https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging */ html_url?: string; /** * The id of the environment. * * @example 56780428 */ id?: number; /** * The name of the environment. * * @example staging */ name?: string; /** * @example MDExOkVudmlyb25tZW50NTY3ODA0Mjg= */ node_id?: string; /** * @example https://api.github.com/repos/github/hello-world/environments/staging */ url?: string; }; /** * The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ reviewers: { reviewer?: SimpleUser | TeamSimple; type?: DeploymentReviewerType; }[]; /** * The set duration of the wait timer * * @example 30 */ wait_timer: number; /** * The time that the wait timer began. * * @example "2020-11-23T22:00:40.000Z" * @format date-time */ wait_timer_started_at: string | null; }; /** * Porter Author */ export type PorterAuthor = { email: string; id: number; /** * @format uri */ import_url: string; name: string; remote_id: string; remote_name: string; /** * @format uri */ url: string; }; /** * Porter Large File */ export type PorterLargeFile = { oid: string; path: string; ref_name: string; size: number; }; /** * Private User */ export type PrivateUser = { /** * @example https://github.com/images/error/octocat_happy.gif * @format uri */ avatar_url: string; /** * @example There once was... */ bio: string | null; /** * @example https://github.com/blog */ blog: string | null; business_plus?: boolean; /** * @example 8 */ collaborators: number; /** * @example GitHub */ company: string | null; /** * @example "2008-01-14T04:33:35.000Z" * @format date-time */ created_at: string; /** * @example 10000 */ disk_usage: number; /** * @example octocat@github.com * @format email */ email: string | null; /** * @example https://api.github.com/users/octocat/events{/privacy} */ events_url: string; /** * @example 20 */ followers: number; /** * @example https://api.github.com/users/octocat/followers * @format uri */ followers_url: string; /** * @example 0 */ following: number; /** * @example https://api.github.com/users/octocat/following{/other_user} */ following_url: string; /** * @example https://api.github.com/users/octocat/gists{/gist_id} */ gists_url: string; /** * @example 41d064eb2195891e12d0413f63227ea7 */ gravatar_id: string | null; hireable: boolean | null; /** * @example https://github.com/octocat * @format uri */ html_url: string; /** * @example 1 */ id: number; ldap_dn?: string; /** * @example San Francisco */ location: string | null; /** * @example octocat */ login: string; /** * @example monalisa octocat */ name: string | null; /** * @example MDQ6VXNlcjE= */ node_id: string; /** * @example https://api.github.com/users/octocat/orgs * @format uri */ organizations_url: string; /** * @example 100 */ owned_private_repos: number; plan?: { collaborators: number; name: string; private_repos: number; space: number; }; /** * @example 81 */ private_gists: number; /** * @example 1 */ public_gists: number; /** * @example 2 */ public_repos: number; /** * @example https://api.github.com/users/octocat/received_events * @format uri */ received_events_url: string; /** * @example https://api.github.com/users/octocat/repos * @format uri */ repos_url: string; site_admin: boolean; /** * @example https://api.github.com/users/octocat/starred{/owner}{/repo} */ starred_url: string; /** * @example https://api.github.com/users/octocat/subscriptions * @format uri */ subscriptions_url: string; /** * @format date-time */ suspended_at?: string | null; /** * @example 100 */ total_private_repos: number; /** * @example monalisa */ twitter_username?: string | null; /** * @example true */ two_factor_authentication: boolean; /** * @example User */ type: string; /** * @example "2008-01-14T04:33:35.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/users/octocat * @format uri */ url: string; }; /** * Projects are a way to organize columns and cards of work. */ export type Project = { /** * Body of the project * * @example This project represents the sprint of the first week in January */ body: string | null; /** * @example https://api.github.com/projects/1002604/columns * @format uri */ columns_url: string; /** * @example "2011-04-10T20:09:31.000Z" * @format date-time */ created_at: string; /** * Simple User */ creator: SimpleUser; /** * @example https://github.com/api-playground/projects-test/projects/12 * @format uri */ html_url: string; /** * @example 1002604 */ id: number; /** * Name of the project * * @example Week One Sprint */ name: string; /** * @example MDc6UHJvamVjdDEwMDI2MDQ= */ node_id: string; /** * @example 1 */ number: number; /** * The baseline permission that all organization members have on this project. Only present if owner is an organization. */ organization_permission?: 'read' | 'write' | 'admin' | 'none'; /** * @example https://api.github.com/repos/api-playground/projects-test * @format uri */ owner_url: string; /** * Whether or not this project can be seen by everyone. Only present if owner is an organization. */ private?: boolean; /** * State of the project; either 'open' or 'closed' * * @example open */ state: string; /** * @example "2014-03-03T18:58:10.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/projects/1002604 * @format uri */ url: string; }; /** * Project cards represent a scope of work. */ export type ProjectCard = { /** * Whether or not the card is archived * * @example false */ archived?: boolean; /** * @example https://api.github.com/projects/columns/367 * @format uri */ column_url: string; /** * @example https://api.github.com/repos/api-playground/projects-test/issues/3 * @format uri */ content_url?: string; /** * @example "2016-09-05T14:21:06.000Z" * @format date-time */ created_at: string; /** * Simple User */ creator: SimpleUser; /** * The project card's ID * * @example 42 */ id: number; /** * @example MDExOlByb2plY3RDYXJkMTQ3OA== */ node_id: string; /** * @example Add payload for delete Project column */ note: string | null; /** * @example https://api.github.com/projects/120 * @format uri */ project_url: string; /** * @example "2016-09-05T14:20:22.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/projects/columns/cards/1478 * @format uri */ url: string; }; /** * Project columns contain cards of work. */ export type ProjectColumn = { /** * @example https://api.github.com/projects/columns/367/cards * @format uri */ cards_url: string; /** * @example "2016-09-05T14:18:44.000Z" * @format date-time */ created_at: string; /** * The unique identifier of the project column * * @example 42 */ id: number; /** * Name of the project column * * @example Remaining tasks */ name: string; /** * @example MDEzOlByb2plY3RDb2x1bW4zNjc= */ node_id: string; /** * @example https://api.github.com/projects/120 * @format uri */ project_url: string; /** * @example "2016-09-05T14:22:28.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/projects/columns/367 * @format uri */ url: string; }; /** * Branch protections protect branches */ export type ProtectedBranch = { allow_deletions?: { enabled: boolean; }; allow_force_pushes?: { enabled: boolean; }; enforce_admins?: { enabled: boolean; /** * @format uri */ url: string; }; required_linear_history?: { enabled: boolean; }; required_pull_request_reviews?: { dismiss_stale_reviews?: boolean; dismissal_restrictions?: { teams: Team[]; /** * @format uri */ teams_url: string; /** * @format uri */ url: string; users: SimpleUser[]; /** * @format uri */ users_url: string; }; require_code_owner_reviews?: boolean; required_approving_review_count?: number; /** * @format uri */ url: string; }; required_signatures?: { /** * @example true */ enabled: boolean; /** * @example https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures * @format uri */ url: string; }; required_status_checks?: StatusCheckPolicy; restrictions?: BranchRestrictionPolicy; /** * @format uri */ url: string; }; /** * Protected Branch Admin Enforced */ export type ProtectedBranchAdminEnforced = { /** * @example true */ enabled: boolean; /** * @example https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins * @format uri */ url: string; }; /** * Protected Branch Pull Request Review */ export type ProtectedBranchPullRequestReview = { /** * @example true */ dismiss_stale_reviews: boolean; dismissal_restrictions?: { /** * The list of teams with review dismissal access. */ teams?: Team[]; /** * @example "https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams" */ teams_url?: string; /** * @example "https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions" */ url?: string; /** * The list of users with review dismissal access. */ users?: SimpleUser[]; /** * @example "https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users" */ users_url?: string; }; /** * @example true */ require_code_owner_reviews: boolean; /** * @example 2 * @maximum 6 * @minimum 1 */ required_approving_review_count?: number; /** * @example https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions * @format uri */ url?: string; }; /** * Public User */ export type PublicUser = { /** * @format uri */ avatar_url: string; bio: string | null; blog: string | null; /** * @example 3 */ collaborators?: number; company: string | null; /** * @format date-time */ created_at: string; /** * @example 1 */ disk_usage?: number; /** * @format email */ email: string | null; events_url: string; followers: number; /** * @format uri */ followers_url: string; following: number; following_url: string; gists_url: string; gravatar_id: string | null; hireable: boolean | null; /** * @format uri */ html_url: string; id: number; location: string | null; login: string; name: string | null; node_id: string; /** * @format uri */ organizations_url: string; /** * @example 2 */ owned_private_repos?: number; plan?: { collaborators: number; name: string; private_repos: number; space: number; }; /** * @example 1 */ private_gists?: number; public_gists: number; public_repos: number; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; /** * @format date-time */ suspended_at?: string | null; /** * @example 2 */ total_private_repos?: number; twitter_username?: string | null; type: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; }; /** * Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. */ export type PullRequest = { _links: { comments: Link; commits: Link; html: Link; issue: Link; review_comment: Link; review_comments: Link; self: Link; statuses: Link; }; /** * @example too heated */ active_lock_reason?: string | null; /** * @example 100 */ additions: number; /** * Simple User */ assignee: SimpleUser; assignees?: SimpleUser[] | null; author_association: AuthorAssociation; auto_merge: AutoMerge; base: { label: string; ref: string; repo: { allow_merge_commit?: boolean; allow_rebase_merge?: boolean; allow_squash_merge?: boolean; archive_url: string; archived: boolean; assignees_url: string; blobs_url: string; branches_url: string; clone_url: string; collaborators_url: string; comments_url: string; commits_url: string; compare_url: string; contents_url: string; /** * @format uri */ contributors_url: string; /** * @format date-time */ created_at: string; default_branch: string; /** * @format uri */ deployments_url: string; description: string | null; disabled: boolean; /** * @format uri */ downloads_url: string; /** * @format uri */ events_url: string; fork: boolean; forks: number; forks_count: number; /** * @format uri */ forks_url: string; full_name: string; git_commits_url: string; git_refs_url: string; git_tags_url: string; git_url: string; has_downloads: boolean; has_issues: boolean; has_pages: boolean; has_projects: boolean; has_wiki: boolean; /** * @format uri */ homepage: string | null; /** * @format uri */ hooks_url: string; /** * @format uri */ html_url: string; id: number; issue_comment_url: string; issue_events_url: string; issues_url: string; keys_url: string; labels_url: string; language: string | null; /** * @format uri */ languages_url: string; /** * License Simple */ license: LicenseSimple; master_branch?: string; /** * @format uri */ merges_url: string; milestones_url: string; /** * @format uri */ mirror_url: string | null; name: string; node_id: string; notifications_url: string; open_issues: number; open_issues_count: number; owner: { /** * @format uri */ avatar_url: string; events_url: string; /** * @format uri */ followers_url: string; following_url: string; gists_url: string; gravatar_id: string | null; /** * @format uri */ html_url: string; id: number; login: string; node_id: string; /** * @format uri */ organizations_url: string; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; type: string; /** * @format uri */ url: string; }; permissions?: { admin: boolean; pull: boolean; push: boolean; }; private: boolean; pulls_url: string; /** * @format date-time */ pushed_at: string; releases_url: string; size: number; ssh_url: string; stargazers_count: number; /** * @format uri */ stargazers_url: string; statuses_url: string; /** * @format uri */ subscribers_url: string; /** * @format uri */ subscription_url: string; /** * @format uri */ svn_url: string; /** * @format uri */ tags_url: string; /** * @format uri */ teams_url: string; temp_clone_token?: string; topics?: string[]; trees_url: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; watchers: number; watchers_count: number; }; sha: string; user: { /** * @format uri */ avatar_url: string; events_url: string; /** * @format uri */ followers_url: string; following_url: string; gists_url: string; gravatar_id: string | null; /** * @format uri */ html_url: string; id: number; login: string; node_id: string; /** * @format uri */ organizations_url: string; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; type: string; /** * @format uri */ url: string; }; }; /** * @example Please pull these awesome changes */ body: string | null; /** * @example 5 */ changed_files: number; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ closed_at: string | null; /** * @example 10 */ comments: number; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347/comments * @format uri */ comments_url: string; /** * @example 3 */ commits: number; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits * @format uri */ commits_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at: string; /** * @example 3 */ deletions: number; /** * @example https://github.com/octocat/Hello-World/pull/1347.diff * @format uri */ diff_url: string; /** * Indicates whether or not the pull request is a draft. * * @example false */ draft?: boolean; head: { label: string; ref: string; repo: { allow_merge_commit?: boolean; allow_rebase_merge?: boolean; allow_squash_merge?: boolean; archive_url: string; archived: boolean; assignees_url: string; blobs_url: string; branches_url: string; clone_url: string; collaborators_url: string; comments_url: string; commits_url: string; compare_url: string; contents_url: string; /** * @format uri */ contributors_url: string; /** * @format date-time */ created_at: string; default_branch: string; /** * @format uri */ deployments_url: string; description: string | null; disabled: boolean; /** * @format uri */ downloads_url: string; /** * @format uri */ events_url: string; fork: boolean; forks: number; forks_count: number; /** * @format uri */ forks_url: string; full_name: string; git_commits_url: string; git_refs_url: string; git_tags_url: string; git_url: string; has_downloads: boolean; has_issues: boolean; has_pages: boolean; has_projects: boolean; has_wiki: boolean; /** * @format uri */ homepage: string | null; /** * @format uri */ hooks_url: string; /** * @format uri */ html_url: string; id: number; issue_comment_url: string; issue_events_url: string; issues_url: string; keys_url: string; labels_url: string; language: string | null; /** * @format uri */ languages_url: string; license: { key: string; name: string; node_id: string; spdx_id: string | null; /** * @format uri */ url: string | null; } | null; master_branch?: string; /** * @format uri */ merges_url: string; milestones_url: string; /** * @format uri */ mirror_url: string | null; name: string; node_id: string; notifications_url: string; open_issues: number; open_issues_count: number; owner: { /** * @format uri */ avatar_url: string; events_url: string; /** * @format uri */ followers_url: string; following_url: string; gists_url: string; gravatar_id: string | null; /** * @format uri */ html_url: string; id: number; login: string; node_id: string; /** * @format uri */ organizations_url: string; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; type: string; /** * @format uri */ url: string; }; permissions?: { admin: boolean; pull: boolean; push: boolean; }; private: boolean; pulls_url: string; /** * @format date-time */ pushed_at: string; releases_url: string; size: number; ssh_url: string; stargazers_count: number; /** * @format uri */ stargazers_url: string; statuses_url: string; /** * @format uri */ subscribers_url: string; /** * @format uri */ subscription_url: string; /** * @format uri */ svn_url: string; /** * @format uri */ tags_url: string; /** * @format uri */ teams_url: string; temp_clone_token?: string; topics?: string[]; trees_url: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; watchers: number; watchers_count: number; }; sha: string; user: { /** * @format uri */ avatar_url: string; events_url: string; /** * @format uri */ followers_url: string; following_url: string; gists_url: string; gravatar_id: string | null; /** * @format uri */ html_url: string; id: number; login: string; node_id: string; /** * @format uri */ organizations_url: string; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; type: string; /** * @format uri */ url: string; }; }; /** * @example https://github.com/octocat/Hello-World/pull/1347 * @format uri */ html_url: string; /** * @example 1 */ id: number; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347 * @format uri */ issue_url: string; labels: { color?: string; ['default']?: boolean; description?: string | null; id?: number; name?: string; node_id?: string; url?: string; }[]; /** * @example true */ locked: boolean; /** * Indicates whether maintainers can modify the pull request. * * @example true */ maintainer_can_modify: boolean; /** * @example e5bd3914e2e596debea16f433f57875b5b90bcd6 */ merge_commit_sha: string | null; /** * @example true */ mergeable: boolean | null; /** * @example clean */ mergeable_state: string; merged: boolean; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ merged_at: string | null; /** * Simple User */ merged_by: SimpleUser; /** * A collection of related issues and pull requests. */ milestone: Milestone; /** * @example MDExOlB1bGxSZXF1ZXN0MQ== */ node_id: string; /** * Number uniquely identifying the pull request within its repository. * * @example 42 */ number: number; /** * @example https://github.com/octocat/Hello-World/pull/1347.patch * @format uri */ patch_url: string; /** * @example true */ rebaseable?: boolean | null; requested_reviewers?: SimpleUser[] | null; requested_teams?: TeamSimple[] | null; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number} */ review_comment_url: string; /** * @example 0 */ review_comments: number; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments * @format uri */ review_comments_url: string; /** * State of this Pull Request. Either `open` or `closed`. * * @example open */ state: 'open' | 'closed'; /** * @example https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ statuses_url: string; /** * The title of the pull request. * * @example Amazing new feature */ title: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * Pull Request Merge Result */ export type PullRequestMergeResult = { merged: boolean; message: string; sha: string; }; export type PullRequestMinimal = { base: { ref: string; repo: { id: number; name: string; url: string; }; sha: string; }; head: { ref: string; repo: { id: number; name: string; url: string; }; sha: string; }; id: number; number: number; url: string; }; /** * Pull Request Reviews are reviews on pull requests. */ export type PullRequestReview = { _links: { html: { href: string; }; pull_request: { href: string; }; }; author_association: AuthorAssociation; /** * The text of the review. * * @example This looks great. */ body: string; body_html?: string; body_text?: string; /** * A commit SHA for the review. * * @example 54bb654c9e6025347f57900a4a5c2313a96b8035 */ commit_id: string; /** * @example https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80 * @format uri */ html_url: string; /** * Unique identifier of the review * * @example 42 */ id: number; /** * @example MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA= */ node_id: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/12 * @format uri */ pull_request_url: string; /** * @example CHANGES_REQUESTED */ state: string; /** * @format date-time */ submitted_at?: string; /** * Simple User */ user: SimpleUser; }; /** * Pull Request Review Comments are comments on a portion of the Pull Request's diff. */ export type PullRequestReviewComment = { _links: { html: { /** * @example https://github.com/octocat/Hello-World/pull/1#discussion-diff-1 * @format uri */ href: string; }; pull_request: { /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1 * @format uri */ href: string; }; self: { /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/comments/1 * @format uri */ href: string; }; }; author_association: AuthorAssociation; /** * The text of the comment. * * @example We should probably include a check for null values here. */ body: string; /** * @example "

    comment body

    " */ body_html?: string; /** * @example "comment body" */ body_text?: string; /** * The SHA of the commit to which the comment applies. * * @example 6dcb09b5b57875f334f61aebed695e2e4193db5e */ commit_id: string; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ created_at: string; /** * The diff of the line that the comment refers to. * * @example @@ -16,33 +16,40 @@ public class Connection : IConnection... */ diff_hunk: string; /** * HTML URL for the pull request review comment. * * @example https://github.com/octocat/Hello-World/pull/1#discussion-diff-1 * @format uri */ html_url: string; /** * The ID of the pull request review comment. * * @example 1 */ id: number; /** * The comment ID to reply to. * * @example 8 */ in_reply_to_id?: number; /** * The line of the blob to which the comment applies. The last line of the range for a multi-line comment * * @example 2 */ line?: number; /** * The node ID of the pull request review comment. * * @example MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw */ node_id: string; /** * The SHA of the original commit to which the comment applies. * * @example 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840 */ original_commit_id: string; /** * The line of the blob to which the comment applies. The last line of the range for a multi-line comment * * @example 2 */ original_line?: number; /** * The index of the original line in the diff to which the comment applies. * * @example 4 */ original_position: number; /** * The first line of the range for a multi-line comment. * * @example 2 */ original_start_line?: number | null; /** * The relative path of the file to which the comment applies. * * @example config/database.yaml */ path: string; /** * The line index in the diff to which the comment applies. * * @example 1 */ position: number; /** * The ID of the pull request review to which the comment belongs. * * @example 42 */ pull_request_review_id: number | null; /** * URL for the pull request that the review comment belongs to. * * @example https://api.github.com/repos/octocat/Hello-World/pulls/1 * @format uri */ pull_request_url: string; reactions?: ReactionRollup; /** * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment * * @default RIGHT */ side?: 'LEFT' | 'RIGHT'; /** * The first line of the range for a multi-line comment. * * @example 2 */ start_line?: number | null; /** * The side of the first line of the range for a multi-line comment. * * @default RIGHT */ start_side?: 'LEFT' | 'RIGHT'; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ updated_at: string; /** * URL for the pull request review comment * * @example https://api.github.com/repos/octocat/Hello-World/pulls/comments/1 */ url: string; user: SimpleUser; }; /** * Pull Request Review Request */ export type PullRequestReviewRequest = { teams: TeamSimple[]; users: SimpleUser[]; }; /** * Pull Request Simple */ export type PullRequestSimple = { _links: { comments: Link; commits: Link; html: Link; issue: Link; review_comment: Link; review_comments: Link; self: Link; statuses: Link; }; /** * @example too heated */ active_lock_reason?: string | null; /** * Simple User */ assignee: SimpleUser; assignees?: SimpleUser[] | null; author_association: AuthorAssociation; auto_merge: AutoMerge; base: { label: string; ref: string; repo: Repository; sha: string; /** * Simple User */ user: SimpleUser; }; /** * @example Please pull these awesome changes */ body: string | null; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ closed_at: string | null; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347/comments * @format uri */ comments_url: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits * @format uri */ commits_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at: string; /** * @example https://github.com/octocat/Hello-World/pull/1347.diff * @format uri */ diff_url: string; /** * Indicates whether or not the pull request is a draft. * * @example false */ draft?: boolean; head: { label: string; ref: string; repo: Repository; sha: string; /** * Simple User */ user: SimpleUser; }; /** * @example https://github.com/octocat/Hello-World/pull/1347 * @format uri */ html_url: string; /** * @example 1 */ id: number; /** * @example https://api.github.com/repos/octocat/Hello-World/issues/1347 * @format uri */ issue_url: string; labels: { color?: string; ['default']?: boolean; description?: string; id?: number; name?: string; node_id?: string; url?: string; }[]; /** * @example true */ locked: boolean; /** * @example e5bd3914e2e596debea16f433f57875b5b90bcd6 */ merge_commit_sha: string | null; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ merged_at: string | null; /** * A collection of related issues and pull requests. */ milestone: Milestone; /** * @example MDExOlB1bGxSZXF1ZXN0MQ== */ node_id: string; /** * @example 1347 */ number: number; /** * @example https://github.com/octocat/Hello-World/pull/1347.patch * @format uri */ patch_url: string; requested_reviewers?: SimpleUser[] | null; requested_teams?: TeamSimple[] | null; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number} */ review_comment_url: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments * @format uri */ review_comments_url: string; /** * @example open */ state: string; /** * @example https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e * @format uri */ statuses_url: string; /** * @example new-feature */ title: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1347 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; export type RateLimit = { limit: number; remaining: number; reset: number; }; /** * Rate Limit Overview */ export type RateLimitOverview = { rate: RateLimit; resources: { code_scanning_upload?: RateLimit; core: RateLimit; graphql?: RateLimit; integration_manifest?: RateLimit; search: RateLimit; source_import?: RateLimit; }; }; /** * Reactions to conversations provide a way to help people express their feelings more simply and effectively. */ export type Reaction = { /** * The reaction to use * * @example heart */ content: | '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'; /** * @example "2016-05-20T20:09:31.000Z" * @format date-time */ created_at: string; /** * @example 1 */ id: number; /** * @example MDg6UmVhY3Rpb24x */ node_id: string; /** * Simple User */ user: SimpleUser; }; export type ReactionRollup = { ['+1']: number; ['-1']: number; confused: number; eyes: number; heart: number; hooray: number; laugh: number; rocket: number; total_count: number; /** * @format uri */ url: string; }; /** * Referrer Traffic */ export type ReferrerTraffic = { /** * @example 4 */ count: number; /** * @example Google */ referrer: string; /** * @example 3 */ uniques: number; }; /** * A release. */ export type Release = { assets: ReleaseAsset[]; /** * @format uri */ assets_url: string; author: SimpleUser; body?: string | null; body_html?: string; body_text?: string; /** * @format date-time */ created_at: string; /** * true to create a draft (unpublished) release, false to create a published one. * * @example false */ draft: boolean; /** * @format uri */ html_url: string; id: number; name: string | null; node_id: string; /** * Whether to identify the release as a prerelease or a full release. * * @example false */ prerelease: boolean; /** * @format date-time */ published_at: string | null; /** * The name of the tag. * * @example v1.0.0 */ tag_name: string; /** * @format uri */ tarball_url: string | null; /** * Specifies the commitish value that determines where the Git tag is created from. * * @example master */ target_commitish: string; upload_url: string; /** * @format uri */ url: string; /** * @format uri */ zipball_url: string | null; }; /** * Data related to a release. */ export type ReleaseAsset = { /** * @format uri */ browser_download_url: string; content_type: string; /** * @format date-time */ created_at: string; download_count: number; id: number; label: string | null; /** * The file name of the asset. * * @example Team Environment */ name: string; node_id: string; size: number; /** * State of the release asset. */ state: 'uploaded' | 'open'; /** * @format date-time */ updated_at: string; /** * Simple User */ uploader: SimpleUser; /** * @format uri */ url: string; }; /** * Repo Search Result Item */ export type RepoSearchResultItem = { allow_merge_commit?: boolean; allow_rebase_merge?: boolean; allow_squash_merge?: boolean; archive_url: string; archived: boolean; assignees_url: string; blobs_url: string; branches_url: string; clone_url: string; collaborators_url: string; comments_url: string; commits_url: string; compare_url: string; contents_url: string; /** * @format uri */ contributors_url: string; /** * @format date-time */ created_at: string; default_branch: string; delete_branch_on_merge?: boolean; /** * @format uri */ deployments_url: string; description: string | null; /** * Returns whether or not this repository disabled. */ disabled: boolean; /** * @format uri */ downloads_url: string; /** * @format uri */ events_url: string; fork: boolean; forks: number; forks_count: number; /** * @format uri */ forks_url: string; full_name: string; git_commits_url: string; git_refs_url: string; git_tags_url: string; git_url: string; has_downloads: boolean; has_issues: boolean; has_pages: boolean; has_projects: boolean; has_wiki: boolean; /** * @format uri */ homepage: string | null; /** * @format uri */ hooks_url: string; /** * @format uri */ html_url: string; id: number; issue_comment_url: string; issue_events_url: string; issues_url: string; keys_url: string; labels_url: string; language: string | null; /** * @format uri */ languages_url: string; /** * License Simple */ license: LicenseSimple; master_branch?: string; /** * @format uri */ merges_url: string; milestones_url: string; /** * @format uri */ mirror_url: string | null; name: string; node_id: string; notifications_url: string; open_issues: number; open_issues_count: number; /** * Simple User */ owner: SimpleUser; permissions?: { admin: boolean; pull: boolean; push: boolean; }; private: boolean; pulls_url: string; /** * @format date-time */ pushed_at: string; releases_url: string; score: number; size: number; ssh_url: string; stargazers_count: number; /** * @format uri */ stargazers_url: string; statuses_url: string; /** * @format uri */ subscribers_url: string; /** * @format uri */ subscription_url: string; /** * @format uri */ svn_url: string; /** * @format uri */ tags_url: string; /** * @format uri */ teams_url: string; temp_clone_token?: string; text_matches?: SearchResultTextMatches; topics?: string[]; trees_url: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; watchers: number; watchers_count: number; }; /** * A git repository */ export type Repository = { /** * Whether to allow merge commits for pull requests. * * @default true * @example true */ allow_merge_commit?: boolean; /** * Whether to allow rebase merges for pull requests. * * @default true * @example true */ allow_rebase_merge?: boolean; /** * Whether to allow squash merges for pull requests. * * @default true * @example true */ allow_squash_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} */ archive_url: string; /** * Whether the repository is archived. * * @default false */ archived: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/assignees{/user} */ assignees_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} */ blobs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/branches{/branch} */ branches_url: string; /** * @example https://github.com/octocat/Hello-World.git */ clone_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} */ collaborators_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/comments{/number} */ comments_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/commits{/sha} */ commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} */ compare_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contents/{+path} */ contents_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contributors * @format uri */ contributors_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at: string | null; /** * The default branch of the repository. * * @example master */ default_branch: string; /** * Whether to delete head branches when pull requests are merged * * @default false * @example false */ delete_branch_on_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/deployments * @format uri */ deployments_url: string; /** * @example This your first repo! */ description: string | null; /** * Returns whether or not this repository disabled. */ disabled: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/downloads * @format uri */ downloads_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/events * @format uri */ events_url: string; fork: boolean; forks: number; /** * @example 9 */ forks_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/forks * @format uri */ forks_url: string; /** * @example octocat/Hello-World */ full_name: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/commits{/sha} */ git_commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/refs{/sha} */ git_refs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/tags{/sha} */ git_tags_url: string; /** * @example git:github.com/octocat/Hello-World.git */ git_url: string; /** * Whether downloads are enabled. * * @default true * @example true */ has_downloads: boolean; /** * Whether issues are enabled. * * @default true * @example true */ has_issues: boolean; has_pages: boolean; /** * Whether projects are enabled. * * @default true * @example true */ has_projects: boolean; /** * Whether the wiki is enabled. * * @default true * @example true */ has_wiki: boolean; /** * @example https://github.com * @format uri */ homepage: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/hooks * @format uri */ hooks_url: string; /** * @example https://github.com/octocat/Hello-World * @format uri */ html_url: string; /** * Unique identifier of the repository * * @example 42 */ id: number; /** * Whether this repository acts as a template that can be used to generate new repositories. * * @default false * @example true */ is_template?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/comments{/number} */ issue_comment_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/events{/number} */ issue_events_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues{/number} */ issues_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/keys{/key_id} */ keys_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/labels{/name} */ labels_url: string; language: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/languages * @format uri */ languages_url: string; /** * License Simple */ license: LicenseSimple; master_branch?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/merges * @format uri */ merges_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/milestones{/number} */ milestones_url: string; /** * @example git:git.example.com/octocat/Hello-World * @format uri */ mirror_url: string | null; /** * The name of the repository. * * @example Team Environment */ name: string; network_count?: number; /** * @example MDEwOlJlcG9zaXRvcnkxMjk2MjY5 */ node_id: string; /** * @example http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} */ notifications_url: string; open_issues: number; /** * @example 0 */ open_issues_count: number; /** * Simple User */ owner: SimpleUser; permissions?: { admin: boolean; maintain?: boolean; pull: boolean; push: boolean; triage?: boolean; }; /** * Whether the repository is private or public. * * @default false */ private: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/pulls{/number} */ pulls_url: string; /** * @example "2011-01-26T19:06:43.000Z" * @format date-time */ pushed_at: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/releases{/id} */ releases_url: string; /** * @example 108 */ size: number; /** * @example git@github.com:octocat/Hello-World.git */ ssh_url: string; /** * @example 80 */ stargazers_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/stargazers * @format uri */ stargazers_url: string; /** * @example "2020-07-09T00:17:42Z" */ starred_at?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/statuses/{sha} */ statuses_url: string; subscribers_count?: number; /** * @example http://api.github.com/repos/octocat/Hello-World/subscribers * @format uri */ subscribers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/subscription * @format uri */ subscription_url: string; /** * @example https://svn.github.com/octocat/Hello-World * @format uri */ svn_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/tags * @format uri */ tags_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/teams * @format uri */ teams_url: string; temp_clone_token?: string; template_repository?: { allow_merge_commit?: boolean; allow_rebase_merge?: boolean; allow_squash_merge?: boolean; archive_url?: string; archived?: boolean; assignees_url?: string; blobs_url?: string; branches_url?: string; clone_url?: string; collaborators_url?: string; comments_url?: string; commits_url?: string; compare_url?: string; contents_url?: string; contributors_url?: string; created_at?: string; default_branch?: string; delete_branch_on_merge?: boolean; deployments_url?: string; description?: string; disabled?: boolean; downloads_url?: string; events_url?: string; fork?: boolean; forks_count?: number; forks_url?: string; full_name?: string; git_commits_url?: string; git_refs_url?: string; git_tags_url?: string; git_url?: string; has_downloads?: boolean; has_issues?: boolean; has_pages?: boolean; has_projects?: boolean; has_wiki?: boolean; homepage?: string; hooks_url?: string; html_url?: string; id?: number; is_template?: boolean; issue_comment_url?: string; issue_events_url?: string; issues_url?: string; keys_url?: string; labels_url?: string; language?: string; languages_url?: string; merges_url?: string; milestones_url?: string; mirror_url?: string; name?: string; network_count?: number; node_id?: string; notifications_url?: string; open_issues_count?: number; owner?: { avatar_url?: string; events_url?: string; followers_url?: string; following_url?: string; gists_url?: string; gravatar_id?: string; html_url?: string; id?: number; login?: string; node_id?: string; organizations_url?: string; received_events_url?: string; repos_url?: string; site_admin?: boolean; starred_url?: string; subscriptions_url?: string; type?: string; url?: string; }; permissions?: { admin?: boolean; pull?: boolean; push?: boolean; }; private?: boolean; pulls_url?: string; pushed_at?: string; releases_url?: string; size?: number; ssh_url?: string; stargazers_count?: number; stargazers_url?: string; statuses_url?: string; subscribers_count?: number; subscribers_url?: string; subscription_url?: string; svn_url?: string; tags_url?: string; teams_url?: string; temp_clone_token?: string; topics?: string[]; trees_url?: string; updated_at?: string; url?: string; visibility?: string; watchers_count?: number; } | null; topics?: string[]; /** * @example http://api.github.com/repos/octocat/Hello-World/git/trees{/sha} */ trees_url: string; /** * @example "2011-01-26T19:14:43.000Z" * @format date-time */ updated_at: string | null; /** * @example https://api.github.com/repos/octocat/Hello-World * @format uri */ url: string; /** * The repository visibility: public, private, or internal. * * @default public */ visibility?: string; watchers: number; /** * @example 80 */ watchers_count: number; }; /** * Repository Collaborator Permission */ export type RepositoryCollaboratorPermission = { permission: string; /** * Simple User */ user: SimpleUser; }; /** * Repository invitations let you manage who you collaborate with. */ export type RepositoryInvitation = { /** * @example "2016-06-13T19:52:50.000Z" * @format date-time */ created_at: string; /** * Whether or not the invitation has expired */ expired?: boolean; /** * @example https://github.com/octocat/Hello-World/invitations */ html_url: string; /** * Unique identifier of the repository invitation. * * @example 42 */ id: number; /** * Simple User */ invitee: SimpleUser; /** * Simple User */ inviter: SimpleUser; node_id: string; /** * The permission associated with the invitation. * * @example read */ permissions: 'read' | 'write' | 'admin'; repository: MinimalRepository; /** * URL for the repository invitation * * @example https://api.github.com/user/repository-invitations/1 */ url: string; }; /** * Repository invitations let you manage who you collaborate with. */ export type RepositorySubscription = { /** * @example "2012-10-06T21:34:12.000Z" * @format date-time */ created_at: string; /** * Determines if all notifications should be blocked from this repository. */ ignored: boolean; reason: string | null; /** * @example https://api.github.com/repos/octocat/example * @format uri */ repository_url: string; /** * Determines if notifications should be received from this repository. * * @example true */ subscribed: boolean; /** * @example https://api.github.com/repos/octocat/example/subscription * @format uri */ url: string; }; /** * Legacy Review Comment */ export type ReviewComment = { _links: { html: Link; pull_request: Link; self: Link; }; author_association: AuthorAssociation; /** * @example Great stuff */ body: string; body_html?: string; body_text?: string; /** * @example 6dcb09b5b57875f334f61aebed695e2e4193db5e */ commit_id: string; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ created_at: string; /** * @example @@ -16,33 +16,40 @@ public class Connection : IConnection... */ diff_hunk: string; /** * @example https://github.com/octocat/Hello-World/pull/1#discussion-diff-1 * @format uri */ html_url: string; /** * @example 10 */ id: number; /** * @example 8 */ in_reply_to_id?: number; /** * The line of the blob to which the comment applies. The last line of the range for a multi-line comment * * @example 2 */ line?: number; /** * @example MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw */ node_id: string; /** * @example 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840 */ original_commit_id: string; /** * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment * * @example 2 */ original_line?: number; /** * @example 4 */ original_position: number; /** * The original first line of the range for a multi-line comment. * * @example 2 */ original_start_line?: number | null; /** * @example file1.txt */ path: string; /** * @example 1 */ position: number | null; /** * @example 42 */ pull_request_review_id: number | null; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/1 * @format uri */ pull_request_url: string; /** * The side of the first line of the range for a multi-line comment. * * @default RIGHT */ side?: 'LEFT' | 'RIGHT'; /** * The first line of the range for a multi-line comment. * * @example 2 */ start_line?: number | null; /** * The side of the first line of the range for a multi-line comment. * * @default RIGHT */ start_side?: 'LEFT' | 'RIGHT'; /** * @example "2011-04-14T16:00:49.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/octocat/Hello-World/pulls/comments/1 * @format uri */ url: string; /** * Simple User */ user: SimpleUser; }; /** * A self hosted runner */ export type Runner = { busy: boolean; /** * The id of the runner. * * @example 5 */ id: number; labels: { /** * Unique identifier of the label. */ id?: number; /** * Name of the label. */ name?: string; /** * The type of label. Read-only labels are applied automatically when the runner is configured. */ type?: 'read-only' | 'custom'; }[]; /** * The name of the runner. * * @example iMac */ name: string; /** * The Operating System of the runner. * * @example macos */ os: string; /** * The status of the runner. * * @example online */ status: string; }; /** * Runner Application */ export type RunnerApplication = { architecture: string; download_url: string; filename: string; os: string; }; export type RunnerGroupsEnterprise = { allows_public_repositories: boolean; ['default']: boolean; id: number; name: string; runners_url: string; selected_organizations_url?: string; visibility: string; }; export type RunnerGroupsOrg = { allows_public_repositories: boolean; ['default']: boolean; id: number; inherited: boolean; inherited_allows_public_repositories?: boolean; name: string; runners_url: string; /** * Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` */ selected_repositories_url?: string; visibility: string; }; export type ScimEnterpriseGroup = { displayName?: string; externalId?: string | null; id: string; members?: { $ref?: string; display?: string; value?: string; }[]; meta?: { created?: string; lastModified?: string; location?: string; resourceType?: string; }; schemas: string[]; }; export type ScimEnterpriseUser = { active?: boolean; emails?: { primary?: boolean; type?: string; value?: string; }[]; externalId?: string; groups?: { value?: string; }[]; id: string; meta?: { created?: string; lastModified?: string; location?: string; resourceType?: string; }; name?: { familyName?: string; givenName?: string; }; schemas: string[]; userName?: string; }; /** * Scim Error */ export type ScimError = { detail?: string | null; documentation_url?: string | null; message?: string | null; schemas?: string[]; scimType?: string | null; status?: number; }; export type ScimGroupListEnterprise = { Resources: { displayName?: string; externalId?: string | null; id: string; members?: { $ref?: string; display?: string; value?: string; }[]; meta?: { created?: string; lastModified?: string; location?: string; resourceType?: string; }; schemas: string[]; }[]; itemsPerPage: number; schemas: string[]; startIndex: number; totalResults: number; }; /** * SCIM /Users provisioning endpoints */ export type ScimUser = { /** * The active status of the User. * * @example true */ active: boolean; /** * The name of the user, suitable for display to end-users * * @example Jon Doe */ displayName?: string | null; /** * user emails * * @example {"primary":true,"value":"someone@example.com"} * @example {"primary":false,"value":"another@example.com"} * @minItems 1 */ emails: { primary?: boolean; value: string; }[]; /** * The ID of the User. * * @example a7b0f98395 */ externalId: string | null; /** * associated groups */ groups?: { display?: string; value?: string; }[]; /** * Unique identifier of an external identity * * @example 1b78eada-9baa-11e6-9eb6-a431576d590e */ id: string; meta: { /** * @example "2019-01-24T22:45:36.000Z" * @format date-time */ created?: string; /** * @example "2019-01-24T22:45:36.000Z" * @format date-time */ lastModified?: string; /** * @example https://api.github.com/scim/v2/organizations/myorg-123abc55141bfd8f/Users/c42772b5-2029-11e9-8543-9264a97dec8d * @format uri */ location?: string; /** * @example User */ resourceType?: string; }; /** * @example {"familyName":"User","givenName":"Jane"} */ name: { familyName: string | null; formatted?: string | null; givenName: string | null; }; /** * Set of operations to be performed * * @example {"op":"replace","value":{"active":false}} * @minItems 1 */ operations?: { op: 'add' | 'remove' | 'replace'; path?: string; value?: string | Record | any[]; }[]; /** * The ID of the organization. */ organization_id?: number; /** * SCIM schema used. * * @minItems 1 */ schemas: string[]; /** * Configured by the admin. Could be an email, login, or username * * @example someone@example.com */ userName: string | null; }; /** * SCIM User List */ export type ScimUserList = { Resources: ScimUser[]; /** * @example 10 */ itemsPerPage: number; /** * SCIM schema used. * * @minItems 1 */ schemas: string[]; /** * @example 1 */ startIndex: number; /** * @example 3 */ totalResults: number; }; export type ScimUserListEnterprise = { Resources: { active?: boolean; emails?: { primary?: boolean; type?: string; value?: string; }[]; externalId?: string; groups?: { value?: string; }[]; id: string; meta?: { created?: string; lastModified?: string; location?: string; resourceType?: string; }; name?: { familyName?: string; givenName?: string; }; schemas: string[]; userName?: string; }[]; itemsPerPage: number; schemas: string[]; startIndex: number; totalResults: number; }; export type ScopedInstallation = { account: SimpleUser; /** * @example true */ has_multiple_single_files?: boolean; permissions: AppPermissions; /** * @example https://api.github.com/users/octocat/repos * @format uri */ repositories_url: string; /** * Describe whether all repositories have been selected or there's a selection involved */ repository_selection: 'all' | 'selected'; /** * @example config.yaml */ single_file_name: string | null; /** * @example config.yml * @example .github/issue_TEMPLATE.md */ single_file_paths?: string[]; }; export type SearchResultTextMatches = { fragment?: string; matches?: { indices?: number[]; text?: string; }[]; object_type?: string | null; object_url?: string; property?: string; }[]; export type SecretScanningAlert = { created_at?: AlertCreatedAt; html_url?: AlertHtmlUrl; number?: AlertNumber; resolution?: SecretScanningAlertResolution; /** * The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. * * @format date-time */ resolved_at?: string | null; resolved_by?: SimpleUser; /** * The secret that was detected. */ secret?: string; /** * The type of secret that secret scanning detected. */ secret_type?: string; state?: SecretScanningAlertState; url?: AlertUrl; }; /** * **Required when the `state` is `resolved`.** The reason for resolving the alert. Can be one of `false_positive`, `wont_fix`, `revoked`, or `used_in_tests`. */ export type SecretScanningAlertResolution = | ('false_positive' | 'wont_fix' | 'revoked' | 'used_in_tests') | any | null; /** * Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. */ export type SecretScanningAlertState = 'open' | 'resolved'; export type SelectedActions = { /** * Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. */ github_owned_allowed: boolean; /** * Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`." */ patterns_allowed: string[]; /** * Whether actions in GitHub Marketplace from verified creators are allowed. Set to `true` to allow all GitHub Marketplace actions by verified creators. */ verified_allowed: boolean; }; /** * The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. */ export type SelectedActionsUrl = string; /** * Short Blob */ export type ShortBlob = { sha: string; url: string; }; /** * Short Branch */ export type ShortBranch = { commit: { sha: string; /** * @format uri */ url: string; }; name: string; protected: boolean; protection?: BranchProtection; /** * @format uri */ protection_url?: string; }; /** * Simple Commit */ export type SimpleCommit = { author: { email: string; name: string; } | null; committer: { email: string; name: string; } | null; id: string; message: string; /** * @format date-time */ timestamp: string; tree_id: string; }; export type SimpleCommitStatus = { /** * @format uri */ avatar_url: string | null; context: string; /** * @format date-time */ created_at: string; description: string | null; id: number; node_id: string; required?: boolean | null; state: string; /** * @format uri */ target_url: string; /** * @format date-time */ updated_at: string; /** * @format uri */ url: string; }; /** * Simple User */ export type SimpleUser = { /** * @example https://github.com/images/error/octocat_happy.gif * @format uri */ avatar_url: string; /** * @example https://api.github.com/users/octocat/events{/privacy} */ events_url: string; /** * @example https://api.github.com/users/octocat/followers * @format uri */ followers_url: string; /** * @example https://api.github.com/users/octocat/following{/other_user} */ following_url: string; /** * @example https://api.github.com/users/octocat/gists{/gist_id} */ gists_url: string; /** * @example 41d064eb2195891e12d0413f63227ea7 */ gravatar_id: string | null; /** * @example https://github.com/octocat * @format uri */ html_url: string; /** * @example 1 */ id: number; /** * @example octocat */ login: string; /** * @example MDQ6VXNlcjE= */ node_id: string; /** * @example https://api.github.com/users/octocat/orgs * @format uri */ organizations_url: string; /** * @example https://api.github.com/users/octocat/received_events * @format uri */ received_events_url: string; /** * @example https://api.github.com/users/octocat/repos * @format uri */ repos_url: string; site_admin: boolean; /** * @example "2020-07-09T00:17:55Z" */ starred_at?: string; /** * @example https://api.github.com/users/octocat/starred{/owner}{/repo} */ starred_url: string; /** * @example https://api.github.com/users/octocat/subscriptions * @format uri */ subscriptions_url: string; /** * @example User */ type: string; /** * @example https://api.github.com/users/octocat * @format uri */ url: string; } | null; /** * Stargazer */ export type Stargazer = { /** * @format date-time */ starred_at: string; /** * Simple User */ user: SimpleUser; }; /** * Starred Repository */ export type StarredRepository = { repo: Repository; /** * @format date-time */ starred_at: string; }; /** * The status of a commit. */ export type Status = { avatar_url: string | null; context: string; created_at: string; creator: SimpleUser; description: string; id: number; node_id: string; state: string; target_url: string; updated_at: string; url: string; }; /** * Status Check Policy */ export type StatusCheckPolicy = { /** * @example continuous-integration/travis-ci */ contexts: string[]; /** * @example https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts * @format uri */ contexts_url: string; /** * @example true */ strict: boolean; /** * @example https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks * @format uri */ url: string; }; /** * Tag */ export type Tag = { commit: { sha: string; /** * @format uri */ url: string; }; /** * @example v0.1 */ name: string; node_id: string; /** * @example https://github.com/octocat/Hello-World/tarball/v0.1 * @format uri */ tarball_url: string; /** * @example https://github.com/octocat/Hello-World/zipball/v0.1 * @format uri */ zipball_url: string; }; /** * Groups of organization members that gives permissions on specified repositories. */ export type Team = { description: string | null; /** * @example https://github.com/orgs/rails/teams/core * @format uri */ html_url: string; id: number; members_url: string; name: string; node_id: string; /** * Groups of organization members that gives permissions on specified repositories. */ parent?: TeamSimple; permission: string; privacy?: string; /** * @format uri */ repositories_url: string; slug: string; /** * @format uri */ url: string; }; /** * A team discussion is a persistent record of a free-form conversation within a team. */ export type TeamDiscussion = { /** * Simple User */ author: SimpleUser; /** * The main text of the discussion. * * @example Please suggest improvements to our workflow in comments. */ body: string; /** * @example

    Hi! This is an area for us to collaborate as a team

    */ body_html: string; /** * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. * * @example 0307116bbf7ced493b8d8a346c650b71 */ body_version: string; /** * @example 0 */ comments_count: number; /** * @example https://api.github.com/organizations/1/team/2343027/discussions/1/comments * @format uri */ comments_url: string; /** * @example "2018-01-25T18:56:31.000Z" * @format date-time */ created_at: string; /** * @example https://github.com/orgs/github/teams/justice-league/discussions/1 * @format uri */ html_url: string; /** * @format date-time */ last_edited_at: string | null; /** * @example MDE0OlRlYW1EaXNjdXNzaW9uMQ== */ node_id: string; /** * The unique sequence number of a team discussion. * * @example 42 */ number: number; /** * Whether or not this discussion should be pinned for easy retrieval. * * @example true */ pinned: boolean; /** * Whether or not this discussion should be restricted to team members and organization administrators. * * @example true */ private: boolean; reactions?: ReactionRollup; /** * @example https://api.github.com/organizations/1/team/2343027 * @format uri */ team_url: string; /** * The title of the discussion. * * @example How can we improve our workflow? */ title: string; /** * @example "2018-01-25T18:56:31.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/organizations/1/team/2343027/discussions/1 * @format uri */ url: string; }; /** * A reply to a discussion within a team. */ export type TeamDiscussionComment = { /** * Simple User */ author: SimpleUser; /** * The main text of the comment. * * @example I agree with this suggestion. */ body: string; /** * @example

    Do you like apples?

    */ body_html: string; /** * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. * * @example 0307116bbf7ced493b8d8a346c650b71 */ body_version: string; /** * @example "2018-01-15T23:53:58.000Z" * @format date-time */ created_at: string; /** * @example https://api.github.com/organizations/1/team/2403582/discussions/1 * @format uri */ discussion_url: string; /** * @example https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1 * @format uri */ html_url: string; /** * @format date-time */ last_edited_at: string | null; /** * @example MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE= */ node_id: string; /** * The unique sequence number of a team discussion comment. * * @example 42 */ number: number; reactions?: ReactionRollup; /** * @example "2018-01-15T23:53:58.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1 * @format uri */ url: string; }; /** * Groups of organization members that gives permissions on specified repositories. */ export type TeamFull = { /** * @example "2017-07-14T16:53:42.000Z" * @format date-time */ created_at: string; /** * @example A great team. */ description: string | null; /** * @example https://github.com/orgs/rails/teams/core * @format uri */ html_url: string; /** * Unique identifier of the team * * @example 42 */ id: number; /** * Distinguished Name (DN) that team maps to within LDAP environment * * @example uid=example,ou=users,dc=github,dc=com */ ldap_dn?: string; /** * @example 3 */ members_count: number; /** * @example https://api.github.com/organizations/1/team/1/members{/member} */ members_url: string; /** * Name of the team * * @example Developers */ name: string; /** * @example MDQ6VGVhbTE= */ node_id: string; organization: OrganizationFull; /** * Groups of organization members that gives permissions on specified repositories. */ parent?: TeamSimple; /** * Permission that the team will have for its repositories * * @example push */ permission: string; /** * The level of privacy this team should have * * @example closed */ privacy?: 'closed' | 'secret'; /** * @example 10 */ repos_count: number; /** * @example https://api.github.com/organizations/1/team/1/repos * @format uri */ repositories_url: string; /** * @example justice-league */ slug: string; /** * @example "2017-08-17T12:37:15.000Z" * @format date-time */ updated_at: string; /** * URL for the team * * @example https://api.github.com/organizations/1/team/1 * @format uri */ url: string; }; /** * Team Membership */ export type TeamMembership = { /** * The role of the user in the team. * * @default member * @example member */ role: 'member' | 'maintainer'; state: string; /** * @format uri */ url: string; }; /** * A team's access to a project. */ export type TeamProject = { body: string | null; columns_url: string; created_at: string; creator: SimpleUser; html_url: string; id: number; name: string; node_id: string; number: number; /** * The organization permission for this project. Only present when owner is an organization. */ organization_permission?: string; owner_url: string; permissions: { admin: boolean; read: boolean; write: boolean; }; /** * Whether the project is private or not. Only present when owner is an organization. */ private?: boolean; state: string; updated_at: string; url: string; }; /** * A team's access to a repository. */ export type TeamRepository = { /** * Whether to allow merge commits for pull requests. * * @default true * @example true */ allow_merge_commit?: boolean; /** * Whether to allow rebase merges for pull requests. * * @default true * @example true */ allow_rebase_merge?: boolean; /** * Whether to allow squash merges for pull requests. * * @default true * @example true */ allow_squash_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref} */ archive_url: string; /** * Whether the repository is archived. * * @default false */ archived: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/assignees{/user} */ assignees_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha} */ blobs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/branches{/branch} */ branches_url: string; /** * @example https://github.com/octocat/Hello-World.git */ clone_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator} */ collaborators_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/comments{/number} */ comments_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/commits{/sha} */ commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head} */ compare_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contents/{+path} */ contents_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/contributors * @format uri */ contributors_url: string; /** * @example "2011-01-26T19:01:12.000Z" * @format date-time */ created_at: string | null; /** * The default branch of the repository. * * @example master */ default_branch: string; /** * Whether to delete head branches when pull requests are merged * * @default false * @example false */ delete_branch_on_merge?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/deployments * @format uri */ deployments_url: string; /** * @example This your first repo! */ description: string | null; /** * Returns whether or not this repository disabled. */ disabled: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/downloads * @format uri */ downloads_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/events * @format uri */ events_url: string; fork: boolean; forks: number; /** * @example 9 */ forks_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/forks * @format uri */ forks_url: string; /** * @example octocat/Hello-World */ full_name: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/commits{/sha} */ git_commits_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/refs{/sha} */ git_refs_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/git/tags{/sha} */ git_tags_url: string; /** * @example git:github.com/octocat/Hello-World.git */ git_url: string; /** * Whether downloads are enabled. * * @default true * @example true */ has_downloads: boolean; /** * Whether issues are enabled. * * @default true * @example true */ has_issues: boolean; has_pages: boolean; /** * Whether projects are enabled. * * @default true * @example true */ has_projects: boolean; /** * Whether the wiki is enabled. * * @default true * @example true */ has_wiki: boolean; /** * @example https://github.com * @format uri */ homepage: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/hooks * @format uri */ hooks_url: string; /** * @example https://github.com/octocat/Hello-World * @format uri */ html_url: string; /** * Unique identifier of the repository * * @example 42 */ id: number; /** * Whether this repository acts as a template that can be used to generate new repositories. * * @default false * @example true */ is_template?: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/comments{/number} */ issue_comment_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues/events{/number} */ issue_events_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/issues{/number} */ issues_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/keys{/key_id} */ keys_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/labels{/name} */ labels_url: string; language: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/languages * @format uri */ languages_url: string; /** * License Simple */ license: LicenseSimple; master_branch?: string; /** * @example http://api.github.com/repos/octocat/Hello-World/merges * @format uri */ merges_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/milestones{/number} */ milestones_url: string; /** * @example git:git.example.com/octocat/Hello-World * @format uri */ mirror_url: string | null; /** * The name of the repository. * * @example Team Environment */ name: string; network_count?: number; /** * @example MDEwOlJlcG9zaXRvcnkxMjk2MjY5 */ node_id: string; /** * @example http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating} */ notifications_url: string; open_issues: number; /** * @example 0 */ open_issues_count: number; /** * Simple User */ owner: SimpleUser; permissions?: { admin: boolean; maintain?: boolean; pull: boolean; push: boolean; triage?: boolean; }; /** * Whether the repository is private or public. * * @default false */ private: boolean; /** * @example http://api.github.com/repos/octocat/Hello-World/pulls{/number} */ pulls_url: string; /** * @example "2011-01-26T19:06:43.000Z" * @format date-time */ pushed_at: string | null; /** * @example http://api.github.com/repos/octocat/Hello-World/releases{/id} */ releases_url: string; /** * @example 108 */ size: number; /** * @example git@github.com:octocat/Hello-World.git */ ssh_url: string; /** * @example 80 */ stargazers_count: number; /** * @example http://api.github.com/repos/octocat/Hello-World/stargazers * @format uri */ stargazers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/statuses/{sha} */ statuses_url: string; subscribers_count?: number; /** * @example http://api.github.com/repos/octocat/Hello-World/subscribers * @format uri */ subscribers_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/subscription * @format uri */ subscription_url: string; /** * @example https://svn.github.com/octocat/Hello-World * @format uri */ svn_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/tags * @format uri */ tags_url: string; /** * @example http://api.github.com/repos/octocat/Hello-World/teams * @format uri */ teams_url: string; temp_clone_token?: string; /** * A git repository */ template_repository?: Repository; topics?: string[]; /** * @example http://api.github.com/repos/octocat/Hello-World/git/trees{/sha} */ trees_url: string; /** * @example "2011-01-26T19:14:43.000Z" * @format date-time */ updated_at: string | null; /** * @example https://api.github.com/repos/octocat/Hello-World * @format uri */ url: string; /** * The repository visibility: public, private, or internal. * * @default public */ visibility?: string; watchers: number; /** * @example 80 */ watchers_count: number; }; /** * Groups of organization members that gives permissions on specified repositories. */ export type TeamSimple = { /** * Description of the team * * @example A great team. */ description: string | null; /** * @example https://github.com/orgs/rails/teams/core * @format uri */ html_url: string; /** * Unique identifier of the team * * @example 1 */ id: number; /** * Distinguished Name (DN) that team maps to within LDAP environment * * @example uid=example,ou=users,dc=github,dc=com */ ldap_dn?: string; /** * @example https://api.github.com/organizations/1/team/1/members{/member} */ members_url: string; /** * Name of the team * * @example Justice League */ name: string; /** * @example MDQ6VGVhbTE= */ node_id: string; /** * Permission that the team will have for its repositories * * @example admin */ permission: string; /** * The level of privacy this team should have * * @example closed */ privacy?: string; /** * @example https://api.github.com/organizations/1/team/1/repos * @format uri */ repositories_url: string; /** * @example justice-league */ slug: string; /** * URL for the team * * @example https://api.github.com/organizations/1/team/1 * @format uri */ url: string; } | null; /** * Thread */ export type Thread = { id: string; last_read_at: string | null; reason: string; repository: MinimalRepository; subject: { latest_comment_url: string; title: string; type: string; url: string; }; /** * @example https://api.github.com/notifications/threads/2/subscription */ subscription_url: string; unread: boolean; updated_at: string; url: string; }; /** * Thread Subscription */ export type ThreadSubscription = { /** * @example "2012-10-06T21:34:12.000Z" * @format date-time */ created_at: string | null; ignored: boolean; reason: string | null; /** * @example https://api.github.com/repos/1 * @format uri */ repository_url?: string; /** * @example true */ subscribed: boolean; /** * @example https://api.github.com/notifications/threads/1 * @format uri */ thread_url?: string; /** * @example https://api.github.com/notifications/threads/1/subscription * @format uri */ url: string; }; /** * A topic aggregates entities that are related to a subject. */ export type Topic = { names: string[]; }; /** * Topic Search Result Item */ export type TopicSearchResultItem = { aliases?: | { topic_relation?: { id?: number; name?: string; relation_type?: string; topic_id?: number; }; }[] | null; /** * @format date-time */ created_at: string; created_by: string | null; curated: boolean; description: string | null; display_name: string | null; featured: boolean; /** * @format uri */ logo_url?: string | null; name: string; related?: | { topic_relation?: { id?: number; name?: string; relation_type?: string; topic_id?: number; }; }[] | null; released: string | null; repository_count?: number | null; score: number; short_description: string | null; text_matches?: SearchResultTextMatches; /** * @format date-time */ updated_at: string; }; export type Traffic = { count: number; /** * @format date-time */ timestamp: string; uniques: number; }; /** * User Marketplace Purchase */ export type UserMarketplacePurchase = { account: MarketplaceAccount; /** * @example monthly */ billing_cycle: string; /** * @example "2017-11-11T00:00:00.000Z" * @format date-time */ free_trial_ends_on: string | null; /** * @example "2017-11-11T00:00:00.000Z" * @format date-time */ next_billing_date: string | null; /** * @example true */ on_free_trial: boolean; plan: MarketplaceListingPlan; unit_count: number | null; /** * @example "2017-11-02T01:12:12.000Z" * @format date-time */ updated_at: string | null; }; /** * User Search Result Item */ export type UserSearchResultItem = { /** * @format uri */ avatar_url: string; bio?: string | null; blog?: string | null; company?: string | null; /** * @format date-time */ created_at?: string; /** * @format email */ email?: string | null; events_url: string; followers?: number; /** * @format uri */ followers_url: string; following?: number; following_url: string; gists_url: string; gravatar_id: string | null; hireable?: boolean | null; /** * @format uri */ html_url: string; id: number; location?: string | null; login: string; name?: string | null; node_id: string; /** * @format uri */ organizations_url: string; public_gists?: number; public_repos?: number; /** * @format uri */ received_events_url: string; /** * @format uri */ repos_url: string; score: number; site_admin: boolean; starred_url: string; /** * @format uri */ subscriptions_url: string; /** * @format date-time */ suspended_at?: string | null; text_matches?: SearchResultTextMatches; type: string; /** * @format date-time */ updated_at?: string; /** * @format uri */ url: string; }; /** * Validation Error */ export type ValidationError = { documentation_url: string; errors?: { code: string; field?: string; index?: number; message?: string; resource?: string; value?: (string | null) | (number | null) | (string[] | null); }[]; message: string; }; /** * Validation Error Simple */ export type ValidationErrorSimple = { documentation_url: string; errors?: string[]; message: string; }; export type Verification = { payload: string | null; reason: string; signature: string | null; verified: boolean; }; /** * View Traffic */ export type ViewTraffic = { /** * @example 14850 */ count: number; /** * @example 3782 */ uniques: number; views: Traffic[]; }; /** * The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). * * @example 30 */ export type WaitTimer = number; /** * Configuration object of the webhook */ export type WebhookConfig = { content_type?: WebhookConfigContentType; insecure_ssl?: WebhookConfigInsecureSsl; secret?: WebhookConfigSecret; url?: WebhookConfigUrl; }; /** * The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. * * @example "json" */ export type WebhookConfigContentType = string; /** * Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** * * @example "0" */ export type WebhookConfigInsecureSsl = string; /** * If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). * * @example "********" */ export type WebhookConfigSecret = string; /** * The URL to which the payloads will be delivered. * * @example https://example.com/webhook * @format uri */ export type WebhookConfigUrl = string; /** * A GitHub Actions workflow */ export type Workflow = { /** * @example https://github.com/actions/setup-ruby/workflows/CI/badge.svg */ badge_url: string; /** * @example "2019-12-06T14:20:20.000Z" * @format date-time */ created_at: string; /** * @example "2019-12-06T14:20:20.000Z" * @format date-time */ deleted_at?: string; /** * @example https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml */ html_url: string; /** * @example 5 */ id: number; /** * @example CI */ name: string; /** * @example MDg6V29ya2Zsb3cxMg== */ node_id: string; /** * @example ruby.yaml */ path: string; /** * @example active */ state: 'active' | 'deleted'; /** * @example "2019-12-06T14:20:20.000Z" * @format date-time */ updated_at: string; /** * @example https://api.github.com/repos/actions/setup-ruby/workflows/5 */ url: string; }; /** * An invocation of a workflow */ export type WorkflowRun = { /** * The URL to the artifacts for the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts */ artifacts_url: string; /** * The URL to cancel the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5/cancel */ cancel_url: string; /** * The URL to the associated check suite. * * @example https://api.github.com/repos/github/hello-world/check-suites/12 */ check_suite_url: string; /** * @example neutral */ conclusion: string | null; /** * @format date-time */ created_at: string; /** * @example push */ event: string; /** * @example master */ head_branch: string | null; head_commit: SimpleCommit; head_repository: MinimalRepository; /** * @example 5 */ head_repository_id?: number; /** * The SHA of the head commit that points to the version of the worflow being run. * * @example 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d */ head_sha: string; /** * @example https://github.com/github/hello-world/suites/4 */ html_url: string; /** * The ID of the workflow run. * * @example 5 */ id: number; /** * The URL to the jobs for the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5/jobs */ jobs_url: string; /** * The URL to download the logs for the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5/logs */ logs_url: string; /** * The name of the workflow run. * * @example Build */ name?: string; /** * @example MDEwOkNoZWNrU3VpdGU1 */ node_id: string; pull_requests: PullRequestMinimal[] | null; repository: MinimalRepository; /** * The URL to rerun the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5/rerun */ rerun_url: string; /** * The auto incrementing run number for the workflow run. * * @example 106 */ run_number: number; /** * @example completed */ status: string | null; /** * @format date-time */ updated_at: string; /** * The URL to the workflow run. * * @example https://api.github.com/repos/github/hello-world/actions/runs/5 */ url: string; /** * The ID of the parent workflow. * * @example 5 */ workflow_id: number; /** * The URL to the workflow. * * @example https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml */ workflow_url: string; }; /** * Workflow Run Usage */ export type WorkflowRunUsage = { billable: { MACOS?: { jobs: number; total_ms: number; }; UBUNTU?: { jobs: number; total_ms: number; }; WINDOWS?: { jobs: number; total_ms: number; }; }; run_duration_ms: number; }; /** * Workflow Usage */ export type WorkflowUsage = { billable: { MACOS?: { total_ms?: number; }; UBUNTU?: { total_ms?: number; }; WINDOWS?: { total_ms?: number; }; }; }; ================================================ FILE: src/hooks/useInfiniteGithubRequest.ts ================================================ import { defaultParams } from '@/constants'; import { usePullDownRefresh, useReachBottom } from '@tarojs/taro'; import { useEffect, useRef, useState } from 'react'; type InitParamsType = { [x: string]: any; }; const useInfiniteGithubRequest = < T extends any = any, U extends Function = any, >( useRequest: U, { pathParams: initPathParams, queryParams: initQueryParams = defaultParams, getItems, }: { pathParams?: InitParamsType; queryParams?: InitParamsType; getItems?: (data: any) => T[]; }, ) => { const [queryParams, setQueryParams] = useState({ ...initQueryParams }); const isMountedRef = useRef(false); const [hasMore, setHasMore] = useState(false); const [data, setData] = useState([]); // FIXME isLoading 每次加载都为 true const { isError, isLoading, isFetching, refetch } = useRequest( { queryParams, pathParams: initPathParams, }, { onSuccess(newData: any) { isMountedRef.current = true; if (getItems) { newData = getItems(newData); } if (newData?.length >= queryParams.per_page!) { setHasMore(true); } if (queryParams.page! > 1) { setData([...data, ...newData]); } else { setData(newData); } }, }, ); useEffect(() => { setQueryParams({ ...initQueryParams }); }, [initQueryParams]); useReachBottom(() => { if (hasMore) { setQueryParams({ ...queryParams, page: queryParams.page! + 1 }); } }); usePullDownRefresh(() => { setQueryParams({ ...initQueryParams }); // refetch(); }); return { data, isFetching, queryParams, hasMore: hasMore && !isError, // 第2页不显示错误 isError: isError && !(queryParams.page > 1), isLoading: isLoading && !isMountedRef.current, }; }; export default useInfiniteGithubRequest; ================================================ FILE: src/hooks/usePageScrollBackToTop.tsx ================================================ import FabButton from '@/components/fab-button'; import Taro, { usePageScroll } from '@tarojs/taro'; import { useState } from 'react'; const usePageScrollBackToTop = () => { const [visible, setVisible] = useState(false); usePageScroll((res) => { if (res.scrollTop > 400) { setVisible(true); } else { setVisible(false); } }); return visible ? ( Taro.pageScrollTo({ scrollTop: 0 })} icon="chevron-up" > ) : null; }; export default usePageScrollBackToTop; ================================================ FILE: src/hooks/usePullDownRefreshEvent.ts ================================================ import { getUniqueId } from '@/utils/common'; import events from '@/utils/event_bus'; import { usePullDownRefresh } from '@tarojs/taro'; import { useRef } from 'react'; import { PULL_DOWN_REFRESH_EVENT } from '../constants'; function usePullDownRefreshEvent() { const pageRef = useRef(getUniqueId()); usePullDownRefresh(() => { events.trigger(PULL_DOWN_REFRESH_EVENT, pageRef.current); }); return null; } export default usePullDownRefreshEvent; ================================================ FILE: src/hooks/useReachBottomEvent.ts ================================================ import { getUniqueId } from '@/utils/common'; import events from '@/utils/event_bus'; import { useReachBottom } from '@tarojs/taro'; import { useRef } from 'react'; import { REACH_BOTTOM_EVENT, THROTTLE_DELAY } from '../constants'; function useReachBottomEvent() { const pageRef = useRef(getUniqueId()); const timerRef = useRef(0); useReachBottom(() => { const prev = timerRef.current; const curr = +Date.now(); if (!prev || curr - prev > THROTTLE_DELAY) { events.trigger(REACH_BOTTOM_EVENT, pageRef.current); timerRef.current = curr; } else { console.log('wait...'); } }); return null; } export default useReachBottomEvent; ================================================ FILE: src/hooks/useRequest.ts ================================================ import { PULL_DOWN_REFRESH_EVENT } from '@/constants'; import events from '@/utils/event_bus'; import { usePullDownRefresh } from '@tarojs/taro'; import { useEffect, useRef, useState } from 'react'; function useRequest( params: any, request: (params: any) => Promise, ): [T | null, () => void] | [] { const [currData, setData] = useState(null); const [count, setCount] = useState(0); const pagePullDownRef = useRef(''); useEffect(() => { request(params).then((data) => { if (data) { setData(data); } }); }, [count]); usePullDownRefresh(() => { refresh(); }); useEffect(() => { events.on(PULL_DOWN_REFRESH_EVENT, (page: string) => { if (!pagePullDownRef.current) { pagePullDownRef.current = page; } else if (pagePullDownRef.current !== page) { return; } refresh(); }); return () => { events.off(PULL_DOWN_REFRESH_EVENT); }; }, []); const refresh = () => { setCount(count + 1); }; return [currData, refresh]; } export default useRequest; ================================================ FILE: src/hooks/useRequestWIthMore.ts ================================================ import events from '@/utils/event_bus'; import Taro, { usePullDownRefresh, useReachBottom } from '@tarojs/taro'; import { useEffect, useRef, useState } from 'react'; import { defaultParams, PULL_DOWN_REFRESH_EVENT, REACH_BOTTOM_EVENT, } from '../constants'; function useRequestWIthMore( data: S, request: (data: S, params: any | null) => Promise, ): [T[] | null, boolean, () => void, () => void] | [] { const [currData, setData] = useState(null); const [hasMore, setHasMore] = useState(true); const [params, setParams] = useState(defaultParams); // 存储唯一 id 用于匹配消息 const pageReachBottomRef = useRef(''); const pagePullDownRef = useRef(''); const loadingRef = useRef(false); useEffect(() => { if (hasMore) { loadingRef.current = true; request(data, params) .then((data) => { if (data) { if (currData) { setData([...currData, ...data]); } else { setData(data); } if (data.length < params.per_page!) { setHasMore(false); } } }) .finally(() => { loadingRef.current = false; Taro.stopPullDownRefresh(); Taro.hideLoading(); }); } }, [params]); usePullDownRefresh(() => { refresh(); }); useEffect(() => { events.on(REACH_BOTTOM_EVENT, (page: string) => { if (loadingRef.current) { return; } if (!pageReachBottomRef.current) { pageReachBottomRef.current = page; } else if (pageReachBottomRef.current !== page) { return; } getMoreData(); }); return () => { events.off(REACH_BOTTOM_EVENT); }; }, []); useEffect(() => { events.on(PULL_DOWN_REFRESH_EVENT, (page: string) => { if (!pagePullDownRef.current) { pagePullDownRef.current = page; } else if (pagePullDownRef.current !== page) { return; } refresh(); }); return () => { events.off(PULL_DOWN_REFRESH_EVENT); }; }, []); useReachBottom(() => { if (loadingRef.current) { return; } getMoreData(); }); const getMoreData = () => { setParams((params) => ({ ...params, page: params.page! + 1 })); }; const refresh = () => { setData(null); setHasMore(true); setParams({ ...params, page: 1 }); }; return [currData, hasMore, refresh, getMoreData]; } export default useRequestWIthMore; ================================================ FILE: src/hooks/useTrending.ts ================================================ import { TRENDING_URL } from '@/constants'; import { useQuery } from '@tanstack/react-query'; import Taro from '@tarojs/taro'; import { TrendingDeveloperData, TrendingRepoData, TrendingRequestParams, } from 'types/trending'; const useTrending = ({ type = 'repositories', ...params }: TrendingRequestParams) => { return useQuery<(TrendingRepoData | TrendingDeveloperData)[]>( ['trending', type, params], () => { // Taro.showLoading({ title: '努力加载中...' }); return Taro.request({ url: `${TRENDING_URL}/${type}`, data: params, method: 'GET', }).then((rsp) => { Taro.stopPullDownRefresh(); Taro.hideLoading(); return rsp.data; }); }, { cacheTime: 60 * 60 * 10 }, ); }; export default useTrending; ================================================ FILE: src/index.html ================================================ GitHub-Pro
    ================================================ FILE: src/pages/activity/index.module.scss ================================================ .wrap { padding: 20px 20px 40px; } ================================================ FILE: src/pages/activity/index.tsx ================================================ import { View } from '@tarojs/components'; import { usePullDownRefresh, useReachBottom, useRouter } from '@tarojs/taro'; import ActivityItem from '../../components/activity-item'; import Empty from '../../components/empty'; import { getUserEvents, IUserReceivedEvent } from '../../services/users'; import styles from './index.module.scss'; import LoadMore from '@/components/load-more'; import useRequestWIthMore from '../../hooks/useRequestWIthMore'; const Activity = () => { const { params: { name }, } = useRouter<{ name: string }>(); const [eventsData, hasMore, refresh, getMoreData] = useRequestWIthMore(name, getUserEvents); usePullDownRefresh(() => { refresh!(); }); useReachBottom(() => { getMoreData!(); }); return ( {eventsData ? ( eventsData.map((item) => { return ; }) ) : ( )} {eventsData && } ); }; Activity.config = { navigationBarTitleText: 'Activity', }; export default Activity; ================================================ FILE: src/pages/activity/repo.tsx ================================================ import LoadMore from '@/components/load-more'; import { getRepoEvents, RepoEvent } from '@/services/repos'; import { View } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; import ActivityItem from '../../components/activity-item'; import Empty from '../../components/empty'; import useRequestWIthMore from '../../hooks/useRequestWIthMore'; import { IUserReceivedEvent } from '../../services/users'; import styles from './index.module.scss'; const RepoActivity = () => { const { params: { owner, repo }, } = useRouter(); const full_name = `${owner}/${repo}`; const [eventsData, hasMore, refresh] = useRequestWIthMore( { full_name }, getRepoEvents, ); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); return ( {eventsData ? ( eventsData.map((item) => { return ( ); }) ) : ( )} {eventsData && } ); }; export default RepoActivity; ================================================ FILE: src/pages/bookmarks/index.module.scss ================================================ ================================================ FILE: src/pages/bookmarks/index.tsx ================================================ import { View } from '@tarojs/components'; const Bookmarks = () => { return Bookmarks; }; export default Bookmarks; ================================================ FILE: src/pages/commits/commit-item/index.module.scss ================================================ .wrap { display: flex; margin: 20px; padding: 20px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; font-size: 22px; line-height: 1.5; } .avatar { margin-right: 20px; } .avatar-img { width: 70px; height: 70px; border-radius: 50%; } .info { flex: 1; } .login { font-size: 28px; color: #40a0fa; } .create { } .top { display: flex; justify-content: space-between; } .title { margin: 8px 0 5px 0; font-size: 26px; font-weight: 400; } .bottom { @extend .top; } .number { color: $text-color; font-weight: 400; } .comments { } ================================================ FILE: src/pages/commits/commit-item/index.tsx ================================================ import Avatar from '@/components/avatar'; import FontIcon from '@/components/font-icon'; import { CommitItemData } from '@/services/commits'; import { Text, View } from '@tarojs/components'; import { ITouchEvent } from '@tarojs/components/types/common'; import Taro from '@tarojs/taro'; import { getTimeAgo } from '../../../utils/date'; import styles from './index.module.scss'; interface CommitItemProps { commit: CommitItemData; full_name?: string; } const CommitItem = ({ commit, full_name = '' }: CommitItemProps) => { if (!commit) { return null; } const { sha, node_id, commit: { committer: { name, email, date }, message, tree, comment_count, verification, }, url, html_url, comments_url, author, committer: { login, id, avatar_url, gravatar_id, followers_url, following_url, gists_url, starred_url, subscriptions_url, organizations_url, repos_url, events_url, received_events_url, type, site_admin, }, parents, } = commit; const handleClick = () => { Taro.showToast({ title: 'Developing', icon: 'none' }); }; const handleNavTo = (e: ITouchEvent) => { e.preventDefault(); const url = `/pages/developer/index?name=${login}`; Taro.navigateTo({ url }); }; const shortSha = sha.slice(0, 8); return ( {login} {getTimeAgo(date)} {message} {shortSha} {comment_count} ); }; export default CommitItem; ================================================ FILE: src/pages/commits/index.module.scss ================================================ ================================================ FILE: src/pages/commits/index.tsx ================================================ import Empty from '@/components/empty'; import LoadMore from '@/components/load-more'; import SkeletonCard from '@/components/skeleton-card'; import { useReposListCommits } from '@/github/githubComponents'; import useInfiniteGithubRequest from '@/hooks/useInfiniteGithubRequest'; import { Block } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; import CommitItem from './commit-item'; const Commits = () => { const { params: { owner, repo }, } = useRouter(); const full_name = `${owner}/${repo}`; const { data: commitList, hasMore, isError, isLoading, } = useInfiniteGithubRequest(useReposListCommits, { pathParams: { owner, repo }, }); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); return ( {commitList ? ( {commitList.map((item) => { return ; })} ) : ( )} ); }; export default Commits; ================================================ FILE: src/pages/developer/followers/index.module.scss ================================================ ================================================ FILE: src/pages/developer/followers/index.tsx ================================================ import UserItem from '@/components/user-item'; import useRequestWIthMore from '@/hooks/useRequestWIthMore'; import { getUserFollowers } from '@/services/users'; import Taro, { useReachBottom, useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const Followers = () => { const { params: { name }, } = useRouter(); const [data, hasMore, refresh, getMore] = useRequestWIthMore( name, getUserFollowers, ); useEffect(() => { const title = `${name} - Followers`; Taro.setNavigationBarTitle({ title }); }, []); useReachBottom(() => { getMore!(); }); return ; }; export default Followers; ================================================ FILE: src/pages/developer/following/index.module.scss ================================================ ================================================ FILE: src/pages/developer/following/index.tsx ================================================ import UserItem from '@/components/user-item'; import useRequestWIthMore from '@/hooks/useRequestWIthMore'; import { getUserFollowing } from '@/services/users'; import Taro, { useReachBottom, useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const Following = () => { const { params: { name }, } = useRouter(); const [data, hasMore, refresh, getMore] = useRequestWIthMore( name, getUserFollowing, ); useEffect(() => { const title = `${name} - Following`; Taro.setNavigationBarTitle({ title }); }, []); useReachBottom(() => { getMore!(); }); return ; }; export default Following; ================================================ FILE: src/pages/developer/index.module.scss ================================================ .wrap { padding: 10px 20px 80px; } .header { padding: 20px 10px 10px; display: flex; align-items: center; } .avatar { width: 120px; height: 120px; border-radius: 50%; margin-right: 20px; } .basic { margin-right: auto; font-size: 25px; } .name { font-size: 30px; font-weight: 600; } .bio { margin: 10px 10px 10px 15px; } .action-btn { display: flex; justify-content: space-around; padding: 40px 80px 0; } .btn { padding: 0 40px; font-size: 32px; font-weight: 700; text-transform: capitalize; } .info { margin-top: 30px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: rgba(255, 255, 255, 0.9); } .meta { padding: 20px 10px; } .nav { display: flex; justify-content: space-around; align-items: center; } .nav-item { flex: 1; text-align: center; } .item-count { color: rgb(43, 43, 43); font-weight: 600; font-size: 35px; } .item-label { font-weight: 400; font-size: 28px; text-transform: capitalize; } .info-list-item { .at-list__item-extra { width: auto; } .item-extra__info { color: rgb(43, 43, 43); } .item-extra__icon-arrow { color: rgb(43, 43, 43); } } ================================================ FILE: src/pages/developer/index.tsx ================================================ import SkeletonCard from '@/components/skeleton-card'; import UserInfo from '@/components/user-info'; import { useUsersCheckPersonIsFollowedByAuthenticated, useUsersFollow, useUsersGetByUsername, useUsersUnfollow, } from '@/github/githubComponents'; import { Block } from '@tarojs/components'; import Taro, { useRouter, useShareAppMessage } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; const Developer = () => { const { params: { name }, } = useRouter<{ name: string }>(); const username = useSelector((state) => state.user.username); const { data: userInfo, isError, isLoading, } = useUsersGetByUsername({ pathParams: { username: name }, }); const [isFollowing, setIsFollowing] = useState(false); useUsersCheckPersonIsFollowedByAuthenticated( { pathParams: { username: name }, }, { enabled: !!username, onSuccess(data) { const isFollowing = !data && data !== null; setIsFollowing(isFollowing); }, }, ); const { mutateAsync: unFollow } = useUsersUnfollow(); const { mutateAsync: updateFollow } = useUsersFollow(); useEffect(() => { const title = `Developer`; Taro.setNavigationBarTitle({ title }); }, []); const handleFollowBtnClick = () => { if (isFollowing) { unFollow({ pathParams: { username: name } }).then((data) => { if (!data && data !== null) { setIsFollowing(false); } }); } else { updateFollow({ pathParams: { username: name } }).then((data) => { if (!data && data !== null) { setIsFollowing(true); } }); } }; useShareAppMessage((res) => { const title = `[${userInfo!.login}] ${userInfo!.bio}`; return { title, path: `/pages/developer/index?name=${name}`, }; }); return ( ); }; export default Developer; ================================================ FILE: src/pages/developer/repos/index.module.scss ================================================ ================================================ FILE: src/pages/developer/repos/index.tsx ================================================ import Empty from '@/components/empty'; import LoadMore from '@/components/load-more'; import RepoItem from '@/components/repo-item'; import useRequestWIthMore from '@/hooks/useRequestWIthMore'; import { getCurrentUserRepos } from '@/services/user'; import { getUserRepos } from '@/services/users'; import { View } from '@tarojs/components'; import Taro, { useReachBottom, useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const RepoList = () => { const { params: { name, isCurrent }, } = useRouter(); // can't use if..else.. const funcMap = { true: getCurrentUserRepos, false: getUserRepos, }; let func = funcMap[isCurrent]; const [repoList, hasMore, refresh, getMoreData] = useRequestWIthMore( name, func, ); useEffect(() => { const title = `${name} - Repositories`; Taro.setNavigationBarTitle({ title }); }, []); useReachBottom(() => { getMoreData!(); }); return ( {repoList ? ( repoList.map((item, idx) => { return ; }) ) : ( )} {repoList && } ); }; export default RepoList; ================================================ FILE: src/pages/developer/starred/index.module.scss ================================================ ================================================ FILE: src/pages/developer/starred/index.tsx ================================================ import Empty from '@/components/empty'; import LoadMore from '@/components/load-more'; import RepoItem from '@/components/repo-item'; import useRequestWIthMore from '@/hooks/useRequestWIthMore'; import { IStarred } from '@/services/user'; import { getUserStarred } from '@/services/users'; import { View } from '@tarojs/components'; import Taro, { useReachBottom, useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const StarredRepoList = () => { const { params: { name }, } = useRouter(); const [starredRepos, hasMore, refresh, getMoreData] = useRequestWIthMore(name, getUserStarred); useEffect(() => { const title = `${name} - Starred`; Taro.setNavigationBarTitle({ title }); }, []); useReachBottom(() => { getMoreData!(); }); return ( {starredRepos ? ( starredRepos.map((item, idx) => { return ; }) ) : ( )} {starredRepos && } ); }; export default StarredRepoList; ================================================ FILE: src/pages/issues/comment-item/index.module.scss ================================================ .wrap { margin-top: 40px; padding: 20px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } ================================================ FILE: src/pages/issues/comment-item/index.tsx ================================================ import Author from '@/components/author'; import Markdown from '@/components/markdown'; import { View } from '@tarojs/components'; import { memo } from 'react'; import styles from './index.module.scss'; const CommentItem = ({ comment, full_name }) => { if (!comment) { return null; } const { url, html_url, issue_url, id, node_id, user: { login, avatar_url, gravatar_id, followers_url, following_url, gists_url, starred_url, subscriptions_url, organizations_url, repos_url, events_url, received_events_url, type, site_admin, }, created_at, updated_at, author_association, body, } = comment; return ( ); }; const areEqual = (prevProps: any, props: any) => { return prevProps && prevProps.comment.id === props.comment.id; }; export default memo(CommentItem, areEqual); ================================================ FILE: src/pages/issues/create-comment/index.module.scss ================================================ .wrap { margin: 40px; } .content { margin-top: 20px; border: 1px solid #ccc; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .confirm { margin-top: 20px; } ================================================ FILE: src/pages/issues/create-comment/index.tsx ================================================ import { showLoginTips } from '@/utils/common'; import { View } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { AtButton, AtTextarea } from 'taro-ui'; import { createIssueComment } from '../../../services/issues'; import styles from './index.module.scss'; const CreateComment = () => { const { params: { full_name, number }, } = useRouter(); if (!full_name) { return; } const username = useSelector((state) => state.user.username); if (!username) { showLoginTips(); } const [content, setContent] = useState(''); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); const handleTextareaChange = (ev) => { setContent(ev.target.value); }; const handleConfirm = () => { const data = { body: content, }; createIssueComment({ full_name, number }, data).then((res) => { if (res && res.body === content) { Taro.showToast({ title: 'Success', icon: 'success' }); setTimeout(() => { Taro.navigateBack(); }, 1000); } }); }; return ( Comment ); }; export default CreateComment; ================================================ FILE: src/pages/issues/create-issue/index.module.scss ================================================ .wrap { margin: 40px; } .title { margin-top: 20px; border: 1px solid #ccc; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .content { @extend .title; } .confirm { margin-top: 20px; } ================================================ FILE: src/pages/issues/create-issue/index.tsx ================================================ import { View } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { AtButton, AtInput, AtTextarea } from 'taro-ui'; import { createIssue } from '../../../services/issues'; import { showLoginTips } from '../../../utils/common'; import styles from './index.module.scss'; const CreateIssue = () => { const { params: { full_name }, } = useRouter(); if (!full_name) { return; } const username = useSelector((state) => state.user.username); if (!username) { showLoginTips(); } const [title, setTitle] = useState(''); const [content, setContent] = useState(''); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); const handleChange = (val: string) => { setTitle(val); }; const handleTextareaChange = (ev) => { setContent(ev.target.value); }; const handleConfirm = () => { const data = { title: title, body: content, }; createIssue({ full_name }, data).then((data) => { if (data && data.title === title) { Taro.showToast({ title: 'Success', icon: 'success' }); setTimeout(() => { Taro.navigateBack(); }, 1000); } }); }; // TODO add preview return ( Submit new issue ); }; export default CreateIssue; ================================================ FILE: src/pages/issues/index.module.scss ================================================ ================================================ FILE: src/pages/issues/index.tsx ================================================ import Empty from '@/components/empty'; import FabButton from '@/components/fab-button'; import { Block, View } from '@tarojs/components'; import Taro, { usePullDownRefresh, useReachBottom, useRouter, } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { AtTabs, AtTabsPane } from 'taro-ui'; import LoadMore from '../../components/load-more/index'; import { issueDefaultParams } from '../../constants'; import { getIssues, Issue } from '../../services/issues'; import IssueItem from './issue-item'; const Issues = () => { const { params: { full_name: _full_name, owner, repo }, } = useRouter(); const full_name = _full_name || `${owner}/${repo}`; const [count, setCount] = useState(0); const [curTab, setTab] = useState(0); const [openHasMore, setOpenHasMore] = useState(true); const [closedHasMore, setClosedHasMore] = useState(true); const [openList, setOpenList] = useState(null); const [closedList, setClosedtList] = useState(null); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); const [openParams, setOpenParams] = useState({ ...issueDefaultParams, filter: 'all', state: 'open', }); const [closedParams, setClosedParams] = useState({ ...issueDefaultParams, filter: 'all', state: 'closed', }); usePullDownRefresh(() => { setOpenParams({ ...openParams, page: 1 }); setClosedParams({ ...closedParams, page: 1 }); setClosedHasMore(true); setOpenHasMore(true); setCount(count + 1); }); useReachBottom(() => { if (curTab === 0) { setOpenParams({ ...openParams, page: openParams.page! + 1 }); } else { setClosedParams({ ...closedParams, page: closedParams.page! + 1 }); } }); const getClosedIssues = (params) => { getIssues(full_name, params).then((data) => { if (data) { if (closedList) { setClosedtList([...closedList, ...data]); } else { setClosedtList(data); } if (data.length < params.per_page) { setClosedHasMore(false); } } }); }; useEffect(() => { if (openHasMore) { getIssues(full_name, openParams).then((data) => { if (data) { if (openList) { setOpenList([...openList, ...data]); } else { setOpenList(data); } if (data.length < openParams.per_page!) { setOpenHasMore(false); } } }); } }, [openParams, count]); useEffect(() => { if (openList && closedHasMore) { getClosedIssues(closedParams); } }, [closedParams, count]); useEffect(() => { if (!closedList && curTab === 1) { getClosedIssues(closedParams); } }, [curTab]); const tabList = [ { title: 'open', data: openList, hasMore: openHasMore }, { title: 'closed', data: closedList, hasMore: closedHasMore }, ]; const handleTabClick = (val) => { setTab(val); }; const handleFaBtnClick = () => { Taro.navigateTo({ url: `/pages/issues/create-issue/index?full_name=${full_name}`, }); }; // TODO use scrollView return ( {tabList.map((tab, idx) => { const data = tab.data; return ( {data ? ( {data.map((item) => { return ( ); })} ) : ( )} ); })} ); }; export default Issues; ================================================ FILE: src/pages/issues/issue-detail/index.module.scss ================================================ .wrap { padding: 20px 20px 40px; height: 100vh; background: $itemBg; } .header { } .meta { font-size: 28px; font-weight: 400; } .title { font-size: 32px; } .content { padding-top: 20px; } .author { display: flex; } .avatar { } .avatar-img { width: 80px; height: 80px; margin: 0 20px; border-radius: 50%; } .author { color: #40a0fa; font-size: 32px; font-weight: 400; } .create-at { margin-left: auto; font-size: 25px; } .body { } .comment-list { } ================================================ FILE: src/pages/issues/issue-detail/index.tsx ================================================ import Author from '@/components/author'; import Empty from '@/components/empty'; import FabButton from '@/components/fab-button'; import LoadMore from '@/components/load-more'; import Markdown from '@/components/markdown'; import useRequestWIthMore from '@/hooks/useRequestWIthMore'; import { getIssueComments, getIssueDetail, Issue, IssueComment, } from '@/services/issues'; import { CLEAR_ISSUE_INFO } from '@/store/constatnts'; import { View } from '@tarojs/components'; import Taro, { usePullDownRefresh, useRouter } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import CommentItem from '../comment-item'; import styles from './index.module.scss'; const IssueDetail = () => { const { params: { full_name, number }, } = useRouter(); const issue = useSelector((state) => state.issue.info); const [issueData, setIssue] = useState(issue); const [commentList, hasMore, refresh] = useRequestWIthMore< IssueComment | null, any >({ full_name, number }, getIssueComments); const dispatch = useDispatch(); useEffect(() => { const title = full_name; Taro.setNavigationBarTitle({ title }); }, []); useEffect(() => { return () => { dispatch({ type: CLEAR_ISSUE_INFO }); }; }, []); useEffect(() => { if (!issueData) { getIssueDetail({ full_name, number }).then((resData) => { if (resData) { setIssue(resData); } }); } }, []); usePullDownRefresh(() => { refresh!(); }); const handleFabBtnClick = () => { Taro.navigateTo({ url: `/pages/issues/create-comment/index?full_name=${full_name}&number=${number}`, }); }; const { url, repository_url, labels_url, comments_url, events_url, html_url, id, node_id, title, user, labels, state, locked, assignee, assignees, milestone, comments, created_at, updated_at, closed_at, author_association, body, pull_request, } = (issueData as Issue) || {}; const { login, avatar_url, gravatar_id, type, site_admin } = user || {}; if (!login) { return ; } return ( {title} #{number} {state} {comments} comments {commentList ? ( {commentList.map((item, idx) => { return ( ); })} ) : ( )} ); }; export default IssueDetail; ================================================ FILE: src/pages/issues/issue-item/index.module.scss ================================================ .wrap { display: flex; margin: 20px; padding: 20px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; font-size: 22px; line-height: 1.5; } .avatar { margin-right: 20px; } .avatar-img { width: 70px; height: 70px; border-radius: 50%; } .info { flex: 1; } .login { font-size: 28px; color: #40a0fa; } .create { } .top { display: flex; justify-content: space-between; } .title { margin: 8px 0 5px 0; font-size: 26px; font-weight: 400; } .bottom { align-items: center; @extend .top; } .number { display: inline-block; } .comments { display: flex; align-items: center; } ================================================ FILE: src/pages/issues/issue-item/index.tsx ================================================ import Avatar from '@/components/avatar'; import FontIcon from '@/components/font-icon'; import { Issue } from '@/services/issues'; import { Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { memo } from 'react'; import { useDispatch } from 'react-redux'; import { UPDATE_ISSUE_INFO } from '../../../store/constatnts'; import { getTimeAgo } from '../../../utils/date'; import styles from './index.module.scss'; interface IssueItemProps { issue: Issue; full_name?: string; } const IssueItem = ({ issue, full_name: _full_name }: IssueItemProps) => { if (!issue) { return null; } const dispatch = useDispatch(); const { url, repository_url, labels_url, comments_url, events_url, html_url, id, node_id, number, title, user: { login, avatar_url, gravatar_id, followers_url, following_url, gists_url, starred_url, subscriptions_url, organizations_url, repos_url, received_events_url, type, site_admin, }, labels, state, locked, assignee, assignees, milestone, comments, created_at, updated_at, closed_at, author_association, body, pull_request, repository, } = issue; const full_name = _full_name || repository!.full_name; const handleNavTo = () => { dispatch({ type: UPDATE_ISSUE_INFO, payload: issue }); const url = `/pages/issues/issue-detail/index?full_name=${full_name}&number=${number}`; Taro.navigateTo({ url }); }; return ( {login} {getTimeAgo(created_at)} {title} #{number} {comments} ); }; const areEqual = (prevProps: any, props: any) => { return prevProps && prevProps.issue.id === props.issue.id; }; export default memo(IssueItem, areEqual); ================================================ FILE: src/pages/issues/shared_data.ts ================================================ const shared_data = { issue: null }; export const setIssueData = (data) => { shared_data.issue = data; }; export const getIssueData = () => { return shared_data.issue; }; ================================================ FILE: src/pages/login/index.config.ts ================================================ export default { navigationBarTitleText: 'Login', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/login/index.module.scss ================================================ page { background: #fff; } .at-input { margin-left: 0; margin-bottom: 20px; padding-left: 32px; } .layout-container { position: relative; } .login-container { margin: 40px 80px; } .login-header { margin-bottom: 40px; text-align: center; background: #fff; } .logo-img { width: 120px; height: 120px; } .login-body { padding: 0 40px; margin-top: 30px; box-shadow: $boxShadow; } .tabs-body { margin-top: 40px; } .login-btn-container { padding: 40px 0; text-align: right; border-bottom: 1px solid #e3e3e3; } .login-btn { width: 180px; height: 70px; line-height: 70px; border-radius: 0; } .desc { font-size: 25px; font-weight: 400; color: $color-brand-light; } ================================================ FILE: src/pages/login/index.tsx ================================================ import { useUsersGetAuthenticated } from '@/github/githubComponents'; import { LOGIN } from '@/store/constatnts'; import { copyText } from '@/utils/common'; import { Block, Image, Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useState } from 'react'; import { useDispatch } from 'react-redux'; import { AtButton, AtInput } from 'taro-ui'; import logo from '../../assets/logo.png'; import styles from './index.module.scss'; const Login = () => { const dispatch = useDispatch(); const [token, setToken] = useState(''); const authorization = `token ${token}`; const { refetch } = useUsersGetAuthenticated( { headers: { Authorization: authorization } }, { enabled: false, onSuccess(data) { if (data) { dispatch({ type: LOGIN, payload: { username: data.login, token: authorization }, }); Taro.showToast({ title: '登录成功!', icon: 'success', duration: 1500, }); setTimeout(() => { Taro.navigateBack(); }, 1500); } }, }, ); const handleInputChange = (val, e) => { setToken(val); }; const handleLoginBtnClick = () => { if (!token) { Taro.showToast({ title: '请输入 Token!', icon: 'none' }); return; } refetch(); }; return ( Welcome to GitHub Pro. 登录 Token 只会在本地保存,不会上传到服务器的,放心使用~😎 { await copyText( 'https://github.com/settings/tokens/new?scopes=repo%2Cworkflow%2Cnotifications%2Cuser%2Cgist%2Cproject&description=Github%20Pro', ); }} > https://github.com/settings/tokens/new (点击复制) Expiration 选择 No expiration ); }; export default Login; ================================================ FILE: src/pages/my-languages/index.config.ts ================================================ export default { navigationBarTitleText: 'My Languages', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/my-languages/index.module.scss ================================================ .wrap { margin-top: 20px; } .filter-input { line-height: 40px; height: 40px; font-size: 35px; padding: 10px 40px; } .at-checkbox__option { } .at-checkbox__option-wrap { padding: 20px 10px; } .at-checkbox__title { font-size: 30px; font-weight: 300; } ================================================ FILE: src/pages/my-languages/index.tsx ================================================ import { UPDATE_SELECTED_LANGS } from '@/store/constatnts'; import { Input, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { AtCheckbox } from 'taro-ui'; import FabButton from '../../components/fab-button'; import { LanguageParams } from '../trending'; import styles from './index.module.scss'; import LANGUAGE_LIST from './languages'; interface OptionsLang { value: string; label: string; } const MyLanguages = () => { const langs = useSelector((state) => state.lang.selected); const initSelectedList = langs.map((lang) => lang.language); const [optionsLangs, setOptionsLangs] = useState(LANGUAGE_LIST); const [selectedList, setSelectedList] = useState(initSelectedList); const [filterVal, setFilterVal] = useState(''); const dispatch = useDispatch(); const handleSelectedChange = (val) => { setSelectedList(val); }; const handleChangeInput = (e) => { const val = e.target.value; setFilterVal(val); const _langs = LANGUAGE_LIST.filter((_lang) => _lang.value.includes(val)); setOptionsLangs(_langs); }; const handleFabClick = () => { const languages = LANGUAGE_LIST.reduce( (result, { value, label }) => { // TODO 按顺序排 if (selectedList.includes(value)) { result.push({ language: value, title: label }); } return result; }, [], ); dispatch({ type: UPDATE_SELECTED_LANGS, payload: languages, }); Taro.navigateBack(); }; return ( ); }; export default MyLanguages; ================================================ FILE: src/pages/my-languages/languages.ts ================================================ export const LANGUAGE_LIST = [ { value: '', label: 'All Languages', disabled: true, }, { value: '1c-enterprise', label: '1C Enterprise', }, { value: 'abap', label: 'ABAP', }, { value: 'abnf', label: 'ABNF', }, { value: 'actionscript', label: 'ActionScript', }, { value: 'ada', label: 'Ada', }, { value: 'adobe-font-metrics', label: 'Adobe Font Metrics', }, { value: 'agda', label: 'Agda', }, { value: 'ags-script', label: 'AGS Script', }, { value: 'alloy', label: 'Alloy', }, { value: 'alpine-abuild', label: 'Alpine Abuild', }, { value: 'ampl', label: 'AMPL', }, { value: 'angelscript', label: 'AngelScript', }, { value: 'ant-build-system', label: 'Ant Build System', }, { value: 'antlr', label: 'ANTLR', }, { value: 'apacheconf', label: 'ApacheConf', }, { value: 'apex', label: 'Apex', }, { value: 'api-blueprint', label: 'API Blueprint', }, { value: 'apl', label: 'APL', }, { value: 'apollo-guidance-computer', label: 'Apollo Guidance Computer', }, { value: 'applescript', label: 'AppleScript', }, { value: 'arc', label: 'Arc', }, { value: 'asciidoc', label: 'AsciiDoc', }, { value: 'asn.1', label: 'ASN.1', }, { value: 'asp', label: 'ASP', }, { value: 'aspectj', label: 'AspectJ', }, { value: 'assembly', label: 'Assembly', }, { value: 'ats', label: 'ATS', }, { value: 'augeas', label: 'Augeas', }, { value: 'autohotkey', label: 'AutoHotkey', }, { value: 'autoit', label: 'AutoIt', }, { value: 'awk', label: 'Awk', }, { value: 'ballerina', label: 'Ballerina', }, { value: 'batchfile', label: 'Batchfile', }, { value: 'befunge', label: 'Befunge', }, { value: 'bison', label: 'Bison', }, { value: 'bitbake', label: 'BitBake', }, { value: 'blade', label: 'Blade', }, { value: 'blitzbasic', label: 'BlitzBasic', }, { value: 'blitzmax', label: 'BlitzMax', }, { value: 'bluespec', label: 'Bluespec', }, { value: 'boo', label: 'Boo', }, { value: 'brainfuck', label: 'Brainfuck', }, { value: 'brightscript', label: 'Brightscript', }, { value: 'bro', label: 'Bro', }, { value: 'c', label: 'C', }, { value: 'c%23', label: 'C#', }, { value: 'c++', label: 'C++', }, { value: 'c-objdump', label: 'C-ObjDump', }, { value: 'c2hs-haskell', label: 'C2hs Haskell', }, { value: "cap'n-proto", label: "Cap'n Proto", }, { value: 'cartocss', label: 'CartoCSS', }, { value: 'ceylon', label: 'Ceylon', }, { value: 'chapel', label: 'Chapel', }, { value: 'charity', label: 'Charity', }, { value: 'chuck', label: 'ChucK', }, { value: 'cirru', label: 'Cirru', }, { value: 'clarion', label: 'Clarion', }, { value: 'clean', label: 'Clean', }, { value: 'click', label: 'Click', }, { value: 'clips', label: 'CLIPS', }, { value: 'clojure', label: 'Clojure', }, { value: 'closure-templates', label: 'Closure Templates', }, { value: 'cmake', label: 'CMake', }, { value: 'cobol', label: 'COBOL', }, { value: 'coffeescript', label: 'CoffeeScript', }, { value: 'coldfusion', label: 'ColdFusion', }, { value: 'coldfusion-cfc', label: 'ColdFusion CFC', }, { value: 'collada', label: 'COLLADA', }, { value: 'common-lisp', label: 'Common Lisp', }, { value: 'common-workflow-value', label: 'Common Workflow value', }, { value: 'component-pascal', label: 'Component Pascal', }, { value: 'cool', label: 'Cool', }, { value: 'coq', label: 'Coq', }, { value: 'cpp-objdump', label: 'Cpp-ObjDump', }, { value: 'creole', label: 'Creole', }, { value: 'crystal', label: 'Crystal', }, { value: 'cson', label: 'CSON', }, { value: 'csound', label: 'Csound', }, { value: 'csound-document', label: 'Csound Document', }, { value: 'csound-score', label: 'Csound Score', }, { value: 'css', label: 'CSS', }, { value: 'csv', label: 'CSV', }, { value: 'cuda', label: 'Cuda', }, { value: 'cweb', label: 'CWeb', }, { value: 'cycript', label: 'Cycript', }, { value: 'cython', label: 'Cython', }, { value: 'd', label: 'D', }, { value: 'd-objdump', label: 'D-ObjDump', }, { value: 'darcs-patch', label: 'Darcs Patch', }, { value: 'dart', label: 'Dart', }, { value: 'dataweave', label: 'DataWeave', }, { value: 'desktop', label: 'desktop', }, { value: 'diff', label: 'Diff', }, { value: 'digital-command-value', label: 'DIGITAL Command value', }, { value: 'dm', label: 'DM', }, { value: 'dns-zone', label: 'DNS Zone', }, { value: 'dockerfile', label: 'Dockerfile', }, { value: 'dogescript', label: 'Dogescript', }, { value: 'dtrace', label: 'DTrace', }, { value: 'dylan', label: 'Dylan', }, { value: 'e', label: 'E', }, { value: 'eagle', label: 'Eagle', }, { value: 'easybuild', label: 'Easybuild', }, { value: 'ebnf', label: 'EBNF', }, { value: 'ec', label: 'eC', }, { value: 'ecere-projects', label: 'Ecere Projects', }, { value: 'ecl', label: 'ECL', }, { value: 'eclipse', label: 'ECLiPSe', }, { value: 'edje-data-collection', label: 'Edje Data Collection', }, { value: 'edn', label: 'edn', }, { value: 'eiffel', label: 'Eiffel', }, { value: 'ejs', label: 'EJS', }, { value: 'elixir', label: 'Elixir', }, { value: 'elm', label: 'Elm', }, { value: 'emacs-lisp', label: 'Emacs Lisp', }, { value: 'emberscript', label: 'EmberScript', }, { value: 'eq', label: 'EQ', }, { value: 'erlang', label: 'Erlang', }, { value: 'f%23', label: 'F#', }, { value: 'factor', label: 'Factor', }, { value: 'fancy', label: 'Fancy', }, { value: 'fantom', label: 'Fantom', }, { value: 'filebench-wml', label: 'Filebench WML', }, { value: 'filterscript', label: 'Filterscript', }, { value: 'fish', label: 'fish', }, { value: 'flux', label: 'FLUX', }, { value: 'formatted', label: 'Formatted', }, { value: 'forth', label: 'Forth', }, { value: 'fortran', label: 'Fortran', }, { value: 'freemarker', label: 'FreeMarker', }, { value: 'frege', label: 'Frege', }, { value: 'g-code', label: 'G-code', }, { value: 'game-maker-value', label: 'Game Maker value', }, { value: 'gams', label: 'GAMS', }, { value: 'gap', label: 'GAP', }, { value: 'gcc-machine-description', label: 'GCC Machine Description', }, { value: 'gdb', label: 'GDB', }, { value: 'gdscript', label: 'GDScript', }, { value: 'genie', label: 'Genie', }, { value: 'genshi', label: 'Genshi', }, { value: 'gentoo-ebuild', label: 'Gentoo Ebuild', }, { value: 'gentoo-eclass', label: 'Gentoo Eclass', }, { value: 'gerber-image', label: 'Gerber Image', }, { value: 'gettext-catalog', label: 'Gettext Catalog', }, { value: 'gherkin', label: 'Gherkin', }, { value: 'glsl', label: 'GLSL', }, { value: 'glyph', label: 'Glyph', }, { value: 'gn', label: 'GN', }, { value: 'gnuplot', label: 'Gnuplot', }, { value: 'go', label: 'Go', }, { value: 'golo', label: 'Golo', }, { value: 'gosu', label: 'Gosu', }, { value: 'grace', label: 'Grace', }, { value: 'gradle', label: 'Gradle', }, { value: 'grammatical-framework', label: 'Grammatical Framework', }, { value: 'graph-modeling-value', label: 'Graph Modeling value', }, { value: 'graphql', label: 'GraphQL', }, { value: 'graphviz-(dot)', label: 'Graphviz (DOT)', }, { value: 'groovy', label: 'Groovy', }, { value: 'groovy-server-pages', label: 'Groovy Server Pages', }, { value: 'hack', label: 'Hack', }, { value: 'haml', label: 'Haml', }, { value: 'handlebars', label: 'Handlebars', }, { value: 'harbour', label: 'Harbour', }, { value: 'haskell', label: 'Haskell', }, { value: 'haxe', label: 'Haxe', }, { value: 'hcl', label: 'HCL', }, { value: 'hlsl', label: 'HLSL', }, { value: 'html', label: 'HTML', }, { value: 'html+django', label: 'HTML+Django', }, { value: 'html+ecr', label: 'HTML+ECR', }, { value: 'html+eex', label: 'HTML+EEX', }, { value: 'html+erb', label: 'HTML+ERB', }, { value: 'html+php', label: 'HTML+PHP', }, { value: 'http', label: 'HTTP', }, { value: 'hy', label: 'Hy', }, { value: 'hyphy', label: 'HyPhy', }, { value: 'idl', label: 'IDL', }, { value: 'idris', label: 'Idris', }, { value: 'igor-pro', label: 'IGOR Pro', }, { value: 'inform-7', label: 'Inform 7', }, { value: 'ini', label: 'INI', }, { value: 'inno-setup', label: 'Inno Setup', }, { value: 'io', label: 'Io', }, { value: 'ioke', label: 'Ioke', }, { value: 'irc-log', label: 'IRC log', }, { value: 'isabelle', label: 'Isabelle', }, { value: 'isabelle-root', label: 'Isabelle ROOT', }, { value: 'j', label: 'J', }, { value: 'jasmin', label: 'Jasmin', }, { value: 'java', label: 'Java', }, { value: 'java-server-pages', label: 'Java Server Pages', }, { value: 'javascript', label: 'JavaScript', }, { value: 'jflex', label: 'JFlex', }, { value: 'jison', label: 'Jison', }, { value: 'jison-lex', label: 'Jison Lex', }, { value: 'jolie', label: 'Jolie', }, { value: 'json', label: 'JSON', }, { value: 'json5', label: 'JSON5', }, { value: 'jsoniq', label: 'JSONiq', }, { value: 'jsonld', label: 'JSONLD', }, { value: 'jsx', label: 'JSX', }, { value: 'julia', label: 'Julia', }, { value: 'jupyter-notebook', label: 'Jupyter Notebook', }, { value: 'kicad-layout', label: 'KiCad Layout', }, { value: 'kicad-legacy-layout', label: 'KiCad Legacy Layout', }, { value: 'kicad-schematic', label: 'KiCad Schematic', }, { value: 'kit', label: 'Kit', }, { value: 'kotlin', label: 'Kotlin', }, { value: 'krl', label: 'KRL', }, { value: 'labview', label: 'LabVIEW', }, { value: 'lasso', label: 'Lasso', }, { value: 'latte', label: 'Latte', }, { value: 'lean', label: 'Lean', }, { value: 'less', label: 'Less', }, { value: 'lex', label: 'Lex', }, { value: 'lfe', label: 'LFE', }, { value: 'lilypond', label: 'LilyPond', }, { value: 'limbo', label: 'Limbo', }, { value: 'linker-script', label: 'Linker Script', }, { value: 'linux-kernel-module', label: 'Linux Kernel Module', }, { value: 'liquid', label: 'Liquid', }, { value: 'literate-agda', label: 'Literate Agda', }, { value: 'literate-coffeescript', label: 'Literate CoffeeScript', }, { value: 'literate-haskell', label: 'Literate Haskell', }, { value: 'livescript', label: 'LiveScript', }, { value: 'llvm', label: 'LLVM', }, { value: 'logos', label: 'Logos', }, { value: 'logtalk', label: 'Logtalk', }, { value: 'lolcode', label: 'LOLCODE', }, { value: 'lookml', label: 'LookML', }, { value: 'loomscript', label: 'LoomScript', }, { value: 'lsl', label: 'LSL', }, { value: 'lua', label: 'Lua', }, { value: 'm', label: 'M', }, { value: 'm4', label: 'M4', }, { value: 'm4sugar', label: 'M4Sugar', }, { value: 'makefile', label: 'Makefile', }, { value: 'mako', label: 'Mako', }, { value: 'markdown', label: 'Markdown', }, { value: 'marko', label: 'Marko', }, { value: 'mask', label: 'Mask', }, { value: 'mathematica', label: 'Mathematica', }, { value: 'matlab', label: 'Matlab', }, { value: 'maven-pom', label: 'Maven POM', }, { value: 'max', label: 'Max', }, { value: 'maxscript', label: 'MAXScript', }, { value: 'mediawiki', label: 'MediaWiki', }, { value: 'mercury', label: 'Mercury', }, { value: 'meson', label: 'Meson', }, { value: 'metal', label: 'Metal', }, { value: 'minid', label: 'MiniD', }, { value: 'mirah', label: 'Mirah', }, { value: 'modelica', label: 'Modelica', }, { value: 'modula-2', label: 'Modula-2', }, { value: 'module-management-system', label: 'Module Management System', }, { value: 'monkey', label: 'Monkey', }, { value: 'moocode', label: 'Moocode', }, { value: 'moonscript', label: 'MoonScript', }, { value: 'mql4', label: 'MQL4', }, { value: 'mql5', label: 'MQL5', }, { value: 'mtml', label: 'MTML', }, { value: 'muf', label: 'MUF', }, { value: 'mupad', label: 'mupad', }, { value: 'myghty', label: 'Myghty', }, { value: 'ncl', label: 'NCL', }, { value: 'nearley', label: 'Nearley', }, { value: 'nemerle', label: 'Nemerle', }, { value: 'nesc', label: 'nesC', }, { value: 'netlinx', label: 'NetLinx', }, { value: 'netlinx+erb', label: 'NetLinx+ERB', }, { value: 'netlogo', label: 'NetLogo', }, { value: 'newlisp', label: 'NewLisp', }, { value: 'nextflow', label: 'Nextflow', }, { value: 'nginx', label: 'Nginx', }, { value: 'nim', label: 'Nim', }, { value: 'ninja', label: 'Ninja', }, { value: 'nit', label: 'Nit', }, { value: 'nix', label: 'Nix', }, { value: 'nl', label: 'NL', }, { value: 'nsis', label: 'NSIS', }, { value: 'nu', label: 'Nu', }, { value: 'numpy', label: 'NumPy', }, { value: 'objdump', label: 'ObjDump', }, { value: 'objective-c', label: 'Objective-C', }, { value: 'objective-c++', label: 'Objective-C++', }, { value: 'objective-j', label: 'Objective-J', }, { value: 'ocaml', label: 'OCaml', }, { value: 'omgrofl', label: 'Omgrofl', }, { value: 'ooc', label: 'ooc', }, { value: 'opa', label: 'Opa', }, { value: 'opal', label: 'Opal', }, { value: 'opencl', label: 'OpenCL', }, { value: 'openedge-abl', label: 'OpenEdge ABL', }, { value: 'openrc-runscript', label: 'OpenRC runscript', }, { value: 'openscad', label: 'OpenSCAD', }, { value: 'opentype-feature-file', label: 'OpenType Feature File', }, { value: 'org', label: 'Org', }, { value: 'ox', label: 'Ox', }, { value: 'oxygene', label: 'Oxygene', }, { value: 'oz', label: 'Oz', }, { value: 'p4', label: 'P4', }, { value: 'pan', label: 'Pan', }, { value: 'papyrus', label: 'Papyrus', }, { value: 'parrot', label: 'Parrot', }, { value: 'parrot-assembly', label: 'Parrot Assembly', }, { value: 'parrot-internal-representation', label: 'Parrot Internal Representation', }, { value: 'pascal', label: 'Pascal', }, { value: 'pawn', label: 'PAWN', }, { value: 'pep8', label: 'Pep8', }, { value: 'perl', label: 'Perl', }, { value: 'perl-6', label: 'Perl 6', }, { value: 'php', label: 'PHP', }, { value: 'pic', label: 'Pic', }, { value: 'pickle', label: 'Pickle', }, { value: 'picolisp', label: 'PicoLisp', }, { value: 'piglatin', label: 'PigLatin', }, { value: 'pike', label: 'Pike', }, { value: 'plpgsql', label: 'PLpgSQL', }, { value: 'plsql', label: 'PLSQL', }, { value: 'pod', label: 'Pod', }, { value: 'pogoscript', label: 'PogoScript', }, { value: 'pony', label: 'Pony', }, { value: 'postcss', label: 'PostCSS', }, { value: 'postscript', label: 'PostScript', }, { value: 'pov-ray-sdl', label: 'POV-Ray SDL', }, { value: 'powerbuilder', label: 'PowerBuilder', }, { value: 'powershell', label: 'PowerShell', }, { value: 'processing', label: 'Processing', }, { value: 'prolog', label: 'Prolog', }, { value: 'propeller-spin', label: 'Propeller Spin', }, { value: 'protocol-buffer', label: 'Protocol Buffer', }, { value: 'public-key', label: 'Public Key', }, { value: 'pug', label: 'Pug', }, { value: 'puppet', label: 'Puppet', }, { value: 'pure-data', label: 'Pure Data', }, { value: 'purebasic', label: 'PureBasic', }, { value: 'purescript', label: 'PureScript', }, { value: 'python', label: 'Python', }, { value: 'python-console', label: 'Python console', }, { value: 'python-traceback', label: 'Python traceback', }, { value: 'qmake', label: 'QMake', }, { value: 'qml', label: 'QML', }, { value: 'r', label: 'R', }, { value: 'racket', label: 'Racket', }, { value: 'ragel', label: 'Ragel', }, { value: 'raml', label: 'RAML', }, { value: 'rascal', label: 'Rascal', }, { value: 'raw-token-data', label: 'Raw token data', }, { value: 'rdoc', label: 'RDoc', }, { value: 'realbasic', label: 'REALbasic', }, { value: 'reason', label: 'Reason', }, { value: 'rebol', label: 'Rebol', }, { value: 'red', label: 'Red', }, { value: 'redcode', label: 'Redcode', }, { value: 'regular-expression', label: 'Regular Expression', }, { value: "ren'py", label: "Ren'Py", }, { value: 'renderscript', label: 'RenderScript', }, { value: 'restructuredtext', label: 'reStructuredText', }, { value: 'rexx', label: 'REXX', }, { value: 'rhtml', label: 'RHTML', }, { value: 'ring', label: 'Ring', }, { value: 'rmarkdown', label: 'RMarkdown', }, { value: 'robotframework', label: 'RobotFramework', }, { value: 'roff', label: 'Roff', }, { value: 'rouge', label: 'Rouge', }, { value: 'rpc', label: 'RPC', }, { value: 'rpm-spec', label: 'RPM Spec', }, { value: 'ruby', label: 'Ruby', }, { value: 'runoff', label: 'RUNOFF', }, { value: 'rust', label: 'Rust', }, { value: 'sage', label: 'Sage', }, { value: 'saltstack', label: 'SaltStack', }, { value: 'sas', label: 'SAS', }, { value: 'sass', label: 'Sass', }, { value: 'scala', label: 'Scala', }, { value: 'scaml', label: 'Scaml', }, { value: 'scheme', label: 'Scheme', }, { value: 'scilab', label: 'Scilab', }, { value: 'scss', label: 'SCSS', }, { value: 'sed', label: 'sed', }, { value: 'self', label: 'Self', }, { value: 'shaderlab', label: 'ShaderLab', }, { value: 'shell', label: 'Shell', }, { value: 'shellsession', label: 'ShellSession', }, { value: 'shen', label: 'Shen', }, { value: 'slash', label: 'Slash', }, { value: 'slim', label: 'Slim', }, { value: 'smali', label: 'Smali', }, { value: 'smalltalk', label: 'Smalltalk', }, { value: 'smarty', label: 'Smarty', }, { value: 'smt', label: 'SMT', }, { value: 'solidity', label: 'Solidity', }, { value: 'sourcepawn', label: 'SourcePawn', }, { value: 'sparql', label: 'SPARQL', }, { value: 'spline-font-database', label: 'Spline Font Database', }, { value: 'sqf', label: 'SQF', }, { value: 'sql', label: 'SQL', }, { value: 'sqlpl', label: 'SQLPL', }, { value: 'squirrel', label: 'Squirrel', }, { value: 'srecode-template', label: 'SRecode Template', }, { value: 'stan', label: 'Stan', }, { value: 'standard-ml', label: 'Standard ML', }, { value: 'stata', label: 'Stata', }, { value: 'ston', label: 'STON', }, { value: 'stylus', label: 'Stylus', }, { value: 'sublime-text-config', label: 'Sublime Text Config', }, { value: 'subrip-text', label: 'SubRip Text', }, { value: 'sugarss', label: 'SugarSS', }, { value: 'supercollider', label: 'SuperCollider', }, { value: 'svg', label: 'SVG', }, { value: 'swift', label: 'Swift', }, { value: 'systemverilog', label: 'SystemVerilog', }, { value: 'tcl', label: 'Tcl', }, { value: 'tcsh', label: 'Tcsh', }, { value: 'tea', label: 'Tea', }, { value: 'terra', label: 'Terra', }, { value: 'tex', label: 'TeX', }, { value: 'text', label: 'Text', }, { value: 'textile', label: 'Textile', }, { value: 'thrift', label: 'Thrift', }, { value: 'ti-program', label: 'TI Program', }, { value: 'tla', label: 'TLA', }, { value: 'toml', label: 'TOML', }, { value: 'turing', label: 'Turing', }, { value: 'turtle', label: 'Turtle', }, { value: 'twig', label: 'Twig', }, { value: 'txl', label: 'TXL', }, { value: 'type-value', label: 'Type value', }, { value: 'typescript', label: 'TypeScript', }, { value: 'unified-parallel-c', label: 'Unified Parallel C', }, { value: 'unity3d-asset', label: 'Unity3D Asset', }, { value: 'unix-assembly', label: 'Unix Assembly', }, { value: 'uno', label: 'Uno', }, { value: 'unrealscript', label: 'UnrealScript', }, { value: 'urweb', label: 'UrWeb', }, { value: 'vala', label: 'Vala', }, { value: 'vcl', label: 'VCL', }, { value: 'verilog', label: 'Verilog', }, { value: 'vhdl', label: 'VHDL', }, { value: 'vim-script', label: 'Vim script', }, { value: 'visual-basic', label: 'Visual Basic', }, { value: 'volt', label: 'Volt', }, { value: 'vue', label: 'Vue', }, { value: 'wavefront-material', label: 'Wavefront Material', }, { value: 'wavefront-object', label: 'Wavefront Object', }, { value: 'wdl', label: 'wdl', }, { value: 'web-ontology-value', label: 'Web Ontology value', }, { value: 'webassembly', label: 'WebAssembly', }, { value: 'webidl', label: 'WebIDL', }, { value: 'wisp', label: 'wisp', }, { value: 'world-of-warcraft-addon-data', label: 'World of Warcraft Addon Data', }, { value: 'x10', label: 'X10', }, { value: 'xbase', label: 'xBase', }, { value: 'xc', label: 'XC', }, { value: 'xcompose', label: 'XCompose', }, { value: 'xml', label: 'XML', }, { value: 'xojo', label: 'Xojo', }, { value: 'xpages', label: 'XPages', }, { value: 'xpm', label: 'XPM', }, { value: 'xproc', label: 'XProc', }, { value: 'xquery', label: 'XQuery', }, { value: 'xs', label: 'XS', }, { value: 'xslt', label: 'XSLT', }, { value: 'xtend', label: 'Xtend', }, { value: 'yacc', label: 'Yacc', }, { value: 'yaml', label: 'YAML', }, { value: 'yang', label: 'YANG', }, { value: 'yara', label: 'YARA', }, { value: 'zephir', label: 'Zephir', }, { value: 'zimpl', label: 'Zimpl', }, ]; export const LANGUAGE_COLOR_MAP = { '1C Enterprise': '#814CCC', ABAP: '#E8274B', ActionScript: '#882B0F', Ada: '#02f88c', Agda: '#315665', 'AGS Script': '#B9D9FF', Alloy: '#64C800', 'Alpine Abuild': null, AMPL: '#E6EFBB', AngelScript: '#C7D7DC', ANTLR: '#9DC3FF', Apex: null, 'API Blueprint': '#2ACCA8', APL: '#5A8164', 'Apollo Guidance Computer': null, AppleScript: '#101F1F', Arc: '#aa2afe', ASP: '#6a40fd', AspectJ: '#a957b0', Assembly: '#6E4C13', Asymptote: '#4a0c0c', ATS: '#1ac620', Augeas: null, AutoHotkey: '#6594b9', AutoIt: '#1C3552', Awk: null, Ballerina: '#FF5000', Batchfile: '#C1F12E', Befunge: null, Bison: null, BitBake: null, BlitzBasic: null, BlitzMax: '#cd6400', Bluespec: null, Boo: '#d4bec1', Brainfuck: '#2F2530', Brightscript: null, Bro: null, C: '#555555', 'C#': '#178600', 'C++': '#f34b7d', 'C2hs Haskell': null, "Cap'n Proto": null, CartoCSS: null, Ceylon: '#dfa535', Chapel: '#8dc63f', Charity: null, ChucK: null, Cirru: '#ccccff', Clarion: '#db901e', Clean: '#3F85AF', Click: '#E4E6F3', CLIPS: null, Clojure: '#db5855', CMake: null, COBOL: null, CoffeeScript: '#244776', ColdFusion: '#ed2cd6', 'ColdFusion CFC': null, 'Common Lisp': '#3fb68b', 'Common Workflow Language': '#B5314C', 'Component Pascal': '#B0CE4E', Cool: null, Coq: null, Crystal: '#000100', Csound: null, 'Csound Document': null, 'Csound Score': null, CSS: '#563d7c', Cuda: '#3A4E3A', CWeb: null, Cycript: null, Cython: null, D: '#ba595e', Dart: '#00B4AB', DataWeave: '#003a52', 'DIGITAL Command Language': null, DM: '#447265', Dockerfile: '#384d54', Dogescript: '#cca760', DTrace: null, Dylan: '#6c616e', E: '#ccce35', eC: '#913960', ECL: '#8a1267', ECLiPSe: null, Eiffel: '#946d57', Elixir: '#6e4a7e', Elm: '#60B5CC', 'Emacs Lisp': '#c065db', EmberScript: '#FFF4F3', EQ: '#a78649', Erlang: '#B83998', 'F#': '#b845fc', 'F*': '#572e30', Factor: '#636746', Fancy: '#7b9db4', Fantom: '#14253c', 'Filebench WML': null, Filterscript: null, fish: null, FLUX: '#88ccff', Forth: '#341708', Fortran: '#4d41b1', FreeMarker: '#0050b2', Frege: '#00cafe', 'Game Maker Language': '#71b417', GAMS: null, GAP: null, 'GCC Machine Description': null, GDB: null, GDScript: '#355570', Genie: '#fb855d', Genshi: null, 'Gentoo Ebuild': null, 'Gentoo Eclass': null, Gherkin: '#5B2063', GLSL: null, Glyph: '#c1ac7f', Gnuplot: '#f0a9f0', Go: '#00ADD8', Golo: '#88562A', Gosu: '#82937f', Grace: null, 'Grammatical Framework': '#79aa7a', Groovy: '#e69f56', 'Groovy Server Pages': null, Hack: '#878787', Harbour: '#0e60e3', Haskell: '#5e5086', Haxe: '#df7900', HCL: null, HiveQL: '#dce200', HLSL: null, HTML: '#e34c26', Hy: '#7790B2', HyPhy: null, IDL: '#a3522f', Idris: '#b30000', 'IGOR Pro': null, 'Inform 7': null, 'Inno Setup': null, Io: '#a9188d', Ioke: '#078193', Isabelle: '#FEFE00', 'Isabelle ROOT': null, J: '#9EEDFF', Jasmin: null, Java: '#b07219', 'Java Server Pages': null, JavaScript: '#f1e05a', JFlex: null, Jison: null, 'Jison Lex': null, Jolie: '#843179', JSONiq: '#40d47e', Jsonnet: '#0064bd', JSX: null, Julia: '#a270ba', 'Jupyter Notebook': '#DA5B0B', Kotlin: '#F18E33', KRL: '#28430A', LabVIEW: null, Lasso: '#999999', Lean: null, Lex: '#DBCA00', LFE: '#4C3023', LilyPond: null, Limbo: null, 'Literate Agda': null, 'Literate CoffeeScript': null, 'Literate Haskell': null, LiveScript: '#499886', LLVM: '#185619', Logos: null, Logtalk: null, LOLCODE: '#cc9900', LookML: '#652B81', LoomScript: null, LSL: '#3d9970', Lua: '#000080', M: null, M4: null, M4Sugar: null, Makefile: '#427819', Mako: null, Mask: '#f97732', Mathematica: null, MATLAB: '#e16737', Max: '#c4a79c', MAXScript: '#00a6a6', mcfunction: '#E22837', Mercury: '#ff2b2b', Meson: '#007800', Metal: '#8f14e9', MiniD: null, Mirah: '#c7a938', Modelica: null, 'Modula-2': null, 'Modula-3': '#223388', 'Module Management System': null, Monkey: null, Moocode: null, MoonScript: null, MQL4: '#62A8D6', MQL5: '#4A76B8', MTML: '#b7e1f4', MUF: null, mupad: null, Myghty: null, NCL: '#28431f', Nearley: '#990000', Nemerle: '#3d3c6e', nesC: '#94B0C7', NetLinx: '#0aa0ff', 'NetLinx+ERB': '#747faa', NetLogo: '#ff6375', NewLisp: '#87AED7', Nextflow: '#3ac486', Nim: '#37775b', Nit: '#009917', Nix: '#7e7eff', NSIS: null, Nu: '#c9df40', NumPy: null, 'Objective-C': '#438eff', 'Objective-C++': '#6866fb', 'Objective-J': '#ff0c5a', OCaml: '#3be133', Omgrofl: '#cabbff', ooc: '#b0b77e', Opa: null, Opal: '#f7ede0', OpenCL: null, 'OpenEdge ABL': null, 'OpenRC runscript': null, OpenSCAD: null, Ox: null, Oxygene: '#cdd0e3', Oz: '#fab738', P4: '#7055b5', Pan: '#cc0000', Papyrus: '#6600cc', Parrot: '#f3ca0a', 'Parrot Assembly': null, 'Parrot Internal Representation': null, Pascal: '#E3F171', Pawn: '#dbb284', Pep8: '#C76F5B', Perl: '#0298c3', 'Perl 6': '#0000fb', PHP: '#4F5D95', PicoLisp: null, PigLatin: '#fcd7de', Pike: '#005390', PLpgSQL: null, PLSQL: '#dad8d8', PogoScript: '#d80074', Pony: null, PostScript: '#da291c', 'POV-Ray SDL': null, PowerBuilder: '#8f0f8d', PowerShell: '#012456', Processing: '#0096D8', Prolog: '#74283c', 'Propeller Spin': '#7fa2a7', Puppet: '#302B6D', PureBasic: '#5a6986', PureScript: '#1D222D', Python: '#3572A5', 'Python console': null, q: '#0040cd', QMake: null, QML: '#44a51c', Quake: '#882233', R: '#198CE7', Racket: '#3c5caa', Ragel: '#9d5200', RAML: '#77d9fb', Rascal: '#fffaa0', REALbasic: null, Reason: null, Rebol: '#358a5b', Red: '#f50000', Redcode: null, "Ren'Py": '#ff7f7f', RenderScript: null, REXX: null, Ring: '#2D54CB', RobotFramework: null, Roff: '#ecdebe', Rouge: '#cc0088', RPC: null, Ruby: '#701516', RUNOFF: '#665a4e', Rust: '#dea584', Sage: null, SaltStack: '#646464', SAS: '#B34936', Scala: '#c22d40', Scheme: '#1e4aec', Scilab: null, sed: '#64b970', Self: '#0579aa', ShaderLab: null, Shell: '#89e051', ShellSession: null, Shen: '#120F14', Slash: '#007eff', Slice: '#003fa2', Smali: null, Smalltalk: '#596706', Smarty: null, SMT: null, Solidity: '#AA6746', SourcePawn: '#5c7611', SQF: '#3F3F3F', SQLPL: null, Squirrel: '#800000', 'SRecode Template': '#348a34', Stan: '#b2011d', 'Standard ML': '#dc566d', Stata: null, SuperCollider: '#46390b', Swift: '#ffac45', SystemVerilog: '#DAE1C2', Tcl: '#e4cc98', Tcsh: null, Terra: '#00004c', TeX: '#3D6117', Thrift: null, 'TI Program': '#A0AA87', TLA: null, Turing: '#cf142b', TXL: null, TypeScript: '#2b7489', 'Unified Parallel C': null, 'Unix Assembly': null, Uno: null, UnrealScript: '#a54c4d', UrWeb: null, Vala: '#fbe5cd', VCL: '#148AA8', Verilog: '#b2b7f8', VHDL: '#adb2cb', 'Vim script': '#199f4b', 'Visual Basic': '#945db7', Volt: '#1F1F1F', Vue: '#2c3e50', wdl: '#42f1f4', WebAssembly: '#04133b', WebIDL: null, wisp: '#7582D1', X10: '#4B6BEF', xBase: '#403a40', XC: '#99DA07', Xojo: null, XProc: null, XQuery: '#5232e7', XS: null, XSLT: '#EB8CEB', Xtend: null, Yacc: '#4B6C4B', YARA: '#220000', YASnippet: '#32AB90', ZAP: '#0d665e', Zephir: '#118f9e', Zig: '#ec915c', ZIL: '#dc75e5', Zimpl: null, }; export default LANGUAGE_LIST; ================================================ FILE: src/pages/news/content/index.module.scss ================================================ .content-wrap { padding: 20px; height: 100vh; background: $bg; } ================================================ FILE: src/pages/news/content/index.tsx ================================================ import ActivityItem, { ActivityItemDataType } from '@/components/activity-item'; import Empty from '@/components/empty'; import LoadMore from '@/components/load-more'; import SkeletonCard from '@/components/skeleton-card'; import { useActivityListPublicEvents, useActivityListReceivedEventsForUser, } from '@/github/githubComponents'; import useInfiniteGithubRequest from '@/hooks/useInfiniteGithubRequest'; import { View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useEffect } from 'react'; import styles from './index.module.scss'; const NewContent = ({ username }) => { const { data, hasMore, isError, isLoading } = useInfiniteGithubRequest( !username ? useActivityListPublicEvents : useActivityListReceivedEventsForUser, { pathParams: { username } }, ); useEffect(() => { const title = username ? 'Received News' : 'Global News'; Taro.setNavigationBarTitle({ title }); }, [username]); return ( {data?.length > 0 ? ( {data.map((item) => { return ; })} ) : ( )} ); }; export default NewContent; ================================================ FILE: src/pages/news/index.config.ts ================================================ export default { navigationBarTitleText: 'News', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/news/index.tsx ================================================ import { View } from '@tarojs/components'; import { useSelector } from 'react-redux'; import NewContent from './content'; const News = () => { const username = useSelector((state) => state.user.username); return ( ); }; export default News; ================================================ FILE: src/pages/notifications/index.module.scss ================================================ ================================================ FILE: src/pages/notifications/index.tsx ================================================ import { View } from '@tarojs/components'; const Notifications = () => { return Notifications; }; export default Notifications; ================================================ FILE: src/pages/profile/content.tsx ================================================ import SkeletonCard from '@/components/skeleton-card'; import UserInfo from '@/components/user-info'; import { useUsersGetAuthenticated } from '@/github/githubComponents'; import { LOGOUT } from '@/store/constatnts'; import Taro, { usePullDownRefresh, useShareAppMessage } from '@tarojs/taro'; import { useDispatch } from 'react-redux'; const ProfileContent = () => { const dispatch = useDispatch(); const { data: userInfo, refetch, isError, isLoading, } = useUsersGetAuthenticated({}); useShareAppMessage((res) => { const title = `[${userInfo!.login}] ${userInfo!.bio}`; return { title, path: `/pages/developer/index?name=${userInfo!.login}`, }; }); usePullDownRefresh(() => { refetch(); }); const handleLogout = () => { Taro.showModal({ content: '确认退出?', cancelText: 'No', cancelColor: '#fb3e3b', confirmText: 'Yes', confirmColor: '#007afb', success(res) { if (res.confirm) { dispatch({ type: LOGOUT }); Taro.switchTab({ url: '/pages/trending/index' }); } else if (res.cancel) { } }, }); }; return ( ); }; export default ProfileContent; ================================================ FILE: src/pages/profile/index.config.ts ================================================ export default { navigationBarTitleText: 'Profile', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/profile/index.module.scss ================================================ .wrap { } .header { padding: 20px; display: flex; align-items: space-between; background: $itemBg; } .divide { height: 1px; width: 100vw; } .basic { display: flex; flex-wrap: wrap; margin-right: auto; font-size: 25px; } .name { font-size: 32px; font-weight: 600; color: $primary; } .bio { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: break-all; word-wrap: break-word; overflow: hidden; text-overflow: ellipsis; color: $text-color; } .Joined { font-size: 25px; font-weight: 400; } .info { margin-top: 30px; padding: 20px; border-radius: 10px; box-sizing: border-box; background: $itemBg; } .meta { margin: 0; } .nav { display: flex; justify-content: space-around; align-items: center; } .nav-item { flex: 1; text-align: center; } .item-count { color: rgb(43, 43, 43); font-weight: 600; font-size: 35px; } .item-label { font-weight: 400; font-size: 28px; text-transform: capitalize; } .logout { padding: 30px; } ================================================ FILE: src/pages/profile/index.tsx ================================================ import NoAuthority from '@/components/no-authority'; import { Block } from '@tarojs/components'; import { useSelector } from 'react-redux'; import ProfileContent from './content'; const Profile = () => { const username = useSelector((state) => state.user.username); return ( {username ? ( ) : ( )} ); }; export default Profile; ================================================ FILE: src/pages/profile/issues.tsx ================================================ import Empty from '@/components/empty'; import { getUserIssues } from '@/services/user'; import { Block, View } from '@tarojs/components'; import { usePullDownRefresh, useReachBottom, useRouter } from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { AtTabs, AtTabsPane } from 'taro-ui'; import LoadMore from '../../components/load-more/index'; import { issueDefaultParams } from '../../constants'; import { Issue } from '../../services/issues'; import IssueItem from '../issues/issue-item'; const UserIssues = () => { const { params: { owner }, } = useRouter(); const [count, setCount] = useState(0); const [curTab, setTab] = useState(0); const [openHasMore, setOpenHasMore] = useState(true); const [closedHasMore, setClosedHasMore] = useState(true); const [openList, setOpenList] = useState(null); const [closedList, setClosedtList] = useState(null); const [openParams, setOpenParams] = useState({ ...issueDefaultParams, filter: 'all', state: 'open', }); const [closedParams, setClosedParams] = useState({ ...issueDefaultParams, filter: 'all', state: 'closed', }); usePullDownRefresh(() => { setOpenParams({ ...openParams, page: 1 }); setClosedParams({ ...closedParams, page: 1 }); setClosedHasMore(true); setOpenHasMore(true); setCount(count + 1); }); useReachBottom(() => { if (curTab === 0) { setOpenParams({ ...openParams, page: openParams.page! + 1 }); } else { setClosedParams({ ...closedParams, page: closedParams.page! + 1 }); } }); // TODO fix request more const getClosedIssues = (params) => { getUserIssues(params).then((data) => { if (data) { if (closedList) { setClosedtList([...closedList, ...data]); } else { setClosedtList(data); } setClosedtList(data); if (data.length < params.per_page) { setClosedHasMore(false); } } }); }; useEffect(() => { if (openHasMore) { getUserIssues(openParams).then((data) => { if (data) { if (openList) { setOpenList([...openList, ...data]); } else { setOpenList(data); } if (data.length < openParams.per_page!) { setOpenHasMore(false); } } }); } }, [openParams, count]); useEffect(() => { if (openList && closedHasMore) { getClosedIssues(closedParams); } }, [closedParams, count]); useEffect(() => { if (!closedList && curTab === 1) { getClosedIssues(closedParams); } }, [curTab]); const tabList = [ { title: 'open', data: openList, hasMore: openHasMore }, { title: 'closed', data: closedList, hasMore: closedHasMore }, ]; const handleTabClick = (val) => { setTab(val); }; return ( {tabList.map((tab, idx) => { const data = tab.data; return ( {data ? ( {data.map((item) => { return ; })} ) : ( )} ); })} ); }; UserIssues.config = { navigationBarTitleText: 'Issues', }; export default UserIssues; ================================================ FILE: src/pages/repos/content/index.module.scss ================================================ ================================================ FILE: src/pages/repos/content/index.tsx ================================================ import Empty from '@/components/empty'; import Markdown from '@/components/markdown'; import useRequest from '@/hooks/useRequest'; import { getRawContent } from '@/services/repos'; import { getCodeMarkup, isImageFile } from '@/utils/repo'; import { View } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const Content = () => { const { params: { url }, } = useRouter(); if (!url) { return null; } const full_file_path = url.split('repos/')[1]; const [rawContent, refreshContent] = useRequest( full_file_path, getRawContent, ); useEffect(() => { const title = full_file_path.replace('/contents', ''); Taro.setNavigationBarTitle({ title }); }, []); if (!rawContent) { return ; } const file_url = url.split('?')[0]; let content = rawContent; // stringify object if (typeof rawContent === 'object') { content = JSON.stringify(rawContent, null, 2); } if (isImageFile(file_url)) { content = '![](' + file_url + ')'; } else { const markup = getCodeMarkup(file_url); if (file_url.endsWith('ipynb')) { // TODO } else if (markup) { content = '```' + markup + '\n' + content + '\n```'; } } return ( {} ); }; Content.config = { enablePullDownRefresh: false, }; export default Content; ================================================ FILE: src/pages/repos/contributors/index.module.scss ================================================ .user { display: flex; align-items: center; margin: 20px; padding: 8px 0; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } ================================================ FILE: src/pages/repos/contributors/index.tsx ================================================ import { useReposListContributors } from '@/github/githubComponents'; import ListRender from '../list-render'; const Contributors = () => { return ( ); }; export default Contributors; ================================================ FILE: src/pages/repos/files/index.module.scss ================================================ .files-wrap { padding: 20px; } .file { padding: 10px; } ================================================ FILE: src/pages/repos/files/index.tsx ================================================ import useRequest from '@/hooks/useRequest'; import { File, getContents } from '@/services/repos'; import { bytesToSize } from '@/utils/size'; import { View } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; import { AtList, AtListItem } from 'taro-ui'; import styles from './index.module.scss'; const Files = () => { const { params: { owner, repo, url }, } = useRouter(); let full_url: string; if (url) { full_url = '/repos/' + url.split('repos/')[1]; } else { full_url = `/repos/${owner}/${repo}/contents`; } const [files, refresh] = useRequest(full_url, getContents); // TODO sort by name & type useEffect(() => { const title = full_url.split('repos/')[1].replace('/contents', ''); Taro.setNavigationBarTitle({ title }); }, []); const handleNavTo = (url: string, isFolder: boolean) => () => { let target_url: string; if (isFolder) { target_url = `/pages/repos/files/index?url=${url}`; } else { target_url = `/pages/repos/content/index?url=${url}`; } Taro.navigateTo({ url: target_url }); }; return ( {files && files.map((item) => { const { name, path, type, download_url, url, size } = item; // TODO check file type to open files or content const isFolder = type === 'dir'; return ( ); })} ); }; export default Files; ================================================ FILE: src/pages/repos/forks/index.module.scss ================================================ ================================================ FILE: src/pages/repos/forks/index.tsx ================================================ import { useReposListForks } from '@/github/githubComponents'; import ListRender from '../list-render'; const Forks = () => { return ( (data ? data.map((item) => item.owner) : null)} name={'Forks'} useRequest={useReposListForks} > ); }; export default Forks; ================================================ FILE: src/pages/repos/index.config.ts ================================================ export default { navigationBarTitleText: 'Repository', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/repos/index.module.scss ================================================ .wrap { font-size: 28px; background: $bg; min-height: 100vh; } .header { display: flex; padding: 30px 20px 10px; background: white; } .avatar-img { min-width: 80px; } .full-name { font-size: 34px; font-weight: 600; color: $primary; white-space: pre-wrap; } .name { } .desc { margin-top: 10px; font-size: 25px; font-weight: 500; line-height: 1.3em; color: #828282; } .language { } .meta { margin-top: 5px; font-size: 25px; font-weight: 450; color: $primary-text-color; } .divider { height: 1px; } .repo-num { display: flex; justify-content: space-around; align-items: center; padding: 25px 20px 20px; background-color: #fff; line-height: 1.2em; } .num-item { text-align: center; } .num { margin-top: 10px; font-size: 33px; font-weight: 600; } .label { font-size: 28px; text-transform: capitalize; } .repo-info { margin-top: 30px; box-sizing: border-box; background: rgba(255, 255, 255, 0.95); } .info-issues { } .readme { margin-top: 0px; padding: 0 20px; @extend .repo-info; } .actions-wrap { position: fixed; right: 26px; bottom: 26px; z-index: 1; } .actions { display: flex; align-items: center; justify-content: space-around; } .action-item { position: relative; margin: 10px; border-radius: 50%; text-align: center; } .action-label { padding-top: 10px; font-weight: 400; text-transform: capitalize; } .at-float-layout__container, .at-float-layout, .at-float-layout .layout-body__content, .at-float-layout .layout-body { min-height: auto; } .at-float-layout .layout-body__content { padding: 30px 18px; } .share-btn { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: green; z-index: 900; border: none; background: none; padding: 0; &::after { border: none; } } ================================================ FILE: src/pages/repos/index.tsx ================================================ import Avatar from '@/components/avatar'; import FontIcon from '@/components/font-icon'; import SkeletonCard from '@/components/skeleton-card'; import { useActivityCheckRepoIsStarredByAuthenticatedUser, useActivityStarRepoForAuthenticatedUser, useActivityUnstarRepoForAuthenticatedUser, useReposGet, } from '@/github/githubComponents'; import { copyText } from '@/utils/common'; import { githubHttpsUrl } from '@/utils/repo'; import { Block, ITouchEvent, Text, View } from '@tarojs/components'; import Taro, { useRouter, useShareAppMessage } from '@tarojs/taro'; import { useRef, useState } from 'react'; import { useSelector } from 'react-redux'; import { AtIcon, AtList } from 'taro-ui'; import Empty from '../../components/empty'; import ListItem from '../../components/list-item'; import { getTimeAgo } from '../../utils/date'; import { bytesToSize } from '../../utils/size'; import { LANGUAGE_COLOR_MAP } from '../my-languages/languages'; import styles from './index.module.scss'; import Readme from './readme'; const Repository = () => { let { params: { owner, repo, full_name }, } = useRouter(); const username = useSelector((state) => state.user.username); if (!owner && full_name) { [owner, repo] = full_name!?.split('/'); } if (!full_name && owner) { full_name = `${owner}/${repo}`; } const pathParams = { owner: owner!, repo: repo! }; const readmeRef = useRef<{ reload: () => void }>(); const [isStarred, setIsStarred] = useState(false); const { data: repoInfo, isError, isLoading } = useReposGet({ pathParams }); useActivityCheckRepoIsStarredByAuthenticatedUser( { pathParams, }, { enabled: !!username, onSuccess(data) { if (!data && data !== null) { setIsStarred(true); } }, }, ); const { mutateAsync: updateStarred } = useActivityStarRepoForAuthenticatedUser({}); const { mutateAsync: updateUnstarred } = useActivityUnstarRepoForAuthenticatedUser({}); useShareAppMessage(() => { const title = `[${full_name}] ${repoInfo!.description}`; return { title, path: `/pages/repos/index?full_name=${full_name}`, }; }); const handleReloadIconClick = () => { readmeRef.current?.reload(); }; const handleNavTo = (url) => { Taro.navigateTo({ url }); }; const handleStarIconClick = async (event: ITouchEvent) => { event.stopPropagation(); event.preventDefault(); let res; if (isStarred) { res = await updateUnstarred({ pathParams }); } else { res = await updateStarred({ pathParams }); } if (!res && res !== null) { setIsStarred(!isStarred); Taro.showToast({ title: '操作成功!', icon: 'none' }); } }; return ( {repoInfo ? ( (() => { const { name, // full_name, owner: ownerInfo = {}, description, pushed_at, size, stargazers_count, watchers_count, language, forks_count, open_issues_count, license, subscribers_count, } = repoInfo || {}; const { login, avatar_url } = ownerInfo as any; const params = `owner=${login}&repo=${name}`; const authorUrl = `/pages/developer/index?name=${login}`; const filesUrl = `/pages/repos/files/index?${params}`; const activityUrl = `/pages/activity/repo?${params}`; const issuesUrl = `/pages/issues/index?${params}`; const commitsUrl = `/pages/commits/index?${params}`; const contributorsUrl = `/pages/repos/contributors/index?${params}`; const watchsUrl = `/pages/repos/watchs/index?${params}`; const starsUrl = `/pages/repos/stars/index?${params}`; const forksUrl = `/pages/repos/forks/index?${params}`; return ( {login} / { const data = `${githubHttpsUrl}/${full_name}`; return copyText(data); }} > {name} {description || ''} {/* Created {getTimeAgo(created_at)} */} Updated {getTimeAgo(pushed_at)} {isStarred ? ( ) : ( )} {Number(stargazers_count).toLocaleString()} {Number(subscribers_count).toLocaleString()} {Number(forks_count).toLocaleString()} {/* */} {/* */} ); })() ) : ( )} {repoInfo && ( { } )} ); }; export default Repository; ================================================ FILE: src/pages/repos/list-render/index.tsx ================================================ import SkeletonCard from '@/components/skeleton-card'; import UserItem from '@/components/user-item'; import useInfiniteGithubRequest from '@/hooks/useInfiniteGithubRequest'; import Taro, { useRouter } from '@tarojs/taro'; import { useEffect } from 'react'; const ListRender = ({ name, useRequest, getItems, }: { name: string; useRequest: Function; getItems?: (data) => any; }) => { const { params: { owner, repo }, } = useRouter(); const full_name = `${owner}/${repo}`; const { data, hasMore, isLoading, isError } = useInfiniteGithubRequest( useRequest, { pathParams: { repo, owner }, getItems, }, ); useEffect(() => { const title = `${full_name} - ${name}`; Taro.setNavigationBarTitle({ title }); }, []); return ( ); }; export default ListRender; ================================================ FILE: src/pages/repos/readme/index.module.scss ================================================ .wrap { max-height: 800px; overflow: hidden; position: relative; padding-bottom: 150px; } .btn { width: 300px; position: absolute; bottom: 15px; left: 50%; transform: translate(-50%); } ================================================ FILE: src/pages/repos/readme/index.tsx ================================================ import Markdown from '@/components/markdown'; import SkeletonCard from '@/components/skeleton-card'; import { useReposGetReadme } from '@/github/githubComponents'; import { Block, View } from '@tarojs/components'; import { forwardRef, useImperativeHandle, useState } from 'react'; import { AtButton, AtIcon } from 'taro-ui'; import styles from './index.module.scss'; const Readme = ({ owner, repo, full_name }, ref) => { const { data, isError, isLoading, isFetching, refetch } = useReposGetReadme({ pathParams: { owner, repo }, headers: { Accept: 'application/vnd.github.v3.raw' }, }); const [showAll, setShowAll] = useState(false); useImperativeHandle(ref, () => ({ reload: () => { refetch(); }, })); return ( {data && ( { setShowAll(!showAll); }} className={styles.btn} type="secondary" size="small" circle > {showAll ? ( 收起更多 ) : ( 查看更多 )} )} ); }; export default forwardRef(Readme); ================================================ FILE: src/pages/repos/stars/index.module.scss ================================================ ================================================ FILE: src/pages/repos/stars/index.tsx ================================================ import { useActivityListStargazersForRepo } from '@/github/githubComponents'; import ListRender from '../list-render'; const Stars = () => { return ( ); }; export default Stars; ================================================ FILE: src/pages/repos/watchs/index.module.scss ================================================ ================================================ FILE: src/pages/repos/watchs/index.tsx ================================================ import { useActivityListWatchersForRepo } from '@/github/githubComponents'; import ListRender from '../list-render'; const Forks = () => { return ( ); }; export default Forks; ================================================ FILE: src/pages/search/index.config.ts ================================================ export default { navigationBarTitleText: 'Search', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/search/index.module.scss ================================================ .wrap { padding: 160px 0; background: $bg; } .search-wrap { position: fixed; top: 0; left: 0; width: 100%; overflow: hidden; z-index: 2; } .sc { position: fixed; top: 82px; left: 0; right: 0; z-index: 2; } .user-item { display: flex; align-items: center; margin: 20px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .history-tags { display: flex; padding: 20px; flex-wrap: wrap; } .tag { margin-bottom: 15px; margin-left: 15px; } ================================================ FILE: src/pages/search/index.tsx ================================================ import usePageScrollBackToTop from '@/hooks/usePageScrollBackToTop'; import { Block, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useEffect, useState } from 'react'; import { AtSearchBar, AtTabs, AtTag } from 'taro-ui'; import styles from './index.module.scss'; import Issues from './issues'; import Repos from './repos'; import Users from './users'; const tabList = [ { title: 'Repositories' }, { title: 'Users' }, { title: 'Issues' }, ]; const Search = () => { const [searchValue, setSearchValue] = useState(''); const [value, setValue] = useState(''); const [current, setCurrent] = useState(0); const [searchHistory, setSearchHistory] = useState([]); useEffect(() => { const history = Taro.getStorageSync('search_history') || []; setSearchHistory(history); }, []); const BackToTop = usePageScrollBackToTop(); const onChange = (val: string) => { if (!val) { onClear(); return; } setValue(val); }; const onClear = () => { setValue(''); setSearchValue(''); }; const handleConfirm = () => { if (!value) { return; } const newHistory = [...new Set([value, ...searchHistory])]; setSearchHistory(newHistory); Taro.setStorageSync('search_history', newHistory); setSearchValue(value); }; const handleSegmentedControlClick = (index: number) => { setCurrent(index); Taro.pageScrollTo({ scrollTop: 0 }); }; const handleTagClick = ({ name }) => { setValue(name); setSearchValue(name); }; return ( {searchValue ? ( {current === 0 && } {current === 1 && } {current === 2 && } ) : ( {searchHistory && searchHistory.map((item) => { return ( {item} ); })} )} {BackToTop} ); }; export default Search; ================================================ FILE: src/pages/search/issues.tsx ================================================ import LoadMore from '@/components/load-more'; import SkeletonCard from '@/components/skeleton-card'; import { defaultSearchParams } from '@/constants'; import { useSearchIssuesAndPullRequests } from '@/github/githubComponents'; import IssueItem from '@/pages/issues/issue-item'; import { View } from '@tarojs/components'; import { usePullDownRefresh, useReachBottom } from '@tarojs/taro'; import { FC, useRef, useState } from 'react'; const issues: FC<{ keyword: string }> = ({ keyword }) => { const [queryParams, setQueryParams] = useState({ ...defaultSearchParams, per_page: 10, q: keyword, }); const isMountedRef = useRef(false); const [hasMore, setHasMore] = useState(false); const [data, setData] = useState([]); // FIXME isLoading 每次加载都为 true const { isError, isLoading, isFetching, refetch } = useSearchIssuesAndPullRequests( { queryParams, }, { onSuccess(newData: any) { isMountedRef.current = true; newData = newData.items; console.log('newData: ', newData); if (newData?.length >= queryParams.per_page!) { setHasMore(true); } if (queryParams.page! > 1) { setData([...data, ...newData]); } else { setData(newData); } }, }, ); useReachBottom(() => { if (hasMore) { setQueryParams({ ...queryParams, page: queryParams.page! + 1 }); } }); usePullDownRefresh(() => { setQueryParams({ ...defaultSearchParams, per_page: 10, q: keyword }); // refetch(); }); return ( {data?.length > 0 && ( {data.map((item, idx) => { const full_name = item.repository_url .split('/') .reverse() .slice(0, 2) .reverse() .join('/'); return ( ); })} )} ); }; export default issues; ================================================ FILE: src/pages/search/repos.tsx ================================================ import LoadMore from '@/components/load-more'; import RepoItem from '@/components/repo-item'; import SkeletonCard from '@/components/skeleton-card'; import { defaultSearchParams } from '@/constants'; import { useSearchRepos } from '@/github/githubComponents'; import { View } from '@tarojs/components'; import { usePullDownRefresh, useReachBottom } from '@tarojs/taro'; import { FC, useRef, useState } from 'react'; const repos: FC<{ keyword: string }> = ({ keyword }) => { const [queryParams, setQueryParams] = useState({ ...defaultSearchParams, q: keyword, }); const isMountedRef = useRef(false); const [hasMore, setHasMore] = useState(false); const [data, setData] = useState([]); // FIXME isLoading 每次加载都为 true const { isError, isLoading, isFetching, refetch } = useSearchRepos( { queryParams, }, { onSuccess(newData: any) { isMountedRef.current = true; newData = newData.items; if (newData?.length >= queryParams.per_page!) { setHasMore(true); } if (queryParams.page! > 1) { setData([...data, ...newData]); } else { setData(newData); } }, }, ); useReachBottom(() => { if (hasMore) { setQueryParams({ ...queryParams, page: queryParams.page! + 1 }); } }); usePullDownRefresh(() => { setQueryParams({ ...defaultSearchParams, q: keyword }); // refetch(); }); return ( {data?.length > 0 && ( {data?.map((item, idx) => { return ; })} )} ); }; export default repos; ================================================ FILE: src/pages/search/users.tsx ================================================ import Author from '@/components/author'; import LoadMore from '@/components/load-more'; import SkeletonCard from '@/components/skeleton-card'; import { defaultSearchParams } from '@/constants'; import { useSearchUsers } from '@/github/githubComponents'; import { View } from '@tarojs/components'; import { usePullDownRefresh, useReachBottom } from '@tarojs/taro'; import { FC, useRef, useState } from 'react'; import styles from './index.module.scss'; const users: FC<{ keyword: string }> = ({ keyword }) => { const [queryParams, setQueryParams] = useState({ ...defaultSearchParams, q: keyword, }); const isMountedRef = useRef(false); const [hasMore, setHasMore] = useState(false); const [data, setData] = useState([]); // FIXME isLoading 每次加载都为 true const { isError, isLoading, isFetching, refetch } = useSearchUsers( { queryParams, }, { onSuccess(newData: any) { isMountedRef.current = true; newData = newData.items; if (newData?.length >= queryParams.per_page!) { setHasMore(true); } if (queryParams.page! > 1) { setData([...data, ...newData]); } else { setData(newData); } }, }, ); useReachBottom(() => { if (hasMore) { setQueryParams({ ...queryParams, page: queryParams.page! + 1 }); } }); usePullDownRefresh(() => { setQueryParams({ ...defaultSearchParams, q: keyword }); // refetch(); }); return ( {data?.length > 0 && ( {data.map((item) => { const login = item.login; const avatar_url = item.avatar_url; return ( ); })} )} ); }; export default users; ================================================ FILE: src/pages/starred/content.tsx ================================================ import LoadMore from '@/components/load-more'; import SkeletonCard from '@/components/skeleton-card'; import { useActivityListReposStarredByUser } from '@/github/githubComponents'; import useInfiniteGithubRequest from '@/hooks/useInfiniteGithubRequest'; import usePageScrollBackToTop from '@/hooks/usePageScrollBackToTop'; import { View } from '@tarojs/components'; import Empty from '../../components/empty'; import RepoItem from '../../components/repo-item'; import styles from './index.module.scss'; const StarredContent = ({ username }) => { const { data, hasMore, isError, isLoading } = useInfiniteGithubRequest( useActivityListReposStarredByUser, { pathParams: { username } }, ); const BackToTop = usePageScrollBackToTop(); return ( {data ? ( {data.map((item, idx) => { return ; })} ) : ( )} {BackToTop} ); }; export default StarredContent; ================================================ FILE: src/pages/starred/index.config.ts ================================================ export default { navigationBarTitleText: 'Starred', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/starred/index.module.scss ================================================ .content-wrap { background: $bg; } ================================================ FILE: src/pages/starred/index.tsx ================================================ import NoAuthority from '@/components/no-authority'; import usePullDownRefreshEvent from '@/hooks/usePullDownRefreshEvent'; import useReachBottomEvent from '@/hooks/useReachBottomEvent'; import { View } from '@tarojs/components'; import { useSelector } from 'react-redux'; import StarredContent from './content'; const StarredRepos = () => { const username = useSelector((state) => state.user.username); useReachBottomEvent(); usePullDownRefreshEvent(); return ( {username ? ( ) : ( )} ); }; export default StarredRepos; ================================================ FILE: src/pages/trending/index.config.ts ================================================ export default { navigationBarTitleText: 'Trending', enablePullDownRefresh: true, }; ================================================ FILE: src/pages/trending/index.module.scss ================================================ .wrap { } .header { position: fixed; top: 0; left: 0; right: 0; display: flex; background-color: white; padding: 0 20px; :global(.at-tabs__item--active .at-tabs__item-underline) { width: 50%; transform: translate(-50%); left: 50%; transition: none; } } .filterIcon { display: flex; justify-content: center; align-items: center; &:active { color: $primary; } } .tabs { } .main { padding: 80px 0; } ================================================ FILE: src/pages/trending/index.tsx ================================================ import Empty from '@/components/empty'; import SkeletonCard from '@/components/skeleton-card'; import { CURRENT_LANGUAGE_STORAGE_KEY } from '@/constants'; import useTrending from '@/hooks/useTrending'; import { Block, View } from '@tarojs/components'; import Taro, { usePullDownRefresh, useShareAppMessage } from '@tarojs/taro'; import { useState } from 'react'; import { AtActionSheet, AtActionSheetItem, AtDrawer, AtIcon, AtTabs, } from 'taro-ui'; import { TrendingDeveloperData, TrendingRepoData, TrendingRequestParams, } from 'types/trending'; import FabButton from '../../components/fab-button'; import styles from './index.module.scss'; import MyLanguage, { defaultLang } from './language'; import RepoItem from './repo-item'; import UserItem from './user-item'; export interface LanguageParams { language: string; title: string; } const tabList: { title: string; value: TrendingRequestParams['type'] }[] = [ { title: 'Repo', value: 'repositories' }, { title: 'User', value: 'developers' }, ]; const dateRangeList = [ { title: 'Today', value: 'daily', name: 'Today', desc: 'today' }, { title: 'This Week', value: 'weekly', name: 'Week', desc: 'this week' }, { title: 'This Month', value: 'monthly', name: 'Month', desc: 'this month' }, ]; const currLang = defaultLang; // Taro.getStorageSync(CURRENT_LANGUAGE_STORAGE_KEY) || defaultLang; const defaultTrendingParams = { since: 'daily', language: currLang, }; const Trending = () => { const [currTab, setCurrTab] = useState(0); const [params, setParams] = useState( defaultTrendingParams, ); const [showLangDrawer, setShowLangDrawer] = useState(false); const [showDataRangeSheet, setShowDataRangeSheet] = useState(false); const { data, isLoading, isError, refetch } = useTrending(params); usePullDownRefresh(() => { refetch(); }); useShareAppMessage((res) => { return { title: `GitHub Trending`, path: `/pages/trending/index`, }; }); const handleClickTab = (idx) => { setCurrTab(idx); setParams({ ...params, type: tabList[idx].value }); Taro.pageScrollTo({ scrollTop: 0 }); }; const handleToggleLangDrawer = (isShow) => { setShowLangDrawer(isShow); }; const handleToggleDataRangeSheet = (isShow) => { setShowDataRangeSheet(isShow); }; const handleChangeLang = ({ language, title }: LanguageParams) => { Taro.setStorageSync(CURRENT_LANGUAGE_STORAGE_KEY, language); Taro.setNavigationBarTitle({ title: `${title}` }); setParams({ ...params, language }); setShowLangDrawer(false); }; const currentDataRange = dateRangeList.find( (item) => item.value === params.since, ); return ( {(data?.length || 0) > 0 ? ( data!.map((data, index) => { if (currTab === 0) { data = data as TrendingRepoData; return ( ); } if (currTab === 1) { data = data as TrendingDeveloperData; return ( ); } }) ) : ( )} {currentDataRange?.name} {dateRangeList.map((item) => { return ( { setShowDataRangeSheet(false); setParams({ ...params, since: item.value }); }} > {item.title} ); })} ); }; export default Trending; ================================================ FILE: src/pages/trending/language/index.module.scss ================================================ .wrap { } .title { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: $navBg; } .lang-list { font-size: 28px; } .lang-item { margin: 20px 0; padding: 0 20px; border-bottom: 1px solid $navBg; } .active { color: $primary; } ================================================ FILE: src/pages/trending/language/index.tsx ================================================ import { Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { useSelector } from 'react-redux'; import { AtIcon, AtRadio } from 'taro-ui'; import styles from './index.module.scss'; export const defaultLang = ''; interface LanguageProps { onChangeLang: (params: { language: string; title: string }) => void; curLang: string; } const Language = ({ onChangeLang, curLang }: LanguageProps) => { const langs = useSelector((state) => state.lang.selected); const handleLangClick = (lang, e) => { const value = langs.find((item) => item.language === lang); onChangeLang(value); }; const handleIconClick = () => { Taro.navigateTo({ url: '/pages/my-languages/index' }); }; return ( Favorite languages ({ label: item.title, value: item.language, }))} value={curLang} onClick={handleLangClick} /> ); }; export default Language; ================================================ FILE: src/pages/trending/repo-item/index.module.scss ================================================ .card-wrap { margin: 25px 20px; padding: 10px 20px 20px 10px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .card-top { display: flex; overflow: hidden; } .info { max-width: 100%; margin-right: 10px; } .nameWrap { display: flex; align-items: center; } .name { display: inline-block; vertical-align: middle; width: 100%; font-size: 32px; font-weight: 700; line-height: 40px; // white-space: nowrap; word-break: keep-all; text-overflow: ellipsis; overflow: hidden; } .index { display: inline-block; vertical-align: middle; width: 32px; height: 32px; line-height: 32px; border-radius: 50%; margin-right: 10px; text-align: center; font-size: 20px; background-color: $color-brand-light; color: white; } .description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-top: 10px; margin-left: 35px; font-size: 23px; font-weight: 400; line-height: 1.5em; color: #828282; word-break: break-all; word-wrap: break-word; overflow: hidden; } .author { flex-basis: 1; flex-shrink: 0; flex-grow: 0; width: 120rpx; max-width: 120px; margin-left: auto; text-align: center; } .author-name { font-size: 25px; font-weight: 400; color: rgb(109, 109, 109); overflow: hidden; } .avatar { width: 80px; height: 80px; border-radius: 50%; } .card-bottom { margin-top: 10px; display: flex; margin-left: 35px; align-items: center; } .meta-item:not(:first-child) { margin-left: 15px; } .meta-item { display: flex; align-items: center; font-size: 24px; } .meta-item:last-child { margin-left: auto; } .language-color { display: inline-block; margin-right: 8px; width: 25px; height: 25px; border-radius: 50%; } ================================================ FILE: src/pages/trending/repo-item/index.tsx ================================================ import FontIcon from '@/components/font-icon'; import { Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { memo } from 'react'; import { TrendingRepoData } from 'types/trending'; import styles from './index.module.scss'; const RepoItem = ({ repo, index, durationText, }: { repo: TrendingRepoData; index: number; durationText: string; }) => { const handleCardClick = () => { const url = `/pages/repos/index?owner=${author}&repo=${name}`; Taro.navigateTo({ url, }); }; const { author, name, avatar, url, description, language, languageColor, stars, forks, currentPeriodStars, builtBy, } = repo; return ( {index + 1} {author}/{name} {description} {language || 'null'} {stars} {forks} {currentPeriodStars} {durationText} ); }; const areEqual = ({ repo: prevRepo }: any, { repo }: any) => { return prevRepo?.url === repo.url; }; export default memo(RepoItem, areEqual); ================================================ FILE: src/pages/trending/user-item/index.module.scss ================================================ .cardWrap { margin: 25px 20px; padding: 10px 20px 20px 10px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); border-radius: 10px; box-sizing: border-box; background: $itemBg; } .author { display: flex; } .index { display: inline-block; vertical-align: middle; width: 32px; height: 32px; margin-top: 10px; line-height: 32px; border-radius: 50%; margin-right: 15px; text-align: center; font-size: 20px; background-color: $color-brand-light; color: white; } .nameWrap { margin-left: 15px; white-space: nowrap; text-align: left; } .name { font-size: 32px; width: 100%; } .authorName { font-size: 28px; font-weight: 600; color: rgb(109, 109, 109); } .repo { margin-left: 35px; } .repoName { font-size: 30px; font-weight: 600; } .description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-top: 5px; font-size: 23px; font-weight: 400; line-height: 1.5em; color: #828282; word-break: break-all; word-wrap: break-word; overflow: hidden; } .avatar { width: 80px; height: 80px; border-radius: 50%; } ================================================ FILE: src/pages/trending/user-item/index.tsx ================================================ import FontIcon from '@/components/font-icon'; import { Image, ITouchEvent, Text, View } from '@tarojs/components'; import Taro from '@tarojs/taro'; import { FC, memo } from 'react'; import { useSelector } from 'react-redux'; import { TrendingDeveloperData } from 'types/trending'; import styles from './index.module.scss'; const UserItem: FC<{ data: TrendingDeveloperData; index: number }> = ({ data, index, }) => { const { avatar, name, repo, url, username: author, sponsorUrl } = data; const username = useSelector((state) => state.user.username); const handleAuthorClick = (e: ITouchEvent) => { e.stopPropagation(); let url: string; if (username === author) { url = `/pages/profile/index`; } else { url = `/pages/developer/index?name=${author}`; } Taro.navigateTo({ url, }); }; const handleRepoClick = () => { if (repo?.url) { const [repoName, owner] = repo.url.split('/').reverse(); const url = `/pages/repos/index?owner=${owner}&repo=${repoName}`; Taro.navigateTo({ url, }); } }; return ( {index + 1} {name} {author} {repo && ( {repo.name} {repo.description} )} ); }; export default memo( UserItem, (prev, curr) => prev?.data.url === curr?.data.url, ); ================================================ FILE: src/services/commits.ts ================================================ import request from '../utils/request'; export interface CommitItemData { sha: string; node_id: string; commit: Commit; url: string; html_url: string; comments_url: string; author: Author2; committer: Author2; parents: Parent[]; } interface Parent { sha: string; url: string; html_url: string; } interface Author2 { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Commit { author: Author; committer: Author; message: string; tree: Tree; url: string; comment_count: number; verification: Verification; } interface Verification { verified: boolean; reason: string; signature?: string; payload?: string; } interface Tree { sha: string; url: string; } interface Author { name: string; email: string; date: string; } export const getCommits = ({ full_name }, params = {}) => { return request.get( `/repos/${full_name}/commits`, params, ); }; // export const createCommit = ({ full_name }, data) => { // return request.post(`/repos/${full_name}/commits`, data) // } // export const createCommitComment = ({ full_name, number }, data) => { // return request.post( // `/repos/${full_name}/commits/${number}/comments`, // data // ) // } ================================================ FILE: src/services/github.ts ================================================ import { IDefaultParams } from '@/constants'; import request from '@/utils/request'; export const getEvents = (_, params: IDefaultParams) => { return request.get('/events', params); }; ================================================ FILE: src/services/issues.ts ================================================ import request from '../utils/request'; export interface Issue { url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; id: number; node_id: string; number: number; title: string; user: User; labels: Label[]; state: string; locked: boolean; assignee?: any; assignees: any[]; milestone?: any; comments: number; created_at: string; updated_at: string; closed_at: string; author_association: string; body: string; pull_request?: Pullrequest; repository?: { full_name: string; }; } interface Pullrequest { url: string; html_url: string; diff_url: string; patch_url: string; } interface Label { id: number; node_id: string; url: string; name: string; color: string; default: boolean; } interface User { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } export const getIssues = (full_name: string, params) => { return request.get(`/repos/${full_name}/issues`, params, { Accept: 'application/vnd.github.VERSION.raw+json', }); }; export const getIssueDetail = ({ full_name, number }, params = {}) => { return request.get( `/repos/${full_name}/issues/${number}`, params, { Accept: 'application/vnd.github.VERSION.raw+json' }, ); }; export interface IssueComment { url: string; html_url: string; issue_url: string; id: number; node_id: string; user: User; created_at: string; updated_at: string; author_association: string; body: string; } export const getIssueComments = ({ full_name, number }, params = {}) => { return request.get( `/repos/${full_name}/issues/${number}/comments`, params, { Accept: 'application/vnd.github.VERSION.raw+json' }, ); }; export const createIssue = ({ full_name }, data) => { return request.post(`/repos/${full_name}/issues`, data); }; export const createIssueComment = ({ full_name, number }, data) => { return request.post( `/repos/${full_name}/issues/${number}/comments`, data, ); }; ================================================ FILE: src/services/repos.ts ================================================ import request from '../utils/request'; export interface Repo { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: Owner; html_url: string; description: string; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage: string; size: number; stargazers_count: number; watchers_count: number; language: string; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license: License; forks: number; open_issues: number; watchers: number; default_branch: string; permissions: Permissions; allow_squash_merge: boolean; allow_merge_commit: boolean; allow_rebase_merge: boolean; network_count: number; subscribers_count: number; } interface Permissions { admin: boolean; push: boolean; pull: boolean; } interface License { key: string; name: string; spdx_id: string; url: string; node_id: string; } interface Owner { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } export const getRepo = (full_name: string) => { return request.get(`/repos/${full_name}`); }; export const getReadme = (full_name: string) => { return request.get(`/repos/${full_name}/readme`, {}); }; export const getRawReadme = (full_name: string) => { return request.get( `/repos/${full_name}/readme`, {}, { Accept: 'application/vnd.github.v3.raw' }, ); }; export interface File { name: string; path: string; sha: string; size: number; url: string; html_url: string; git_url: string; download_url?: string; type: string; _links: Links; } interface Links { self: string; git: string; html: string; } export const getContents = (url: string) => { return request.get(url); }; export const getRawContent = (full_file_path: string) => { return request.get( `/repos/${full_file_path}`, {}, { Accept: 'application/vnd.github.v3.raw' }, ); }; export interface Contributor { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; contributions: number; } export const getContributors = ({ full_name }, params) => { return request.get( `/repos/${full_name}/contributors`, params, ); }; export interface RepoEvent { id: string; type: string; actor: Actor; repo: EventRepo; payload: Payload; public: boolean; created_at: string; } interface Payload { action?: string; issue?: Issue; forkee?: Forkee; comment?: Comment; } interface Comment { url: string; html_url: string; issue_url: string; id: number; node_id: string; user: User; created_at: string; updated_at: string; author_association: string; body: string; } interface Forkee { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: User; html_url: string; description: string; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage: string; size: number; stargazers_count: number; watchers_count: number; language?: any; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license: License; forks: number; open_issues: number; watchers: number; default_branch: string; public: boolean; } interface License { key: string; name: string; spdx_id: string; url: string; node_id: string; } interface Issue { url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; id: number; node_id: string; number: number; title: string; user: User; labels: any[]; state: string; locked: boolean; assignee?: any; assignees: any[]; milestone?: any; comments: number; created_at: string; updated_at: string; closed_at?: string; author_association: string; body: string; } interface User { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface EventRepo { id: number; name: string; url: string; } interface Actor { id: number; login: string; display_login: string; gravatar_id: string; url: string; avatar_url: string; } export const getRepoEvents = ({ full_name }, params) => { return request.get(`/repos/${full_name}/events`, params); }; export const getRepoWatchs = ({ full_name }, params) => { return request.get(`/repos/${full_name}/subscribers`, params); }; export const getRepoForks = ({ full_name }, params) => { return request .get(`/repos/${full_name}/forks`, params) .then((data) => { // TODO 目前只显示 fork 用户 return data && data.map((item) => item.owner); }); }; export const getRepoStars = ({ full_name }, params) => { return request.get(`/repos/${full_name}/stargazers`, params); }; ================================================ FILE: src/services/search.ts ================================================ import { IDefaultParams } from '@/constants'; import request from '../utils/request'; export interface SearchRepoData { total_count: number; incomplete_results: boolean; items: IRepoItem[]; } export interface IRepoItem { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: Owner; html_url: string; description?: string; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage?: string; size: number; stargazers_count: number; watchers_count: number; language?: string; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license?: License; forks: number; open_issues: number; watchers: number; default_branch: string; permissions: Permissions; score: number; } interface Permissions { admin: boolean; push: boolean; pull: boolean; } interface License { key: string; name: string; spdx_id: string; url?: string; node_id: string; } interface Owner { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } export interface ISearchPrams extends IDefaultParams { q: string; sort?: string; order?: string; } export const searchRepos = async ({ q, sort = '', order = 'desc', per_page = 30, page = 1, }: ISearchPrams) => { return request .get(`/search/repositories`, { q, sort, order, per_page, page, }) .then((data) => { return data && data.items; }); }; export const searchIssues = async ({ q, sort = '', order = 'desc', per_page = 30, page = 1, }: ISearchPrams) => { return request.get(`/search/issues`, { q, sort, order, per_page, page, }); }; export interface ISearchUser { total_count: number; incomplete_results: boolean; items: ISearchUserItem[]; } export interface ISearchUserItem { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; score: number; } export const searchUsers = async ({ q, sort = '', order = 'desc', per_page = 30, page = 1, }: ISearchPrams) => { return request .get(`/search/users`, { q, sort, order, per_page, page, }) .then((data) => { return data && data.items; }); }; ================================================ FILE: src/services/trending.ts ================================================ import { request } from '@/utils/request'; const TRENDING_URL = 'https://trending.stayin.cn/'; export interface TrendingRepo { author: string; name: string; avatar: string; url: string; description: string; language?: string; languageColor?: string; stars: number; forks: number; currentPeriodStars: number; builtBy: BuiltBy[]; } interface BuiltBy { username: string; href: string; avatar: string; } export interface TrendingRequestParams { language?: string; since?: string; } export async function getTrendingRepos({ language = '', since = '', }: TrendingRequestParams): Promise { try { // const res = await Taro.cloud.callFunction({ // name: "trending", // data: { // type: "repo", // language, // since // } // }) // return res.result.data const data = await request(TRENDING_URL, { type: 'repo', language, since, }); return data; } catch (e) { console.log('get trending repos error : ', e); return null; } } export interface TrendingUser { author: string; name: string; avatar: string; url: string; description: string; language: string; languageColor: string; stars: number; forks: number; currentPeriodStars: number; builtBy: BuiltBy[]; } interface BuiltBy { username: string; href: string; avatar: string; } export async function getTrendingUsers({ language = '', since = '', }: TrendingRequestParams): Promise { try { // const res = await Taro.cloud.callFunction({ // name: "trending", // data: { // type: "user", // language, // since // } // }) // return res.result.data const data = await request(TRENDING_URL, { type: 'user', language, since, }); return data; } catch (e) { console.log('get trending users error : ', e); return null; } } ================================================ FILE: src/services/user.ts ================================================ import { IDefaultParams } from '@/constants'; import { Issue } from '@/services/issues'; import request from '../utils/request'; export interface IUserInfo { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; name: string; company: string; blog: string; location: string; email: string; hireable?: any; bio: string; public_repos: number; public_gists: number; followers: number; following: number; created_at: string; updated_at: string; } export const getCurrentUser = (token?: string) => { const headers = token ? { Authorization: token } : {}; return request.get('/user', {}, headers); }; export interface IStarred { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: Owner; html_url: string; description: string; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage?: string; size: number; stargazers_count: number; watchers_count: number; language?: string; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license?: License; forks: number; open_issues: number; watchers: number; default_branch: string; permissions: Permissions; } interface Permissions { admin: boolean; push: boolean; pull: boolean; } interface License { key: string; name: string; spdx_id: string; url?: string; node_id: string; } interface Owner { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } export interface starredParams { per_page: number; page: number; } export const getStarred = (params: starredParams) => { return request.get('/user/starred', params); }; export const follow = { is: async (username: string): Promise => { return request.get(`/user/following/${username}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, delete: async (username: string): Promise => { return request.delete(`/user/following/${username}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, put: async (username: string): Promise => { return request.put(`/user/following/${username}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, }; export const starred = { is: async (full_name: string): Promise => { return request.get(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, delete: async (full_name: string): Promise => { return request.delete(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, put: async (full_name: string): Promise => { return request.put(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, }; export const forks = { is: async (full_name: string): Promise => { return request.get(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, delete: async (full_name: string): Promise => { return request.delete(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, put: async (full_name: string): Promise => { return request.put(`/user/starred/${full_name}`).then((data) => { if (!data && data !== null) { return true; } return false; }); }, }; export const getUserIssues = (params: any) => { return request.get('/user/issues', params); }; export const getCurrentUserRepos = (name, params: IDefaultParams) => { return request.get('/user/repos', params); }; ================================================ FILE: src/services/users.ts ================================================ import { IDefaultParams } from '@/constants'; import request from '../utils/request'; import { IStarred, starredParams } from './user'; export interface IUserOrg { login: string; id: number; node_id: string; url: string; repos_url: string; events_url: string; hooks_url: string; issues_url: string; members_url: string; public_members_url: string; avatar_url: string; description: string; } export const getUserOrgs = (username: string) => { return request.get(`/users/${username}/orgs`); }; export interface IUserReceivedEvent { id: string; type: string; actor: Actor; repo: Repo; payload: Payload; public: boolean; created_at: string; org?: Org; } interface Org { id: number; login: string; gravatar_id: string; url: string; avatar_url: string; } interface Payload { action?: string; ref?: string; ref_type?: string; master_branch?: string; description?: string; pusher_type?: string; push_id?: number; size?: number; distinct_size?: number; head?: string; before?: string; commits?: Commit[]; forkee?: Forkee; issue?: Issue; comment?: Comment; repository?: Repository; number?: number; pull_request?: Pullrequest; sender?: User; member?: Member; pages?: Page[]; release?: Release; } interface Comment { url: string; html_url: string; id: number; node_id: string; user: User; position?: any; line?: any; path?: any; commit_id: string; created_at: string; updated_at: string; author_association: string; body: string; } interface Release { url: string; assets_url: string; upload_url: string; html_url: string; id: number; node_id: string; tag_name: string; target_commitish: string; name?: any; draft: boolean; author: Author; prerelease: boolean; created_at: string; published_at: string; assets: any[]; tarball_url: string; zipball_url: string; body?: any; } interface Author { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Owner { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Page { page_name: string; title: string; summary?: any; action: string; sha: string; html_url: string; } interface Member { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Pullrequest { url: string; id: number; node_id: string; html_url: string; diff_url: string; patch_url: string; issue_url: string; number: number; state: string; locked: boolean; title: string; user: User; body: string; created_at: string; updated_at: string; closed_at?: any; merged_at?: any; merge_commit_sha?: any; assignee?: any; assignees: any[]; requested_reviewers: any[]; requested_teams: any[]; labels: any[]; milestone?: any; commits_url: string; review_comments_url: string; review_comment_url: string; comments_url: string; statuses_url: string; head: Head; base: Head; _links: Links; author_association: string; draft: boolean; merged: boolean; mergeable?: any; rebaseable?: any; mergeable_state: string; merged_by?: any; comments: number; review_comments: number; maintainer_can_modify: boolean; commits: number; additions: number; deletions: number; changed_files: number; } interface Links { self: Self; html: Self; issue: Self; comments: Self; review_comments: Self; review_comment: Self; commits: Self; statuses: Self; } interface Self { href: string; } interface Head { label: string; ref: string; sha: string; user: User; repo: Repository; } interface Repository { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: User; html_url: string; description?: any; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage?: any; size: number; stargazers_count: number; watchers_count: number; language?: any; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license?: any; forks: number; open_issues: number; watchers: number; default_branch: string; } interface Issue { url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; id: number; node_id: string; number: number; title: string; user: User; labels: Label[]; state: string; locked: boolean; assignee: User; assignees: User[]; milestone: Milestone; comments: number; created_at: string; updated_at: string; closed_at?: any; author_association: string; body: string; } interface Milestone { url: string; html_url: string; labels_url: string; id: number; node_id: string; number: number; title: string; description: string; creator: User; open_issues: number; closed_issues: number; state: string; created_at: string; updated_at: string; due_on: string; closed_at: string; } interface Label { id: number; node_id: string; url: string; name: string; color: string; default: boolean; } interface User { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Forkee { id: number; node_id: string; name: string; full_name: string; private: boolean; owner: Owner; html_url: string; description: string; fork: boolean; url: string; forks_url: string; keys_url: string; collaborators_url: string; teams_url: string; hooks_url: string; issue_events_url: string; events_url: string; assignees_url: string; branches_url: string; tags_url: string; blobs_url: string; git_tags_url: string; git_refs_url: string; trees_url: string; statuses_url: string; languages_url: string; stargazers_url: string; contributors_url: string; subscribers_url: string; subscription_url: string; commits_url: string; git_commits_url: string; comments_url: string; issue_comment_url: string; contents_url: string; compare_url: string; merges_url: string; archive_url: string; downloads_url: string; issues_url: string; pulls_url: string; milestones_url: string; notifications_url: string; labels_url: string; releases_url: string; deployments_url: string; created_at: string; updated_at: string; pushed_at: string; git_url: string; ssh_url: string; clone_url: string; svn_url: string; homepage: string; size: number; stargazers_count: number; watchers_count: number; language?: any; has_issues: boolean; has_projects: boolean; has_downloads: boolean; has_wiki: boolean; has_pages: boolean; forks_count: number; mirror_url?: any; archived: boolean; disabled: boolean; open_issues_count: number; license?: License; forks: number; open_issues: number; watchers: number; default_branch: string; public: boolean; } interface License { key: string; name: string; spdx_id: string; url: string; node_id: string; } interface Owner { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; } interface Commit { sha: string; author: Author; message: string; distinct: boolean; url: string; } interface Author { email: string; name: string; } interface Repo { id: number; name: string; url: string; } interface Actor { id: number; login: string; display_login: string; gravatar_id: string; url: string; avatar_url: string; } export interface IUserReceivedEventsRequestData { per_page: number; page: number; } export const getUserReceivedEvents = ( username: string, data?: IUserReceivedEventsRequestData, ) => { return request.get( `/users/${username}/received_events`, data, ); }; export const getUserEvents = ( username: string, data?: IUserReceivedEventsRequestData, ) => { return request.get( `/users/${username}/events`, data, ); }; export interface IUser { login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; name: string; company: string; blog: string; location: string; email: string; hireable?: any; bio: string; public_repos: number; public_gists: number; followers: number; following: number; created_at: string; updated_at: string; } export const getUser = (username: string) => { return request.get(`/users/${username}`); }; export const getUserStarred = (username, params: starredParams) => { return request.get(`/users/${username}/starred`, params); }; export const getUserRepos = (username: string, params: IDefaultParams) => { return request.get(`/users/${username}/repos`, params); }; export const getUserFollowers = (username: string, params: IDefaultParams) => { return request.get(`/users/${username}/followers`, params); }; export const getUserFollowing = (username: string, params: IDefaultParams) => { return request.get(`/users/${username}/following`, params); }; ================================================ FILE: src/store/constatnts.ts ================================================ export const LOGIN = 'user/login'; export const LOGOUT = 'user/logout'; export const UPDATE_SELECTED_LANGS = 'language/update_selected_langs'; export const UPDATE_CURRENT_LANG = 'language/update_current_lang'; export const UPDATE_ISSUE_INFO = 'issue/update_issue_info'; export const CLEAR_ISSUE_INFO = 'issue/clear_issue_info'; ================================================ FILE: src/store/index.ts ================================================ import { applyMiddleware, createStore } from 'redux'; // import thunkMiddleware from 'redux-thunk' import { createLogger } from 'redux-logger'; import rootReducer from './reducers'; let middlewares: any = [ // thunkMiddleware ]; if (process.env.NODE_ENV === 'development') { middlewares.push(createLogger()); } export default function configStore() { const store = createStore(rootReducer, applyMiddleware(...middlewares)); return store; } ================================================ FILE: src/store/reducers/issue.ts ================================================ import { CLEAR_ISSUE_INFO, UPDATE_ISSUE_INFO } from '../constatnts'; import { IAction } from '../reducers'; interface IssueState { info: any; } const INITIAL_STATE: IssueState = { info: null, }; const issueReducer = (state = INITIAL_STATE, action: IAction) => { const { type, payload } = action; switch (type) { case UPDATE_ISSUE_INFO: return { ...state, info: payload }; case CLEAR_ISSUE_INFO: return { ...state, info: null }; default: return state; } }; export default issueReducer; ================================================ FILE: src/store/reducers/lang.ts ================================================ import Taro from '@tarojs/taro'; import { UPDATE_SELECTED_LANGS } from '../constatnts'; import { IAction } from '../reducers'; export interface Language { language: string; title: string; } const defaultLangs: Language[] = [ { language: '', title: 'All Languages', }, { language: 'java', title: 'Java', }, { language: 'javascript', title: 'JavaScript', }, { language: 'typescript', title: 'TypeScript', }, ]; interface ILangState { // current: string selected: Language[]; } const INITIAL_STATE: ILangState = { // current: Taro.getStorageSync('current') || '', selected: Taro.getStorageSync('selected') || defaultLangs, }; const languageReducer = (state = INITIAL_STATE, action: IAction) => { const { type, payload } = action; switch (type) { case UPDATE_SELECTED_LANGS: Taro.setStorageSync('selected', payload); return { ...state, selected: payload }; // case UPDATE_CURRENT_LANG: // Taro.setStorageSync('current', payload) // return { ...state, current: payload } default: return state; } }; export default languageReducer; ================================================ FILE: src/store/reducers/user.ts ================================================ import Taro from '@tarojs/taro'; import { LOGIN, LOGOUT } from '../constatnts'; import { IAction } from '../reducers'; const INITIAL_STATE: IUserState = { username: Taro.getStorageSync('username') || '', }; interface IUserState { username: string; } const userReducer = (state = INITIAL_STATE, action: IAction) => { const { type, payload } = action; switch (type) { case LOGIN: const { username, token } = payload; Taro.setStorageSync('username', username); token && Taro.setStorageSync('authorization', token); return { ...state, username }; case LOGOUT: Taro.setStorageSync('username', ''); Taro.setStorageSync('authorization', ''); return { ...state, username: '' }; default: return state; } }; export default userReducer; ================================================ FILE: src/store/reducers.ts ================================================ import { combineReducers } from 'redux'; import issueReducer from './reducers/issue'; import languageReducer from './reducers/lang'; import userReducer from './reducers/user'; export interface IAction { type: string; payload: any; } export default combineReducers({ user: userReducer, lang: languageReducer, issue: issueReducer, }); ================================================ FILE: src/style/variables.scss ================================================ /* Custom Theme */ $color-brand: #007afb; $color-brand-light: #409bfc; $color-brand-dark: #0062c9; $primary: $color-brand; $normal: #ababab; $bg: #f3f3f3; $navBg: #fafafa; $text-color: #6d7178; $primary-text-color: #313b4c; $loading-text-color: #57606a; $boxShadow: 0 0 10px 0 rgba(0, 0, 0, 0.05); $itemBg: rgba(255, 255, 255, 0.9); ================================================ FILE: src/utils/base64.js ================================================ const Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function(e) { var t = "" var n, r, i, s, o, u, a var f = 0 e = Base64._utf8_encode(e) while (f < e.length) { n = e.charCodeAt(f++) r = e.charCodeAt(f++) i = e.charCodeAt(f++) s = n >> 2 o = ((n & 3) << 4) | (r >> 4) u = ((r & 15) << 2) | (i >> 6) a = i & 63 if (isNaN(r)) { u = a = 64 } else if (isNaN(i)) { a = 64 } t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a) } return t }, decode: function(e) { var t = "" var n, r, i var s, o, u, a var f = 0 e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "") while (f < e.length) { s = this._keyStr.indexOf(e.charAt(f++)) o = this._keyStr.indexOf(e.charAt(f++)) u = this._keyStr.indexOf(e.charAt(f++)) a = this._keyStr.indexOf(e.charAt(f++)) n = (s << 2) | (o >> 4) r = ((o & 15) << 4) | (u >> 2) i = ((u & 3) << 6) | a t = t + String.fromCharCode(n) if (u != 64) { t = t + String.fromCharCode(r) } if (a != 64) { t = t + String.fromCharCode(i) } } t = Base64._utf8_decode(t) return t }, _utf8_encode: function(e) { e = e.replace(/\r\n/g, "\n") var t = "" for (var n = 0; n < e.length; n++) { var r = e.charCodeAt(n) if (r < 128) { t += String.fromCharCode(r) } else if (r > 127 && r < 2048) { t += String.fromCharCode((r >> 6) | 192) t += String.fromCharCode((r & 63) | 128) } else { t += String.fromCharCode((r >> 12) | 224) t += String.fromCharCode(((r >> 6) & 63) | 128) t += String.fromCharCode((r & 63) | 128) } } return t }, _utf8_decode: function(e) { var t = "" var n = 0 var r = (c1 = c2 = 0) while (n < e.length) { r = e.charCodeAt(n) if (r < 128) { t += String.fromCharCode(r) n++ } else if (r > 191 && r < 224) { c2 = e.charCodeAt(n + 1) t += String.fromCharCode(((r & 31) << 6) | (c2 & 63)) n += 2 } else { c2 = e.charCodeAt(n + 1) c3 = e.charCodeAt(n + 2) t += String.fromCharCode( ((r & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63) ) n += 3 } } return t } } export default Base64 ================================================ FILE: src/utils/common.ts ================================================ import Taro from '@tarojs/taro'; let isShoTip = false; export const showLoginTips = () => { if (isShoTip) { return; } isShoTip = true; Taro.showModal({ title: '是否前往登录?', content: '该页面操作需要登录才能操作', cancelText: 'No', cancelColor: '#fb3e3b', confirmText: 'Yes', confirmColor: '#007afb', success(res) { if (res.confirm) { Taro.navigateTo({ url: '/pages/login/index' }); } else if (res.cancel) { } isShoTip = false; }, }); }; export const copyText = async (text: string) => { const { data } = await Taro.setClipboardData({ data: `${text}`, }); Taro.showToast({ title: `复制成功:${text}`, icon: 'none', mask: true, }); }; export const getUniqueId = () => { return Math.random().toString(36).substr(2); }; ================================================ FILE: src/utils/date.ts ================================================ export const getFormatDate = (rawDate = ''): string => { const itemArr = new Date(rawDate).toString().split(' '); const m = itemArr[1]; const d = itemArr[2]; const y = itemArr[3]; return `${m} ${d}, ${y}`; }; export const getTimeAgo = (rawDate = ''): string => { const date = new Date(rawDate); const now = new Date().getTime(); const limit = (now - date.getTime()) / 1e3; let content = ''; if (limit < 60) { content = 'just now'; } else if (limit >= 60 && limit < 3600) { content = Math.floor(limit / 60) + ' minutes ago'; } else if (limit >= 3600 && limit < 86400) { content = Math.floor(limit / 3600) + ' hours ago'; } else if (limit >= 86400 && limit < 2592000) { content = Math.floor(limit / 86400) + ' days ago'; } else if (limit >= 2592000 && limit < 31104000) { content = Math.floor(limit / 2592000) + ' months ago'; } else { content = getFormatDate(rawDate); } return content; }; ================================================ FILE: src/utils/event_bus.ts ================================================ import { Events } from '@tarojs/taro'; const events = new Events(); export default events; ================================================ FILE: src/utils/repo.ts ================================================ export function FindGitHubUrl(c) { var urls = FindUrls(c); if (urls.length == 0) { return ''; } var gurl = ''; for (var j = 0; j < urls.length; j++) { if (isGitHubPage(urls[j])) { //@ts-ignore if (gurl == '' || gurl.length > urls[j].length) { gurl = urls[j]; } } } if (gurl) { return gurl; } return urls[0]; } export function FindUrls(c) { var linkRegExp = /https?:\/\/[/0-9a-zA-Z.&=#_?-]+/g; var urls = []; var match; while ((match = linkRegExp.exec(c))) { //@ts-ignore urls.push(match[0]); } return urls; } export function ArrayContains(arr, val) { var i = arr.length; while (i--) { if (arr[i] === val) { return true; } } return false; } export function GetPercent(num, total) { num = parseFloat(num); total = parseFloat(total); if (isNaN(num) || isNaN(total)) { return '-'; } return total <= 0 ? '0%' : Math.round((num / total) * 10000) / 100.0 + '%'; } const CodeFileExtentsions = { java: 'java', kt: 'java', scala: 'java', py: 'python', go: 'go', sh: 'markup', js: 'javascript', jsx: 'javascript', php: 'php', c: 'c', json: 'json', cpp: 'go', html: 'markup', yml: 'markup', yaml: 'markup', R: 'R', css: 'css', scss: 'css', wxss: 'css', swift: 'swift', xml: 'markup', wxml: 'markup', ipynb: 'python', }; export function getCodeMarkup(file) { for (var key in CodeFileExtentsions) { if (file.endsWith('.' + key)) { return CodeFileExtentsions[key]; } } return false; } const ImageFileExtentsions = ['png', 'jpg', 'gif', 'jpeg', 'ico', 'incs']; export function isImageFile(file) { for (var i in ImageFileExtentsions) { var key = ImageFileExtentsions[i]; if (file.toLowerCase().endsWith('.' + key)) { return true; } } return false; } export function mdLink(text, link) { return '[' + text + '](' + link + ')'; } export const githubHttpUrl = `http://github.com`; export const githubHttpsUrl = `https://github.com`; export function isGitHubPage(url) { return url.startsWith(githubHttpUrl) || url.startsWith(githubHttpsUrl); } type owner = 'owner' | ''; type repo = 'repo' | ''; type filePath = 'filePath' | ''; export type parseGitHubReturn = [owner, repo, filePath]; export function parseGitHub(url: string): parseGitHubReturn { let arr = url.split('/'); if (arr.length == 4) { return [arr[3] as owner, '', '']; } else if (arr.length == 5) { let repo = arr[4]; if (repo.indexOf('#')) { repo = arr[4].split('#')[0]; } return [arr[3] as owner, repo as repo, '']; } else if (arr.length > 5) { const len = (githubHttpsUrl + '/' + arr[3] + '/' + arr[4] + '/').length; let file = url.slice(len); return [arr[3] as owner, arr[4] as repo, file as filePath]; } return ['', '', '']; } export const getNavPath = ({ owner, filePath, repo }): string => { let url = ''; if (filePath) { const full_name = `${owner}/${repo}`; if (filePath.startsWith('issues/new')) { url = `/pages/issues/create-issue?full_name=${full_name}`; } else if (/^issues\/\d+/.test(filePath)) { const num = filePath.split('/')[1]; url = `/pages/issues/issue-detail/index?full_name=${full_name}&number=${num}`; } else if (filePath.startsWith('issues')) { url = `/pages/issues/index?full_name=${full_name}`; } else if (filePath.startsWith('pulls?q=')) { // TODO } else if (filePath.startsWith('pull')) { // TODO } else { const isFile = /.*\.\w{1,10}$/.test(filePath); const path = `/repos/${owner}/${repo}/contents/${filePath}`; if (isFile) { url = `/pages/repos/content/index?url=${path}`; } else { url = `/pages/repos/files/index?url=${path}`; } } } else if (repo) { url = `/pages/repos/index?owner=${owner}&repo=${repo}`; } else { url = `/pages/developer/index?name=${owner}`; } return url; }; ================================================ FILE: src/utils/request.ts ================================================ import Taro from '@tarojs/taro'; let BASE_URL = 'https://api.github.com'; // TODO 目前不做缓存 const isDev = process.env.NODE_ENV === 'development' && false; let token = Taro.getStorageSync('authorization'); type Method = | 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'CONNECT'; export const request = ( url: string, data?: any, method: Method = 'GET', headers = {}, ) => { if (isDev) { const data = Taro.getStorageSync(url); if (data) { return Promise.resolve(data); } } const option = { url, data, method, header: { Authorization: token || (token = Taro.getStorageSync('authorization')), ...headers, }, }; if ( (data && data.page > 1) || url.endsWith('/readme') || url.includes('/user/starred') ) { // TODO } else { Taro.showLoading({ title: 'loading..' }); } return Taro.request(option) .then(({ statusCode, data }) => { if (statusCode >= 200 && statusCode < 300) { if (isDev) { Taro.setStorageSync(url, data); } return data; } // TODO refactor if ( (statusCode === 404 && url.includes('/user/following')) || url.includes('/user/starred') ) { return null; } if (statusCode === 401) { // TODO if ( url.includes('/user/starred') || (url.includes('/user') && method === 'GET') ) { return null; } throw new Error(`Error 401: Required Login!`); } if (statusCode === 403) { throw new Error(`Error 403: API rate limit exceeded, required login!`); } const msg = `Error: code ${statusCode}`; throw new Error(msg); }) .catch(({ message }) => { Taro.showToast({ title: message || 'error(─‿─)', icon: 'none', duration: 1500, mask: true, }); return null; }) .finally(() => { Taro.stopPullDownRefresh(); Taro.hideLoading(); }); }; export default { get(url = '/', data = {}, headers = {}): Promise { return request(BASE_URL + url, data, 'GET', headers); }, post(url = '/', data = {}): Promise { return request(BASE_URL + url, data, 'POST'); }, put(url = '/', data = {}): Promise { return request(BASE_URL + url, data, 'PUT'); }, delete(url = '/', data = {}): Promise { return request(BASE_URL + url, data, 'DELETE'); }, }; ================================================ FILE: src/utils/size.ts ================================================ export function bytesToSize(bytes: number | string): string { bytes = +bytes; const sizes = ['B', 'KB', 'MB', 'GB', 'TB']; if (bytes == 0) return '0 B'; const i = parseInt('' + Math.floor(Math.log(bytes) / Math.log(1024))); return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + ' ' + sizes[i]; } ================================================ FILE: src/wemark/parser.js ================================================ var Remarkable = require('./remarkable'); var parser = new Remarkable({ html: true }); var prism = require('./prism'); var idDict = {} var images = [] function urlModify(baseurl, url, currentDir) { var url = _urlModify(baseurl, url, currentDir) images.push(url) return url } function _urlModify(baseurl, url, currentDir) { var re = '/blob/master/' if (url.startsWith('https://github.com/') && url.indexOf(re)>0) { // 暂时以 /blob/master/ 作为替换标识 return baseurl + url.slice(url.indexOf(re) + re.length, url.length) } if (url == "" || url == undefined || url.startsWith('http')) { return url } if (url.startsWith('./')) {url = url.replace('./', currentDir + '/')} return baseurl + url; } function isHtml(h) { var h = h.trim() h = h.replace(/^\s+|\s+$/g, ''); return h.startsWith('<') && h.endsWith('>') } function parse(md, options){ if(!options) options = {}; var tokens = parser.parse(md, {}); // markdwon渲染列表 var renderList = []; var env = []; // 记录当前list深度 var listLevel = 0; // 记录第N级ol的顺序 var orderNum = [0, 0]; var tmp; var parseHtml = function(html, ret) { var list = [{ type: 'text', reg: /(.*?)<\/a>/g }, {type: 'image', reg: //g}, {type: 'text', reg: /(.*?)<\/h2>/g}, {type: 'text', reg: /(.*?)<\/h1>/g}, {type: 'text', reg: /(.*?)<\/p>/g}, {type: 'text', reg: /(.*)/g}] var match; list.map(function(p) { var tmpHtml = html while (match = p.reg.exec(tmpHtml)) { // console.log('match: ', match) if (match[1]) { if (isHtml(match[1])) { var left = parseHtml(match[1], ret) match[1] = match[1].replace(match[1], left) } var data = { type: p.type, content: match[1]} if (p.type == 'image') { data['src'] = urlModify(options.baseurl, match[1], options.currentDir) } ret.push(data) html = html.replace(match[0], '') } } }) if (html) { ret.push({ type: 'text', content: html }) } return html } // 获取inline内容 var getInlineContent = function(inlineToken){ var ret = []; var env; var tokenData = {}; if (inlineToken.type === 'htmlblock' || (inlineToken.type === 'inline' && isHtml(inlineToken.content))){ // 匹配video // 兼容video[src]和video > source[src] var videoRegExp = /|<\/video>)/g; var match; var html = inlineToken.content.replace(/\n/g, ''); parseHtml(html, ret) while(match = videoRegExp.exec(html)){ if(match[1]){ var retParam = { type: 'video', src: match[1] }; if(match[3]) { retParam.poster = match[3]; } ret.push(retParam); } } }else{ inlineToken.children && inlineToken.children.forEach(function(token, index){ if(['text', 'code'].indexOf(token.type) > -1){ ret.push({ type: env || token.type, content: token.content, id: idDict[token.content] || '', data: tokenData }); env = ''; tokenData = {}; }else if(token.type === 'del_open'){ env = 'deleted'; }else if (token.type === 'softbreak') { // todo:处理li的问题 /* ret.push({ type: 'text', content: ' ' }); */ }else if (token.type === 'hardbreak') { ret.push({ type: 'text', content: '\n' }); }else if(token.type === 'strong_open'){ if(env === 'em') { env = 'strong_em'; }else { env = 'strong'; } }else if (token.type === 'em_open') { if(env === 'strong') { env = 'strong_em'; }else { env = 'em'; } }else if (token.type === 'link_open') { if(options.link){ env = 'link'; tokenData = { href: token.href }; if (token.href.startsWith('#')) { // console.log("link:", token, token.href, inlineToken.children[index + 1].content) idDict[inlineToken.children[index+1].content] = token.href.substr(1) } } }else if(token.type === 'image'){ ret.push({ type: token.type, src: urlModify(options.baseurl, token.src, options.currentDir) }); } }); } return ret; }; var getBlockContent = function(blockToken, index, firstInLi){ if(blockToken.type === 'htmlblock'){ return getInlineContent(blockToken); }else if(blockToken.type === 'heading_open'){ return { type: 'h' + blockToken.hLevel, content: getInlineContent(tokens[index+1]) }; }else if(blockToken.type === 'paragraph_open'){ // var type = 'p'; var prefix = ''; if(env.length){ prefix = env.join('_') + '_'; } var content = getInlineContent(tokens[index+1]); // 处理ol前的数字 if(env[env.length - 1] === 'li' && env[env.length - 2] === 'ol'){ let prefix = ' '; if (firstInLi){ prefix = orderNum[listLevel - 1] + '. '; } content.unshift({ type:'text', content: prefix }); } return { type: prefix + 'p', content: content }; }else if(blockToken.type === 'fence' || blockToken.type === 'code'){ content = blockToken.content; var highlight = false; if (!blockToken.params){blockToken.params = 'python'} if (blockToken.params == 'c' || blockToken.params == 'c++' || blockToken.params == 'c#') { blockToken.params = 'clike' } if(options.highlight && blockToken.params && prism.languages[blockToken.params]){ content = prism.tokenize(content, prism.languages[blockToken.params]); highlight = true; } const flattenTokens = (tokensArr, result = [], parentType = '') => { if (Array.isArray(tokensArr)) { tokensArr.forEach(el => { if (typeof el === 'object') { // el.type = parentType + ' wemark_inline_code_' + el.type; if(Array.isArray(el.content)){ flattenTokens(el.content, result, el.type); }else{ flattenTokens(el, result, el.type); } } else { const obj = {}; obj.type = parentType || 'text'; // obj.type = parentType + ' wemark_inline_code_'; obj.content = el; result.push(obj); } }) return result } else { result.push(tokensArr) return result } } if(highlight){ var tokenList = content; content = []; tokenList.forEach((token) => { // let contentListForToken = []; if(Array.isArray(token.content)){ content = content.concat(flattenTokens(token.content, [], '')); }else{ content.push(token); } }); } // flatten nested tokens in html // if (blockToken.params === 'html') { // content = flattenTokens(content) // } // console.log(content); return { type: 'code', highlight: highlight, content: content }; }else if(blockToken.type === 'bullet_list_open'){ env.push('ul'); listLevel++; }else if(blockToken.type === 'ordered_list_open'){ env.push('ol'); listLevel++; }else if(blockToken.type === 'list_item_open'){ env.push('li'); if(env[env.length - 2] === 'ol' ){ orderNum[listLevel - 1]++; } }else if(blockToken.type === 'list_item_close'){ env.pop(); }else if(blockToken.type === 'bullet_list_close'){ env.pop(); listLevel--; }else if(blockToken.type === 'ordered_list_close'){ env.pop(); listLevel--; orderNum[listLevel] = 0; }else if(blockToken.type === 'blockquote_open'){ env.push('blockquote'); }else if(blockToken.type === 'blockquote_close'){ env.pop(); }else if(blockToken.type === 'tr_open'){ tmp = { type: 'table_tr', content: [] }; return tmp; }else if(blockToken.type === 'th_open'){ tmp.content.push({ type: 'table_th', content: getInlineContent(tokens[index+1]) }); }else if(blockToken.type === 'td_open'){ tmp.content.push({ type: 'table_td', content: getInlineContent(tokens[index+1]) }); } }; tokens.forEach(function(token, index){ // 标记是否刚进入li,如果刚进入,可以加符号/序号,否则不加 var firstInLi = false; if(token.type === 'paragraph_open' && tokens[index-1] && tokens[index-1].type === 'list_item_open'){ firstInLi = true; } var blockContent = getBlockContent(token, index, firstInLi); if(!blockContent) return; if(!Array.isArray(blockContent)){ blockContent = [blockContent]; } blockContent.forEach(function(block){ if(Array.isArray(block.content)){ block.isArray = true; }else{ block.isArray = false; } renderList.push(block); }); }); return [renderList, images]; } module.exports = { parse: parse }; ================================================ FILE: src/wemark/prism.js ================================================ /* PrismJS 1.17.1 https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+basic+markup-templating+go+java+php+json+typescript+sql+python */ var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,a=0;var _={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof L?new L(e.type,_.util.encode(e.content),e.alias):Array.isArray(e)?e.map(_.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof L)){if(h&&y!=a.length-1){if(c.lastIndex=v,!(x=c.exec(e)))break;for(var b=x.index+(f&&x[1]?x[1].length:0),w=x.index+x[0].length,A=y,P=v,O=a.length;A"+n.content+""},!u.document)return u.addEventListener&&(_.disableWorkerMessageHandler||u.addEventListener("message",function(e){var a=JSON.parse(e.data),n=a.language,r=a.code,t=a.immediateClose;u.postMessage(_.highlight(r,_.languages[n],n)),t&&u.close()},!1)),_;var e=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();if(e&&(_.filename=e.src,e.hasAttribute("data-manual")&&(_.manual=!0)),!_.manual){function n(){_.manual||_.highlightAll()}"loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n):window.setTimeout(n,16):document.addEventListener("DOMContentLoaded",n)}return _}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var i={};i[a]={pattern:RegExp("(<__[\\s\\S]*?>)(?:\\s*|[\\s\\S])*?(?=<\\/__>)".replace(/__/g,a),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",i)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; !function(s){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+t.source+"|[^\n\r()]*)\\)","i"),inside:{function:/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+t.source+")*?(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var e=s.languages.markup;e&&(e.tag.addInlined("style","css"),s.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:e.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:s.languages.css}},alias:"language-css"}},e.tag))}(Prism); Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript; Prism.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i,greedy:!0},number:/(?:\b\d+\.?\d*|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}; !function(h){function v(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(h.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,o){if(a.language===r){var c=a.tokenStack=[];a.code=a.code.replace(e,function(e){if("function"==typeof o&&!o(e))return e;for(var n,t=c.length;-1!==a.code.indexOf(n=v(r,t));)++t;return c[t]=e,n}),a.grammar=h.languages.markup}}},tokenizePlaceholders:{value:function(p,k){if(p.language===k&&p.tokenStack){p.grammar=h.languages[k];var m=0,d=Object.keys(p.tokenStack);!function e(n){for(var t=0;t=d.length);t++){var a=n[t];if("string"==typeof a||a.content&&"string"==typeof a.content){var r=d[m],o=p.tokenStack[r],c="string"==typeof a?a:a.content,i=v(k,r),u=c.indexOf(i);if(-1(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,string:{pattern:/(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0}}),delete Prism.languages.go["class-name"]; !function(e){var t=/\b(?:abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while|var|null|exports|module|open|opens|provides|requires|to|transitive|uses|with)\b/,a=/\b[A-Z](?:\w*[a-z]\w*)?\b/;e.languages.java=e.languages.extend("clike",{"class-name":[a,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:t,function:[e.languages.clike.function,{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism); !function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:{rest:n.languages.php}};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); Prism.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,number:/-?\d+\.?\d*(e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}}; Prism.languages.typescript=Prism.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),Prism.languages.ts=Prism.languages.typescript; Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}; Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python; ================================================ FILE: src/wemark/prism.wxss ================================================ /* PrismJS 1.15.0 https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+basic+markup-templating+go+java+json+php+sql+python+typescript */ /** * prism.js default theme for JavaScript, CSS and HTML * Based on dabblet (http://dabblet.com) * @author Lea Verou */ .wemark_inline_code_comment, .wemark_inline_code_prolog, .wemark_inline_code_doctype, .wemark_inline_code_cdata { color: slategray; } .wemark_inline_code_punctuation, .wemark_inline_code_interpolation-punctuation { color: #999; } .wemark_inline_code_namespace { opacity: .7; color: #e0e0e0; } .wemark_inline_code_property, .wemark_inline_code_tag, .wemark_inline_code_boolean, .wemark_inline_code_number, .wemark_inline_code_constant, .wemark_inline_code_symbol, .wemark_inline_code_deleted { color: #905; } .wemark_inline_code_selector, .wemark_inline_code_attr-name, .wemark_inline_code_string, .wemark_inline_code_char, .wemark_inline_code_builtin, .wemark_inline_code_inserted { color: #690; } .wemark_inline_code_function-variable, .wemark_inline_code_operator, .wemark_inline_code_entity, .wemark_inline_code_url, .language-css .wemark_inline_code_string, .style .wemark_inline_code_string { color: #e0e0e0; } .wemark_inline_code_atrule, .wemark_inline_code_attr-value, .wemark_inline_code_keyword { color: #07a; } .wemark_inline_code_function, .wemark_inline_code_class-name { color: #DD4A68; } .wemark_inline_code_regex, .wemark_inline_code_important, .wemark_inline_code_variable, .wemark_inline_code_interpolation { color: #e90; } .wemark_inline_code_important, .wemark_inline_code_bold { font-weight: bold; } .wemark_inline_code_italic { font-style: italic; } .wemark_inline_code_entity { cursor: help; } ================================================ FILE: src/wemark/remarkable.js ================================================ /*! remarkable 1.6.0 https://github.com/jonschlinkert/remarkable @license MIT */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Remarkable=e()}}(function(){var e;return function t(e,r,n){function s(i,l){if(!r[i]){if(!e[i]){var a="function"==typeof require&&require;if(!l&&a)return a(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return s(r?r:t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒","in":"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬","int":"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},{}],2:[function(e,t,r){"use strict";var n={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){n[e]=!0}),t.exports=n},{}],3:[function(e,t,r){"use strict";function n(e,t){return e=e.source,t=t||"",function r(n,s){return n?(s=s.source||s,e=e.replace(n,s),r):new RegExp(e,t)}}var s=/[a-zA-Z_:][a-zA-Z0-9:._-]*/,o=/[^"'=<>`\x00-\x20]+/,i=/'[^']*'/,l=/"[^"]*"/,a=n(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",o)("single_quoted",i)("double_quoted",l)(),c=n(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",s)("attr_value",a)(),u=n(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",c)(),p=/<\/[A-Za-z][A-Za-z0-9]*\s*>/,h=//,f=/<[?].*?[?]>/,d=/]*>/,g=/])*\]\]>/,m=n(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",u)("close_tag",p)("comment",h)("processing",f)("declaration",d)("cdata",g)();t.exports.HTML_TAG_RE=m},{}],4:[function(e,t,r){"use strict";t.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},{}],5:[function(e,t,r){"use strict";function n(e){return Object.prototype.toString.call(e)}function s(e){return"[object String]"===n(e)}function o(e,t){return e?d.call(e,t):!1}function i(e){var t=[].slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function l(e){return e.indexOf("\\")<0?e:e.replace(g,"$1")}function a(e){return e>=55296&&57343>=e?!1:e>=64976&&65007>=e?!1:65535===(65535&e)||65534===(65535&e)?!1:e>=0&&8>=e?!1:11===e?!1:e>=14&&31>=e?!1:e>=127&&159>=e?!1:e>1114111?!1:!0}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function u(e,t){var r=0;return o(v,t)?v[t]:35===t.charCodeAt(0)&&b.test(t)&&(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),a(r))?c(r):e}function p(e){return e.indexOf("&")<0?e:e.replace(m,u)}function h(e){return y[e]}function f(e){return k.test(e)?e.replace(_,h):e}var d=Object.prototype.hasOwnProperty,g=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,m=/&([a-z#][a-z0-9]{1,31});/gi,b=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,v=e("./entities"),k=/[&<>"]/,_=/[&<>"]/g,y={"&":"&","<":"<",">":">",'"':"""};r.assign=i,r.isString=s,r.has=o,r.unescapeMd=l,r.isValidEntityCode=a,r.fromCodePoint=c,r.replaceEntities=p,r.escapeHtml=f},{"./entities":1}],6:[function(e,t,r){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},{}],7:[function(e,t,r){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},{}],8:[function(e,t,r){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},{}],9:[function(e,t,r){"use strict";var n=e("../common/utils").replaceEntities;t.exports=function(e){var t=n(e);try{t=decodeURI(t)}catch(r){}return encodeURI(t)}},{"../common/utils":5}],10:[function(e,t,r){"use strict";t.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},{}],11:[function(e,t,r){"use strict";var n=e("./normalize_link"),s=e("../common/utils").unescapeMd;t.exports=function(e,t){var r,o,i,l=t,a=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;a>t;){if(r=e.src.charCodeAt(t),10===r)return!1;if(62===r)return i=n(s(e.src.slice(l+1,t))),e.parser.validateLink(i)?(e.pos=t+1,e.linkContent=i,!0):!1;92===r&&a>t+1?t+=2:t++}return!1}for(o=0;a>t&&(r=e.src.charCodeAt(t),32!==r)&&!(r>8&&14>r);)if(92===r&&a>t+1)t+=2;else{if(40===r&&(o++,o>1))break;if(41===r&&(o--,0>o))break;t++}return l===t?!1:(i=s(e.src.slice(l,t)),e.parser.validateLink(i)?(e.linkContent=i,e.pos=t,!0):!1)}},{"../common/utils":5,"./normalize_link":9}],12:[function(e,t,r){"use strict"; t.exports=function(e,t){var r,n,s,o=-1,i=e.posMax,l=e.pos,a=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,r=1;e.post;){if(r=e.src.charCodeAt(t),r===i)return e.pos=t+1,e.linkContent=n(e.src.slice(s+1,t)),!0;92===r&&o>t+1?t+=2:t++}return!1}},{"../common/utils":5}],14:[function(e,t,r){"use strict";function n(e,t,r){this.src=t,this.env=r,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function s(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new c,this.block=new a,this.core=new l,this.renderer=new i,this.ruler=new u,this.options={},this.configure(p[e]),this.set(t||{})}var o=e("./common/utils").assign,i=e("./renderer"),l=e("./parser_core"),a=e("./parser_block"),c=e("./parser_inline"),u=e("./ruler"),p={"default":e("./configs/default"),full:e("./configs/full"),commonmark:e("./configs/commonmark")};s.prototype.set=function(e){o(this.options,e)},s.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enable(e.components[r].rules,!0)})},s.prototype.use=function(e,t){return e(this,t),this},s.prototype.parse=function(e,t){var r=new n(this,e,t);return this.core.process(r),r.tokens},s.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},s.prototype.parseInline=function(e,t){var r=new n(this,e,t);return r.inlineMode=!0,this.core.process(r),r.tokens},s.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},t.exports=s,t.exports.utils=e("./common/utils")},{"./common/utils":5,"./configs/commonmark":6,"./configs/default":7,"./configs/full":8,"./parser_block":15,"./parser_core":16,"./parser_inline":17,"./renderer":18,"./ruler":19}],15:[function(e,t,r){"use strict";function n(){this.ruler=new s;for(var e=0;el&&(e.line=l=e.skipEmptyLines(l),!(l>=r))&&!(e.tShift[l]s&&!(n=o[s](e,l,r,!1));s++);if(e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),l=e.line,r>l&&e.isEmpty(l)){if(a=!0,l++,r>l&&"list"===e.parentType&&e.isEmpty(l))break;e.line=l}}};var l=/[\n\t]/g,a=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,c=/\u00a0/g;n.prototype.parse=function(e,t,r,n){var s,i=0,u=0;return e?(e=e.replace(c," "),e=e.replace(a,"\n"),e.indexOf(" ")>=0&&(e=e.replace(l,function(t,r){var n;return 10===e.charCodeAt(r)?(i=r+1,u=0,t):(n=" ".slice((r-i-u)%4),u=r-i+1,n)})),s=new o(e,this,t,r,n),void this.tokenize(s,s.line,s.lineMax)):[]},t.exports=n},{"./ruler":19,"./rules_block/blockquote":21,"./rules_block/code":22,"./rules_block/deflist":23,"./rules_block/fences":24,"./rules_block/footnote":25,"./rules_block/heading":26,"./rules_block/hr":27,"./rules_block/htmlblock":28,"./rules_block/lheading":29,"./rules_block/list":30,"./rules_block/paragraph":31,"./rules_block/state_block":32,"./rules_block/table":33}],16:[function(e,t,r){"use strict";function n(){this.options={},this.ruler=new s;for(var e=0;et;t++)n[t](e)},t.exports=n},{"./ruler":19,"./rules_core/abbr":34,"./rules_core/abbr2":35,"./rules_core/block":36,"./rules_core/footnote_tail":37,"./rules_core/inline":38,"./rules_core/linkify":39,"./rules_core/references":40,"./rules_core/replacements":41,"./rules_core/smartquotes":42}],17:[function(e,t,r){"use strict";function n(){this.ruler=new o;for(var e=0;e0)return void(e.pos=r);for(t=0;s>t;t++)if(n[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)},n.prototype.tokenize=function(e){for(var t,r,n=this.ruler.getRules(""),s=n.length,o=e.posMax;e.posr&&!(t=n[r](e,!1));r++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},n.prototype.parse=function(e,t,r,n){var s=new i(e,this,t,r,n);this.tokenize(s)},t.exports=n},{"./common/utils":5,"./ruler":19,"./rules_inline/autolink":43,"./rules_inline/backticks":44,"./rules_inline/del":45,"./rules_inline/emphasis":46,"./rules_inline/entity":47,"./rules_inline/escape":48,"./rules_inline/footnote_inline":49,"./rules_inline/footnote_ref":50,"./rules_inline/htmltag":51,"./rules_inline/ins":52,"./rules_inline/links":53,"./rules_inline/mark":54,"./rules_inline/newline":55,"./rules_inline/state_inline":56,"./rules_inline/sub":57,"./rules_inline/sup":58,"./rules_inline/text":59}],18:[function(e,t,r){"use strict";function n(){this.rules=s.assign({},o),this.getBreak=o.getBreak}var s=e("./common/utils"),o=e("./rules");t.exports=n,n.prototype.renderInline=function(e,t,r){for(var n=this.rules,s=e.length,o=0,i="";s--;)i+=n[e[o].type](e,o++,t,r,this);return i},n.prototype.render=function(e,t,r){for(var n=this.rules,s=e.length,o=-1,i="";++ot)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},n.prototype.disable=function(e){e=Array.isArray(e)?e:[e],e.forEach(function(e){var t=this.__find__(e);if(0>t)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},n.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]},t.exports=n},{}],20:[function(e,t,r){"use strict";function n(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?n(e,t+2):t}var s=e("./common/utils").has,o=e("./common/utils").unescapeMd,i=e("./common/utils").replaceEntities,l=e("./common/utils").escapeHtml,a={};a.blockquote_open=function(){return"
    \n"},a.blockquote_close=function(e,t){return"
    "+c(e,t)},a.code=function(e,t){return e[t].block?"
    "+l(e[t].content)+"
    "+c(e,t):""+l(e[t].content)+""},a.fence=function(e,t,r,n,a){var u,p,h=e[t],f="",d=r.langPrefix,g="";if(h.params){if(u=h.params.split(/\s+/g)[0],s(a.rules.fence_custom,u))return a.rules.fence_custom[u](e,t,r,n,a);g=l(i(o(u))),f=' class="'+d+g+'"'}return p=r.highlight?r.highlight(h.content,g)||l(h.content):l(h.content),"
    "+p+"
    "+c(e,t)},a.fence_custom={},a.heading_open=function(e,t){return""},a.heading_close=function(e,t){return"\n"},a.hr=function(e,t,r){return(r.xhtmlOut?"
    ":"
    ")+c(e,t)},a.bullet_list_open=function(){return"
      \n"},a.bullet_list_close=function(e,t){return"
    "+c(e,t)},a.list_item_open=function(){return"
  • "},a.list_item_close=function(){return"
  • \n"},a.ordered_list_open=function(e,t){var r=e[t],n=r.order>1?' start="'+r.order+'"':"";return"\n"},a.ordered_list_close=function(e,t){return""+c(e,t)},a.paragraph_open=function(e,t){return e[t].tight?"":"

    "},a.paragraph_close=function(e,t){var r=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"

    ")+(r?c(e,t):"")},a.link_open=function(e,t,r){var n=e[t].title?' title="'+l(i(e[t].title))+'"':"",s=r.linkTarget?' target="'+r.linkTarget+'"':"";return'"},a.link_close=function(){return""},a.image=function(e,t,r){var n=' src="'+l(e[t].src)+'"',s=e[t].title?' title="'+l(i(e[t].title))+'"':"",o=' alt="'+(e[t].alt?l(i(e[t].alt)):"")+'"',a=r.xhtmlOut?" /":"";return""},a.table_open=function(){return"\n"},a.table_close=function(){return"
    \n"},a.thead_open=function(){return"\n"},a.thead_close=function(){return"\n"},a.tbody_open=function(){return"\n"},a.tbody_close=function(){return"\n"},a.tr_open=function(){return""},a.tr_close=function(){return"\n"},a.th_open=function(e,t){var r=e[t];return""},a.th_close=function(){return""},a.td_open=function(e,t){var r=e[t];return""},a.td_close=function(){return""},a.strong_open=function(){return""},a.strong_close=function(){return""},a.em_open=function(){return""},a.em_close=function(){return""},a.del_open=function(){return""},a.del_close=function(){return""},a.ins_open=function(){return""},a.ins_close=function(){return""},a.mark_open=function(){return""},a.mark_close=function(){return""},a.sub=function(e,t){return""+l(e[t].content)+""},a.sup=function(e,t){return""+l(e[t].content)+""},a.hardbreak=function(e,t,r){return r.xhtmlOut?"
    \n":"
    \n"},a.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"
    \n":"
    \n":"\n"},a.text=function(e,t){return l(e[t].content)},a.htmlblock=function(e,t){return e[t].content},a.htmltag=function(e,t){return e[t].content},a.abbr_open=function(e,t){return''},a.abbr_close=function(){return""},a.footnote_ref=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),'['+r+"]"},a.footnote_block_open=function(e,t,r){var n=r.xhtmlOut?'
    \n':'
    \n';return n+'
    \n
      \n'},a.footnote_block_close=function(){return"
    \n
    \n"},a.footnote_open=function(e,t){var r=Number(e[t].id+1).toString();return'
  • '},a.footnote_close=function(){return"
  • \n"},a.footnote_anchor=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),' '},a.dl_open=function(){return"
    \n"},a.dt_open=function(){return"
    "},a.dd_open=function(){return"
    "},a.dl_close=function(){return"
    \n"},a.dt_close=function(){return"\n"},a.dd_close=function(){return"\n"};var c=a.getBreak=function(e,t){return t=n(e,t),tm)return!1;if(62!==e.src.charCodeAt(g++))return!1;if(e.level>=e.options.maxNesting)return!1;if(n)return!0;for(32===e.src.charCodeAt(g)&&g++,a=e.blkIndent,e.blkIndent=0,l=[e.bMarks[t]],e.bMarks[t]=g,g=m>g?e.skipSpaces(g):g,o=g>=m,i=[e.tShift[t]],e.tShift[t]=g-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),s=t+1;r>s&&(g=e.bMarks[s]+e.tShift[s],m=e.eMarks[s],!(g>=m));s++)if(62!==e.src.charCodeAt(g++)){if(o)break;for(d=!1,h=0,f=p.length;f>h;h++)if(p[h](e,s,r,!0)){d=!0;break}if(d)break;l.push(e.bMarks[s]),i.push(e.tShift[s]),e.tShift[s]=-1337}else 32===e.src.charCodeAt(g)&&g++,l.push(e.bMarks[s]),e.bMarks[s]=g,g=m>g?e.skipSpaces(g):g,o=g>=m,i.push(e.tShift[s]),e.tShift[s]=g-e.bMarks[s];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:u=[t,0],level:e.level++}),e.parser.tokenize(e,t,s),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,u[1]=e.line,h=0;hn;)if(e.isEmpty(n))n++;else{if(!(e.tShift[n]-e.blkIndent>=4))break;n++,s=n}return e.line=n,e.tokens.push({type:"code",content:e.getLines(t,s,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},{}],23:[function(e,t,r){"use strict";function n(e,t){var r,n,s=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return s>=o?-1:(n=e.src.charCodeAt(s++),126!==n&&58!==n?-1:(r=e.skipSpaces(s),s===r?-1:r>=o?-1:r))}function s(e,t){var r,n,s=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===s&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].tight=!0,e.tokens[r].tight=!0,r+=2)}t.exports=function(e,t,r,o){var i,l,a,c,u,p,h,f,d,g,m,b,v,k;if(o)return e.ddIndent<0?!1:n(e,t)>=0;if(h=t+1,e.isEmpty(h)&&++h>r)return!1;if(e.tShift[h]i)return!1;if(e.level>=e.options.maxNesting)return!1;p=e.tokens.length,e.tokens.push({type:"dl_open",lines:u=[t,0],level:e.level++}),a=t,l=h;e:for(;;){for(k=!0,v=!1,e.tokens.push({type:"dt_open",lines:[a,a],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(a,a+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[a,a],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:c=[h,0],level:e.level++}),b=e.tight,d=e.ddIndent,f=e.blkIndent,m=e.tShift[l],g=e.parentType,e.blkIndent=e.ddIndent=e.tShift[l]+2,e.tShift[l]=i-e.bMarks[l],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,l,r,!0),(!e.tight||v)&&(k=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.tShift[l]=m,e.tight=b,e.parentType=g,e.blkIndent=f,e.ddIndent=d,e.tokens.push({type:"dd_close",level:--e.level}),c[1]=h=e.line,h>=r)break e;if(e.tShift[h]i)break;l=h}if(h>=r)break;if(a=h,e.isEmpty(a))break;if(e.tShift[a]=r)break;if(e.isEmpty(l)&&l++,l>=r)break;if(e.tShift[l]i)break}return e.tokens.push({type:"dl_close",level:--e.level}),u[1]=h,e.line=h,k&&s(e,p),!0}},{}],24:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var s,o,i,l,a,c=!1,u=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(u+3>p)return!1;if(s=e.src.charCodeAt(u),126!==s&&96!==s)return!1;if(a=u,u=e.skipChars(u,s),o=u-a,3>o)return!1;if(i=e.src.slice(u,p).trim(),i.indexOf("`")>=0)return!1;if(n)return!0;for(l=t;(l++,!(l>=r))&&(u=a=e.bMarks[l]+e.tShift[l],p=e.eMarks[l],!(p>u&&e.tShift[l]=4||(u=e.skipChars(u,s),o>u-a||(u=e.skipSpaces(u),p>u)))){c=!0;break}return o=e.tShift[t],e.line=l+(c?1:0),e.tokens.push({type:"fence",params:i,content:e.getLines(t+1,l,o,!0),lines:[t,e.line],level:e.level}),!0}},{}],25:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var s,o,i,l,a,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(c+4>u)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(l=c+2;u>l;l++){if(32===e.src.charCodeAt(l))return!1;if(93===e.src.charCodeAt(l))break}return l===c+2?!1:l+1>=u||58!==e.src.charCodeAt(++l)?!1:n?!0:(l++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),a=e.src.slice(c+2,l-2),e.env.footnotes.refs[":"+a]=-1,e.tokens.push({type:"footnote_reference_open",label:a,level:e.level++}),s=e.bMarks[t],o=e.tShift[t],i=e.parentType,e.tShift[t]=e.skipSpaces(l)-l,e.bMarks[t]=l,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]=a)return!1;if(s=e.src.charCodeAt(l),35!==s||l>=a)return!1;for(o=1,s=e.src.charCodeAt(++l);35===s&&a>l&&6>=o;)o++,s=e.src.charCodeAt(++l);return o>6||a>l&&32!==s?!1:n?!0:(a=e.skipCharsBack(a,32,l),i=e.skipCharsBack(a,35,l),i>l&&32===e.src.charCodeAt(i-1)&&(a=i),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),a>l&&e.tokens.push({type:"inline",content:e.src.slice(l,a).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level}),!0)}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var s,o,i,l=e.bMarks[t],a=e.eMarks[t];if(l+=e.tShift[t],l>a)return!1;if(s=e.src.charCodeAt(l++),42!==s&&45!==s&&95!==s)return!1;for(o=1;a>l;){if(i=e.src.charCodeAt(l++),i!==s&&32!==i)return!1;i===s&&o++}return 3>o?!1:n?!0:(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0)}},{}],28:[function(e,t,r){"use strict";function n(e){var t=32|e;return t>=97&&122>=t}var s=e("../common/html_blocks"),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;t.exports=function(e,t,r,l){var a,c,u,p=e.bMarks[t],h=e.eMarks[t],f=e.tShift[t];if(p+=f,!e.options.html)return!1;if(f>3||p+2>=h)return!1;if(60!==e.src.charCodeAt(p))return!1;if(a=e.src.charCodeAt(p+1),33===a||63===a){if(l)return!0}else{if(47!==a&&!n(a))return!1;if(47===a){if(c=e.src.slice(p,h).match(i),!c)return!1}else if(c=e.src.slice(p,h).match(o),!c)return!1;if(s[c[1].toLowerCase()]!==!0)return!1;if(l)return!0}for(u=t+1;u=r?!1:e.tShift[i]3?!1:(s=e.bMarks[i]+e.tShift[i],o=e.eMarks[i],s>=o?!1:(n=e.src.charCodeAt(s),45!==n&&61!==n?!1:(s=e.skipChars(s,n),s=e.skipSpaces(s),o>s?!1:(s=e.bMarks[t]+e.tShift[t],e.line=i+1,e.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(s,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:e.level}),!0))))}},{}],30:[function(e,t,r){"use strict";function n(e,t){var r,n,s;return n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],n>=s?-1:(r=e.src.charCodeAt(n++),42!==r&&45!==r&&43!==r?-1:s>n&&32!==e.src.charCodeAt(n)?-1:n)}function s(e,t){var r,n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(n+1>=s)return-1;if(r=e.src.charCodeAt(n++),48>r||r>57)return-1;for(;;){if(n>=s)return-1;if(r=e.src.charCodeAt(n++),!(r>=48&&57>=r)){if(41===r||46===r)break;return-1}}return s>n&&32!==e.src.charCodeAt(n)?-1:n}function o(e,t){var r,n,s=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===s&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].tight=!0,e.tokens[r].tight=!0,r+=2)}t.exports=function(e,t,r,i){var l,a,c,u,p,h,f,d,g,m,b,v,k,_,y,x,w,A,q,C,S,E,M=!0;if((d=s(e,t))>=0)k=!0;else{if(!((d=n(e,t))>=0))return!1;k=!1}if(e.level>=e.options.maxNesting)return!1;if(v=e.src.charCodeAt(d-1),i)return!0;for(y=e.tokens.length,k?(f=e.bMarks[t]+e.tShift[t],b=Number(e.src.substr(f,d-f-1)),e.tokens.push({type:"ordered_list_open",order:b,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),l=t,x=!1,q=e.parser.ruler.getRules("list");!(!(r>l)||(_=e.skipSpaces(d),g=e.eMarks[l],m=_>=g?1:_-d,m>4&&(m=1),1>m&&(m=1),a=d-e.bMarks[l]+m,e.tokens.push({type:"list_item_open",lines:A=[t,0],level:e.level++}),u=e.blkIndent,p=e.tight,c=e.tShift[t],h=e.parentType,e.tShift[t]=_-e.bMarks[t],e.blkIndent=a,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,r,!0),(!e.tight||x)&&(M=!1),x=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=u,e.tShift[t]=c,e.tight=p,e.parentType=h,e.tokens.push({type:"list_item_close",level:--e.level}),l=t=e.line,A[1]=l,_=e.bMarks[t],l>=r)||e.isEmpty(l)||e.tShift[l]C;C++)if(q[C](e,l,r,!0)){E=!0;break}if(E)break;if(k){if(d=s(e,l),0>d)break}else if(d=n(e,l),0>d)break;if(v!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:k?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=l,e.line=l,M&&o(e,y),!0}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i,l,a=t+1;if(r=e.lineMax,r>a&&!e.isEmpty(a))for(l=e.parser.ruler.getRules("paragraph");r>a&&!e.isEmpty(a);a++)if(!(e.tShift[a]-e.blkIndent>3)){for(s=!1,o=0,i=l.length;i>o;o++)if(l[o](e,a,r,!0)){s=!0;break}if(s)break}return n=e.getLines(t,a,e.blkIndent,!1).trim(),e.line=a,n.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:n,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},{}],32:[function(e,t,r){"use strict";function n(e,t,r,n,s){var o,i,l,a,c,u,p;for(this.src=e,this.parser=t,this.options=r,this.env=n,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",i=this.src,u=0,p=!1,l=a=u=0,c=i.length;c>a;a++){if(o=i.charCodeAt(a),!p){if(32===o){u++;continue}p=!0}(10===o||a===c-1)&&(10!==o&&a++,this.bMarks.push(l),this.eMarks.push(a),this.tShift.push(u),p=!1,u=0,l=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}n.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},n.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;t>e&&!(this.bMarks[e]+this.tShift[e]e&&32===this.src.charCodeAt(e);e++);return e},n.prototype.skipChars=function(e,t){for(var r=this.src.length;r>e&&this.src.charCodeAt(e)===t;e++);return e},n.prototype.skipCharsBack=function(e,t,r){if(r>=e)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},n.prototype.getLines=function(e,t,r,n){var s,o,i,l,a,c=e;if(e>=t)return"";if(c+1===t)return o=this.bMarks[c]+Math.min(this.tShift[c],r),i=n?this.eMarks[c]+1:this.eMarks[c],this.src.slice(o,i);for(l=new Array(t-e),s=0;t>c;c++,s++)a=this.tShift[c],a>r&&(a=r),0>a&&(a=0),o=this.bMarks[c]+a,i=t>c+1||n?this.eMarks[c]+1:this.eMarks[c],l[s]=this.src.slice(o,i);return l.join("")},t.exports=n},{}],33:[function(e,t,r){"use strict";function n(e,t){var r=e.bMarks[t]+e.blkIndent,n=e.eMarks[t];return e.src.substr(r,n-r)}t.exports=function(e,t,r,s){var o,i,l,a,c,u,p,h,f,d;if(t+2>r)return!1;if(c=t+1,e.tShift[c]=e.eMarks[c])return!1;if(o=e.src.charCodeAt(l),124!==o&&45!==o&&58!==o)return!1;if(i=n(e,t+1),!/^[-:| ]+$/.test(i))return!1;if(u=i.split("|"),2>=u)return!1;for(p=[],a=0;ac&&!(e.tShift[c]l||58!==e.charCodeAt(l+1))return-1;for(c=i.posMax,a=l+2;c>a&&10!==i.src.charCodeAt(a);a++);return u=e.slice(2,l),p=e.slice(l+2,a).trim(),0===p.length?-1:(n.abbreviations||(n.abbreviations={}),"undefined"==typeof n.abbreviations[":"+u]&&(n.abbreviations[":"+u]=p),a)}var s=e("../rules_inline/state_inline"),o=e("../helpers/parse_link_label");t.exports=function(e){var t,r,s,o,i=e.tokens;if(!e.inlineMode)for(t=1,r=i.length-1;r>t;t++)if("paragraph_open"===i[t-1].type&&"inline"===i[t].type&&"paragraph_close"===i[t+1].type){for(s=i[t].content;s.length&&(o=n(s,e.inline,e.options,e.env),!(0>o));)s=s.slice(o).trim();i[t].content=s,s.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},{"../helpers/parse_link_label":12,"../rules_inline/state_inline":56}],35:[function(e,t,r){"use strict";function n(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#r;r++)if("inline"===g[r].type)for(i=g[r].children,t=i.length-1;t>=0;t--)if(l=i[t],"text"===l.type){for(u=0,a=l.content,h.lastIndex=0,p=l.level,c=[];f=h.exec(a);)h.lastIndex>u&&c.push({type:"text",content:a.slice(u,f.index+f[1].length),level:p}),c.push({type:"abbr_open",title:e.env.abbreviations[":"+f[2]],level:p++}),c.push({type:"text",content:f[2],level:p}),c.push({type:"abbr_close",level:--p}),u=h.lastIndex-f[3].length;c.length&&(ut;t++){for(e.tokens.push({type:"footnote_open",id:t,level:u++}),i[t].tokens?(l=[],l.push({type:"paragraph_open",tight:!1,level:u++}),l.push({type:"inline",content:"",level:u,children:i[t].tokens}),l.push({type:"paragraph_close",tight:!1,level:--u})):i[t].label&&(l=h[":"+i[t].label]),e.tokens=e.tokens.concat(l),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,s=i[t].count>0?i[t].count:1,n=0;s>n;n++)e.tokens.push({type:"footnote_anchor",id:t,subId:n,level:u});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--u})}e.tokens.push({type:"footnote_block_close",level:--u})}}},{}],38:[function(e,t,r){"use strict";t.exports=function(e){var t,r,n,s=e.tokens;for(r=0,n=s.length;n>r;r++)t=s[r],"inline"===t.type&&e.inline.parse(t.content,e.options,e.env,t.children)}},{}],39:[function(e,t,r){"use strict";function n(e){return/^\s]/i.test(e)}function s(e){return/^<\/a\s*>/i.test(e)}function o(){var e=[],t=new i({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,r){switch(r.getType()){case"url":e.push({text:r.matchedText,url:r.getUrl()});break;case"email":e.push({text:r.matchedText,url:"mailto:"+r.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}var i=e("autolinker"),l=/www|@|\:\/\//;t.exports=function(e){var t,r,i,a,c,u,p,h,f,d,g,m,b,v=e.tokens,k=null;if(e.options.linkify)for(r=0,i=v.length;i>r;r++)if("inline"===v[r].type)for(a=v[r].children, g=0,t=a.length-1;t>=0;t--)if(c=a[t],"link_close"!==c.type){if("htmltag"===c.type&&(n(c.content)&&g>0&&g--,s(c.content)&&g++),!(g>0)&&"text"===c.type&&l.test(c.content)){if(k||(k=o(),m=k.links,b=k.autolinker),u=c.content,m.length=0,b.link(u),!m.length)continue;for(p=[],d=c.level,h=0;hu||58!==e.charCodeAt(u+1))return-1;for(h=c.posMax,p=u+2;h>p&&(f=c.src.charCodeAt(p),32===f||10===f);p++);if(!i(c,p))return-1;for(g=c.linkContent,p=c.pos,d=p,p+=1;h>p&&(f=c.src.charCodeAt(p),32===f||10===f);p++);for(h>p&&d!==p&&l(c,p)?(m=c.linkContent,p=c.pos):(m="",p=d);h>p&&32===c.src.charCodeAt(p);)p++;return h>p&&10!==c.src.charCodeAt(p)?-1:(b=a(e.slice(1,u)),"undefined"==typeof n.references[b]&&(n.references[b]={title:m,href:g}),p)}var s=e("../rules_inline/state_inline"),o=e("../helpers/parse_link_label"),i=e("../helpers/parse_link_destination"),l=e("../helpers/parse_link_title"),a=e("../helpers/normalize_reference");t.exports=function(e){var t,r,s,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,r=i.length-1;r>t;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(s=i[t].content;s.length&&(o=n(s,e.inline,e.options,e.env),!(0>o));)s=s.slice(o).trim();i[t].content=s,s.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},{"../helpers/normalize_reference":10,"../helpers/parse_link_destination":11,"../helpers/parse_link_label":12,"../helpers/parse_link_title":13,"../rules_inline/state_inline":56}],41:[function(e,t,r){"use strict";function n(e){return e.indexOf("(")<0?e:e.replace(o,function(e,t){return i[t.toLowerCase()]})}var s=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};t.exports=function(e){var t,r,o,i,l;if(e.options.typographer)for(l=e.tokens.length-1;l>=0;l--)if("inline"===e.tokens[l].type)for(i=e.tokens[l].children,t=i.length-1;t>=0;t--)r=i[t],"text"===r.type&&(o=r.content,o=n(o),s.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),r.content=o)}},{}],42:[function(e,t,r){"use strict";function n(e,t){return 0>t||t>=e.length?!1:!l.test(e[t])}function s(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}var o=/['"]/,i=/['"]/g,l=/[-\s()\[\]]/,a="’";t.exports=function(e){var t,r,l,c,u,p,h,f,d,g,m,b,v,k,_,y,x;if(e.options.typographer)for(x=[],_=e.tokens.length-1;_>=0;_--)if("inline"===e.tokens[_].type)for(y=e.tokens[_].children,x.length=0,t=0;t=0&&!(x[v].level<=h);v--);x.length=v+1,l=r.content,u=0,p=l.length;e:for(;p>u&&(i.lastIndex=u,c=i.exec(l));)if(f=!n(l,c.index-1),u=c.index+1,k="'"===c[0],d=!n(l,u),d||f){if(m=!d,b=!f)for(v=x.length-1;v>=0&&(g=x[v],!(x[v].level/,i=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;t.exports=function(e,t){var r,l,a,c,u,p=e.pos;return 60!==e.src.charCodeAt(p)?!1:(r=e.src.slice(p),r.indexOf(">")<0?!1:(l=r.match(i))?n.indexOf(l[1].toLowerCase())<0?!1:(c=l[0].slice(1,-1),u=s(c),e.parser.validateLink(c)?(t||(e.push({type:"link_open",href:u,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=l[0].length,!0):!1):(a=r.match(o),a?(c=a[0].slice(1,-1),u=s("mailto:"+c),e.parser.validateLink(u)?(t||(e.push({type:"link_open",href:u,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=a[0].length,!0):!1):!1))}},{"../common/url_schemas":4,"../helpers/normalize_link":9}],44:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.pos,a=e.src.charCodeAt(l);if(96!==a)return!1;for(r=l,l++,n=e.posMax;n>l&&96===e.src.charCodeAt(l);)l++;for(s=e.src.slice(r,l),o=i=l;-1!==(o=e.src.indexOf("`",i));){for(i=o+1;n>i&&96===e.src.charCodeAt(i);)i++;if(i-o===s.length)return t||e.push({type:"code",content:e.src.slice(l,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=i,!0}return t||(e.pending+=s),e.pos+=s.length,!0}},{}],45:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(126!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),126===o)return!1;if(126===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&126===e.src.charCodeAt(n);)n++;if(n>a+3)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],46:[function(e,t,r){"use strict";function n(e){return e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e}function s(e,t){var r,s,o,i=t,l=!0,a=!0,c=e.posMax,u=e.src.charCodeAt(t);for(r=t>0?e.src.charCodeAt(t-1):-1;c>i&&e.src.charCodeAt(i)===u;)i++;return i>=c&&(l=!1),o=i-t,o>=4?l=a=!1:(s=c>i?e.src.charCodeAt(i):-1,(32===s||10===s)&&(l=!1),(32===r||10===r)&&(a=!1),95===u&&(n(r)&&(l=!1),n(s)&&(a=!1))),{can_open:l,can_close:a,delims:o}}t.exports=function(e,t){var r,n,o,i,l,a,c,u=e.posMax,p=e.pos,h=e.src.charCodeAt(p);if(95!==h&&42!==h)return!1;if(t)return!1;if(c=s(e,p),r=c.delims,!c.can_open)return e.pos+=r,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+r,a=[r];e.posl){a.push(i-l);break}if(l-=i,0===a.length)break;e.pos+=i,i=a.pop()}if(0===a.length){r=i,o=!0;break}e.pos+=n;continue}c.can_open&&a.push(n),e.pos+=n}return o?(e.posMax=e.pos,e.pos=p+r,t||((2===r||3===r)&&e.push({type:"strong_open",level:e.level++}),(1===r||3===r)&&e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),(1===r||3===r)&&e.push({type:"em_close",level:--e.level}),(2===r||3===r)&&e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+r,e.posMax=u,!0):(e.pos=p,!1)}},{}],47:[function(e,t,r){"use strict";var n=e("../common/entities"),s=e("../common/utils").has,o=e("../common/utils").isValidEntityCode,i=e("../common/utils").fromCodePoint,l=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,a=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(e,t){var r,c,u,p=e.pos,h=e.posMax;if(38!==e.src.charCodeAt(p))return!1;if(h>p+1)if(r=e.src.charCodeAt(p+1),35===r){if(u=e.src.slice(p).match(l))return t||(c="x"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),e.pending+=i(o(c)?c:65533)),e.pos+=u[0].length,!0}else if(u=e.src.slice(p).match(a),u&&s(n,u[1]))return t||(e.pending+=n[u[1]]),e.pos+=u[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},{"../common/entities":1,"../common/utils":5}],48:[function(e,t,r){"use strict";for(var n=[],s=0;256>s;s++)n.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){n[e.charCodeAt(0)]=1}),t.exports=function(e,t){var r,s=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(s))return!1;if(s++,o>s){if(r=e.src.charCodeAt(s),256>r&&0!==n[r])return t||(e.pending+=e.src[s]),e.pos+=2,!0;if(10===r){for(t||e.push({type:"hardbreak",level:e.level}),s++;o>s&&32===e.src.charCodeAt(s);)s++;return e.pos=s,!0}}return t||(e.pending+="\\"),e.pos++,!0}},{}],49:[function(e,t,r){"use strict";var n=e("../helpers/parse_link_label");t.exports=function(e,t){var r,s,o,i,l=e.posMax,a=e.pos;return a+2>=l?!1:94!==e.src.charCodeAt(a)?!1:91!==e.src.charCodeAt(a+1)?!1:e.level>=e.options.maxNesting?!1:(r=a+2,s=n(e,a+1),0>s?!1:(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=r,e.posMax=s,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,i=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(i)},e.linkLevel--),e.pos=s+1,e.posMax=l,!0))}},{"../helpers/parse_link_label":12}],50:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i=e.posMax,l=e.pos;if(l+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(n=l+2;i>n;n++){if(32===e.src.charCodeAt(n))return!1;if(10===e.src.charCodeAt(n))return!1;if(93===e.src.charCodeAt(n))break}return n===l+2?!1:n>=i?!1:(n++,r=e.src.slice(l+2,n-1),"undefined"==typeof e.env.footnotes.refs[":"+r]?!1:(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+r]<0?(s=e.env.footnotes.list.length,e.env.footnotes.list[s]={label:r,count:0},e.env.footnotes.refs[":"+r]=s):s=e.env.footnotes.refs[":"+r],o=e.env.footnotes.list[s].count,e.env.footnotes.list[s].count++,e.push({type:"footnote_ref",id:s,subId:o,level:e.level})),e.pos=n,e.posMax=i,!0))}},{}],51:[function(e,t,r){"use strict";function n(e){var t=32|e;return t>=97&&122>=t}var s=e("../common/html_re").HTML_TAG_RE;t.exports=function(e,t){var r,o,i,l=e.pos;return e.options.html?(i=e.posMax,60!==e.src.charCodeAt(l)||l+2>=i?!1:(r=e.src.charCodeAt(l+1),(33===r||63===r||47===r||n(r))&&(o=e.src.slice(l).match(s))?(t||e.push({type:"htmltag",content:e.src.slice(l,l+o[0].length),level:e.level}),e.pos+=o[0].length,!0):!1)):!1}},{"../common/html_re":3}],52:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(43!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(43!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),43===o)return!1;if(43===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&43===e.src.charCodeAt(n);)n++;if(n!==a+2)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],53:[function(e,t,r){"use strict";var n=e("../helpers/parse_link_label"),s=e("../helpers/parse_link_destination"),o=e("../helpers/parse_link_title"),i=e("../helpers/normalize_reference");t.exports=function(e,t){var r,l,a,c,u,p,h,f,d=!1,g=e.pos,m=e.posMax,b=e.pos,v=e.src.charCodeAt(b);if(33===v&&(d=!0,v=e.src.charCodeAt(++b)),91!==v)return!1;if(e.level>=e.options.maxNesting)return!1;if(r=b+1,l=n(e,b),0>l)return!1;if(p=l+1,m>p&&40===e.src.charCodeAt(p)){for(p++;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(p>=m)return!1;for(b=p,s(e,p)?(c=e.linkContent,p=e.pos):c="",b=p;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(m>p&&b!==p&&o(e,p))for(u=e.linkContent,p=e.pos;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);else u="";if(p>=m||41!==e.src.charCodeAt(p))return e.pos=g,!1;p++}else{if(e.linkLevel>0)return!1;for(;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(m>p&&91===e.src.charCodeAt(p)&&(b=p+1,p=n(e,p),p>=0?a=e.src.slice(b,p++):p=b-1),a||("undefined"==typeof a&&(p=l+1),a=e.src.slice(r,l)),h=e.env.references[i(a)],!h)return e.pos=g,!1;c=h.href,u=h.title}return t||(e.pos=r,e.posMax=l,d?e.push({type:"image",src:c,title:u,alt:e.src.substr(r,l-r),level:e.level}):(e.push({type:"link_open",href:c,title:u,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=m,!0}},{"../helpers/normalize_reference":10,"../helpers/parse_link_destination":11,"../helpers/parse_link_label":12,"../helpers/parse_link_title":13}],54:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(61!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(61!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),61===o)return!1;if(61===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&61===e.src.charCodeAt(n);)n++;if(n!==a+2)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],55:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;for(r=e.pending.length-1,n=e.posMax,t||(r>=0&&32===e.pending.charCodeAt(r)?r>=1&&32===e.pending.charCodeAt(r-1)?(e.pending=e.pending.replace(/ +$/,""),e.push({type:"hardbreak",level:e.level})):(e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level})):e.push({type:"softbreak",level:e.level})),s++;n>s&&32===e.src.charCodeAt(s);)s++;return e.pos=s,!0}},{}],56:[function(e,t,r){"use strict";function n(e,t,r,n,s){this.src=e,this.env=n,this.options=r,this.parser=t,this.tokens=s,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}n.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},n.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},n.prototype.cacheSet=function(e,t){for(var r=this.cache.length;e>=r;r++)this.cache.push(0);this.cache[e]=t},n.prototype.cacheGet=function(e){return e?@[\]^_`{|}~-])/g;t.exports=function(e,t){var r,s,o=e.posMax,i=e.pos;if(126!==e.src.charCodeAt(i))return!1;if(t)return!1;if(i+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=i+1;e.pos?@[\]^_`{|}~-])/g;t.exports=function(e,t){var r,s,o=e.posMax,i=e.pos;if(94!==e.src.charCodeAt(i))return!1;if(t)return!1;if(i+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=i+1;e.poso;o++){var l=r[o],a=l.getType(),c=l.getText();if("element"===a)"a"===l.getTagName()&&(l.isClosing()?n=Math.max(n-1,0):n++),s.push(c);else if("entity"===a)s.push(c);else if(0===n){var u=this.linkifyStr(c);s.push(u)}else s.push(c)}return s.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var r;if(this.replaceFn&&(r=this.replaceFn.call(this,this,t)),"string"==typeof r)return r;if(r===!1)return t.getMatchedText();if(r instanceof e.HtmlTag)return r.toString();var n=this.getTagBuilder(),s=n.build(t);return s.toString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,r){var n=new e(r);return n.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var n=t.prototype,s=function(){};s.prototype=n;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){n.constructor.apply(this,arguments)};var i=o.prototype=new s;return i.constructor=o,i.superclass=n,delete r.constructor,e.Util.assign(i,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,n=[],s=0;r=t.exec(e);)n.push(e.substring(s,r.index)),n.push(r[0]),s=r.index+r[0].length;return n.push(e.substring(s)),n}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var r=this.getAttrs();return r[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,n=this.getClass(),s=this.whitespaceRegex,o=e.Util.indexOf,i=n?n.split(s):[],l=t.split(s);r=l.shift();)-1===o(i,r)&&i.push(r);return this.getAttrs()["class"]=i.join(" "),this},removeClass:function(t){for(var r,n=this.getClass(),s=this.whitespaceRegex,o=e.Util.indexOf,i=n?n.split(s):[],l=t.split(s);i.length&&(r=l.shift());){var a=o(i,r);-1!==a&&i.splice(a,1)}return this.getAttrs()["class"]=i.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t},n=this.createCssClass(e);return n&&(r["class"]=n),this.newWindow&&(r.target="_blank"),r},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=t.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",n,")*","\\s*/?",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,r,n=this.htmlRegex,s=0,o=[];null!==(t=n.exec(e));){var i=t[0],l=t[1]||t[3],a=!!t[2],c=e.substring(s,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),o.push(this.createElementNode(i,l,a)),s=t.index+i.length}if(ss;s+=2){var i=n[s],l=n[s+1];i&&r.push(this.createTextNode(i)),l&&r.push(this.createEntityNode(l))}return r},createElementNode:function(t,r,n){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:n})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,n=/(?:www\.)/,s=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,o=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,i=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,s.source,o.source,")","|","(","(?:","(",r.source,s.source,")","|","(?:","(.?//)?",n.source,s.source,")","|","(?:","(.?//)?",s.source,o.source,")",")","(?:"+i.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var n=this;return e.replace(this.matcherRegex,function(e,s,o,i,l,a,c,u,p){var h=n.processCandidateMatch(e,s,o,i,l,a,c,u,p);if(h){var f=t.call(r,h.match);return h.prefixStr+f+h.suffixStr}return e})},processCandidateMatch:function(t,r,n,s,o,i,l,a,c){var u,p=a||c,h="",f="";if(r&&!this.twitter||o&&!this.email||i&&!this.urls||!this.matchValidator.isValidMatch(i,l,p))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),f=")"),o)u=new e.match.Email({matchedText:t,email:o});else if(r)n&&(h=n,t=t.slice(1)),u=new e.match.Twitter({matchedText:t,twitterHandle:s});else{if(p){var d=p.match(this.charBeforeProtocolRelMatchRegex)[1]||"";d&&(h=d,t=t.slice(1))}u=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!l,protocolRelativeMatch:!!p,stripPrefix:this.stripPrefix})}return{prefixStr:h,suffixStr:f,match:u}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var r=e.match(/\(/g),n=e.match(/\)/g),s=r&&r.length||0,o=n&&n.length||0;if(o>s)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e})},{}],"/":[function(e,t,r){"use strict";t.exports=e("./lib/")},{"./lib/":14}]},{},[])("/")}); ================================================ FILE: src/wemark/richtext.js ================================================ exports.getRichTextNodes = function(parsedData){ var richTextNodes = []; var getNodeName = (function(){ var stack = []; return function(type, nodeType = 'inline'){ if(type === 'table_tr'){ return 'tr'; }else{ // 有多级的,block返回第一级,inline返回最后一级 if(type.indexOf('_') > -1){ var typePart = type.split('_'); if(nodeType === 'inline'){ return typePart.pop(); }else{ return typePart[0]; } } } return type; }; })(); var getBlockNode = function(node){ var nodeType = node.type; // console.log('nodeType:', nodeType); var richTextNode = { name: getNodeName(nodeType, 'inline'), attrs: { class: 'wemark_block_' + nodeType }, children: [] }; if(node.isArray){ node.content.forEach((childNode) => { if(['text','code','strong','deleted','em'].indexOf(childNode.type) > -1){ richTextNode.children.push({ name: 'span', attrs: { class: 'wemark_inline_' + childNode.type }, children:[{ type: 'text', text: childNode.content }] }); }else if(node.highlight){ if(typeof childNode === 'string'){ richTextNode.children.push({ name: 'span', attrs: { class: 'wemark_inline_code_text' }, children: [{ type: 'text', text: childNode }] }); }else{ richTextNode.children.push({ name: 'span', attrs: { class: 'wemark_inline_code_' + childNode.type }, children: [{ type: 'text', text: childNode.content }] }); } }else if(childNode.type === 'link'){ richTextNode.children.push({ name: 'a', attrs: { class: 'wemark_inline_link', href: childNode.data.href }, children:[{ type: 'text', text: childNode.content }] }); }else if(childNode.type === 'image'){ richTextNode.children.push({ name: 'img', attrs: { mode: 'widthFix', class: 'wemark_inline_image', src: childNode.src } }); }else if(childNode.type === 'table_th'){ richTextNode.children.push({ name: 'th', attrs: { class: 'wemark_inline_table_th', }, children: [{ type: 'text', text: childNode.content }] }); }else if(childNode.type === 'table_td'){ richTextNode.children.push({ name: 'td', attrs: { class: 'wemark_inline_table_td', }, children: [{ type: 'text', text: childNode.content }] }); } }); }else if(node.type === 'code'){ richTextNode.children = [{ name: 'code', children: [{ type: 'text', text: node.content }] }]; } return richTextNode; } for(var i=0; i { if (!this.isFaceImg(i)) {tmpList.push(i)} }) // console.log('parsedData:', parsedData, imagesList); if(this.data.type === 'wemark'){ this.setData({ parsedData, imagesList: tmpList, }); }else{ // var inTable = false; var richTextNodes = getRichTextNodes(parsedData); // console.log('richTextNodes:', richTextNodes); this.setData({ richTextNodes }); /* // 分批更新 var update = {}; var batchLength = 1000; console.log(batchLength); for(var i=0; i {{renderInline.content}} {{inner.content}} {{inner.content}} {{renderInline.content}} {{renderInline}} {{renderInline.content}} {{renderBlock.content}} {{renderBlock.content}} ================================================ FILE: src/wemark/wemark.wxss ================================================ @import "prism.wxss"; .wemark_wrapper{ margin:10px 0; font-size:32rpx; line-height: 1.8em; } .wemark_block_h1{ font-size:50rpx; /**不喜欢居中,把居中去掉**/ /**text-align: center;**/ margin-bottom:1em; margin-top:40px; font-weight: 500; position: relative; } .wemark_block_h1:after{ content: ''; /*CSS伪类用法*/ position: absolute; /*定位背景横线的位置*/ top: 130%; background: #e0e0e0; /*宽和高做出来的背景横线*/ width: 100%; height: 1px; left:0px; } .wemark_block_h2{ font-size:40rpx; padding-bottom:.5em; margin-top:1em; margin-bottom:1em; border-bottom:1px solid #f0f0f0; } .wemark_block_h3{ font-size:36rpx; margin-top: 1em; margin-bottom: 1em; } .wemark_block_h4, .wemark_block_h5, .wemark_block_h6{ font-weight: bold; margin-top: 1em; margin-bottom: 1em; } .wemark_block_p{ margin-top:1em; margin-bottom:1em; } .wemark_block_video{ margin-top:1em; margin-bottom:1em; width:100%; } .wemark_block_blockquote_p{ margin-top: 1em; margin-bottom: 1em; padding: 10rpx 0 10rpx 1em; font-size: 28rpx; background: #f6f8fa; border-left: 5rpx solid #e0e0e0; } .wemark_block_ul_li_p::before{ content:'• '; } .wemark_block_ul_li_ul_li_p::before, .wemark_block_ol_li_ul_li_p::before{ content:'◦ '; } .wemark_block_ul_li_ul_li_p, .wemark_block_ul_li_ol_li_p, .wemark_block_ol_li_ul_li_p, .wemark_block_ol_li_ol_li_p{ padding-left: 1em; } .wemark_block_ul_li_p:last{ margin-bottom:1em; } .wemark_block_code{ display: block; padding:10px; font-size:28rpx; line-height: 1.5em; border:1px solid #f0f0f0; white-space: pre; overflow: auto; background-color: #2b2b2b; } .wemark_block_table{ width: 100%; border-spacing: 0; border-collapse: collapse; /* border-left: 1px solid #e0e0e0; */ /* border-top: 1px solid #e0e0e0; */ } .wemark_block_table_tr{ display: flex; } .wemark_wrapper_richtext .wemark_block_table_tr{ display: table-row; } .wemark_inline_table_th, .wemark_inline_table_td{ flex:1; padding:5px; font-size:28rpx; word-break: break-all; border: 1px solid #e0e0e0; } .wemark_wrapper_richtext .wemark_inline_table_th, .wemark_wrapper_richtext .wemark_inline_table_td{ display: table-cell; /* background:red; border-right:1px solid #e0e0e0; border-bottom:1px solid #e0e0e0; */ } .wemark_inline_table_td:last{ /* border-top:1px solid #e0e0e0; */ } .wemark_inline_table_th{ background:#f0f0f0; /* border-top:1px solid #e0e0e0; */ } .wemark_inline_strong{ font-weight: bold; padding:0 5px; word-wrap:break-word; } .wemark_inline_em{ font-style: italic; padding:0 5px; word-wrap:break-word; } .wemark_inline_strong_em{ font-style: italic; font-weight: bold; padding:0 5px; word-wrap:break-word; } .wemark_inline_deleted{ text-decoration: line-through; padding:0 5px; word-wrap:break-word; } .wemark_inline_image{ width:100%; height:auto; margin-left: 3rpx; margin-right: 3rpx; } .wemark_inline_code{ background:#edebed; padding:3px 5px; word-wrap:break-word; border-radius:5px; margin-left:5px; margin-right:5px; } .wemark_inline_code_annotation, .wemark_inline_code_triple-quoted-string{ color: #e0e0e0; } .wemark_inline_code_rule, view.wemark_block_code view, .wemark_inline_code_text { color: #e0e0e0; } .wemark_inline_text{ word-wrap:break-word; } .wemark_inline_link{ display: inline; color: blue; word-wrap:break-word; } ================================================ FILE: tsconfig.json ================================================ { "compilerOptions": { "target": "es2017", "module": "commonjs", "removeComments": false, "preserveConstEnums": true, "moduleResolution": "node", "experimentalDecorators": true, "noImplicitAny": false, "allowSyntheticDefaultImports": true, "outDir": "lib", "noUnusedLocals": true, "noUnusedParameters": true, "strictNullChecks": true, "sourceMap": true, "baseUrl": ".", "rootDir": ".", "jsx": "preserve", "allowJs": true, "resolveJsonModule": true, "typeRoots": ["node_modules/@types"], "paths": { "@/*": ["./src/*"] } }, "include": ["./src", "./types"], "compileOnSave": false } ================================================ FILE: types/global.d.ts ================================================ /// declare module '*.png'; declare module '*.gif'; declare module '*.jpg'; declare module '*.jpeg'; declare module '*.svg'; declare module '*.css'; declare module '*.less'; declare module '*.scss'; declare module '*.sass'; declare module '*.styl'; declare namespace NodeJS { interface ProcessEnv { TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd' } } declare namespace JSX { interface IntrinsicElements { 'wemark': any } } ================================================ FILE: types/trending.ts ================================================ export interface TrendingRequestParams { language?: string; since?: string; type?: 'repositories' | 'developers'; } export interface TrendingRepoData { author: string; name: string; avatar: string; description?: string; url: string; language?: string; languageColor?: string; stars: number; forks: number; currentPeriodStars: number; builtBy: BuiltBy[]; } interface BuiltBy { username: string; href: string; avatar: string; } export interface TrendingDeveloperData { username: string; name: string; url: string; sponsorUrl?: any; avatar: string; repo: Repo; } interface Repo { name: string; description: string; url: string; }